lilact 0.31.15 → 0.31.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/bin/bundle.cjs +1 -1
  2. package/dist/lilact.development.js +406 -393
  3. package/dist/lilact.development.js.map +4 -4
  4. package/dist/lilact.development.min.js +35 -35
  5. package/dist/lilact.development.min.js.map +4 -4
  6. package/dist/lilact.production.min.js +38 -38
  7. package/docs/assets/hierarchy.js +1 -1
  8. package/docs/assets/navigation.js +1 -1
  9. package/docs/assets/search.js +1 -1
  10. package/docs/classes/accessories.ErrorBoundary.html +11 -11
  11. package/docs/classes/accessories.Suspense.html +10 -10
  12. package/docs/classes/components.Component.html +11 -11
  13. package/docs/classes/components.HTMLComponent.html +11 -11
  14. package/docs/classes/components.RootComponent.html +11 -11
  15. package/docs/functions/accessories.DragHandle.html +1 -1
  16. package/docs/functions/accessories.Spinner.html +1 -1
  17. package/docs/functions/components.cloneComponent.html +1 -1
  18. package/docs/functions/components.createComponent.html +1 -1
  19. package/docs/functions/components.createPortal.html +1 -1
  20. package/docs/functions/components.createRoot.html +1 -1
  21. package/docs/functions/components.memo.html +1 -1
  22. package/docs/functions/components.render.html +1 -1
  23. package/docs/functions/hooks.useLocalStorage.html +2 -2
  24. package/docs/functions/run.lazy.html +1 -1
  25. package/docs/functions/run.require.html +1 -1
  26. package/docs/functions/run.run.html +1 -1
  27. package/docs/functions/run.runScripts.html +1 -1
  28. package/docs/hierarchy.html +1 -1
  29. package/docs/modules/components.html +1 -1
  30. package/docs/static/index.html +1 -1
  31. package/docs/static/lilact.development.js +406 -393
  32. package/docs/static/lilact.development.js.map +4 -4
  33. package/docs/static/lilact.development.min.js +35 -35
  34. package/docs/static/lilact.development.min.js.map +4 -4
  35. package/docs/static/lilact.production.min.js +38 -38
  36. package/docs/variables/accessories.SplitPane.html +1 -1
  37. package/docs/variables/components.cloneElement.html +1 -1
  38. package/examples/index.html +1 -1
  39. package/examples/lilact.development.js +406 -393
  40. package/examples/lilact.development.js.map +4 -4
  41. package/examples/lilact.development.min.js +35 -35
  42. package/examples/lilact.development.min.js.map +4 -4
  43. package/examples/lilact.production.min.js +38 -38
  44. package/package.json +2 -2
  45. package/scripts/build.mjs +1 -1
  46. package/src/accessories.jsx +4 -2
  47. package/src/cache.jsx +299 -0
  48. package/src/components.jsx +6 -1042
  49. package/src/core.jsx +794 -0
  50. package/src/hooks.jsx +2 -2
  51. package/src/run.jsx +2 -1
  52. package/src/symbols.jsx +0 -2
  53. package/docs/functions/components.replaceAllComponentInstances.html +0 -1
  54. package/docs/functions/components.replaceComponentEntity.html +0 -1
@@ -1715,7 +1715,6 @@ __export(symbols_exports, {
1715
1715
  DUE: () => DUE,
1716
1716
  IDX: () => IDX,
1717
1717
  INTERVAL: () => INTERVAL,
1718
- IS_ZOMBIE: () => IS_ZOMBIE,
1719
1718
  LAZY: () => LAZY,
1720
1719
  LOCATION: () => LOCATION,
1721
1720
  MEMOIZED: () => MEMOIZED,
@@ -1727,7 +1726,6 @@ var [
1727
1726
  CORE,
1728
1727
  COMPONENT,
1729
1728
  TEXT2,
1730
- IS_ZOMBIE,
1731
1729
  IDX,
1732
1730
  CHILD_CLASS_ADDENDUM,
1733
1731
  MEMOIZED,
@@ -1744,7 +1742,6 @@ var [
1744
1742
  /* @__PURE__ */ Symbol.for("LILACT:CORE"),
1745
1743
  /* @__PURE__ */ Symbol.for("LILACT:COMPONENT"),
1746
1744
  /* @__PURE__ */ Symbol.for("LILACT:TEXT"),
1747
- /* @__PURE__ */ Symbol.for("LILACT:IS_ZOMBIE"),
1748
1745
  /* @__PURE__ */ Symbol.for("LILACT:IDX"),
1749
1746
  /* @__PURE__ */ Symbol.for("LILACT:CHILD_CLASS_ADDENDUM"),
1750
1747
  /* @__PURE__ */ Symbol.for("LILACT:MEMOIZED"),
@@ -1772,7 +1769,8 @@ var isValidComponent = (value) => {
1772
1769
  };
1773
1770
  var isValidElement = isValidComponent;
1774
1771
  var findDOMNode = (component) => {
1775
- if (!component[CORE]?.element?.parentNode) throw new Error("findDOMNode only works on mounted components.");
1772
+ var _a6, _b;
1773
+ if (!((_b = (_a6 = component[CORE]) == null ? void 0 : _a6.element) == null ? void 0 : _b.parentNode)) throw new Error("findDOMNode only works on mounted components.");
1776
1774
  return component[CORE].element;
1777
1775
  };
1778
1776
  function Fragment2({ children }) {
@@ -2352,8 +2350,6 @@ __export(components_exports, {
2352
2350
  Component: () => Component,
2353
2351
  HTMLComponent: () => HTMLComponent,
2354
2352
  RootComponent: () => RootComponent,
2355
- boolean_html_attributes_set: () => boolean_html_attributes_set,
2356
- capture_events_set: () => capture_events_set,
2357
2353
  cloneComponent: () => cloneComponent,
2358
2354
  cloneElement: () => cloneElement,
2359
2355
  createComponent: () => createComponent2,
@@ -2362,43 +2358,25 @@ __export(components_exports, {
2362
2358
  createRoot: () => createRoot,
2363
2359
  current_component: () => current_component,
2364
2360
  effect_timeout: () => effect_timeout,
2365
- events_set: () => events_set,
2366
2361
  insertion_effects: () => insertion_effects,
2367
2362
  layout_effects: () => layout_effects,
2368
- length_css_attributes_set: () => length_css_attributes_set,
2369
2363
  memo: () => memo,
2370
2364
  passive_effects: () => passive_effects,
2371
2365
  processEffects: () => processEffects,
2372
2366
  render: () => render,
2373
- replaceAllComponentInstances: () => replaceAllComponentInstances,
2374
- replaceComponentEntity: () => replaceComponentEntity,
2375
2367
  roots: () => roots,
2376
- special_attributes: () => special_attributes,
2377
2368
  update_cbs: () => update_cbs,
2378
2369
  update_interval_margin: () => update_interval_margin,
2379
2370
  update_set: () => update_set,
2380
2371
  update_timeout: () => update_timeout
2381
2372
  });
2382
- var SVG_NS = "http://www.w3.org/2000/svg";
2373
+
2374
+ // .tmp/src/cache.jsx
2383
2375
  function getComponentEntity(entity) {
2384
- return entity?.[MEMOIZED] ? entity.component : entity;
2376
+ return (entity == null ? void 0 : entity[MEMOIZED]) ? entity.component : entity;
2385
2377
  }
2386
2378
  var hotEntityAliases = /* @__PURE__ */ new Map();
2387
2379
  var hotEntityCacheTokens = /* @__PURE__ */ new WeakMap();
2388
- function getHotEntityCacheToken(entity) {
2389
- entity = getComponentEntity(entity);
2390
- if (typeof entity !== "function") {
2391
- return entity;
2392
- }
2393
- let token2 = hotEntityCacheTokens.get(entity);
2394
- if (!token2) {
2395
- const resolved = resolveHotEntity(entity);
2396
- token2 = hotEntityCacheTokens.get(resolved) || {};
2397
- hotEntityCacheTokens.set(entity, token2);
2398
- hotEntityCacheTokens.set(resolved, token2);
2399
- }
2400
- return token2;
2401
- }
2402
2380
  function resolveHotEntity(entity) {
2403
2381
  entity = getComponentEntity(entity);
2404
2382
  const visited = /* @__PURE__ */ new Set();
@@ -2513,6 +2491,7 @@ var ComponentCache = class {
2513
2491
  this.owner = owner;
2514
2492
  }
2515
2493
  pick(key, construct_func, nextEntity) {
2494
+ var _a6;
2516
2495
  let componentCore;
2517
2496
  let bucket = this.current_map.get(key);
2518
2497
  if (bucket && bucket.length > bucket[IDX]) {
@@ -2538,17 +2517,19 @@ var ComponentCache = class {
2538
2517
  bucket[IDX] = 0;
2539
2518
  }
2540
2519
  if (componentCore) {
2541
- componentCore.parent ?? (componentCore.parent = this.owner);
2520
+ (_a6 = componentCore.parent) != null ? _a6 : componentCore.parent = this.owner;
2542
2521
  }
2543
2522
  return componentCore;
2544
2523
  }
2545
2524
  commit() {
2546
2525
  this.current_map.forEach((arr) => {
2547
2526
  arr.slice(arr[IDX]).forEach((ex) => {
2527
+ var _a6, _b;
2548
2528
  if (ex.cleanup) {
2549
2529
  ex.cleanup();
2550
- } else if (ex.element && !ex.portal) {
2551
- ex.element.parentElement?.removeChild?.(ex.element);
2530
+ }
2531
+ if (ex.element && !ex.portal) {
2532
+ (_b = (_a6 = ex.element) == null ? void 0 : _a6.remove) == null ? void 0 : _b.call(_a6);
2552
2533
  }
2553
2534
  });
2554
2535
  });
@@ -2556,6 +2537,33 @@ var ComponentCache = class {
2556
2537
  this.new_map = /* @__PURE__ */ new Map();
2557
2538
  }
2558
2539
  };
2540
+
2541
+ // .tmp/src/core.jsx
2542
+ var SVG_NS = "http://www.w3.org/2000/svg";
2543
+ var renderErrorHandler = (c, e) => {
2544
+ var _a6, _b, _c, _d;
2545
+ const value = (e == null ? void 0 : e.error) instanceof Error ? e.error : (e == null ? void 0 : e.reason) !== void 0 ? e.reason : e;
2546
+ const error2 = lilact_default.isThenable(e) ? e : lilact_default.traceError(
2547
+ value,
2548
+ (e == null ? void 0 : e.fileName) || null
2549
+ );
2550
+ const stack = [c];
2551
+ while (c && !((_a6 = c.component) == null ? void 0 : _a6.componentDidCatch)) {
2552
+ c = c.parent;
2553
+ if (c) stack.push(c);
2554
+ }
2555
+ if ((_b = c == null ? void 0 : c.component) == null ? void 0 : _b.componentDidCatch) {
2556
+ if ((_c = c.entity) == null ? void 0 : _c.getDerivedStateFromError) {
2557
+ c.component.setState(c.entity.getDerivedStateFromError.call(c, error2));
2558
+ }
2559
+ }
2560
+ let stack_log = Array.prototype.map.call(stack, (x) => `in ${typeof x.component.displayName === "function" ? x.component.displayName() : x.component.displayName}`).join("\n");
2561
+ error2.componentStack = stack;
2562
+ error2.componentStackLog = stack_log;
2563
+ if ((_d = c == null ? void 0 : c.component) == null ? void 0 : _d.componentDidCatch) {
2564
+ c.component.componentDidCatch(error2, { componentStack: stack, componentStackLog: stack_log });
2565
+ } else throw e;
2566
+ };
2559
2567
  var ComponentCore = class {
2560
2568
  constructor(comp, props) {
2561
2569
  /*
@@ -2588,38 +2596,37 @@ var ComponentCore = class {
2588
2596
  this.component = comp;
2589
2597
  this.props = props || {};
2590
2598
  }
2591
- /*
2592
- */
2593
2599
  // TODO: should componentDidUpdate be called after arranging/appending the outlet or before?
2594
2600
  apply(next_props = this.props, next_state = this.next_state || this.state) {
2601
+ var _a6, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
2595
2602
  try {
2596
2603
  let do_rerender = true;
2597
- if (this.outlet && this?.[MEMOIZED]) {
2598
- if (shallowEqual(this.props, next_props, "children") && shallowEqual(this.props?.children, next_props?.children)) {
2604
+ if (this.outlet && (this == null ? void 0 : this[MEMOIZED])) {
2605
+ if (shallowEqual(this.props, next_props, "children") && shallowEqual((_a6 = this.props) == null ? void 0 : _a6.children, next_props == null ? void 0 : next_props.children)) {
2599
2606
  do_rerender = false;
2600
2607
  }
2601
2608
  }
2602
2609
  if (do_rerender) {
2603
2610
  if (true) {
2604
- if (this.entity?.propTypes) {
2611
+ if ((_b = this.entity) == null ? void 0 : _b.propTypes) {
2605
2612
  PropTypes.checkPropTypes(this.entity.propTypes, next_props, "prop", this.entity.name);
2606
- } else if (this.component?.propTypes) {
2613
+ } else if ((_c = this.component) == null ? void 0 : _c.propTypes) {
2607
2614
  PropTypes.checkPropTypes(this.component.propTypes, next_props, "prop", this.component.name);
2608
2615
  }
2609
2616
  }
2610
2617
  if (typeof next_state === "function") next_state = next_state(this.state);
2611
- const defaultProps = this.entity?.defaultProps || this.component?.constructor?.defaultProps;
2618
+ const defaultProps = ((_d = this.entity) == null ? void 0 : _d.defaultProps) || ((_f = (_e = this.component) == null ? void 0 : _e.constructor) == null ? void 0 : _f.defaultProps);
2612
2619
  if (defaultProps) {
2613
2620
  next_props = {
2614
2621
  ...defaultProps,
2615
2622
  ...next_props || {}
2616
2623
  };
2617
2624
  }
2618
- if (next_props?.style && typeof next_props.style === "object" && !next_props.style[CLONED_STYLE]) {
2625
+ if ((next_props == null ? void 0 : next_props.style) && typeof next_props.style === "object" && !next_props.style[CLONED_STYLE]) {
2619
2626
  next_props.style = { ...next_props.style, [CLONED_STYLE]: true };
2620
2627
  }
2621
- if (this?.parent?.component?.context || this?.parent?.component?.getChildContext) {
2622
- this.context = { ...this.parent.component.context, ...this.parent.component.getChildContext?.() };
2628
+ if (((_h = (_g = this == null ? void 0 : this.parent) == null ? void 0 : _g.component) == null ? void 0 : _h.context) || ((_j = (_i = this == null ? void 0 : this.parent) == null ? void 0 : _i.component) == null ? void 0 : _j.getChildContext)) {
2629
+ this.context = { ...this.parent.component.context, ...(_l = (_k = this.parent.component).getChildContext) == null ? void 0 : _l.call(_k) };
2623
2630
  if (this.component.constructor.contextTypes) {
2624
2631
  PropTypes.checkPropTypes(this.component.constructor.contextTypes, this.context, "context", this.entity.name);
2625
2632
  }
@@ -2633,8 +2640,8 @@ var ComponentCore = class {
2633
2640
  } else {
2634
2641
  this.element = document.createElement(this.entity);
2635
2642
  }
2636
- if (next_props?.defaultValue) this.element.value = String(next_props.defaultValue).slice(0, next_props?.maxLength);
2637
- if (next_props?.defaultChecked) this.element.checked = next_props.defaultChecked;
2643
+ if (next_props == null ? void 0 : next_props.defaultValue) this.element.value = String(next_props.defaultValue).slice(0, next_props == null ? void 0 : next_props.maxLength);
2644
+ if (next_props == null ? void 0 : next_props.defaultChecked) this.element.checked = next_props.defaultChecked;
2638
2645
  }
2639
2646
  this.element[COMPONENT] = this.component;
2640
2647
  }
@@ -2652,7 +2659,7 @@ var ComponentCore = class {
2652
2659
  this.component.componentWillUpdate(next_props, next_state);
2653
2660
  }
2654
2661
  const prev_state = this.state, prev_props = this.props;
2655
- if (this.element && !(this?.component instanceof RootComponent)) {
2662
+ if (this.element && !((this == null ? void 0 : this.component) instanceof lilact_default.RootComponent)) {
2656
2663
  this.updateElementProps(next_props);
2657
2664
  }
2658
2665
  this.props = next_props;
@@ -2669,10 +2676,10 @@ var ComponentCore = class {
2669
2676
  } else {
2670
2677
  this.outlet = this.component.render({ current: this.element || this.component });
2671
2678
  }
2672
- if (this?.portal) {
2679
+ if (this == null ? void 0 : this.portal) {
2673
2680
  this.element = this.portal;
2674
2681
  }
2675
- if (this.outlet?.constructor?.name !== "Array") {
2682
+ if (((_n = (_m = this.outlet) == null ? void 0 : _m.constructor) == null ? void 0 : _n.name) !== "Array") {
2676
2683
  this.outlet = [this.outlet];
2677
2684
  } else {
2678
2685
  this.outlet = [...this.outlet];
@@ -2698,11 +2705,10 @@ var ComponentCore = class {
2698
2705
  } else {
2699
2706
  if (!core.element) {
2700
2707
  core.element = document.createTextNode(item[TEXT2]);
2701
- core[TEXT2] = item[TEXT2];
2702
2708
  } else if (core[TEXT2] !== item[TEXT2]) {
2703
2709
  core.element.textContent = item[TEXT2];
2704
- core[TEXT2] = item[TEXT2];
2705
2710
  }
2711
+ core[TEXT2] = item[TEXT2];
2706
2712
  }
2707
2713
  }
2708
2714
  }
@@ -2718,10 +2724,11 @@ var ComponentCore = class {
2718
2724
  }
2719
2725
  }
2720
2726
  async cleanup() {
2727
+ var _a6, _b, _c;
2721
2728
  unregisterComponentCore(this);
2722
2729
  try {
2723
2730
  const promises = [];
2724
- if (this.props?.ref) {
2731
+ if ((_a6 = this.props) == null ? void 0 : _a6.ref) {
2725
2732
  if (typeof this.props.ref === "function") {
2726
2733
  this.props.ref(null);
2727
2734
  } else {
@@ -2731,8 +2738,8 @@ var ComponentCore = class {
2731
2738
  if (this.component.componentWillUnmount) {
2732
2739
  this.component.componentWillUnmount();
2733
2740
  }
2734
- if (this?.element?.parentElement && !this.portal) {
2735
- this.element.parentElement.removeChild(this.element);
2741
+ if (((_b = this == null ? void 0 : this.element) == null ? void 0 : _b.parentElement) && !this.portal) {
2742
+ this.element.remove();
2736
2743
  }
2737
2744
  if (this.outlet !== void 0) {
2738
2745
  for (let c of this.outlet) {
@@ -2741,7 +2748,7 @@ var ComponentCore = class {
2741
2748
  }
2742
2749
  }
2743
2750
  }
2744
- if (this.props?.children !== void 0) {
2751
+ if (((_c = this.props) == null ? void 0 : _c.children) !== void 0) {
2745
2752
  for (let c of this.props.children) {
2746
2753
  if (c.cleanup) {
2747
2754
  promises.push(c.cleanup());
@@ -2761,18 +2768,19 @@ var ComponentCore = class {
2761
2768
  }
2762
2769
  }
2763
2770
  updateElementProps(patch, force = false) {
2771
+ var _a6, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
2764
2772
  if (this.entity === "input") {
2765
- if (!patch?.type) patch.type = "text";
2773
+ if (!(patch == null ? void 0 : patch.type)) patch.type = "text";
2766
2774
  if (patch.type !== this.element.type) {
2767
2775
  this.element.type = patch.type;
2768
2776
  }
2769
- if (patch?.value !== void 0 && patch?.value !== this.element.value) {
2777
+ if ((patch == null ? void 0 : patch.value) !== void 0 && (patch == null ? void 0 : patch.value) !== this.element.value) {
2770
2778
  if (patch.value === void 0) patch.value = "";
2771
- this.element.value = String(patch.value).slice(0, patch?.maxLength);
2779
+ this.element.value = String(patch.value).slice(0, patch == null ? void 0 : patch.maxLength);
2772
2780
  }
2773
2781
  } else if (this.entity === "textarea") {
2774
- if (patch?.value !== this.element.value) {
2775
- this.element.value = String(patch.value).slice(0, patch?.maxLength);
2782
+ if ((patch == null ? void 0 : patch.value) !== this.element.value) {
2783
+ this.element.value = String(patch.value).slice(0, patch == null ? void 0 : patch.maxLength);
2776
2784
  }
2777
2785
  } else if (this.entity === "select") {
2778
2786
  if (typeof patch.value === "string") {
@@ -2781,9 +2789,9 @@ var ComponentCore = class {
2781
2789
  }
2782
2790
  }
2783
2791
  } else if (this.entity === "option") {
2784
- if (this.container?.props?.value?.constructor?.name === "Array") {
2792
+ if (((_d = (_c = (_b = (_a6 = this.container) == null ? void 0 : _a6.props) == null ? void 0 : _b.value) == null ? void 0 : _c.constructor) == null ? void 0 : _d.name) === "Array") {
2785
2793
  patch.selected = this.container.props.value.indexOf(patch.value) !== -1;
2786
- } else if (typeof this.container?.props?.value === "string") {
2794
+ } else if (typeof ((_f = (_e = this.container) == null ? void 0 : _e.props) == null ? void 0 : _f.value) === "string") {
2787
2795
  patch.selected = this.container.props.value === patch.value;
2788
2796
  }
2789
2797
  }
@@ -2802,24 +2810,24 @@ var ComponentCore = class {
2802
2810
  if (special_attributes.has(al)) continue;
2803
2811
  if (patch === this.props || !lilact_default.defaultIsEqual(patch[a], this.props[a]) || force) {
2804
2812
  if (events_set.has(al)) {
2805
- this.event_detachers ?? (this.event_detachers = {});
2806
- this.event_detachers[al]?.();
2813
+ (_g = this.event_detachers) != null ? _g : this.event_detachers = {};
2814
+ (_i = (_h = this.event_detachers)[al]) == null ? void 0 : _i.call(_h);
2807
2815
  this.event_detachers[al] = lilact_default.addWrappedEventListener(this.element, al.substring(2), patch[a]);
2808
2816
  } else if (capture_events_set.hasOwnProperty(al)) {
2809
2817
  const alc = capture_events_set[al];
2810
- this.event_detachers ?? (this.event_detachers = {});
2811
- this.event_detachers[al]?.();
2818
+ (_j = this.event_detachers) != null ? _j : this.event_detachers = {};
2819
+ (_l = (_k = this.event_detachers)[al]) == null ? void 0 : _l.call(_k);
2812
2820
  this.event_detachers[al] = lilact_default.addWrappedEventListener(this.element, alc.substring(2), patch[a], { capture: true });
2813
2821
  } else if (a === "style") {
2814
2822
  if (typeof patch.style === "string") {
2815
2823
  this.element.style = patch.style;
2816
2824
  } else {
2817
- if (this.props?.style) {
2825
+ if ((_m = this.props) == null ? void 0 : _m.style) {
2818
2826
  if (typeof this.props.style === "string") {
2819
2827
  this.element.style = "";
2820
2828
  } else {
2821
2829
  for (let p in this.props.style) {
2822
- if (p !== CLONED_STYLE && !patch?.style?.hasOwnProperty?.(p)) {
2830
+ if (p !== CLONED_STYLE && !((_o = (_n = patch == null ? void 0 : patch.style) == null ? void 0 : _n.hasOwnProperty) == null ? void 0 : _o.call(_n, p))) {
2823
2831
  this.element.style[p] = "";
2824
2832
  }
2825
2833
  }
@@ -2848,7 +2856,7 @@ var ComponentCore = class {
2848
2856
  }
2849
2857
  }
2850
2858
  }
2851
- if (patch?.action) {
2859
+ if (patch == null ? void 0 : patch.action) {
2852
2860
  this.element.onsubmit = patch.action;
2853
2861
  } else {
2854
2862
  this.element.onsubmit = void 0;
@@ -2856,8 +2864,9 @@ var ComponentCore = class {
2856
2864
  this.updateElementClass(patch);
2857
2865
  }
2858
2866
  updateElementClass(patch = this.props) {
2859
- let cn = patch?.className ?? patch?.class ?? "";
2860
- if (this?.parent?.[CHILD_CLASS_ADDENDUM]) {
2867
+ var _a6, _b, _c;
2868
+ let cn = (_b = (_a6 = patch == null ? void 0 : patch.className) != null ? _a6 : patch == null ? void 0 : patch.class) != null ? _b : "";
2869
+ if ((_c = this == null ? void 0 : this.parent) == null ? void 0 : _c[CHILD_CLASS_ADDENDUM]) {
2861
2870
  cn += " " + this.parent[CHILD_CLASS_ADDENDUM];
2862
2871
  }
2863
2872
  cn = cn.trim();
@@ -2875,21 +2884,15 @@ var ComponentCore = class {
2875
2884
  }
2876
2885
  }
2877
2886
  }
2878
- scanZombies(container2, next_element) {
2879
- const chs = container2.element.childNodes;
2880
- while (chs[container2.insert_index] && chs[container2.insert_index][IS_ZOMBIE] && chs[container2.insert_index] !== next_element) {
2881
- container2.insert_index++;
2882
- }
2883
- }
2884
2887
  appendElement(core) {
2888
+ var _a6;
2885
2889
  if (core.portal) return;
2886
- this.scanZombies(core.container, core.element);
2887
- if (core?.element.parentNode === null) {
2890
+ if ((core == null ? void 0 : core.element.parentNode) === null) {
2888
2891
  core.container.element.insertBefore(
2889
2892
  core.element,
2890
2893
  core.container.element.childNodes[core.container.insert_index] || null
2891
2894
  );
2892
- if (core?.component?.componentDidMount) {
2895
+ if ((_a6 = core == null ? void 0 : core.component) == null ? void 0 : _a6.componentDidMount) {
2893
2896
  core.component.componentDidMount();
2894
2897
  }
2895
2898
  } else {
@@ -2903,6 +2906,7 @@ var ComponentCore = class {
2903
2906
  core.container.insert_index++;
2904
2907
  }
2905
2908
  arrangeOutlet() {
2909
+ var _a6;
2906
2910
  this.insert_index = 0;
2907
2911
  for (const core of this.outlet) {
2908
2912
  if (core) {
@@ -2911,9 +2915,9 @@ var ComponentCore = class {
2911
2915
  core.container.appendElement(core);
2912
2916
  } else {
2913
2917
  if (core.arrangeOutlet && core.outlet) core.arrangeOutlet();
2914
- if (!core?.mounted) {
2918
+ if (!(core == null ? void 0 : core.mounted)) {
2915
2919
  core.mounted = true;
2916
- if (core?.component?.componentDidMount) {
2920
+ if ((_a6 = core == null ? void 0 : core.component) == null ? void 0 : _a6.componentDidMount) {
2917
2921
  core.component.componentDidMount();
2918
2922
  }
2919
2923
  }
@@ -2926,35 +2930,44 @@ var ComponentCore = class {
2926
2930
  return func(this.state);
2927
2931
  }
2928
2932
  };
2929
- var renderErrorHandler = (c, e) => {
2930
- const value = e?.error instanceof Error ? e.error : e?.reason !== void 0 ? e.reason : e;
2931
- const error2 = lilact_default.isThenable(e) ? e : lilact_default.traceError(
2932
- value,
2933
- e?.fileName || null
2934
- );
2935
- const stack = [c];
2936
- while (c && !c.component?.componentDidCatch) {
2937
- c = c.parent;
2938
- if (c) stack.push(c);
2939
- }
2940
- if (c?.component?.componentDidCatch) {
2941
- if (c.entity?.getDerivedStateFromError) {
2942
- c.component.setState(c.entity.getDerivedStateFromError.call(c, error2));
2933
+ function prepareCore(parent, core) {
2934
+ var _a6, _b;
2935
+ try {
2936
+ (_a6 = parent.cache) != null ? _a6 : parent.cache = new ComponentCache(parent);
2937
+ const isText = core[TEXT2] !== void 0;
2938
+ const isExistingCore = core instanceof ComponentCore;
2939
+ const entity = isText || isExistingCore ? void 0 : resolveHotEntity(core.entity);
2940
+ const hasExplicitKey = !isText && core.props && core.props.key !== void 0 && core.props.key !== null;
2941
+ let key;
2942
+ if (isText) {
2943
+ key = ":text:";
2944
+ } else if (hasExplicitKey) {
2945
+ key = core.props.key;
2946
+ } else if (typeof entity === "function") {
2947
+ key = getHotEntityCacheToken(entity);
2948
+ } else {
2949
+ key = entity;
2950
+ }
2951
+ return parent.cache.pick(
2952
+ key,
2953
+ () => isText || isExistingCore ? core : constructFunc(core, parent)[CORE],
2954
+ entity
2955
+ );
2956
+ } catch (e) {
2957
+ if ((_b = core == null ? void 0 : core.component) == null ? void 0 : _b.componentDidCatch) {
2958
+ core.component.componentDidCatch(e);
2959
+ } else {
2960
+ throw e;
2943
2961
  }
2944
2962
  }
2945
- let stack_log = Array.prototype.map.call(stack, (x) => `in ${typeof x.component.displayName === "function" ? x.component.displayName() : x.component.displayName}`).join("\n");
2946
- error2.componentStack = stack;
2947
- error2.componentStackLog = stack_log;
2948
- if (c?.component?.componentDidCatch) {
2949
- c.component.componentDidCatch(error2, { componentStack: stack, componentStackLog: stack_log });
2950
- } else throw e;
2951
- };
2963
+ }
2952
2964
  function constructFunc(core, parent) {
2965
+ var _a6;
2953
2966
  let comp = core;
2954
2967
  if (core[TEXT2] === void 0) {
2955
2968
  let entity = core.entity;
2956
2969
  let memoized = false;
2957
- const loc = core.props[LOCATION];
2970
+ const loc = (_a6 = core == null ? void 0 : core.props) == null ? void 0 : _a6[LOCATION];
2958
2971
  if (loc) delete core.props[LOCATION];
2959
2972
  if (typeof entity === "object") {
2960
2973
  if (entity[MEMOIZED]) {
@@ -2968,7 +2981,7 @@ function constructFunc(core, parent) {
2968
2981
  if (typeof entity === "string") {
2969
2982
  comp = new HTMLComponent(entity, core.props);
2970
2983
  } else if (isClass(entity)) {
2971
- if (entity?.defaultProps) {
2984
+ if (entity == null ? void 0 : entity.defaultProps) {
2972
2985
  core.props = {
2973
2986
  ...entity.defaultProps,
2974
2987
  ...core.props
@@ -2996,7 +3009,7 @@ function constructFunc(core, parent) {
2996
3009
  }
2997
3010
  }
2998
3011
  } else if (typeof entity === "function") {
2999
- if (entity?.defaultProps) {
3012
+ if (entity == null ? void 0 : entity.defaultProps) {
3000
3013
  core.props = {
3001
3014
  ...entity.defaultProps,
3002
3015
  ...core.props
@@ -3007,7 +3020,7 @@ function constructFunc(core, parent) {
3007
3020
  comp[CORE].hooks = [];
3008
3021
  comp[CORE].hook_index = 0;
3009
3022
  } else {
3010
- throw new Error("Error in constructing component.");
3023
+ throw new Error(`Error in constructing component (${String(core.entity)}).`);
3011
3024
  }
3012
3025
  if (loc) comp[CORE].location = loc;
3013
3026
  comp[CORE].entity = entity;
@@ -3024,36 +3037,161 @@ function constructFunc(core, parent) {
3024
3037
  }
3025
3038
  return comp;
3026
3039
  }
3027
- function prepareCore(parent, core) {
3028
- try {
3029
- parent.cache ?? (parent.cache = new ComponentCache(parent));
3030
- const isText = core[TEXT2] !== void 0;
3031
- const isExistingCore = core instanceof ComponentCore;
3032
- const entity = isText || isExistingCore ? void 0 : resolveHotEntity(core.entity);
3033
- const hasExplicitKey = !isText && core.props && core.props.key !== void 0 && core.props.key !== null;
3034
- let key;
3035
- if (isText) {
3036
- key = ":text:";
3037
- } else if (hasExplicitKey) {
3038
- key = core.props.key;
3039
- } else if (typeof entity === "function") {
3040
- key = getHotEntityCacheToken(entity);
3041
- } else {
3042
- key = entity;
3043
- }
3044
- return parent.cache.pick(
3045
- key,
3046
- () => isText || isExistingCore ? core : constructFunc(core, parent)[CORE],
3047
- entity
3048
- );
3049
- } catch (e) {
3050
- if (core?.component?.componentDidCatch) {
3051
- core.component.componentDidCatch(e);
3052
- } else {
3053
- throw e;
3054
- }
3055
- }
3040
+ var special_attributes = /* @__PURE__ */ new Set([
3041
+ "classname",
3042
+ "ref",
3043
+ "action",
3044
+ "lilact_jsx_loc",
3045
+ "children",
3046
+ "key",
3047
+ "defaultvalue",
3048
+ "defaultchecked"
3049
+ ]);
3050
+ var events_set = /* @__PURE__ */ new Set([
3051
+ "onafterprint",
3052
+ "onbeforeprint",
3053
+ "onbeforeunload",
3054
+ "onerror",
3055
+ "onhashchange",
3056
+ "onload",
3057
+ "onmessage",
3058
+ "onoffline",
3059
+ "ononline",
3060
+ "onpagehide",
3061
+ "onpageshow",
3062
+ "onpopstate",
3063
+ "onresize",
3064
+ "onstorage",
3065
+ "onunload",
3066
+ "onblur",
3067
+ "onchange",
3068
+ "oncontextmenu",
3069
+ "onfocus",
3070
+ "oninput",
3071
+ "oninvalid",
3072
+ "onreset",
3073
+ "onsearch",
3074
+ "onselect",
3075
+ "onsubmit",
3076
+ "oncancel",
3077
+ "onkeydown",
3078
+ "onkeypress",
3079
+ "onkeyup",
3080
+ "onclick",
3081
+ "ondblclick",
3082
+ "onmousedown",
3083
+ "onmousemove",
3084
+ "onmouseout",
3085
+ "onmouseover",
3086
+ "onmouseup",
3087
+ "onmousewheel",
3088
+ "onwheel",
3089
+ "ondrag",
3090
+ "ondragend",
3091
+ "ondragenter",
3092
+ "ondragleave",
3093
+ "ondragover",
3094
+ "ondragstart",
3095
+ "ondrop",
3096
+ "onscroll",
3097
+ "oncopy",
3098
+ "oncut",
3099
+ "onpaste",
3100
+ "onabort",
3101
+ "oncanplay",
3102
+ "oncanplaythrough",
3103
+ "oncuechange",
3104
+ "ondurationchange",
3105
+ "onemptied",
3106
+ "onended",
3107
+ "onerror",
3108
+ "onloadeddata",
3109
+ "onloadedmetadata",
3110
+ "onloadstart",
3111
+ "onpause",
3112
+ "onplay",
3113
+ "onplaying",
3114
+ "onprogress",
3115
+ "onratechange",
3116
+ "onseeked",
3117
+ "onseeking",
3118
+ "onstalled",
3119
+ "onsuspend",
3120
+ "ontimeupdate",
3121
+ "onvolumechange",
3122
+ "onwaiting",
3123
+ "ontoggle",
3124
+ "onpointerdown",
3125
+ "onpointerup",
3126
+ "onpointermove",
3127
+ "onpointercancel",
3128
+ "onpointerover",
3129
+ "onpointerout",
3130
+ "onpointerenter",
3131
+ "onpointerleave"
3132
+ ]);
3133
+ var capture_events_set = {};
3134
+ for (const x of events_set) {
3135
+ capture_events_set[x + "capture"] = x;
3056
3136
  }
3137
+ var length_css_attributes_set = /* @__PURE__ */ new Set([
3138
+ "width",
3139
+ "height",
3140
+ "minWidth",
3141
+ "minHeight",
3142
+ "maxWidth",
3143
+ "maxHeight",
3144
+ "top",
3145
+ "right",
3146
+ "bottom",
3147
+ "left",
3148
+ "margin",
3149
+ "marginTop",
3150
+ "marginRight",
3151
+ "marginBottom",
3152
+ "marginLeft",
3153
+ "padding",
3154
+ "paddingTop",
3155
+ "paddingRight",
3156
+ "paddingBottom",
3157
+ "paddingLeft",
3158
+ "borderWidth",
3159
+ "borderTopWidth",
3160
+ "borderRightWidth",
3161
+ "borderBottomWidth",
3162
+ "borderLeftWidth",
3163
+ "outlineWidth",
3164
+ "fontSize",
3165
+ "lineHeight",
3166
+ "letterSpacing",
3167
+ "wordSpacing",
3168
+ "textIndent",
3169
+ "borderRadius",
3170
+ "borderTopLeftRadius",
3171
+ "borderTopRightRadius",
3172
+ "borderBottomLeftRadius",
3173
+ "borderBottomRightRadius",
3174
+ "columnGap",
3175
+ "rowGap",
3176
+ "gap"
3177
+ ]);
3178
+ var boolean_html_attributes_set = /* @__PURE__ */ new Set([
3179
+ "disabled",
3180
+ "readOnly",
3181
+ "required",
3182
+ "checked",
3183
+ "multiple",
3184
+ "selected",
3185
+ "hidden",
3186
+ "open",
3187
+ "loop",
3188
+ "muted",
3189
+ "controls",
3190
+ "playsInline",
3191
+ "allowFullScreen"
3192
+ ]);
3193
+
3194
+ // .tmp/src/components.jsx
3057
3195
  function doUpdates() {
3058
3196
  clearTimeout(lilact_default.effect_timeout);
3059
3197
  const _update_set = lilact_default.update_set;
@@ -3091,7 +3229,7 @@ var generateComponentKey = (entity, props) => {
3091
3229
  } else {
3092
3230
  if (typeof entity === "string") {
3093
3231
  key = ":t:" + entity;
3094
- } else if (entity?.name) {
3232
+ } else if (entity == null ? void 0 : entity.name) {
3095
3233
  key = entity.name;
3096
3234
  } else {
3097
3235
  key = "::";
@@ -3182,7 +3320,7 @@ var Component = class {
3182
3320
  */
3183
3321
  get displayName() {
3184
3322
  const entity = this[CORE].entity;
3185
- if (entity?.displayName) {
3323
+ if (entity == null ? void 0 : entity.displayName) {
3186
3324
  return entity.displayName;
3187
3325
  }
3188
3326
  if (typeof entity === "string") {
@@ -3261,6 +3399,7 @@ var RootComponent = class extends HTMLComponent {
3261
3399
  if (typeof this.element === "string") {
3262
3400
  element = document.querySelector(element);
3263
3401
  }
3402
+ element.innerHTML = "";
3264
3403
  this[CORE].element = element;
3265
3404
  for (const ch2 of props.children) {
3266
3405
  if (ch2[CORE]) ch2[CORE].container = this[CORE];
@@ -3309,7 +3448,7 @@ function createRoot(element) {
3309
3448
  },
3310
3449
  unmount() {
3311
3450
  if (root) {
3312
- root.cleanup();
3451
+ root[CORE].cleanup();
3313
3452
  element.innerHTML = "";
3314
3453
  }
3315
3454
  },
@@ -3323,7 +3462,7 @@ function createPortal(children, element) {
3323
3462
  }
3324
3463
  function cloneComponent(component, propsPatch, ...children) {
3325
3464
  const cc = { entity: component.entity, props: { ...component.props, ...propsPatch }, [CORE]: null };
3326
- if (children?.length) {
3465
+ if (children == null ? void 0 : children.length) {
3327
3466
  cc.props.children = children;
3328
3467
  }
3329
3468
  return cc;
@@ -3354,159 +3493,6 @@ var passive_effects = /* @__PURE__ */ new Set();
3354
3493
  var update_timeout = void 0;
3355
3494
  var effect_timeout = void 0;
3356
3495
  var update_interval_margin = 0;
3357
- var special_attributes = /* @__PURE__ */ new Set([
3358
- "classname",
3359
- "ref",
3360
- "action",
3361
- "lilact_jsx_loc",
3362
- "children",
3363
- "key",
3364
- "defaultvalue",
3365
- "defaultchecked"
3366
- ]);
3367
- var events_set = /* @__PURE__ */ new Set([
3368
- "onafterprint",
3369
- "onbeforeprint",
3370
- "onbeforeunload",
3371
- "onerror",
3372
- "onhashchange",
3373
- "onload",
3374
- "onmessage",
3375
- "onoffline",
3376
- "ononline",
3377
- "onpagehide",
3378
- "onpageshow",
3379
- "onpopstate",
3380
- "onresize",
3381
- "onstorage",
3382
- "onunload",
3383
- "onblur",
3384
- "onchange",
3385
- "oncontextmenu",
3386
- "onfocus",
3387
- "oninput",
3388
- "oninvalid",
3389
- "onreset",
3390
- "onsearch",
3391
- "onselect",
3392
- "onsubmit",
3393
- "oncancel",
3394
- "onkeydown",
3395
- "onkeypress",
3396
- "onkeyup",
3397
- "onclick",
3398
- "ondblclick",
3399
- "onmousedown",
3400
- "onmousemove",
3401
- "onmouseout",
3402
- "onmouseover",
3403
- "onmouseup",
3404
- "onmousewheel",
3405
- "onwheel",
3406
- "ondrag",
3407
- "ondragend",
3408
- "ondragenter",
3409
- "ondragleave",
3410
- "ondragover",
3411
- "ondragstart",
3412
- "ondrop",
3413
- "onscroll",
3414
- "oncopy",
3415
- "oncut",
3416
- "onpaste",
3417
- "onabort",
3418
- "oncanplay",
3419
- "oncanplaythrough",
3420
- "oncuechange",
3421
- "ondurationchange",
3422
- "onemptied",
3423
- "onended",
3424
- "onerror",
3425
- "onloadeddata",
3426
- "onloadedmetadata",
3427
- "onloadstart",
3428
- "onpause",
3429
- "onplay",
3430
- "onplaying",
3431
- "onprogress",
3432
- "onratechange",
3433
- "onseeked",
3434
- "onseeking",
3435
- "onstalled",
3436
- "onsuspend",
3437
- "ontimeupdate",
3438
- "onvolumechange",
3439
- "onwaiting",
3440
- "ontoggle",
3441
- "onpointerdown",
3442
- "onpointerup",
3443
- "onpointermove",
3444
- "onpointercancel",
3445
- "onpointerover",
3446
- "onpointerout",
3447
- "onpointerenter",
3448
- "onpointerleave"
3449
- ]);
3450
- var capture_events_set = {};
3451
- for (const x of events_set) {
3452
- capture_events_set[x + "capture"] = x;
3453
- }
3454
- var length_css_attributes_set = /* @__PURE__ */ new Set([
3455
- "width",
3456
- "height",
3457
- "minWidth",
3458
- "minHeight",
3459
- "maxWidth",
3460
- "maxHeight",
3461
- "top",
3462
- "right",
3463
- "bottom",
3464
- "left",
3465
- "margin",
3466
- "marginTop",
3467
- "marginRight",
3468
- "marginBottom",
3469
- "marginLeft",
3470
- "padding",
3471
- "paddingTop",
3472
- "paddingRight",
3473
- "paddingBottom",
3474
- "paddingLeft",
3475
- "borderWidth",
3476
- "borderTopWidth",
3477
- "borderRightWidth",
3478
- "borderBottomWidth",
3479
- "borderLeftWidth",
3480
- "outlineWidth",
3481
- "fontSize",
3482
- "lineHeight",
3483
- "letterSpacing",
3484
- "wordSpacing",
3485
- "textIndent",
3486
- "borderRadius",
3487
- "borderTopLeftRadius",
3488
- "borderTopRightRadius",
3489
- "borderBottomLeftRadius",
3490
- "borderBottomRightRadius",
3491
- "columnGap",
3492
- "rowGap",
3493
- "gap"
3494
- ]);
3495
- var boolean_html_attributes_set = /* @__PURE__ */ new Set([
3496
- "disabled",
3497
- "readOnly",
3498
- "required",
3499
- "checked",
3500
- "multiple",
3501
- "selected",
3502
- "hidden",
3503
- "open",
3504
- "loop",
3505
- "muted",
3506
- "controls",
3507
- "playsInline",
3508
- "allowFullScreen"
3509
- ]);
3510
3496
 
3511
3497
  // .tmp/src/hooks.jsx
3512
3498
  var hooks_exports = {};
@@ -3557,11 +3543,11 @@ function useCallback(callback, deps) {
3557
3543
  }
3558
3544
  const hk = useHook();
3559
3545
  if (!isEmpty(hk)) {
3560
- if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) {
3546
+ if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) {
3561
3547
  return hk.callback;
3562
3548
  }
3563
3549
  }
3564
- if (hk?.cleanup) {
3550
+ if (hk == null ? void 0 : hk.cleanup) {
3565
3551
  hk.cleanup();
3566
3552
  }
3567
3553
  hk.deps = deps;
@@ -3578,11 +3564,12 @@ function createContext(defaultValue) {
3578
3564
  };
3579
3565
  }
3580
3566
  function useContext(context2) {
3581
- let core = lilact_default.current_component[0]?.parent;
3567
+ var _a6, _b, _c;
3568
+ let core = (_a6 = lilact_default.current_component[0]) == null ? void 0 : _a6.parent;
3582
3569
  while (core && core.entity !== context2.Provider) {
3583
3570
  core = core.parent;
3584
3571
  }
3585
- return core ? core.props?.value ?? context2.default : context2.default;
3572
+ return core ? (_c = (_b = core.props) == null ? void 0 : _b.value) != null ? _c : context2.default : context2.default;
3586
3573
  }
3587
3574
  function useId(prefix2 = "N") {
3588
3575
  const hk = useHook();
@@ -3613,6 +3600,7 @@ function useTransition() {
3613
3600
  return [hk.count != 0, hk.func];
3614
3601
  }
3615
3602
  function useLocalStorage(key, initialValue) {
3603
+ if (Array.isArray(key)) key = key.join(":");
3616
3604
  const hk = useHook();
3617
3605
  let val;
3618
3606
  try {
@@ -3649,9 +3637,9 @@ async function useLayoutEffect(effect, deps) {
3649
3637
  }
3650
3638
  const hk = useHook();
3651
3639
  if (!isEmpty(hk)) {
3652
- if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) return;
3640
+ if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
3653
3641
  }
3654
- if (hk?.cleanup) {
3642
+ if (hk == null ? void 0 : hk.cleanup) {
3655
3643
  await hk.cleanup();
3656
3644
  hk.cleanup = void 0;
3657
3645
  }
@@ -3668,9 +3656,9 @@ async function useEffect(effect, deps) {
3668
3656
  }
3669
3657
  const hk = useHook();
3670
3658
  if (!isEmpty(hk)) {
3671
- if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) return;
3659
+ if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
3672
3660
  }
3673
- if (hk?.cleanup) {
3661
+ if (hk == null ? void 0 : hk.cleanup) {
3674
3662
  await hk.cleanup();
3675
3663
  hk.cleanup = void 0;
3676
3664
  }
@@ -3687,9 +3675,9 @@ async function useInsertionEffect(effect, deps) {
3687
3675
  }
3688
3676
  const hk = useHook();
3689
3677
  if (!isEmpty(hk)) {
3690
- if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) return;
3678
+ if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
3691
3679
  }
3692
- if (hk?.cleanup) {
3680
+ if (hk == null ? void 0 : hk.cleanup) {
3693
3681
  await hk.cleanup();
3694
3682
  hk.cleanup = void 0;
3695
3683
  }
@@ -3706,7 +3694,7 @@ function useMemo(factory, deps) {
3706
3694
  }
3707
3695
  const hk = useHook();
3708
3696
  if (!isEmpty(hk)) {
3709
- if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) {
3697
+ if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) {
3710
3698
  return hk.value;
3711
3699
  }
3712
3700
  }
@@ -3778,9 +3766,9 @@ function useDeferredValue(value, initialValue) {
3778
3766
  return deferred;
3779
3767
  }
3780
3768
  function useImperativeHandle(ref, factory, deps) {
3781
- if (deps !== void 0 && ref?.deps !== void 0 && shallowEqual(deps, ref.deps)) return;
3769
+ if (deps !== void 0 && (ref == null ? void 0 : ref.deps) !== void 0 && shallowEqual(deps, ref.deps)) return;
3782
3770
  ref.deps = deps;
3783
- if (typeof ref?.current !== "object") {
3771
+ if (typeof (ref == null ? void 0 : ref.current) !== "object") {
3784
3772
  ref.current = {};
3785
3773
  }
3786
3774
  Object.assign(ref.current, factory());
@@ -3821,9 +3809,9 @@ function joinPaths(basePath, relativePath) {
3821
3809
  }
3822
3810
  function asError(value, fallback = "Unknown error") {
3823
3811
  if (value instanceof Error) return value;
3824
- if (value?.error instanceof Error) return value.error;
3812
+ if ((value == null ? void 0 : value.error) instanceof Error) return value.error;
3825
3813
  const error2 = new Error(
3826
- value?.message == null ? fallback : String(value.message)
3814
+ (value == null ? void 0 : value.message) == null ? fallback : String(value.message)
3827
3815
  );
3828
3816
  if (value && typeof value === "object") {
3829
3817
  if (value.name) error2.name = value.name;
@@ -3872,10 +3860,11 @@ function createModule(path2, {
3872
3860
  return module2;
3873
3861
  }
3874
3862
  function loadModule(path2, options2 = {}) {
3875
- if (lilact_default.importObjectPaths?.[path2]) {
3863
+ var _a6, _b, _c, _d;
3864
+ if ((_a6 = lilact_default.importObjectPaths) == null ? void 0 : _a6[path2]) {
3876
3865
  return lilact_default.importObjectPaths[path2];
3877
3866
  }
3878
- if (options2.requirer?.path) {
3867
+ if ((_b = options2.requirer) == null ? void 0 : _b.path) {
3879
3868
  path2 = joinPaths(options2.requirer.path, path2);
3880
3869
  }
3881
3870
  const loadAsync = Boolean(lilact_default[LAZY]) || Boolean(options2.isLazy);
@@ -3904,7 +3893,7 @@ function loadModule(path2, options2 = {}) {
3904
3893
  }
3905
3894
  return loadAsyncResource(path2, module2, options2);
3906
3895
  }
3907
- const resolved = lilact_default.resolver?.(path2);
3896
+ const resolved = (_d = (_c = lilact_default).resolver) == null ? void 0 : _d.call(_c, path2);
3908
3897
  if (resolved != null) {
3909
3898
  if (path2.endsWith(".css")) {
3910
3899
  injectGlobal(String(resolved));
@@ -3953,7 +3942,8 @@ function require2(path2) {
3953
3942
  return loadModule(path2, options2);
3954
3943
  }
3955
3944
  function makeImportsObject(mod, options2 = {}) {
3956
- mod.importsObject ?? (mod.importsObject = {});
3945
+ var _a6;
3946
+ (_a6 = mod.importsObject) != null ? _a6 : mod.importsObject = {};
3957
3947
  for (const key of Object.keys(mod.importsObject)) {
3958
3948
  delete mod.importsObject[key];
3959
3949
  }
@@ -3998,13 +3988,14 @@ function replaceReloadedExports(previousExports2, nextExports2) {
3998
3988
  const oldExport = oldExports[name];
3999
3989
  const newExport = newExports[name];
4000
3990
  if (typeof oldExport === "function" && typeof newExport === "function") {
4001
- lilact_default.replaceAllComponentInstances(oldExport, newExport);
3991
+ replaceAllComponentInstances(oldExport, newExport);
4002
3992
  }
4003
3993
  }
4004
3994
  }
4005
3995
  function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, options = {}) {
3996
+ var _a6, _b, _c;
4006
3997
  let module = required_scripts[path];
4007
- const previousExports = module?.loaded ? module.exports : void 0;
3998
+ const previousExports = (module == null ? void 0 : module.loaded) ? module.exports : void 0;
4008
3999
  if (!module) {
4009
4000
  module = createModule(path, {
4010
4001
  code: jsx
@@ -4033,8 +4024,8 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, options = {})
4033
4024
  });
4034
4025
  } catch (value) {
4035
4026
  const error2 = asError(value);
4036
- error2.fileName ?? (error2.fileName = path);
4037
- error2.lilact_source ?? (error2.lilact_source = { path });
4027
+ (_a6 = error2.fileName) != null ? _a6 : error2.fileName = path;
4028
+ (_b = error2.lilact_source) != null ? _b : error2.lilact_source = { path };
4038
4029
  error2.sourcePhase = "transpile";
4039
4030
  module.error = error2;
4040
4031
  lilact_default.error = error2;
@@ -4054,7 +4045,7 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, options = {})
4054
4045
  return nextExports;
4055
4046
  } catch (value) {
4056
4047
  const error2 = report(value, path);
4057
- error2.sourcePhase ?? (error2.sourcePhase = "runtime");
4048
+ (_c = error2.sourcePhase) != null ? _c : error2.sourcePhase = "runtime";
4058
4049
  module.error = error2;
4059
4050
  throw error2;
4060
4051
  }
@@ -4063,9 +4054,10 @@ function getOrCreateModule(path2, options2 = {}) {
4063
4054
  return required_scripts[path2] || createModule(path2, options2);
4064
4055
  }
4065
4056
  function loadAsyncResource(path2, module2, options2 = {}) {
4057
+ var _a6, _b;
4066
4058
  let source;
4067
4059
  try {
4068
- const resolved = lilact_default.resolver?.(path2);
4060
+ const resolved = (_b = (_a6 = lilact_default).resolver) == null ? void 0 : _b.call(_a6, path2);
4069
4061
  if (resolved == null) {
4070
4062
  if (module2.code && !module2.loaded) {
4071
4063
  source = Promise.resolve(module2.code);
@@ -4097,7 +4089,10 @@ function loadAsyncResource(path2, module2, options2 = {}) {
4097
4089
  return void 0;
4098
4090
  }
4099
4091
  return run(module2.code, path2, options2);
4100
- }).then((result2) => result2?.default ?? result2).catch((error2) => {
4092
+ }).then((result2) => {
4093
+ var _a7;
4094
+ return (_a7 = result2 == null ? void 0 : result2.default) != null ? _a7 : result2;
4095
+ }).catch((error2) => {
4101
4096
  module2.error = report(error2, path2);
4102
4097
  throw module2.error;
4103
4098
  }).finally(() => {
@@ -4135,10 +4130,11 @@ function lazy(factory) {
4135
4130
  status = "success";
4136
4131
  }
4137
4132
  function LazyComponent(props) {
4133
+ var _a6;
4138
4134
  if (status === "pending" || status === "error") {
4139
4135
  throw result2;
4140
4136
  }
4141
- const Component2 = result2?.default ?? result2;
4137
+ const Component2 = (_a6 = result2 == null ? void 0 : result2.default) != null ? _a6 : result2;
4142
4138
  return createComponent(Component2, { ...props });
4143
4139
  }
4144
4140
  return LazyComponent;
@@ -4192,10 +4188,10 @@ function Transition({
4192
4188
  // but the user should use CSSTransition itself.
4193
4189
  _classNames: classNames
4194
4190
  }) {
4195
- var _a, _b, _c;
4196
- (_a = this[CORE]).is_mounted ?? (_a.is_mounted = !mountOnEnter || inProp || appear);
4197
- (_b = this[CORE]).is_appeared ?? (_b.is_appeared = inProp);
4198
- (_c = this[CORE]).timer ?? (_c.timer = null);
4191
+ var _a6, _b, _c, _d, _e, _f;
4192
+ (_b = (_a6 = this[CORE]).is_mounted) != null ? _b : _a6.is_mounted = !mountOnEnter || inProp || appear;
4193
+ (_d = (_c = this[CORE]).is_appeared) != null ? _d : _c.is_appeared = inProp;
4194
+ (_f = (_e = this[CORE]).timer) != null ? _f : _e.timer = null;
4199
4195
  this[CORE].childFunctionHandler = (func) => {
4200
4196
  return func(this[CORE].mount_state);
4201
4197
  };
@@ -4210,15 +4206,15 @@ function Transition({
4210
4206
  }, []);
4211
4207
  useEffect(() => {
4212
4208
  if (!this[CORE].is_appeared && appear && this[CORE].mount_state === ENTERING && inProp) {
4213
- onEnter?.();
4209
+ onEnter == null ? void 0 : onEnter();
4214
4210
  requestAnimationFrame(() => {
4215
- onEntering?.(!this[CORE].is_appeared);
4211
+ onEntering == null ? void 0 : onEntering(!this[CORE].is_appeared);
4216
4212
  clearTimeout(this[CORE].timer);
4217
4213
  this[CORE].timer = setTimeout(() => {
4218
4214
  this[CORE].mount_state = ENTERED;
4219
4215
  this.forceUpdate();
4220
4216
  this[CORE].is_appeared = true;
4221
- onEntered?.(!this[CORE].is_appeared);
4217
+ onEntered == null ? void 0 : onEntered(!this[CORE].is_appeared);
4222
4218
  }, timeout);
4223
4219
  });
4224
4220
  }
@@ -4227,29 +4223,29 @@ function Transition({
4227
4223
  if (inProp) {
4228
4224
  this[CORE].is_mounted = true;
4229
4225
  if (this[CORE].mount_state === ENTERING || this[CORE].mount_state === ENTERED) return;
4230
- onEnter?.(!this[CORE].is_appeared);
4226
+ onEnter == null ? void 0 : onEnter(!this[CORE].is_appeared);
4231
4227
  this[CORE].mount_state = ENTERING;
4232
4228
  this.forceUpdate(() => {
4233
- onEntering?.(!this[CORE].is_appeared);
4229
+ onEntering == null ? void 0 : onEntering(!this[CORE].is_appeared);
4234
4230
  clearTimeout(this[CORE].timer);
4235
4231
  this[CORE].timer = setTimeout(() => {
4236
4232
  this[CORE].mount_state = ENTERED;
4237
4233
  this.forceUpdate();
4238
4234
  this[CORE].is_appeared = true;
4239
- onEntered?.();
4235
+ onEntered == null ? void 0 : onEntered();
4240
4236
  }, timeout);
4241
4237
  });
4242
4238
  } else {
4243
4239
  if (this[CORE].mount_state === UNMOUNTED || this[CORE].mount_state === EXITING || this[CORE].mount_state === EXITED) return;
4244
- onExit?.();
4240
+ onExit == null ? void 0 : onExit();
4245
4241
  this[CORE].mount_state = EXITING;
4246
4242
  this.forceUpdate(() => {
4247
- onExiting?.();
4243
+ onExiting == null ? void 0 : onExiting();
4248
4244
  clearTimeout(this[CORE].timer);
4249
4245
  this[CORE].timer = setTimeout(() => {
4250
4246
  this[CORE].mount_state = EXITED;
4251
4247
  this.forceUpdate();
4252
- onExited?.();
4248
+ onExited == null ? void 0 : onExited();
4253
4249
  if (unmountOnExit) {
4254
4250
  this[CORE].is_mounted = false;
4255
4251
  this[CORE].mount_state = UNMOUNTED;
@@ -4371,7 +4367,8 @@ function SwitchTransition({
4371
4367
  }
4372
4368
  };
4373
4369
  return createComponent("div", { "style": { position: "relative" } }, childArray.map((child, index2) => {
4374
- const key = child?.props?.key || index2;
4370
+ var _a6;
4371
+ const key = ((_a6 = child == null ? void 0 : child.props) == null ? void 0 : _a6.key) || index2;
4375
4372
  const isIncoming = key === activeKey;
4376
4373
  const isOutgoing = key === exitingKey;
4377
4374
  const inProp = isIncoming ? enterAllowed : isOutgoing ? !exitStarted : false;
@@ -4393,21 +4390,24 @@ __export(events_exports, {
4393
4390
  });
4394
4391
  var SyntheticEvent = class {
4395
4392
  constructor(nativeEvent, currentTarget) {
4393
+ var _a6;
4396
4394
  this.nativeEvent = nativeEvent;
4397
4395
  this.type = nativeEvent.type;
4398
4396
  this.target = nativeEvent.target || nativeEvent.srcElement || null;
4399
4397
  this.currentTarget = currentTarget || nativeEvent.currentTarget || null;
4400
- this.timeStamp = nativeEvent.timeStamp ?? Date.now();
4398
+ this.timeStamp = (_a6 = nativeEvent.timeStamp) != null ? _a6 : Date.now();
4401
4399
  this.defaultPrevented = !!nativeEvent.defaultPrevented;
4402
4400
  let propagationStopped = false;
4403
4401
  this.isDefaultPrevented = () => this.defaultPrevented;
4404
4402
  this.isPropagationStopped = () => propagationStopped;
4405
4403
  this.preventDefault = () => {
4406
- nativeEvent.preventDefault?.();
4404
+ var _a7;
4405
+ (_a7 = nativeEvent.preventDefault) == null ? void 0 : _a7.call(nativeEvent);
4407
4406
  this.defaultPrevented = true;
4408
4407
  };
4409
4408
  this.stopPropagation = () => {
4410
- nativeEvent.stopPropagation?.();
4409
+ var _a7;
4410
+ (_a7 = nativeEvent.stopPropagation) == null ? void 0 : _a7.call(nativeEvent);
4411
4411
  propagationStopped = true;
4412
4412
  };
4413
4413
  this.persist = () => {
@@ -4469,7 +4469,7 @@ __export(redux_exports2, {
4469
4469
  });
4470
4470
  var ReduxContext;
4471
4471
  function Provider({ store, children }) {
4472
- ReduxContext ?? (ReduxContext = createContext(null));
4472
+ ReduxContext != null ? ReduxContext : ReduxContext = createContext(null);
4473
4473
  return createComponent(ReduxContext.Provider, { "value": store }, children);
4474
4474
  }
4475
4475
  function useStore() {
@@ -4571,11 +4571,16 @@ var timer_pause_time;
4571
4571
  var current_timer_idx = 0;
4572
4572
  var timer_list = [];
4573
4573
  var timer_timeout = 0;
4574
- globalThis.NATIVE_TIMERS ?? (globalThis.NATIVE_TIMERS = {});
4575
- NATIVE_TIMERS.setTimeout ?? (NATIVE_TIMERS.setTimeout = globalThis.setTimeout.bind(globalThis));
4576
- NATIVE_TIMERS.setInterval ?? (NATIVE_TIMERS.setInterval = globalThis.setInterval.bind(globalThis));
4577
- NATIVE_TIMERS.clearTimeout ?? (NATIVE_TIMERS.clearTimeout = globalThis.clearTimeout.bind(globalThis));
4578
- NATIVE_TIMERS.clearInterval ?? (NATIVE_TIMERS.clearInterval = globalThis.clearInterval.bind(globalThis));
4574
+ var _a;
4575
+ (_a = globalThis.NATIVE_TIMERS) != null ? _a : globalThis.NATIVE_TIMERS = {};
4576
+ var _a2;
4577
+ (_a2 = NATIVE_TIMERS.setTimeout) != null ? _a2 : NATIVE_TIMERS.setTimeout = globalThis.setTimeout.bind(globalThis);
4578
+ var _a3;
4579
+ (_a3 = NATIVE_TIMERS.setInterval) != null ? _a3 : NATIVE_TIMERS.setInterval = globalThis.setInterval.bind(globalThis);
4580
+ var _a4;
4581
+ (_a4 = NATIVE_TIMERS.clearTimeout) != null ? _a4 : NATIVE_TIMERS.clearTimeout = globalThis.clearTimeout.bind(globalThis);
4582
+ var _a5;
4583
+ (_a5 = NATIVE_TIMERS.clearInterval) != null ? _a5 : NATIVE_TIMERS.clearInterval = globalThis.clearInterval.bind(globalThis);
4579
4584
  var all_timers = /* @__PURE__ */ new Map();
4580
4585
  function get_bucket(target) {
4581
4586
  let left = 0;
@@ -4643,7 +4648,7 @@ function run_timer() {
4643
4648
  try {
4644
4649
  timer[CALLBACK](...timer[ARGS]);
4645
4650
  } catch (error2) {
4646
- first_error ?? (first_error = error2);
4651
+ first_error != null ? first_error : first_error = error2;
4647
4652
  }
4648
4653
  if (timer[CLEARED]) {
4649
4654
  all_timers.delete(timer[IDX]);
@@ -4795,9 +4800,9 @@ function number(value) {
4795
4800
  }
4796
4801
  function asError2(value) {
4797
4802
  if (value instanceof Error) return value;
4798
- if (value?.error instanceof Error) return value.error;
4803
+ if ((value == null ? void 0 : value.error) instanceof Error) return value.error;
4799
4804
  const error2 = new Error(
4800
- value?.message == null ? String(value) : String(value.message)
4805
+ (value == null ? void 0 : value.message) == null ? String(value) : String(value.message)
4801
4806
  );
4802
4807
  if (value && typeof value === "object") {
4803
4808
  if (value.name) error2.name = value.name;
@@ -4809,7 +4814,7 @@ function asError2(value) {
4809
4814
  return error2;
4810
4815
  }
4811
4816
  function isParserError(error2) {
4812
- return error2?.name === "JSXParserError";
4817
+ return (error2 == null ? void 0 : error2.name) === "JSXParserError";
4813
4818
  }
4814
4819
  function stackLocation(stack) {
4815
4820
  if (typeof stack !== "string") return null;
@@ -4825,11 +4830,12 @@ function stackLocation(stack) {
4825
4830
  return null;
4826
4831
  }
4827
4832
  function browserLocation(error2) {
4833
+ var _a6, _b, _c, _d;
4828
4834
  const line2 = number(
4829
- error2?.lineNumber ?? error2?.lineno ?? error2?.line
4835
+ (_b = (_a6 = error2 == null ? void 0 : error2.lineNumber) != null ? _a6 : error2 == null ? void 0 : error2.lineno) != null ? _b : error2 == null ? void 0 : error2.line
4830
4836
  );
4831
4837
  const column2 = number(
4832
- error2?.columnNumber ?? error2?.colno ?? error2?.column
4838
+ (_d = (_c = error2 == null ? void 0 : error2.columnNumber) != null ? _c : error2 == null ? void 0 : error2.colno) != null ? _d : error2 == null ? void 0 : error2.column
4833
4839
  );
4834
4840
  const lineOffset = isSafari() ? 0 : 1;
4835
4841
  return {
@@ -4838,12 +4844,13 @@ function browserLocation(error2) {
4838
4844
  };
4839
4845
  }
4840
4846
  function traceBlock(error2) {
4841
- const trace = error2?.lilact_trace;
4847
+ const trace = error2 == null ? void 0 : error2.lilact_trace;
4842
4848
  return Array.isArray(trace) ? trace[0] : trace;
4843
4849
  }
4844
4850
  function blockInfo(error2) {
4851
+ var _a6, _b;
4845
4852
  const trace = traceBlock(error2);
4846
- return trace == null ? null : lilact_default.blocksInfo?.labels?.[trace];
4853
+ return trace == null ? null : (_b = (_a6 = lilact_default.blocksInfo) == null ? void 0 : _a6.labels) == null ? void 0 : _b[trace];
4847
4854
  }
4848
4855
  function mapLocation(mappings, line2, column2) {
4849
4856
  if (!Array.isArray(mappings) || !mappings.length || !Number.isFinite(line2) || !Number.isFinite(column2)) {
@@ -4875,7 +4882,8 @@ function mapLocation(mappings, line2, column2) {
4875
4882
  };
4876
4883
  }
4877
4884
  function traceError(value, runPath) {
4878
- if (value?.isTraced) return value;
4885
+ var _a6, _b, _c, _d, _e, _f, _g, _h;
4886
+ if (value == null ? void 0 : value.isTraced) return value;
4879
4887
  const error2 = asError2(value);
4880
4888
  const source = error2.lilact_source;
4881
4889
  const stack = isParserError(error2) ? null : stackLocation(error2.stack);
@@ -4883,10 +4891,10 @@ function traceError(value, runPath) {
4883
4891
  line: number(error2.lineNumber),
4884
4892
  column: number(error2.columnNumber)
4885
4893
  } : browserLocation(error2);
4886
- const fileName = source?.path || stack?.path || error2.fileName || runPath || null;
4887
- const sameSource = !source?.path || !stack?.path || source.path === stack.path;
4888
- let line2 = sameSource ? stack?.line ?? browser.line ?? null : browser.line ?? null;
4889
- let column2 = sameSource ? stack?.column ?? browser.column ?? null : browser.column ?? null;
4894
+ const fileName = (source == null ? void 0 : source.path) || (stack == null ? void 0 : stack.path) || error2.fileName || runPath || null;
4895
+ const sameSource = !(source == null ? void 0 : source.path) || !(stack == null ? void 0 : stack.path) || source.path === stack.path;
4896
+ let line2 = sameSource ? (_b = (_a6 = stack == null ? void 0 : stack.line) != null ? _a6 : browser.line) != null ? _b : null : (_c = browser.line) != null ? _c : null;
4897
+ let column2 = sameSource ? (_e = (_d = stack == null ? void 0 : stack.column) != null ? _d : browser.column) != null ? _e : null : (_f = browser.column) != null ? _f : null;
4890
4898
  const result2 = {
4891
4899
  fileName,
4892
4900
  lineNumber: line2,
@@ -4911,30 +4919,32 @@ function traceError(value, runPath) {
4911
4919
  const block = blockInfo(error2);
4912
4920
  if (block && (result2.lineNumber == null || result2.columnNumber == null || !result2.fileName)) {
4913
4921
  result2.fileName || (result2.fileName = block.path || runPath || null);
4914
- result2.lineNumber ?? (result2.lineNumber = block.line);
4915
- result2.columnNumber ?? (result2.columnNumber = block.column);
4922
+ (_g = result2.lineNumber) != null ? _g : result2.lineNumber = block.line;
4923
+ (_h = result2.columnNumber) != null ? _h : result2.columnNumber = block.column;
4916
4924
  result2.label = block.desc;
4917
4925
  }
4918
4926
  lilact_default.error = result2;
4919
4927
  return result2;
4920
4928
  }
4921
4929
  function escapeHtml(value) {
4922
- return String(value ?? "").replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#39;");
4930
+ return String(value != null ? value : "").replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#39;");
4923
4931
  }
4924
4932
  function sourceExcerpt(module2, line2) {
4933
+ var _a6, _b, _c, _d;
4925
4934
  if (!module2 || !Number.isFinite(line2)) return null;
4926
- const lines = String(module2.code ?? "").split(/\r?\n/);
4935
+ const lines = String((_a6 = module2.code) != null ? _a6 : "").split(/\r?\n/);
4927
4936
  return {
4928
- before: lines[line2 - 1] ?? "",
4929
- current: lines[line2] ?? "",
4930
- after: lines[line2 + 1] ?? ""
4937
+ before: (_b = lines[line2 - 1]) != null ? _b : "",
4938
+ current: (_c = lines[line2]) != null ? _c : "",
4939
+ after: (_d = lines[line2 + 1]) != null ? _d : ""
4931
4940
  };
4932
4941
  }
4933
4942
  function globalErrorHandler(eventOrError) {
4934
- const value = eventOrError?.error instanceof Error ? eventOrError.error : eventOrError?.reason !== void 0 ? eventOrError.reason : eventOrError;
4943
+ var _a6, _b;
4944
+ const value = (eventOrError == null ? void 0 : eventOrError.error) instanceof Error ? eventOrError.error : (eventOrError == null ? void 0 : eventOrError.reason) !== void 0 ? eventOrError.reason : eventOrError;
4935
4945
  const error2 = traceError(
4936
4946
  value,
4937
- eventOrError?.fileName || null
4947
+ (eventOrError == null ? void 0 : eventOrError.fileName) || null
4938
4948
  );
4939
4949
  const excerpt = sourceExcerpt(
4940
4950
  required_scripts[error2.fileName],
@@ -4967,7 +4977,7 @@ function globalErrorHandler(eventOrError) {
4967
4977
  dialog.className = className;
4968
4978
  const location = error2.fileName ? `At ${escapeHtml(error2.fileName)}` : "";
4969
4979
  const line2 = Number.isFinite(error2.lineNumber) ? `: Line ${error2.lineNumber + 1}` : "";
4970
- const componentStack = error2._error?.componentStackLog || error2._error?.componentStack || "";
4980
+ const componentStack = ((_a6 = error2._error) == null ? void 0 : _a6.componentStackLog) || ((_b = error2._error) == null ? void 0 : _b.componentStack) || "";
4971
4981
  dialog.innerHTML = `
4972
4982
  <h3><red>Error!</red></h3>
4973
4983
  <b>${location}${line2}</b><br><br>
@@ -5033,6 +5043,7 @@ var createURL = (to) => typeof to === "string" ? to : (to.pathname || "") + (to.
5033
5043
  var escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
5034
5044
  function HashRouter({ children, basename = "" }) {
5035
5045
  const readLocation = () => {
5046
+ var _a6;
5036
5047
  const raw = window.location.hash || "#/";
5037
5048
  const full = raw.slice(1);
5038
5049
  const baseRe = new RegExp("^" + escapeRegExp(basename));
@@ -5043,7 +5054,7 @@ function HashRouter({ children, basename = "" }) {
5043
5054
  pathname: path2 || "/",
5044
5055
  search: search ? "?" + search : "",
5045
5056
  hash: hashPart ? "#" + hashPart : "",
5046
- state: history.state?.__state
5057
+ state: (_a6 = history.state) == null ? void 0 : _a6.__state
5047
5058
  };
5048
5059
  };
5049
5060
  const [location, setLocation] = useState(readLocation);
@@ -5066,7 +5077,7 @@ function HashRouter({ children, basename = "" }) {
5066
5077
  done = true;
5067
5078
  window.removeEventListener("popstate", onPop);
5068
5079
  window.removeEventListener("hashchange", onHash);
5069
- fn?.();
5080
+ fn == null ? void 0 : fn();
5070
5081
  resolve();
5071
5082
  };
5072
5083
  const onPop = () => cleanup(() => setLocation(readLocation()));
@@ -5172,13 +5183,14 @@ function Route({ path: path2, element = null, children }) {
5172
5183
  return null;
5173
5184
  }
5174
5185
  function Routes({ children }) {
5186
+ var _a6;
5175
5187
  const location = useLocation();
5176
5188
  const pathname = location.pathname || "/";
5177
5189
  const routes = Children.toArray(children);
5178
5190
  for (let i2 = 0; i2 < routes.length; i2++) {
5179
5191
  const route = routes[i2];
5180
5192
  const path2 = route.props.path === void 0 ? null : route.props.path;
5181
- const element = route.props.element ?? null;
5193
+ const element = (_a6 = route.props.element) != null ? _a6 : null;
5182
5194
  const childRoutes = route.props.children;
5183
5195
  const { matched, params } = matchPath(path2, pathname);
5184
5196
  if (matched) {
@@ -5378,7 +5390,7 @@ function DragHandle({
5378
5390
  }, []);
5379
5391
  const endDrag = useCallback((reason = "up") => {
5380
5392
  if (!draggingRef.current) return;
5381
- onEnd?.(reason);
5393
+ onEnd == null ? void 0 : onEnd(reason);
5382
5394
  resetDrag();
5383
5395
  }, [onEnd, resetDrag]);
5384
5396
  const onPointerDown = useCallback((e) => {
@@ -5390,17 +5402,17 @@ function DragHandle({
5390
5402
  lastClientXRef.current = e.clientX;
5391
5403
  lastClientYRef.current = e.clientY;
5392
5404
  setIsDragging(true);
5393
- onStart?.(data);
5405
+ onStart == null ? void 0 : onStart(data);
5394
5406
  try {
5395
5407
  e.currentTarget.setPointerCapture(e.pointerId);
5396
- } catch {
5408
+ } catch (e2) {
5397
5409
  }
5398
5410
  }, [onStart]);
5399
5411
  const onPointerMove = useCallback((e) => {
5400
5412
  if (!draggingRef.current) return;
5401
5413
  if (activePointerIdRef.current !== e.pointerId) return;
5402
5414
  const { dx, dy } = computeDeltaFromStart(e.clientX, e.clientY);
5403
- onDelta?.(dx, dy, data);
5415
+ onDelta == null ? void 0 : onDelta(dx, dy, data);
5404
5416
  lastClientXRef.current = e.clientX;
5405
5417
  lastClientYRef.current = e.clientY;
5406
5418
  }, [computeDeltaFromStart, onDelta]);
@@ -5468,18 +5480,21 @@ var SplitPane = forwardRef(function SplitPane2({
5468
5480
  const { w: w2, h: h2 } = sizeRef.current;
5469
5481
  if (modeNow === "vertical" ? h2 <= 0 : w2 <= 0) {
5470
5482
  if (position2 == null) setInternalPos(next2);
5471
- onSizeChange?.(next2);
5483
+ onSizeChange == null ? void 0 : onSizeChange(next2);
5472
5484
  return;
5473
5485
  }
5474
5486
  const clamped = clampWithSize(next2, modeNow, w2, h2);
5475
5487
  if (position2 == null) setInternalPos(clamped);
5476
5488
  effectivePosRef.current = clamped;
5477
- onSizeChange?.(clamped);
5489
+ onSizeChange == null ? void 0 : onSizeChange(clamped);
5478
5490
  };
5479
5491
  useImperativeHandle(ref, () => ({
5480
5492
  setPosition,
5481
5493
  setMode: (nextMode) => setInternalMode(nextMode === "vertical" ? "vertical" : "horizontal"),
5482
- getPosition: () => effectivePosRef.current ?? posResolved,
5494
+ getPosition: () => {
5495
+ var _a6;
5496
+ return (_a6 = effectivePosRef.current) != null ? _a6 : posResolved;
5497
+ },
5483
5498
  getMode: () => internalModeRef.current
5484
5499
  }));
5485
5500
  const didInitRef = useRef(false);
@@ -5487,6 +5502,7 @@ var SplitPane = forwardRef(function SplitPane2({
5487
5502
  const el = containerRef.current;
5488
5503
  if (!el) return;
5489
5504
  const ro = new ResizeObserver((entries) => {
5505
+ var _a6;
5490
5506
  const rect = el.getBoundingClientRect();
5491
5507
  const prev2 = sizeRef.current;
5492
5508
  const nextSize = { w: rect.width, h: rect.height };
@@ -5500,11 +5516,11 @@ var SplitPane = forwardRef(function SplitPane2({
5500
5516
  const clamped = clampWithSize(raw, modeNow, nextSize.w, nextSize.h);
5501
5517
  if (position2 == null) setInternalPos(clamped);
5502
5518
  effectivePosRef.current = clamped;
5503
- onSizeChange?.(clamped);
5519
+ onSizeChange == null ? void 0 : onSizeChange(clamped);
5504
5520
  return;
5505
5521
  }
5506
5522
  if (!hadSize || !hasSizeNow) return;
5507
- const p2 = effectivePosRef.current ?? posResolved;
5523
+ const p2 = (_a6 = effectivePosRef.current) != null ? _a6 : posResolved;
5508
5524
  const rp = resizePolicyRef.current;
5509
5525
  const s = splitterSize;
5510
5526
  if (rp === "fixFirst") {
@@ -5554,8 +5570,9 @@ var SplitPane = forwardRef(function SplitPane2({
5554
5570
  if (!dragging) startPosRef.current = posResolved;
5555
5571
  }, [posResolved, dragging]);
5556
5572
  const handleStart = () => {
5573
+ var _a6;
5557
5574
  setDragging(true);
5558
- startPosRef.current = effectivePosRef.current ?? posResolved;
5575
+ startPosRef.current = (_a6 = effectivePosRef.current) != null ? _a6 : posResolved;
5559
5576
  };
5560
5577
  const handleDelta = (x, y) => {
5561
5578
  const modeNow = internalModeRef.current;
@@ -5669,7 +5686,7 @@ var SplitPane = forwardRef(function SplitPane2({
5669
5686
  });
5670
5687
  }
5671
5688
  }
5672
- return createComponent("div", { "ref": containerRef, "className": className, "style": {
5689
+ return createComponent("div", { "ref": containerRef, "className": cx(className, dragging && "dragging"), "style": {
5673
5690
  position: "relative",
5674
5691
  width: "100%",
5675
5692
  height: "100%",
@@ -5888,6 +5905,7 @@ function generateSequence(arr, labeler2 = labeler2.bind(null, null)) {
5888
5905
  var import_export_regexp = /(?:i[C \n]*(?:(?:I|J|(?:\*[C \n]*a[C \n]*I))[C \n]*,[C \n]*)*(?:(?:(?:I(?:[C \n]*a[C \n]*I)?)|J|(?:\*[C \n]*a[C \n]*I))[C \n]*f[C \n]*)?S)|(?:e[C \n]*(?:(?:[*J][C \n]*f[C \n]*S)|(?:d[C \n]*[IFJ])|J|(?:[VF][c \n]*I)|I))|(?:r[c \n]*P)/mg;
5889
5906
  var props_regexp = /O[C \n]*(?:[Id](?:[C \n]*a[C \n]*I)?[C \n]*,[C \n]*)*(?:I(?:[C \n]*a[C \n]*I)?)[C \n]*O/mg;
5890
5907
  function processImportExports(node3, jsx2, meta) {
5908
+ var _a6;
5891
5909
  const s = generateSequence(
5892
5910
  node3.out,
5893
5911
  labeler.bind(
@@ -5932,7 +5950,7 @@ function processImportExports(node3, jsx2, meta) {
5932
5950
  }
5933
5951
  }
5934
5952
  begins.push(node3.end);
5935
- meta.imports ?? (meta.imports = {});
5953
+ (_a6 = meta.imports) != null ? _a6 : meta.imports = {};
5936
5954
  const imported_names = /* @__PURE__ */ new Set();
5937
5955
  for (const m of s.matchAll(import_export_regexp)) {
5938
5956
  if (m[0].startsWith("r")) {
@@ -6300,14 +6318,14 @@ function preprocessPragmas(node, context) {
6300
6318
  var scope_stack = [];
6301
6319
  var last_block = null;
6302
6320
  const clone_block = (i2, val) => {
6303
- var _a;
6321
+ var _a6, _b;
6304
6322
  last_block = typeof all_nodes[i2] === "object" ? structuredClone(
6305
6323
  { ...all_nodes[i2], children: void 0, attributes: {} }
6306
6324
  ) : all_nodes[i2];
6307
6325
  if (last_block.type === "directive") {
6308
6326
  last_block.value = val;
6309
6327
  }
6310
- (_a = scope_stack[0]).out ?? (_a.out = []);
6328
+ (_b = (_a6 = scope_stack[0]).out) != null ? _b : _a6.out = [];
6311
6329
  scope_stack[0].out.push(last_block);
6312
6330
  return last_block;
6313
6331
  };
@@ -6838,12 +6856,13 @@ function generateSourceMap(json, path2, jsx_eols, out_eols, mappings = []) {
6838
6856
  "mappings": ""
6839
6857
  };
6840
6858
  const scan_leaves = (node3) => {
6841
- if (node3?.out?.length > 0) {
6859
+ var _a6;
6860
+ if (((_a6 = node3 == null ? void 0 : node3.out) == null ? void 0 : _a6.length) > 0) {
6842
6861
  for (const ch2 of node3.out) {
6843
6862
  scan_leaves(ch2);
6844
6863
  }
6845
6864
  }
6846
- if (node3?.begin !== void 0 && node3?.out_index !== void 0) {
6865
+ if ((node3 == null ? void 0 : node3.begin) !== void 0 && (node3 == null ? void 0 : node3.out_index) !== void 0) {
6847
6866
  mpps.push([...getRowCol(out_eols, node3.out_index), ...getRowCol(jsx_eols, node3.begin), node3]);
6848
6867
  }
6849
6868
  };
@@ -6897,8 +6916,9 @@ function transpileJSX(jsx2, {
6897
6916
  counter: 0
6898
6917
  }
6899
6918
  } = {}) {
6900
- transpilerConfig.preprocessorDelimiter ?? (transpilerConfig.preprocessorDelimiter = "\u0294");
6901
- transpilerConfig.injectTraceLabels ?? (transpilerConfig.injectTraceLabels = injectTraceLabels);
6919
+ var _a6, _b;
6920
+ (_a6 = transpilerConfig.preprocessorDelimiter) != null ? _a6 : transpilerConfig.preprocessorDelimiter = "\u0294";
6921
+ (_b = transpilerConfig.injectTraceLabels) != null ? _b : transpilerConfig.injectTraceLabels = injectTraceLabels;
6902
6922
  jsx2 += "\n";
6903
6923
  const eols = scanEOLs(jsx2);
6904
6924
  raiseError = ((eols2, msg, index2) => {
@@ -7002,7 +7022,7 @@ function transpileJSX(jsx2, {
7002
7022
  if (is_attr) {
7003
7023
  return out2.substring(1, out2.length - 1);
7004
7024
  }
7005
- if (node3?.is_xml_js) {
7025
+ if (node3 == null ? void 0 : node3.is_xml_js) {
7006
7026
  return jsx2.substring(node3.begin + 1, node3.end - 1);
7007
7027
  }
7008
7028
  return out2;
@@ -7105,7 +7125,8 @@ globalThis.require = Lilact2.require;
7105
7125
  document.addEventListener("DOMContentLoaded", () => {
7106
7126
  Lilact2.grabTimers();
7107
7127
  Lilact2.runScripts().catch((error2) => {
7108
- Lilact2.globalErrorHandler?.(error2);
7128
+ var _a6;
7129
+ (_a6 = Lilact2.globalErrorHandler) == null ? void 0 : _a6.call(Lilact2, error2);
7109
7130
  });
7110
7131
  });
7111
7132
  if (true) {
@@ -7139,7 +7160,6 @@ export {
7139
7160
  HashRouter,
7140
7161
  IDX,
7141
7162
  INTERVAL,
7142
- IS_ZOMBIE,
7143
7163
  LAZY,
7144
7164
  LOCATION,
7145
7165
  Lilact2 as Lilact,
@@ -7165,8 +7185,6 @@ export {
7165
7185
  animationFramePromise,
7166
7186
  asError2 as asError,
7167
7187
  blocksInfo,
7168
- boolean_html_attributes_set,
7169
- capture_events_set,
7170
7188
  clearInterval,
7171
7189
  clearTimeout2 as clearTimeout,
7172
7190
  cloneComponent,
@@ -7186,7 +7204,6 @@ export {
7186
7204
  emotion_css_esm_exports as emotion,
7187
7205
  error,
7188
7206
  eval_num,
7189
- events_set,
7190
7207
  findDOMNode,
7191
7208
  forwardRef,
7192
7209
  getComponentUnderPointer,
@@ -7203,7 +7220,6 @@ export {
7203
7220
  isValidElement,
7204
7221
  layout_effects,
7205
7222
  lazy,
7206
- length_css_attributes_set,
7207
7223
  memo,
7208
7224
  passive_effects,
7209
7225
  pauseTimers,
@@ -7212,8 +7228,6 @@ export {
7212
7228
  releaseSyntheticEvent,
7213
7229
  releaseTimers,
7214
7230
  render,
7215
- replaceAllComponentInstances,
7216
- replaceComponentEntity,
7217
7231
  require2 as require,
7218
7232
  required_scripts,
7219
7233
  resetTimers,
@@ -7225,7 +7239,6 @@ export {
7225
7239
  setInterval,
7226
7240
  setTimeout2 as setTimeout,
7227
7241
  shallowEqual,
7228
- special_attributes,
7229
7242
  startTransition,
7230
7243
  timeoutPromise,
7231
7244
  toBool,