// xjs.js - combined single-file build (animal + layer) // Generated by `go run main.go build`. // NOTE: Do not edit this file directly in development. // Edit animal.js / layer.js instead. /* --- layer.js --- */ (function (global, factory) { const LayerClass = factory(); // Allow usage as `Layer({...})` or `new Layer()` // But Layer is a class. We can wrap it in a proxy or factory function. function LayerFactory(options) { if (options && typeof options === 'object') { return LayerClass.$(options); } return new LayerClass(); } // Copy static methods (including non-enumerable class statics like `fire` / `$`) // Class static methods are non-enumerable by default, so Object.assign() would miss them. const copyStatic = (to, from) => { try { Object.getOwnPropertyNames(from).forEach((k) => { if (k === 'prototype' || k === 'name' || k === 'length') return; const desc = Object.getOwnPropertyDescriptor(from, k); if (!desc) return; Object.defineProperty(to, k, desc); }); } catch (e) { // Best-effort fallback try { Object.assign(to, from); } catch {} } }; copyStatic(LayerFactory, LayerClass); // Also copy prototype for instanceof checks if needed (though tricky with factory) LayerFactory.prototype = LayerClass.prototype; typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = LayerFactory : typeof define === 'function' && define.amd ? define(() => LayerFactory) : (global.Layer = LayerFactory); }(this, (function () { 'use strict'; const PREFIX = 'layer-'; // Ensure library CSS is loaded (xjs.css) // - CSS is centralized in xjs.css (no runtime