mutts 1.0.7 → 1.0.8

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 (132) hide show
  1. package/README.md +61 -23
  2. package/dist/async/browser.d.ts +2 -0
  3. package/dist/async/browser.d.ts.map +1 -0
  4. package/dist/async/index.d.ts +18 -0
  5. package/dist/async/index.d.ts.map +1 -0
  6. package/dist/async/node.d.ts +2 -0
  7. package/dist/async/node.d.ts.map +1 -0
  8. package/dist/{chunks/index-BFYK02LG.js → browser.cjs} +169 -60
  9. package/dist/browser.cjs.map +1 -0
  10. package/dist/browser.d.ts +1654 -1
  11. package/dist/browser.esm.js +260 -25
  12. package/dist/browser.esm.js.map +1 -1
  13. package/dist/chunks/async-browser-CA0jPWIi.cjs +304 -0
  14. package/dist/chunks/async-browser-CA0jPWIi.cjs.map +1 -0
  15. package/dist/chunks/async-core-UqHzvJ-S.cjs +25 -0
  16. package/dist/chunks/async-core-UqHzvJ-S.cjs.map +1 -0
  17. package/dist/chunks/async-node-BYHuGTni.cjs +103 -0
  18. package/dist/chunks/async-node-BYHuGTni.cjs.map +1 -0
  19. package/dist/chunks/{index-CNR6QRUl.esm.js → index-DhaOVusv.esm.js} +173 -53
  20. package/dist/chunks/index-DhaOVusv.esm.js.map +1 -0
  21. package/dist/decorator.d.ts +106 -0
  22. package/dist/decorator.d.ts.map +1 -0
  23. package/dist/destroyable.d.ts +87 -0
  24. package/dist/destroyable.d.ts.map +1 -0
  25. package/dist/devtools/devtool/devtools.d.ts +1 -0
  26. package/dist/devtools/devtool/devtools.d.ts.map +1 -0
  27. package/dist/devtools/devtool/panel.d.ts +2 -0
  28. package/dist/devtools/devtool/panel.d.ts.map +1 -0
  29. package/dist/entry-browser.d.ts +3 -0
  30. package/dist/entry-browser.d.ts.map +1 -0
  31. package/dist/entry-node.d.ts +3 -0
  32. package/dist/entry-node.d.ts.map +1 -0
  33. package/dist/eventful.d.ts +18 -0
  34. package/dist/eventful.d.ts.map +1 -0
  35. package/dist/index.d.ts +13 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/indexable.d.ts +243 -0
  38. package/dist/indexable.d.ts.map +1 -0
  39. package/dist/introspection.d.ts +27 -0
  40. package/dist/introspection.d.ts.map +1 -0
  41. package/dist/iterableWeak.d.ts +53 -0
  42. package/dist/iterableWeak.d.ts.map +1 -0
  43. package/dist/mixins.d.ts +25 -0
  44. package/dist/mixins.d.ts.map +1 -0
  45. package/dist/mutts.umd.js +1 -1
  46. package/dist/mutts.umd.js.map +1 -1
  47. package/dist/mutts.umd.min.js +1 -1
  48. package/dist/mutts.umd.min.js.map +1 -1
  49. package/dist/node.cjs +105 -0
  50. package/dist/node.cjs.map +1 -0
  51. package/dist/node.d.ts +1 -2
  52. package/dist/node.esm.js +91 -32
  53. package/dist/node.esm.js.map +1 -1
  54. package/dist/promiseChain.d.ts +20 -0
  55. package/dist/promiseChain.d.ts.map +1 -0
  56. package/dist/reactive/array.d.ts +49 -0
  57. package/dist/reactive/array.d.ts.map +1 -0
  58. package/dist/reactive/buffer.d.ts +44 -0
  59. package/dist/reactive/buffer.d.ts.map +1 -0
  60. package/dist/reactive/change.d.ts +29 -0
  61. package/dist/reactive/change.d.ts.map +1 -0
  62. package/dist/reactive/debug.d.ts +111 -0
  63. package/dist/reactive/debug.d.ts.map +1 -0
  64. package/dist/reactive/deep-touch.d.ts +28 -0
  65. package/dist/reactive/deep-touch.d.ts.map +1 -0
  66. package/dist/reactive/deep-watch-state.d.ts +25 -0
  67. package/dist/reactive/deep-watch-state.d.ts.map +1 -0
  68. package/dist/reactive/deep-watch.d.ts +19 -0
  69. package/dist/reactive/deep-watch.d.ts.map +1 -0
  70. package/dist/reactive/effect-context.d.ts +7 -0
  71. package/dist/reactive/effect-context.d.ts.map +1 -0
  72. package/dist/reactive/effects.d.ts +151 -0
  73. package/dist/reactive/effects.d.ts.map +1 -0
  74. package/dist/reactive/index.d.ts +20 -0
  75. package/dist/reactive/index.d.ts.map +1 -0
  76. package/dist/reactive/interface.d.ts +64 -0
  77. package/dist/reactive/interface.d.ts.map +1 -0
  78. package/dist/reactive/map.d.ts +30 -0
  79. package/dist/reactive/map.d.ts.map +1 -0
  80. package/dist/reactive/memoize.d.ts +5 -0
  81. package/dist/reactive/memoize.d.ts.map +1 -0
  82. package/dist/reactive/non-reactive-state.d.ts +9 -0
  83. package/dist/reactive/non-reactive-state.d.ts.map +1 -0
  84. package/dist/reactive/non-reactive.d.ts +11 -0
  85. package/dist/reactive/non-reactive.d.ts.map +1 -0
  86. package/dist/reactive/project.d.ts +41 -0
  87. package/dist/reactive/project.d.ts.map +1 -0
  88. package/dist/reactive/proxy-state.d.ts +8 -0
  89. package/dist/reactive/proxy-state.d.ts.map +1 -0
  90. package/dist/reactive/proxy.d.ts +23 -0
  91. package/dist/reactive/proxy.d.ts.map +1 -0
  92. package/dist/reactive/record.d.ts +116 -0
  93. package/dist/reactive/record.d.ts.map +1 -0
  94. package/dist/reactive/register.d.ts +64 -0
  95. package/dist/reactive/register.d.ts.map +1 -0
  96. package/dist/reactive/registry.d.ts +20 -0
  97. package/dist/reactive/registry.d.ts.map +1 -0
  98. package/dist/reactive/set.d.ts +28 -0
  99. package/dist/reactive/set.d.ts.map +1 -0
  100. package/dist/reactive/tracking.d.ts +7 -0
  101. package/dist/reactive/tracking.d.ts.map +1 -0
  102. package/dist/reactive/types.d.ts +376 -0
  103. package/dist/reactive/types.d.ts.map +1 -0
  104. package/dist/std-decorators.d.ts +50 -0
  105. package/dist/std-decorators.d.ts.map +1 -0
  106. package/dist/utils.d.ts +49 -0
  107. package/dist/utils.d.ts.map +1 -0
  108. package/dist/zone.d.ts +40 -0
  109. package/dist/zone.d.ts.map +1 -0
  110. package/docs/std-decorators.md +69 -1
  111. package/docs/zone.md +7 -0
  112. package/package.json +39 -27
  113. package/src/async/browser.ts +266 -34
  114. package/src/async/index.ts +17 -2
  115. package/src/async/node.ts +89 -31
  116. package/src/entry-browser.ts +5 -0
  117. package/src/entry-node.ts +5 -0
  118. package/src/index.d.ts +12 -9
  119. package/src/index.ts +1 -0
  120. package/src/reactive/array.ts +139 -52
  121. package/src/reactive/effect-context.ts +3 -3
  122. package/src/reactive/index.ts +2 -1
  123. package/src/reactive/map.ts +1 -1
  124. package/src/reactive/set.ts +1 -1
  125. package/src/utils.ts +1 -1
  126. package/src/zone.ts +19 -8
  127. package/dist/browser.js +0 -161
  128. package/dist/browser.js.map +0 -1
  129. package/dist/chunks/index-BFYK02LG.js.map +0 -1
  130. package/dist/chunks/index-CNR6QRUl.esm.js.map +0 -1
  131. package/dist/node.js +0 -136
  132. package/dist/node.js.map +0 -1
@@ -0,0 +1,25 @@
1
+ /**
2
+ * A mixin function that takes a base class and returns a new class with mixed-in functionality
3
+ * @template Mixed - The functionality to be mixed in
4
+ */
5
+ export type MixinFunction<Mixed> = <Base>(base: new (...args: any[]) => Base) => new (...args: any[]) => Base & Mixed;
6
+ /**
7
+ * A mixin class that can be used both as a base class and as a mixin function
8
+ * @template Mixed - The functionality to be mixed in
9
+ */
10
+ export type MixinClass<Mixed> = new (...args: any[]) => Mixed;
11
+ /**
12
+ * Creates a mixin that can be used both as a class (extends) and as a function (mixin)
13
+ *
14
+ * This function supports:
15
+ * - Using mixins as base classes: `class MyClass extends MyMixin`
16
+ * - Using mixins as functions: `class MyClass extends MyMixin(SomeBase)`
17
+ * - Composing mixins: `const Composed = MixinA(MixinB)`
18
+ * - Type-safe property inference for all patterns
19
+ *
20
+ * @param mixinFunction - The function that creates the mixin
21
+ * @param unwrapFunction - Optional function to unwrap reactive objects for method calls
22
+ * @returns A mixin that can be used both as a class and as a function
23
+ */
24
+ export declare function mixin<MixinFn extends (base: any) => new (...args: any[]) => any>(mixinFunction: MixinFn, unwrapFunction?: (obj: any) => any): (new (...args: any[]) => InstanceType<ReturnType<MixinFn>>) & (<Base>(base: abstract new (...args: any[]) => Base) => new (...args: any[]) => InstanceType<ReturnType<MixinFn>> & Base);
25
+ //# sourceMappingURL=mixins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mixins.d.ts","sourceRoot":"","sources":["../src/mixins.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,KAAK,IAAI,CAAC,IAAI,EACvC,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,KAC9B,KACJ,GAAG,IAAI,EAAE,GAAG,EAAE,KACV,IAAI,GAAG,KAAK,CAAA;AAEjB;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,KAAK,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,CAAA;AAE7D;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,OAAO,SAAS,CAAC,IAAI,EAAE,GAAG,KAAK,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAC/E,aAAa,EAAE,OAAO,EACtB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,GAChC,CAAC,KACH,GAAG,IAAI,EAAE,GAAG,EAAE,KACV,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GACtC,CAAC,CAAC,IAAI,EACL,IAAI,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,KACvC,KACJ,GAAG,IAAI,EAAE,GAAG,EAAE,KACV,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAiF9C"}
package/dist/mutts.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Mutts={})}(this,function(e){"use strict";const t={addHook(e){throw"One must import the library from the server or the client side"}};const n=new Set([Object,Array,Date,Function,Set,Map,WeakMap,WeakSet,Promise,Error,TypeError,ReferenceError,SyntaxError,RangeError,URIError,EvalError,Reflect,Proxy,RegExp,String,Number,Boolean]);function r(e){return e&&"function"==typeof e&&(n.has(e)||e.toString?.().startsWith("class "))}function o(e,t){return Object.defineProperties(e,{name:{value:t}})}const s={get:(e,t,n)=>"undefined"!=typeof Node&&e instanceof Node?e[t]:Reflect.get(e,t,n),set:(e,t,n,r)=>"undefined"!=typeof Node&&e instanceof Node?(e[t]=n,!0):e instanceof Object||Reflect.has(e,t)?Reflect.set(e,t,n,r):(Object.defineProperty(e,t,{value:n,configurable:!0,writable:!0,enumerable:!0}),!0)};function i(e,t){const n=Object.getOwnPropertyDescriptor(e,t);return!(!n?.get&&!n?.set)}function c(e,t,n=new Map){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return e===t;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;let r=n.get(e);if(r?.has(t))return!0;if(r||(r=new Set,n.set(e,r)),r.add(t),Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!c(e[r],t[r],n))return!1;return!0}if(e instanceof Date){const n=t instanceof Date&&e.getTime()===t.getTime();return n}if(e instanceof RegExp){const n=t instanceof RegExp&&e.toString()===t.toString();return n}if(e instanceof Set){if(!(t instanceof Set)||e.size!==t.size)return!1;for(const r of e){let e=!1;for(const o of t)if(c(r,o,n)){e=!0;break}if(!e)return!1}return!0}if(e instanceof Map){if(!(t instanceof Map)||e.size!==t.size)return!1;for(const[r,o]of e)if(t.has(r)){if(!c(o,t.get(r),n))return!1}else{let e=!1;for(const[s,i]of t)if(c(r,s,n)&&c(o,i,n)){e=!0;break}if(!e)return!1}return!0}const o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;for(const r of o){if(!Object.hasOwn(t,r))return!1;if(!c(e[r],t[r],n))return!1}return!0}const a=new WeakMap;function f(e){return a.has(e)||a.set(e,Object.seal(Object.create(null,{contentOf:{value:e,writable:!1,configurable:!1}}))),a.get(e)}function l(e,t){return Object.defineProperties(e,{[Symbol.toStringTag]:{value:t,writable:!1,configurable:!1},toString:{value:()=>t,writable:!1,configurable:!1}}),e}function u(e,t){return Object.defineProperty(t,"name",{value:t.name?`${t.name}::${e}`:e,writable:!1,configurable:!1}),t}class h extends Error{constructor(e){super(e),this.name="DecoratorException"}}function d(e){return function(t,n,o,...s){if(void 0===n){if(r(t)){if(!("class"in e))throw new Error("Decorator cannot be applied to a class");return e.class(t)}}else if("object"==typeof t&&["string","symbol"].includes(typeof n)){if(!o)throw new Error("Decorator cannot be applied to a field");if("object"==typeof o&&"configurable"in o){if("get"in o||"set"in o){if(!("getter"in e)&&!("setter"in e))throw new Error("Decorator cannot be applied to a getter or setter");if("getter"in e){const r=e.getter(o.get,t,n);r&&(o.get=r)}if("setter"in e){const r=e.setter(o.set,t,n);r&&(o.set=r)}return o}if("function"==typeof o.value){if(!("method"in e))throw new Error("Decorator cannot be applied to a method");const r=e.method(o.value,t,n);return r&&(o.value=r),o}}}if(!("default"in e))throw new Error("Decorator do not have a default implementation");return e.default.call(this,t,n,o,...s)}}function p(e){return function(t,n,...r){if(!n?.kind||"string"!=typeof n.kind){if(!("default"in e))throw new Error("Decorator do not have a default implementation");return e.default.call(this,t,n,...r)}switch(n.kind){case"class":if(!("class"in e))throw new Error("Decorator cannot be applied to a class");return e.class(t);case"field":throw new Error("Decorator cannot be applied to a field");case"getter":if(!("getter"in e))throw new Error("Decorator cannot be applied to a getter");return e.getter(t,t,n.name);case"setter":if(!("setter"in e))throw new Error("Decorator cannot be applied to a setter");return e.setter(t,t,n.name);case"method":if(!("method"in e))throw new Error("Decorator cannot be applied to a method");return e.method(t,t,n.name);case"accessor":{if(!("getter"in e)&&!("setter"in e))throw new Error("Decorator cannot be applied to a getter or setter");const r={};if("getter"in e){const o=e.getter(t.get,t,n.name);o&&(r.get=o)}if("setter"in e){const o=e.setter(t.set,t,n.name);o&&(r.set=o)}return r}}}}const g=e=>{const t=p(e),n=d(e);return(e,r,...o)=>{const s=function(e,t){return"object"==typeof t&&null!==t&&"string"==typeof t.kind?"modern":"legacy"}(0,r,o[0]);return"modern"===s?t(e,r,...o):n(e,r,...o)}},y=new FinalizationRegistry(e=>e()),m=Symbol("destructor"),b=Symbol("allocated");class w extends Error{static throw(e){return()=>{throw new w(e)}}constructor(e){super(`Object is destroyed. ${e}`),this.name="DestroyedAccessError"}}const v={[Symbol.toStringTag]:"MutTs Destroyable",get:w.throw("Cannot access destroyed object"),set:w.throw("Cannot access destroyed object")};const S=g({setter:(e,t,n)=>function(t){return this[b][n]=t,e.call(this,t)}});function k(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var c,a=r.kind,f="getter"===a?"get":"setter"===a?"set":"value",l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var p={};for(var g in r)p[g]="access"===g?{}:r[g];for(var g in r.access)p.access[g]=r.access[g];p.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[d])("accessor"===a?{get:u.get,set:u.set}:u[f],p);if("accessor"===a){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(c=i(y.get))&&(u.get=c),(c=i(y.set))&&(u.set=c),(c=i(y.init))&&o.unshift(c)}else(c=i(y))&&("field"===a?o.unshift(c):u[f]=c)}l&&Object.defineProperty(l,r.name,u),h=!0}function j(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function O(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function E(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}var M,x;"function"==typeof SuppressedError&&SuppressedError;M=new WeakMap,x=new WeakMap;const R=Symbol("getAt"),D=Symbol("setAt");function T(e,t){e&&"function"!=typeof e&&(t=e,e=void 0),e||(e=class{}),t||(t={get(e){if("function"!=typeof this[R])throw new Error("Indexable class must have an [getAt] method");return this[R](e)},set(e,t){if("function"!=typeof this[D])throw new Error("Indexable class has read-only numeric index access");this[D](e,t)}});class n extends e{}return Object.setPrototypeOf(n.prototype,new Proxy(e.prototype,{[Symbol.toStringTag]:"MutTs Indexable",get(e,n,r){if(n in e){const t=Object.getOwnPropertyDescriptor(e,n)?.get;return t?t.call(r):e[n]}if("string"==typeof n){if("length"===n&&t.getLength)return t.getLength.call(r);const e=Number(n);if(!Number.isNaN(e))return t.get.call(r,e)}},set(e,n,r,o){if(n in e){const t=Object.getOwnPropertyDescriptor(e,n)?.set;return t?t.call(o,r):e[n]=r,!0}if("string"==typeof n){if("length"===n&&t.setLength)return t.setLength.call(o,r),!0;const e=Number(n);if(!Number.isNaN(e)){if(!t.set)throw new Error("Indexable class has read-only numeric index access");return t.set.call(o,e,r),!0}}return Object.defineProperty(o,n,{value:r,writable:!0,enumerable:!0,configurable:!0}),!0},has(e,n){if(n in e)return!0;if("string"==typeof n){if("length"===n&&t.getLength)return!0;const e=Number(n);if(!Number.isNaN(e))return!0}return!1},ownKeys(e){const n=Reflect.ownKeys(e);if(t.getLength){n.push("length");const e=t.getLength.call(this);for(let t=0;t<e;t++)n.push(String(t))}return n},getOwnPropertyDescriptor(e,n){if(n in e)return Object.getOwnPropertyDescriptor(e,n);if("string"==typeof n){if("length"===n&&t.getLength)return{enumerable:!1,configurable:!0,get:()=>t.getLength.call(this)};const e=Number(n);if(!Number.isNaN(e))return{enumerable:!0,configurable:!0,get:()=>t.get.call(this,e),set:t.set?n=>t.set.call(this,e,n):void 0}}}})),n}const A=Symbol("forwardArray");class P{get[A](){throw new Error("ArrayReadForward is not implemented")}get length(){return this[A].length}[Symbol.iterator](){return this[A][Symbol.iterator]()}map(e,t){return this[A].map(e,t)}filter(e,t){return this[A].filter(e,t)}reduce(e,t){return void 0!==t?this[A].reduce(e,t):this[A].reduce(e)}reduceRight(e,t){return void 0!==t?this[A].reduceRight(e,t):this[A].reduceRight(e)}forEach(e,t){this[A].forEach(e,t)}find(e,t){return this[A].find(e,t)}findIndex(e,t){return this[A].findIndex(e,t)}findLast(e,t){return this[A].findLast(e,t)}findLastIndex(e,t){return this[A].findLastIndex(e,t)}includes(e,t){return this[A].includes(e,t)}indexOf(e,t){return this[A].indexOf(e,t)}lastIndexOf(e,t){return this[A].lastIndexOf(e,t)}slice(e,t){return this[A].slice(e,t)}concat(...e){return this[A].concat(...e)}every(e,t){return this[A].every(e,t)}some(e,t){return this[A].some(e,t)}join(e){return this[A].join(e)}keys(){return this[A].keys()}values(){return this[A].values()}entries(){return this[A].entries()}toString(){return this[A].toString()}toLocaleString(e,t){return this[A].toLocaleString(e,t)}at(e){return this[A].at(e)}flat(e){return this[A].flat(e)}flatMap(e,t){return this[A].flatMap(e,t)}toReversed(){return this[A].toReversed?.()??[...this[A]].reverse()}toSorted(e){return this[A].toSorted?.(e)??[...this[A]].sort(e)}toSpliced(e,t,...n){return void 0===t?this[A].toSpliced(e):this[A].toSpliced(e,t,...n)}with(e,t){return this[A].with(e,t)}get[Symbol.unscopables](){return this[A][Symbol.unscopables]}}var W,$;class I{constructor(e){if(this.uuids=new WeakMap,this.refs={},this[W]="IterableWeakMap",this.registry=new FinalizationRegistry(e=>{delete this.refs[e]}),e)for(const[t,n]of e)this.set(t,n)}createIterator(e){const{refs:t}=this;return function*(){for(const n of Object.keys(t)){const[r,o]=t[n],s=r.deref();s?yield e(s,o):delete t[n]}}()}clear(){for(const e of Object.keys(this.refs)){const t=this.refs[e][0].deref();t&&this.registry.unregister(t)}this.uuids=new WeakMap,this.refs={}}delete(e){const t=this.uuids.get(e);return!!t&&(delete this.refs[t],this.uuids.delete(e),this.registry.unregister(e),!0)}forEach(e,t){for(const[n,r]of this)e.call(t??this,r,n,t??this)}get(e){const t=this.uuids.get(e);if(t)return this.refs[t][1]}has(e){return this.uuids.has(e)}set(e,t){let n=this.uuids.get(e);return n?this.refs[n][1]=t:(n=crypto.randomUUID(),this.uuids.set(e,n),this.refs[n]=[new WeakRef(e),t],this.registry.register(e,n,e)),this}get size(){return[...this].length}entries(){return this.createIterator((e,t)=>[e,t])}keys(){return this.createIterator((e,t)=>e)}values(){return this.createIterator((e,t)=>t)}[Symbol.iterator](){return this.entries()}}W=Symbol.toStringTag;class z{constructor(e){if(this.uuids=new WeakMap,this.refs={},this[$]="IterableWeakSet",this.registry=new FinalizationRegistry(e=>{delete this.refs[e]}),e)for(const t of e)this.add(t)}createIterator(e){const{refs:t}=this;return function*(){for(const n of Object.keys(t)){const r=t[n].deref();r?yield e(r):delete t[n]}}()}clear(){for(const e of Object.keys(this.refs)){const t=this.refs[e].deref();t&&this.registry.unregister(t)}this.uuids=new WeakMap,this.refs={}}add(e){let t=this.uuids.get(e);return t||(t=crypto.randomUUID(),this.uuids.set(e,t),this.refs[t]=new WeakRef(e),this.registry.register(e,t,e)),this}delete(e){const t=this.uuids.get(e);return!!t&&(delete this.refs[t],this.uuids.delete(e),this.registry.unregister(e),!0)}forEach(e,t){for(const n of this)e.call(t??this,n,n,t??this)}has(e){return this.uuids.has(e)}get size(){return[...this].length}entries(){return this.createIterator(e=>[e,e])}keys(){return this.createIterator(e=>e)}values(){return this.createIterator(e=>e)}[Symbol.iterator](){return this.keys()}union(e){const t={[Symbol.iterator]:()=>e.keys()},n=this;return new Set(function*(){yield*n;for(const e of t)n.has(e)||(yield e)}())}intersection(e){const t=this;return new Set(function*(){for(const n of t)e.has(n)&&(yield n)}())}difference(e){const t=this;return new Set(function*(){for(const n of t)e.has(n)||(yield n)}())}symmetricDifference(e){const t={[Symbol.iterator]:()=>e.keys()},n=this;return new Set(function*(){for(const t of n)e.has(t)||(yield t);for(const e of t)n.has(e)||(yield e)}())}isSubsetOf(e){for(const t of this)if(!e.has(t))return!1;return!0}isSupersetOf(e){const t={[Symbol.iterator]:()=>e.keys()};for(const e of t)if(!this.has(e))return!1;return!0}isDisjointFrom(e){for(const t of this)if(e.has(t))return!1;return!0}}function C(e,t){const n=new WeakMap,o=e(Object);return n.set(Object,o),new Proxy(o,{apply(o,i,c){if(0===c.length)throw new Error("Mixin requires a base class");const a=c[0];if("function"!=typeof a)throw new Error("Mixin requires a constructor function");if(!(r(a)||a&&"function"==typeof a&&a.prototype))throw new Error("Mixin requires a valid constructor");const f=n.get(a);if(f)return f;let l=a;if(t){const e=class extends a{},n=a.prototype,r=new Proxy(n,{get(e,n,r){const o=s.get(e,n,r);return"function"!=typeof o||"string"!=typeof n||["constructor","toString","valueOf"].includes(n)?o:function(...e){const n=t(this);return o.apply(n,e)}}});Object.setPrototypeOf(e.prototype,r),l=e}const u=e(l);return n.set(a,u),u}})}$=Symbol.toStringTag;const N=(e,t)=>(...n)=>t[e](...n),K=new WeakMap,_=new WeakMap;function V(e,t){_.set(t,e),K.set(e,t)}const L={[Symbol.toStringTag]:"MutTs PromiseChain function",get:(e,t)=>t===Symbol.toStringTag?"PromiseProxy":"string"==typeof t&&["then","catch","finally"].includes(t)?e[t]:B(e.then(e=>e[t]))},F=e=>({then:N("then",e),catch:N("catch",e),finally:N("finally",e)}),q={[Symbol.toStringTag]:"MutTs PromiseChain object",get(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t)?.get,o=r?r.call(n):e[t];return"function"==typeof e?o:B(o)},apply:(e,t,n)=>B(e.apply(t,n))};function H(e){const t=new Proxy(e,q);return V(e,t),t}function U(e){return e&&["function","object"].includes(typeof e)}function B(e){if(!U(e))return e;if(K.has(e))return K.get(e);if(!(e instanceof Promise))return H(e);e=e.then(e=>U(e)?H(e):e);const t=Object.assign(function(...t){return B(e.then(e=>this?.then?this.then(n=>e.apply(n,t)):e.apply(this,t)))},F(e)),n=new Proxy(t,L);return V(e,n),n}const Z=Symbol("native-reactive"),G=Symbol("non-reactive"),X=Symbol("unreactive-properties"),J=Symbol("all-props"),Y=Symbol("projection-info"),Q=Symbol("stopped"),ee=Symbol("cleanup"),te=Symbol("root-function");var ne;e.ReactiveErrorCode=void 0,(ne=e.ReactiveErrorCode||(e.ReactiveErrorCode={})).CycleDetected="CYCLE_DETECTED",ne.MaxDepthExceeded="MAX_DEPTH_EXCEEDED",ne.MaxReactionExceeded="MAX_REACTION_EXCEEDED",ne.WriteInComputed="WRITE_IN_COMPUTED",ne.TrackingError="TRACKING_ERROR",ne.BrokenEffects="BROKEN_EFFECTS";class re extends Error{constructor(e,t){super(e),this.debugInfo=t,this.name="ReactiveError"}get code(){return this.debugInfo?.code}get cause(){return this.debugInfo?.cause}}const oe={enter:e=>{},leave:e=>{},chain:(e,t)=>{},beginChain:e=>{},endChain:()=>{},garbageCollected:e=>{},touched:(e,t,n,r)=>{},skipRunningEffect:e=>{},maxEffectChain:100,maxTriggerPerBatch:10,maxEffectReaction:"throw",onMemoizationDiscrepancy:void 0,cycleHandling:"none",isVerificationRun:!1,maxDeepWatchDepth:100,instanceMembers:!0,ignoreAccessors:!0,recursiveTouching:!0,asyncMode:"cancel",warn:(...e)=>{},introspection:{enableHistory:!1,historySize:50},zones:{setTimeout:!0,setInterval:!0,requestAnimationFrame:!0,queueMicrotask:!0}},se=new WeakMap,ie=new WeakMap,ce=new WeakMap,ae=new WeakMap,fe=new WeakMap;function le(e,t){const n=fe.get(t),r=n?.deref();if(r&&r!==e){const n=t.name||"anonymous",o=r.name||"anonymous",s=e.name||"anonymous";throw new Error(`[reactive] Abusive Shared Root detected: Root '${n}' is already identifying function '${o}'. Cannot reuse it for '${s}'. Shared roots cause lost updates and broken identity logic.`)}return fe.set(t,new WeakRef(e)),Object.defineProperty(e,te,{value:ue(t),writable:!1})}function ue(e){for(;e&&te in e;)e=e[te];return e}const he=Symbol("external-source");let de=!1;const pe=new Set,ge=new Set,ye=new WeakMap,me=new WeakMap;let be=0,we=0;const ve=new Map;function Se(e){let t=ye.get(e);if(!t){const n=ue(e);t=n?.name?.trim()||"effect_"+ ++be,ye.set(e,t)}return t}function ke(e){let t=me.get(e);if(!t){const n=e?.constructor?.name;t=`${n&&"Object"!==n?n:"object"}_${++we}`,me.set(e,t)}return t}function je(e){if(!e||pe.has(e))return;pe.add(e);const t=se.get(e);if(t)for(const e of t)Oe(e)}function Oe(e){ge.has(e)||function(e){ge.add(e),ke(e)}(e)}function Ee(e,t,n,r,o,s){const i=function(e){let t=ve.get(e);return t||(t=new Map,ve.set(e,t)),t}(e);let c=i.get(t);c||(c=new Map,i.set(t,c));let a=c.get(n);return a||(a={label:n,object:r,prop:o,evolution:s,count:0,lastTriggered:Date.now()},c.set(n,a)),a}function Me(e,t){ye.set(e,t)}function xe(e,t){me.set(e,t),ge.add(e)}function Re(e){e&&de&&je(e)}function De(e){de&&Oe(e)}function Te(e,t,n,r,o){if(oe.introspection.enableHistory&&function(e,t,n,r,o){const s={id:++Ie,timestamp:Date.now(),source:e?Se(e):"External",target:Se(t),objectName:ke(n),prop:String(r),type:o.type};$e.push(s),$e.length>oe.introspection.historySize&&$e.shift()}(e,t,n,r,o),!de)return;je(t),e&&je(e);const s=function(e,t){const n=ke(e);return t===J?`${n}.*`:"symbol"==typeof t?`${n}.${t.description??t.toString()}`:`${n}.${String(t)}`}(n,r),i=Ee(e??he,t,s,n,r,o);i.count+=1,i.lastTriggered=Date.now(),Oe(n)}function Ae(e,t=5){const n=[];let r=e;for(let e=0;e<t;e++){let e,t="";e:for(const[n,o]of ve)for(const[s,i]of o)if(s===r){let r=0;for(const o of i.values())o.lastTriggered>r&&(r=o.lastTriggered,t=o.label,e=n===he?void 0:n);if(e||t)break e}if(!e){if(t){n.push(`External -> (${t}) -> ${Se(r)}`);break}break}n.push(`${Se(e)} -> (${t}) -> ${Se(r)}`),r=e}return n.reverse()}function Pe(){const e=[],t=[],n=new Map,r=new Set(pe);!function(e){const t=Array.from(e);for(let n=0;n<t.length;n++){const r=t[n],o=ae.get(r);o&&!e.has(o)&&(e.add(o),t.push(o))}}(r);const{nodes:o,nodeByEffect:s}=function(e){const t=[],n=new Map,r=Array.from(e);for(const e of r){const r=Se(e),o={id:`effect_${t.length}`,label:r,type:"effect",depth:0,debugName:r};t.push(o),n.set(e,o)}const o=new Map,s=e=>{if(!e)return 0;const t=o.get(e);if(void 0!==t)return t;const n=ae.get(e),r=s(n)+(n?1:0);return o.set(e,r),r};for(const[e,t]of n){t.depth=s(e);const r=ae.get(e);if(r){const e=n.get(r);e&&(t.parentId=e.id)}}return{nodes:t,nodeByEffect:n}}(r);for(const t of o)e.push(t);for(const[e,t]of s)n.set(e,t.id);for(const t of ge){const r=`object_${e.length}`;e.push({id:r,label:ke(t),type:"state",debugName:me.get(t)}),n.set(t,r)}if(ve.has(he)){const t="effect_external";e.push({id:t,label:"External",type:"external",depth:0}),n.set(he,t)}for(const e of r){const r=n.get(e);if(!r)continue;const o=se.get(e);if(o)for(const e of o){const o=n.get(e);o&&t.push({id:`${r}->${o}`,source:r,target:o,type:"dependency",label:"depends"})}}for(const[e,r]of ve)for(const[o,s]of r){const r=n.get(o);if(!r)continue;const i=n.get(e);if(i)for(const e of s.values())t.push({id:`${i}->${r}:${e.label}`,source:i,target:r,type:"cause",label:e.count>1?`${e.label} (${e.count})`:e.label,count:e.count})}return{nodes:e,edges:t,meta:{generatedAt:Date.now(),devtoolsEnabled:de}}}function We(){return de}const $e=[];let Ie=0;var ze;class Ce{enter(e){const t=this.active;return this.active=e,t}leave(e){this.active=e}with(e,t){const n=this.enter(e);try{return t()}finally{this.leave(n)}}root(e){let t=this.enter();try{return e()}finally{this.leave(t)}}get zoned(){const e=this.active;return u(`${this}@${e}`,t=>this.with(e,t))}}class Ne extends Ce{}class Ke extends Ce{has(e){return this.history.has(e)}some(e){for(const t of this.history)if(e(t))return!0;return!1}constructor(e=new Ne){super(),this.controlled=e,this.history=new Set;const t=this;this.present=Object.create(e,Object.getOwnPropertyDescriptors({get active(){return e.active},set active(t){e.active=t},enter(n){if(n&&t.history.has(n))throw new Error("ZoneHistory: re-entering historical zone");return void 0!==n&&t.history.add(n),{added:n,entered:e.enter(n)}},leave:n=>(void 0!==n.added&&t.history.delete(n.added),e.leave(n.entered))}))}get active(){return{present:this.controlled.active,history:new Set(this.history)}}set active(e){this.history=this.history&&new Set(this.history),this.controlled.active=e?.present}}class _e extends Ce{constructor(...e){super(),ze.set(this,new Set);for(const t of e)O(this,ze,"f").add(t)}get active(){const e=new Map;for(const t of O(this,ze,"f"))void 0!==t.active&&e.set(t,t.active);return e}set active(e){for(const t of O(this,ze,"f"))t.active=e?.get(t)}enter(e){const t=new Map;for(const n of O(this,ze,"f")){const r=e?.get(n);t.set(n,n.enter(r))}return t}leave(e){for(const t of O(this,ze,"f"))t.leave(e.get(t))}add(e){O(this,ze,"f").add(e)}delete(e){O(this,ze,"f").delete(e)}clear(){O(this,ze,"f").clear()}}ze=new WeakMap;const Ve=l(new _e,"async");t.addHook(()=>{const e=Ve.active;return()=>{const t=Ve.active;return Ve.active=e,()=>Ve.active=t}});const Le=l(new Ke,"effectHistory");l(Le.present,"effectHistory.present"),Ve.add(Le);const Fe=l(new _e(Le.present),"effectAggregator");function qe(e){const t=ue(e);return Le.some(e=>ue(e)===t)}function He(){return Le.present.active}const Ue=new WeakMap,Be=new WeakMap;function Ze(e){let t=e;for(;t&&"object"==typeof t&&null!==t&&Be.has(t);)t=Be.get(t);return t}function Ge(e){const t=new Map;for(let n=0;n<e.length;n++){const r=e[n];if(t.has(r))return e.slice(t.get(r));t.set(r,n)}return null}function Xe(e,t=20){const n=e.map(e=>e.name||"<anonymous>");if(n.length<=t)return n.join(" → ");const r=n.slice(0,5),o=n.slice(-10);return`${r.join(" → ")} ... (${n.length-15} more) ... ${o.join(" → ")}`}let Je;const Ye=new Array(100);function Qe(t,n,r,o){const s=ue(t);if(!Je)return;let i=Je.get(s);i||(i=new Map,Je.set(s,i));let c=i.get(n);c||(c=new Map,i.set(n,c));const a=(c.get(o)??0)+1;if(c.set(o,a),Ye.unshift({effect:t,obj:n,evolution:r,prop:o}),Ye.pop(),a>=oe.maxTriggerPerBatch){const t=s?.name||"anonymous",n=`Aggressive trigger detected: effect "${t}" triggered ${a} times in the batch by the same cause.`;if("throw"===oe.maxEffectReaction)throw new re(n,{code:e.ReactiveErrorCode.MaxReactionExceeded,count:a,effect:t});oe.warn(`[reactive] ${n}`)}}const et=new WeakMap,tt=new WeakSet,nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,st=new WeakMap,it=new WeakMap;function ct(e,t){let n=e.get(t);return n||(n=new z,e.set(t,n)),n}function at(e,t,n){if(e===t)return!0;if(e===n)return!1;const r=new Set,o=[e];for(r.add(e),r.add(n);o.length>0;){const e=o.shift(),n=nt.get(e);if(n)for(const e of n){if(e===t)return!0;r.has(e)||(r.add(e),o.push(e))}}return!1}let ft;function lt(e){return ft?.all.has(ue(e))}const ut=new Set;function ht(e,t,n=new Set,r=[]){if(e===t)return[...r,t];if(n.has(e))return[];n.add(e);const o=[...r,e],s=nt.get(e);if(s)for(const e of s){const r=ht(e,t,n,o);if(r.length>0)return r}return[]}function dt(e,t){const n=ht(t,e);return n.length>0?[e,...n]:[]}function pt(t,n,r){if(t[ee]?.(),t[Q])return;if(!ft)return;const o=ue(t);if("none"===oe.cycleHandling&&ft.all.has(o)&&ft.all.delete(o),ft.all.set(o,t),n&&!r&&"none"!==oe.cycleHandling){const r=ue(n);if(function(e,t){if(e===t)return!1;const n=st.get(t);return!!n?.has(e)}(r,o)){const n=dt(r,o),s=n.length>0?`Cycle detected: ${n.map(e=>e.name||e.toString()).join(" → ")}`:`Cycle detected: ${r.name||r.toString()} → ${o.name||o.toString()} (and back)`,i=oe.cycleHandling;if("strict"===i){ft.all.delete(o);const r=Ae(t),i=it.get(o);throw new re(`[reactive] Strict Cycle Prevention: ${s}`,{code:e.ReactiveErrorCode.CycleDetected,cycle:n.map(e=>e.name||e.toString()),details:s,causalChain:r,creationStack:i})}switch(i){case"throw":{ft.all.delete(o);const r=Ae(t),i=it.get(o);throw new re(`[reactive] ${s}`,{code:e.ReactiveErrorCode.CycleDetected,cycle:n.map(e=>e.name||e.toString()),details:s,causalChain:r,creationStack:i})}case"warn":return oe.warn(`[reactive] ${s}`),void ft.all.delete(o);case"break":return void ft.all.delete(o)}}!function(e,t){if("none"===oe.cycleHandling)return;const n=nt.get(e);if(n?.has(t))return;if(n)n.add(t);else{const n=new z;n.add(t),nt.set(e,n)}let r=rt.get(t);if(r||(r=new z,rt.set(t,r)),r.add(e),e===t)return;const o=ct(st,e),s=ct(ot,t);o.add(t),s.add(e);const i=ot.get(e);if(i)for(const e of i)e!==t&&(ct(st,e).add(t),s.add(e));const c=st.get(t);if(c)for(const t of c)t!==e&&(ct(ot,t).add(e),o.add(t));if(i&&c)for(const e of i){const t=ct(st,e);for(const n of c)e!==n&&(t.add(n),ct(ot,n).add(e))}}(r,o)}}function gt(e){ft?ut.add(e):e()}const yt=gt;function mt(e,t,n,r,o){if(n.has(e)){const t=r.indexOf(e);return r.slice(t).concat([e])}if(t.has(e))return[];t.add(e),n.add(e),r.push(e);const s=nt.get(e);if(s)for(const e of s)if(o.all.has(e)){const s=mt(e,t,n,r,o);if(s.length>0)return s}return r.pop(),n.delete(e),[]}function bt(e){let t=null,n=null;if("none"===oe.cycleHandling){const e=ft.all.entries().next().value;e&&([n,t]=e)}else for(const[e,r]of ft.all){if(0===(ft.inDegrees.get(e)??0)){t=r,n=e;break}}if(!t){if(ft.all.size>0){let e=function(e){const t=new Set,n=new Set,r=[];for(const[o]of e.all){if(t.has(o))continue;const s=mt(o,t,n,r,e);if(s.length>0)return s}return[]}(ft);if(0===e.length)for(const[t]of ft.all){const n=st.get(t);if(n){for(const r of n)if(r!==t&&ft.all.has(r)){const n=st.get(r);if(n?.has(t)){e=[t,r,t];break}}if(e.length>0)break}}const t=e.length>0?`Cycle detected: ${e.map(e=>e.name||"<anonymous>").join(" → ")}`:"Cycle detected in effect batch - all effects have dependencies that prevent execution";switch(oe.cycleHandling){case"throw":throw new re(`[reactive] ${t}`);case"warn":{oe.warn(`[reactive] ${t}`);const e=ft.all.values().next().value;if(e){const t=ue(e);return ft.all.delete(t),ft.inDegrees.delete(t),e()}break}case"break":{const e=ft.all.values().next().value;if(e){const t=ue(e);return ft.all.delete(t),ft.inDegrees.delete(t),e()}break}}}return null}e.push(ue(t));const r=t();return ft.all.delete(n),ft.inDegrees.delete(n),function(e,t){const n=st.get(t);if(n)for(const t of n)if(e.all.has(t)){const n=e.inDegrees.get(t)??0;n>0&&e.inDegrees.set(t,n-1)}}(ft,n),r}function wt(t,n){Array.isArray(t)||(t=[t]);const r=t.map(ue);if(ft){oe?.chain(r,ue(He()));const e=He();for(let r=0;r<t.length;r++)pt(t[r],e,"immediate"===n);if(n){const e={};for(let n=0;n<t.length;n++)try{const r=t[n]();void 0===r||"value"in e||(e.value=r)}finally{const e=ue(t[n]);ft.all.delete(e)}return e.value}}else{if(Je)throw new Error("Batch already in progress");Je=new Map,oe.beginChain(r),ft={all:new Map,inDegrees:new Map};const o=He(),s=[],i={};try{if(n)for(let e=0;e<t.length;e++)try{const n=t[e]();void 0===n||"value"in i||(i.value=n)}finally{ft.all.delete(ue(t[e]))}else{for(let e=0;e<t.length;e++)pt(t[e],o,!1);!function(e){if("none"===oe.cycleHandling)return;const t=He(),n=t?ue(t):null;e.inDegrees.clear();for(const[t]of e.all){let r=0;const o=ot.get(t);if(o)for(const s of o)e.all.has(s)&&s!==n&&s!==t&&r++;e.inDegrees.set(t,r)}}(ft)}for(;ft.all.size>0||ut.size>0;)if(ft.all.size>0){if(s.length>oe.maxEffectChain){const t=Ge(s),n=Xe(s),r=t?`Max effect chain reached (cycle detected: ${Xe(t)})`:`Max effect chain reached (trace: ${n})`,o=(ft?Array.from(ft.all.keys()):[]).map(e=>e.name||"<anonymous>"),i={code:e.ReactiveErrorCode.MaxDepthExceeded,effectuatedRoots:s,cycle:t,trace:n,maxEffectChain:oe.maxEffectChain,queued:o.slice(0,50),queuedCount:o.length,causalChain:s.length>0?Ae(ft.all.get(s[s.length-1])):[]};switch(oe.maxEffectReaction){case"throw":case"debug":throw new re(`[reactive] ${r}`,i);case"warn":oe.warn(`[reactive] ${r} (queued: ${o.slice(0,10).join(", ")}${o.length>10?", …":""})`)}}const t=bt(s);void 0===t||"value"in i||(i.value=t)}else{const e=Array.from(ut);ut.clear();for(const t of e)t()}return i.value}catch(t){throw t instanceof re?t:new re("Effects are broken",{code:e.ReactiveErrorCode.BrokenEffects,cause:t})}finally{Je=void 0,ft=void 0,oe.endChain()}}}const vt=g({method:e=>function(...t){const n=()=>e.apply(this,t);return Object.defineProperty(n,"name",{value:`atomic(${e.name})`}),wt(n,"immediate")},default:e=>function(...t){const n=()=>e.apply(this,t);return Object.defineProperty(n,"name",{value:`atomic(${e.name})`}),wt(n,"immediate")}}),St=new FinalizationRegistry(e=>e());function kt(e,t){const n=t?.asyncMode??oe.asyncMode??"cancel";if(oe.introspection.enableHistory){const t=(new Error).stack;if(t){const n=t.split("\n").slice(2).join("\n");it.set(ue(e),n)}}let r=null;const o=Le.present.with(u,()=>Fe.zoned),s=Le.zoned;let i=Le.present.active,c=!1,a=!1,f=null,l=null;function u(){if(r){const e=r;r=null,jt(()=>e())}if(f)if("cancel"===n&&l)l(),l=null,f=null;else if("ignore"===n)return;if(c)return;let t,i;oe.enter(ue(e));try{if(i=o(()=>e({tracked:o,ascend:s,reaction:a})),i&&"function"!=typeof i&&("object"!=typeof i||!("then"in i)))throw new re(`[reactive] Effect returned a non-function value: ${i}`);if(i&&"object"==typeof i&&"function"==typeof i.then){const e=i;let t=null;const n=new Promise((e,n)=>{t=n}),r=new re("[reactive] Effect canceled due to dependency change");f=Promise.race([e,n]),l=()=>{t&&t(r)}}else t=i}finally{a=!0,oe.leave(e)}r=()=>{r=null,t?.();const e=se.get(u);if(e){for(const t of e){const e=ie.get(t);if(e){for(const[t,n]of e.entries())n.delete(u),0===n.size&&e.delete(t);0===e.size&&ie.delete(t)}}se.delete(u)}const n=ce.get(u);if(n){for(const e of n)e();ce.delete(u)}}}function h(e){return Object.defineProperties(e,{[Q]:{get:()=>c},[ee]:{value:()=>{if(r){const e=r;r=null,jt(()=>e())}}}})}le(u,e),h(u),t?.opaque&&tt.add(u),We()&&Re(u),wt(u,"immediate"),ae.set(u,i);const d=()=>{c||(c=!0,l&&(l(),l=null,f=null),r?.(),function(e){if("none"===oe.cycleHandling)return;const t=ue(e),n=ot.get(t),r=st.get(t),o=nt.get(t);if(o){for(const e of o){const n=rt.get(e);n?.delete(t)}nt.delete(t)}const s=rt.get(t);if(s){for(const e of s){const n=nt.get(e);n?.delete(t)}rt.delete(t)}if(n)for(const e of n){const n=st.get(e);if(n&&(n.delete(t),r))for(const o of r)at(e,o,t)||n.delete(o)}if(r)for(const e of r){const r=ot.get(e);if(r&&(r.delete(t),n))for(const o of n)at(o,e,t)||r.delete(o)}if(n&&r)for(const e of n){const n=st.get(e);if(n)for(const o of r)if(!at(e,o,t)){n.delete(o);const t=ot.get(o);t?.delete(e)}}ot.delete(t),st.delete(t)}(u),St.unregister(d))};if(!i){const t=h(()=>d());return St.register(t,()=>{d(),oe.garbageCollected(e)},d),t}let p=ce.get(i);p||(p=new Set,ce.set(i,p));const g=h(()=>{p.delete(g),0===p.size&&ce.delete(i),d()});return p.add(g),g}function jt(e){return Le.present.root(e)}function Ot(e){return Le.root(e)}const Et=new WeakMap,Mt=new WeakSet,xt=new WeakMap,Rt=new WeakMap;function Dt(e,t,n){let r=Et.get(e);r||(r=new Set,Et.set(e,r)),r.add({parent:t,prop:n})}function Tt(e,t,n){const r=Et.get(e);if(r){for(const e of r)if(e.parent===t&&e.prop===n){r.delete(e);break}0===r.size&&Et.delete(e)}}function At(e){return!!Mt.has(e)||Wt(e)}function Pt(e,t){const n=Et.get(e);if(n)for(const{parent:e}of n){const t=xt.get(e);if(t)for(const e of t)wt(e);Pt(e)}}function Wt(e){const t=Et.get(e);if(!t)return!1;for(const{parent:e}of t){if(Mt.has(e))return!0;if(Wt(e))return!0}return!1}const $t=new WeakMap;function It(e,t){const n={},r=zt(e=Ze(e));r&&Object.assign(r,{evolution:t,next:n}),$t.set(e,n)}function zt(e){e=Ze(e);let t=$t.get(e);return t||(t={},$t.set(e,t)),t}function Ct(e,t,n,r,...o){const s=He();for(const i of o)for(const o of i){const i=r.get(o);if(i)for(const r of i){if(qe(r)){oe.skipRunningEffect(r);continue}n.has(r)||(n.add(r),lt(r)||Qe(r,e,t,o));const i=et.get(r);if(Te(s,r,e,o,t),i){for(const n of i)n(e,t,o);i.delete(r)}}}}function Nt(e,t,n){Kt(e,t,[n])}function Kt(e,t,n){It(e=Ze(e),t);const r=ie.get(e);if(r){const o=new Set;n?Ct(e,t,o,r,[J],n):Ct(e,t,o,r,r.keys()),oe.touched(e,t,n,o),wt(Array.from(o))}Mt.has(e)&&Pt(e)}const _t=new WeakSet,Vt=new Set,Lt=Symbol("absent");function Ft(...e){for(const t of e)t&&(t.prototype[G]=!0);return e[0]}function qt(e){if(null===e||"object"!=typeof e)return!0;if(_t.has(e))return!0;if(e[G])return!0;for(const t of Vt)if(t(e))return!0;return!1}function Ht(e){return function(e){return"object"==typeof e&&null!==e}(e)}function Ut(e){if(Ht(e)){if(Array.isArray(e))return Array.prototype;try{return e.constructor}catch{return}}}function Bt(e,t){return e!==t&&(!(!Ht(e)||!Ht(t))&&(!qt(e)&&!qt(t)&&Ut(e)===Ut(t)))}function Zt(e,t,n,r,o){const s={type:o?"set":"add",prop:t};if(oe.recursiveTouching&&void 0!==n&&Bt(n,r)){const o={obj:Ze(e),prop:t};!function(e){if(!e.length)return;const t=new Set,n=e[0]?.origin;let r;if(n){r=new Set;const e=ie.get(n.obj);if(e){const t=new Set;Ct(n.obj,{type:"set",prop:n.prop},t,e,[J],[n.prop]);for(const e of t)r.add(e)}if(0===r.size)return}for(const{target:o,evolution:s,prop:i}of e){if(!Ht(o))continue;const e=Ze(o);It(e,s);const c=ie.get(e);let a;const f=[i];if(c){if(a=new Set,Ct(e,s,a,c,[J],f),n&&r){const e=new Set;for(const t of a)(r.has(t)||Jt(t,r))&&e.add(t);a=e}for(const e of a)t.add(e)}oe.touched(e,s,f,a),Mt.has(e)&&Pt(e)}t.size&&wt([...t])}(Xt(n,r,new WeakMap,[],o)),function(e,t,n){e=Ze(e);const r=ie.get(e);if(!r)return;const o=r.get(n);if(!o)return;const s=new Set,i=He();for(const r of o){if(!tt.has(r))continue;if(qe(r)){oe.skipRunningEffect(r);continue}s.add(r),Qe(r,e,t,n);const o=et.get(r);if(Te(i,r,e,n,t),o){for(const r of o)r(e,t,n);o.delete(r)}}s.size>0&&(oe.touched(e,t,[n],s),wt(Array.from(s)))}(e,s,t)}else Nt(e,s,t)}function Gt(e){const t=new Set(Reflect.ownKeys(e));let n=Object.getPrototypeOf(e);for(;n&&!Object.hasOwn(n,"constructor");){for(const e of Reflect.ownKeys(n))t.add(e);n=Object.getPrototypeOf(n)}return t}function Xt(e,t,n=new WeakMap,r=[],o){return Bt(e,t)&&Ht(e)&&Ht(t)?function(e,t,n){let r=e.get(t);return r||(r=new WeakSet,e.set(t,r)),!!r.has(n)||(r.add(n),!1)}(n,e,t)?r:Array.isArray(e)&&Array.isArray(t)?(function(e,t,n,r,o){const s=[],i=e.length,c=t.length,a=Math.max(i,c);for(let n=0;n<a;n++){const r=n<i,a=n<c;if(r&&!a){s.push({target:e,evolution:{type:"del",prop:n},prop:n,origin:o});continue}if(!r&&a){s.push({target:e,evolution:{type:"add",prop:n},prop:n,origin:o});continue}if(!r||!a)continue;const f=Ze(e[n]),l=Ze(t[n]);Object.is(f,l)||s.push({target:e,evolution:{type:"set",prop:n},prop:n,origin:o})}i!==c&&s.push({target:e,evolution:{type:"set",prop:"length"},prop:"length",origin:o});r.push(...s)}(e,t,0,r,o),r):(function(e,t,n,r,o){const s=Gt(e),i=Gt(t),c=[];for(const t of s)i.has(t)||c.push({target:e,evolution:{type:"del",prop:t},prop:t,origin:o});for(const t of i)s.has(t)||c.push({target:e,evolution:{type:"add",prop:t},prop:t,origin:o});for(const a of i){if(!s.has(a))continue;const i=Ze(e[a]),f=Ze(t[a]);Bt(i,f)?Xt(i,f,n,r,o):Object.is(i,f)||c.push({target:e,evolution:{type:"set",prop:a},prop:a,origin:o})}r.push(...c)}(e,t,n,r,o),r):r}function Jt(e,t){let n=e;const r=new WeakSet;for(;n&&!r.has(n);){if(r.add(n),t.has(n))return!0;n=ae.get(n)}return!1}function Yt(e,t=J){e=Ze(e);const n=He();if(!n||"symbol"==typeof t&&t!==J)return;let r=ie.get(e);r||(r=new Map,ie.set(e,r));let o=r.get(t);o||(o=new Set,r.set(t,o)),o.add(n);const s=se.get(n);s?s.add(e):se.set(n,new Set([e]))}Ft(Date,RegExp,Error,Promise,Function),"undefined"!=typeof window&&(!function(...e){for(const t of e){try{Object.defineProperty(t,G,{value:!0,writable:!1,enumerable:!1,configurable:!1})}catch{}G in t||_t.add(t)}e[0]}(window,document),Ft(Node,Element,HTMLElement,EventTarget));const Qt=new WeakMap,en=[],tn={[Symbol.toStringTag]:"MutTs Reactive",get(e,t,n){if(e&&"object"==typeof e&&!Object.hasOwn(e,t)){const n=Qt.get(e.constructor);if(n&&t in n){const r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(e):(...t)=>r.value.apply(e,t)}}if(t===G)return!1;const r=Ze(e);if(r[X]?.has(t)||"symbol"==typeof t)return s.get(e,t,n);const o=Reflect.has(n,t),c=o&&Object.hasOwn(n,t),a=o&&!c,f=oe.ignoreAccessors&&c&&(i(n,t)||i(r,t));if(o&&(oe.instanceMembers&&a&&e instanceof Object||f)||Yt(e,t),a&&(!oe.instanceMembers||!(e instanceof Object))){let n=on(Object.getPrototypeOf(e));for(;n&&n!==Object.prototype&&(Yt(n,t),!Object.hasOwn(n,t));){let e=on(Object.getPrototypeOf(n));e===n&&(e=on(Object.getPrototypeOf(Ze(n)))),n=e}}const l=s.get(e,t,n);if("object"==typeof l&&null!==l){const n=on(l);return At(e)&&Dt(n,e,t),n}return l},set(e,t,n,r){const o=Ze(e),i=Ze(r);if(o[X]?.has(t)||o!==i)return s.set(e,t,n,r);const c=Ze(n);let a=Lt;if(Reflect.has(i,t)){Object.getOwnPropertyDescriptor(i,t),Object.getOwnPropertyDescriptor(o,t);a=jt(()=>Reflect.get(o,t,r))}if(Mt.has(e)&&("object"==typeof a&&null!==a&&Tt(a,e,t),"object"==typeof c&&null!==c)){Dt(on(c),e,t)}return a!==c&&s.set(e,t,c,r)&&Zt(e,t,a,c,a!==Lt),!0},has(t,n){if(en.includes(t))throw new re(`[reactive] Circular dependency detected in 'has' check for property '${String(n)}'`,{code:e.ReactiveErrorCode.CycleDetected,cycle:[]});en.push(t),Yt(t,n);const r=Reflect.has(t,n);return en.pop(),r},deleteProperty(e,t){if(!Object.hasOwn(e,t))return!1;const n=e[t];return Mt.has(e)&&"object"==typeof n&&null!==n&&Tt(n,e,t),delete e[t],Nt(e,{type:"del",prop:t},t),Mt.has(e)&&Pt(e),!0},ownKeys:e=>(Yt(e,J),Reflect.ownKeys(e))},nn=new WeakSet,rn=C(e=>class extends e{constructor(...e){return super(...e),nn.has(new.target)?sn(this):this}});function on(e){if(!e||"object"!=typeof e)return e;const t=e;if(qt(t))return t;if(Be.has(t))return t;const n=function(e){return Ue.get(e)}(t);if(void 0!==n)return n;const r=!(Z in t)||t instanceof t[Z]?t:new t[Z](t);r!==t&&function(e,t){Be.set(e,t)}(r,t);const o=new Proxy(r,tn);return function(e,t){Ue.set(e,t),Be.set(t,e)}(t,o),o}const sn=g({class(e){if(e.prototype instanceof rn)return nn.add(e),e;class t extends e{constructor(...n){return super(...n),new.target===t||nn.has(new.target)||oe.warn(`${e.name} has been inherited by ${this.constructor.name} that is not reactive.\n@reactive decorator must be applied to the leaf class OR classes have to extend ReactiveBase.`),sn(this)}}return Object.defineProperty(t,"name",{value:`Reactive<${e.name}>`}),t},get:e=>on(e),default:on});function cn(e,t,{immediate:n=!1}={}){if(null==e)return;if("object"!=typeof e)throw new Error("Target of deep watching must be an object");const r=le(()=>t(e),t);return kt(()=>{Mt.add(e);let o=Rt.get(r);o||(o=new Set,Rt.set(r,o)),o.add(e);const s=new WeakSet;return function e(t,n=0){var r;if(!(!t||s.has(t)||(r=t,"object"!=typeof r||null===r)||n>oe.maxDeepWatchDepth||qt(t))){s.add(t),Mt.add(t),o.add(t);for(const r in Ze(t))if(Object.hasOwn(t,r)){const o=t[r];e("object"==typeof o&&null!==o?sn(o):o,n+1)}if(Array.isArray(t)||t instanceof Array){const r=t.length;for(let o=0;o<r;o++){const r=t[o];e("object"==typeof r&&null!==r?sn(r):r,n+1)}}else if(t instanceof Set)for(const r of t){e("object"==typeof r&&null!==r?sn(r):r,n+1)}else if(t instanceof Map)for(const[r,o]of t){e("object"==typeof o&&null!==o?sn(o):o,n+1)}}}(e),n&&t(e),n=!0,()=>{const e=Rt.get(r);if(e){for(const t of e){const e=xt.get(t);e?(e.delete(r),0===e.size&&(xt.delete(t),Mt.delete(t))):Mt.delete(t)}Rt.delete(r)}}})}const an=Symbol("cleanup"),fn=Symbol("unset-yet");const ln=g({class(e){Ft(e)},default:function(e,...t){return"object"==typeof e?function(e){if(qt(e=Ze(e)))return e;try{Object.defineProperty(e,G,{value:!0,writable:!1,enumerable:!1,configurable:!0})}catch{}return G in e||_t.add(e),e}(e):n=>{n.prototype[X]=new Set(n.prototype[X]||[]),n.prototype[X].add(e);for(const e of t)n.prototype[X].add(e);return n}}});function un(e,t){return Object.defineProperty(e,an,{value:t,writable:!1,enumerable:!1,configurable:!0})}const hn=new WeakMap,dn=new WeakMap;function pn(e,t){e.branches??(e.branches=new WeakMap);let n=e.branches.get(t);return n||(n={},e.branches.set(t,n)),n}function gn(e){const t=ue(e),n=hn.get(t);if(n)return n;const r={},o=le((...t)=>{const n=t;if(n.some(e=>!(e&&["object","symbol","function"].includes(typeof e))))throw new Error("memoize expects non-null object arguments");let o=r;for(const e of n)o=pn(o,e);if(Yt(o,"memoize"),"result"in o){if(oe.onMemoizationDiscrepancy){const t=oe.isVerificationRun;oe.isVerificationRun=!0;try{const t=jt(()=>e(...n));c(o.result,t)||oe.onMemoizationDiscrepancy(o.result,t,e,n,"calculation")}finally{oe.isVerificationRun=t}}return o.result}if(o.cleanup=Ot(()=>kt(()=>(o.result=e(...n),()=>{delete o.result,Nt(o,{type:"invalidate",prop:n},"memoize"),o.cleanup&&(o.cleanup(),o.cleanup=void 0)}),{opaque:!0})),oe.onMemoizationDiscrepancy){const t=oe.isVerificationRun;oe.isVerificationRun=!0;try{const t=jt(()=>e(...n));c(o.result,t)||oe.onMemoizationDiscrepancy(o.result,t,e,n,"comparison")}finally{oe.isVerificationRun=t}}return o.result},e);return hn.set(t,o),hn.set(o,o),o}const yn=g({getter:(e,t,n)=>function(){let r=dn.get(e);r||(r=le(o(t=>e.call(t),`${String(t?.constructor?.name??t?.name??"Object")}.${String(n)}`),{method:e,propertyKey:n,...e[te]?{[te]:e[te]}:{}}),dn.set(e,r));return gn(r)(this)},method:(e,t,n)=>function(...r){let s=dn.get(e);s||(s=le(o((t,...n)=>e.call(t,...n),`${String(t?.constructor?.name??t?.name??"Object")}.${String(n)}`),{method:e,propertyKey:n,...e[te]?{[te]:e[te]}:{}}),dn.set(e,s));return gn(s)(this,...r)},default:gn});function*mn(e){let t=e.next();for(;!t.done;)yield sn(t.value),t=e.next()}function*bn(e){let t=e.next();for(;!t.done;){const[n,r]=t.value;yield[sn(n),sn(r)],t=e.next()}}let wn=(()=>{var e,t,n,r,o,s,i,c,a;let f,l,u=[ln],h=[],d=function(){class e extends(T(P,{get(e){return this[R](e)},set(e,t){this[D](e,t)},getLength(){return this.length},setLength(e){this.length=e}})){toArray(){return Array.from(this)}}return e}();var p,g,y;return l=class extends d{get[(t=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,s=new WeakMap,i=new WeakMap,c=new WeakMap,e=new WeakSet,A)](){return this.toArray()}constructor(a,f){let l;if(super(),e.add(this),t.set(this,void 0),n.set(this,void 0),r.set(this,void 0),o.set(this,new Map),s.set(this,new Map),i.set(this,new Set),c.set(this,void 0),kt(({ascend:e})=>{l=e}),E(this,c,l,"f"),"function"!=typeof a)throw new Error("Register requires a key function");E(this,t,a,"f"),E(this,n,sn([]),"f"),E(this,r,sn(new Map),"f"),f&&this.push(...f)}ensureKey(n){let r=O(this,s,"f").get(n);if(r)return r.key;if(r={key:void 0},O(this,s,"f").set(n,r),O(this,c,"f").call(this,()=>{const o=kt(({reaction:o})=>{const s=O(this,t,"f").call(this,n);this.assertValidKey(s);const i=r.key;o&&void 0!==i&&!Object.is(s,i)&&O(this,e,"m",a).call(this,n,i,s),r.key=s});r.stop=o,O(this,i,"f").add(o)}),void 0===r.key)throw new Error("Register key function must return a property key");return r.key}assertValidKey(e){const t=typeof e;if("string"!==t&&"number"!==t&&"symbol"!==t)throw new Error("Register key function must return a property key")}setKeyValue(e,t){const n=O(this,r,"f").get(e);void 0!==n&&n!==t&&this.cleanupValue(n),O(this,r,"f").set(e,t)}cleanupValue(e){const t=O(this,s,"f").get(e);if(!t)return;const n=t.stop;n&&(t.stop=void 0,O(this,i,"f").delete(n),n()),O(this,s,"f").delete(e)}disposeKeyEffects(){for(const e of Array.from(O(this,s,"f").keys()))this.cleanupValue(e);O(this,i,"f").clear()}incrementUsage(e){const t=O(this,o,"f").get(e)??0;O(this,o,"f").set(e,t+1)}decrementUsage(e){const t=O(this,o,"f").get(e);if(t)if(t<=1){const t=O(this,r,"f").get(e);O(this,o,"f").delete(e),O(this,r,"f").delete(e),void 0!==t&&this.cleanupValue(t)}else O(this,o,"f").set(e,t-1)}normalizeIndex(e,t=!1){const n=this.length;let r=e;if(r<0&&(r=Math.max(n+r,0)),r>n){if(!t)throw new RangeError("Index out of bounds");r=n}if(!t&&r===n)throw new RangeError("Index out of bounds");return r}assignAt(e,t,r){const o=O(this,n,"f")[e];void 0!==o&&Object.is(o,t)||(void 0!==o&&this.decrementUsage(o),O(this,n,"f")[e]=t,this.incrementUsage(t)),this.setKeyValue(t,r)}insertKeyValue(e,t,r){O(this,n,"f").splice(e,0,t),this.incrementUsage(t),this.setKeyValue(t,r)}rebuildFrom(e){this.disposeKeyEffects(),O(this,n,"f").splice(0,O(this,n,"f").length),O(this,o,"f").clear(),O(this,r,"f").clear();for(const t of e){const e=this.ensureKey(t);O(this,n,"f").push(e),this.incrementUsage(e),O(this,r,"f").set(e,t)}}get length(){return O(this,n,"f").length}[(a=function(e,t,i){if(Object.is(t,i))return;const c=O(this,r,"f").get(i);if(void 0!==c&&c!==e)throw new Error(`Register key collision for key ${String(i)}`);const a=O(this,o,"f").get(t);if(!a)return;const f=O(this,o,"f").get(i)??0;this.setKeyValue(i,e);for(let e=0;e<O(this,n,"f").length;e++)Object.is(O(this,n,"f")[e],t)&&(O(this,n,"f")[e]=i);O(this,o,"f").set(i,f+a),O(this,o,"f").delete(t),O(this,r,"f").delete(t);const l=O(this,s,"f").get(e);l&&(l.key=i)},R)](e){const t=O(this,n,"f")[e];return void 0===t?void 0:O(this,r,"f").get(t)}[D](e,t){const n=this.ensureKey(t);if(e===this.length)return void this.insertKeyValue(e,n,t);const r=this.normalizeIndex(e);this.assignAt(r,n,t)}push(...e){for(const t of e){const e=this.ensureKey(t);this.insertKeyValue(this.length,e,t)}return this.length}pop(){if(this.length)return this.removeAt(this.length-1)}shift(){if(this.length)return this.removeAt(0)}unshift(...e){let t=0;for(const n of e){const e=this.ensureKey(n);this.insertKeyValue(t++,e,n)}return this.length}splice(e,t,...o){const s=this.normalizeIndex(e,!0),i=this.length-s,c=Math.min(void 0===t?i:Math.max(t,0),i),a=[];for(const e of o)a.push(this.ensureKey(e));const f=O(this,n,"f").splice(s,c,...a),l=[];for(const e of f){if(void 0===e)continue;const t=O(this,r,"f").get(e);this.decrementUsage(e),l.push(t)}for(let e=0;e<a.length;e++){const t=a[e],n=o[e];this.incrementUsage(t),this.setKeyValue(t,n)}return l}clear(){O(this,n,"f").length=0,O(this,o,"f").clear(),O(this,r,"f").clear(),this.disposeKeyEffects()}get(e){return O(this,r,"f").get(e)}set(e,t){O(this,r,"f").has(e)&&this.setKeyValue(e,t)}remove(e){let t=this.indexOfKey(e);for(;-1!==t;)this.removeAt(t),t=this.indexOfKey(e)}removeAt(e){const[t]=O(this,n,"f").splice(e,1);if(void 0===t)return;const o=O(this,r,"f").get(t);return this.decrementUsage(t),o}keep(e){const t=new Map;for(const[o,s]of O(this,n,"f").entries()){if(t.has(s)){t.get(s)||this.removeAt(o);continue}const n=e(O(this,r,"f").get(s));t.set(s,n),n||this.removeAt(o)}}hasKey(e){return O(this,o,"f").has(e)}indexOfKey(e){return O(this,n,"f").indexOf(e)}mapKeys(){return O(this,r,"f").keys()}update(...e){for(const t of e){const e=this.ensureKey(t);O(this,r,"f").has(e)&&this.setKeyValue(e,t)}}upsert(e,...t){for(const n of t){const t=this.ensureKey(n);O(this,r,"f").has(t)?this.setKeyValue(t,n):e(n)}}entries(){const e=this;return function*(){for(let t=0;t<O(e,n,"f").length;t++){const o=O(e,r,"f").get(O(e,n,"f")[t]);void 0!==o&&(yield[t,o])}}()}[Symbol.iterator](){const e=this;return function*(){for(const t of O(e,n,"f")){const n=O(e,r,"f").get(t);void 0!==n&&(yield n)}}()}toString(){return`[Register length=${this.length}]`}at(e){const t=e<0?this.length+e:e;if(!(t<0||t>=this.length))return this[R](t)}reverse(){return O(this,n,"f").reverse(),this}sort(e){const t=e?(t,n)=>e(O(this,r,"f").get(t),O(this,r,"f").get(n)):void 0;return O(this,n,"f").sort(t),this}fill(e,t=0,n=this.length){const r=this.toArray();return r.fill(e,t,n),this.rebuildFrom(r),this}copyWithin(e,t,n){const r=this.toArray();return r.copyWithin(e,t,n),this.rebuildFrom(r),this}},p=l,"symbol"==typeof(g="RegisterClass")&&(g=g.description?"[".concat(g.description,"]"):""),Object.defineProperty(p,"name",{configurable:!0,value:y?"".concat(y," ",g):g}),(()=>{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;k(null,f={value:l},u,{kind:"class",name:l.name,metadata:e},null,h),l=f.value,e&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),j(l,h)})(),l})();const vn=wn;const Sn=new WeakMap;function kn(){const e=He();return e?Sn.get(e):void 0}function jn(e){Object.defineProperty(e,"value",{get:e.get,set:e.set,configurable:!0,enumerable:!0})}function On(e,t,n,r){return r&&Object.defineProperty(e,Y,{value:r,writable:!1,enumerable:!1,configurable:!0}),un(e,()=>{n();for(const e of t.values())e?.();t.clear()})}function En(e,t){e=sn(e);const n=sn([]),r=new Map;function o(e){const t=r.get(e);t&&(r.delete(e),t(),Reflect.deleteProperty(n,e))}const i=kn(),c=i?i.depth+1:0,a=kt(function({ascend:a}){const f=e.length;!function(e){s.set(n,"length",e,n)}(f);const l=Array.from(r.keys());for(let o=0;o<f;o++)r.has(o)||a(()=>{const a=o,f=kt(function(){const r=jt(()=>n[a]),o={key:a,source:e,get:()=>s.get(e,a,e),set:t=>s.set(e,a,t,e),old:r};jn(o);const i=t(o,n);n[a]=i});Me(f,`project[${c}]:${a}`),Sn.set(f,{source:e,key:a,target:n,depth:c,parent:i}),r.set(o,f)});for(const e of l)e>=f&&o(e)});return On(n,r,()=>a(),{source:e,target:n,apply:t,depth:c,parent:i})}function Mn(e,t){const n=sn(e),r=new Map,o=sn(r),s=new Map;function i(e){const t=s.get(e);t&&(t(),s.delete(e),o.delete(e))}const c=kn(),a=c?c.depth+1:0,f=kt(function({ascend:e}){const r=new Set;for(const e of n.mapKeys())r.add(e);for(const i of r)s.has(i)||e(()=>{const e=kt(function(){const e=jt(()=>o.get(i)),r={key:i,source:n,get:()=>n.get(i),set:e=>(n.set(i,e),!0),old:e};jn(r);const s=t(r,o);o.set(i,s)});Me(e,`project[${a}]:${String(i)}`),Sn.set(e,{source:n,key:i,target:o,depth:a,parent:c}),s.set(i,e)});for(const e of Array.from(s.keys()))r.has(e)||i(e)});return On(o,s,()=>f(),{source:n,target:o,apply:t,depth:a,parent:c})}function xn(e,t){const n=sn(e),r=sn({}),o=new Map;function i(e){const t=o.get(e);t&&(t(),o.delete(e),Reflect.deleteProperty(r,e))}const c=kn(),a=c?c.depth+1:0,f=kt(function({ascend:e}){const f=new Set;for(const e in n)f.add(e);const l=Reflect.ownKeys(n);for(const e of l)f.add(e);for(const i of f)o.has(i)||e(()=>{const e=kt(function(){const e=i,o=jt(()=>r[i]),c={key:e,source:n,get:()=>s.get(n,e,n),set:t=>s.set(n,e,t,n),old:o};jn(c);const a=t(c,r);r[e]=a});Me(e,`project[${a}]:${String(i)}`),Sn.set(e,{source:n,key:i,target:r,depth:a,parent:c}),o.set(i,e)});for(const e of Array.from(o.keys()))f.has(e)||i(e)});return On(r,o,()=>f(),{source:n,target:r,apply:t,depth:a,parent:c})}function Rn(e,t){const n=sn(e),r=new Map,o=sn(r),s=new Map;function i(e){const t=s.get(e);t&&(t(),s.delete(e),o.delete(e))}const c=kn(),a=c?c.depth+1:0,f=kt(function({ascend:e}){const r=new Set;for(const e of n.keys())r.add(e);for(const i of r)s.has(i)||e(()=>{const e=kt(function(){const e=jt(()=>o.get(i)),r={key:i,source:n,get:()=>n.get(i),set:e=>(n.set(i,e),!0),old:e};jn(r);const s=t(r,o);o.set(i,s)});Me(e,`project[${a}]:${String(i)}`),Sn.set(e,{source:n,key:i,target:o,depth:a,parent:c}),s.set(i,e)});for(const e of Array.from(s.keys()))r.has(e)||i(e)});return On(o,s,()=>f(),{source:n,target:o,apply:t,depth:a,parent:c})}const Dn=Object.assign(function(e,t){if(Array.isArray(e))return En(e,t);if(e instanceof Map)return Rn(e,t);if(e instanceof vn)return Mn(e,t);if(e&&(e.constructor===Object||void 0===e.constructor))return xn(e,t);throw new Error("Unsupported source type")},{array:En,register:Mn,record:xn,map:Rn});function*Tn(e,{length:t=!0}={}){t&&(yield"length"),yield e}function*An(e,t,{length:n=!1}={}){const r=Math.min(e,t),o=Math.max(e,t);n&&(yield"length");for(let e=r;e<=o;e++)yield e}class Pn extends Array{get(e){return Yt(this,e),sn(this[e])}set(e,t){const n=e>=this.length;this[e]=t,Kt(this,{type:"set",prop:e},Tn(e,{length:n}))}getLength(){return Yt(this,"length"),this.length}setLength(e){const t=this.length;try{this.length=e}finally{Kt(this,{type:"set",prop:"length"},An(t,e,{length:!0}))}}}const Wn={get:s.get,set:s.set};Object.assign(s,{get(e,t,n){if(e instanceof Array&&"string"==typeof t){if("length"===t)return Pn.prototype.getLength.call(e);const n=parseInt(t);if(!Number.isNaN(n))return Pn.prototype.get.call(e,n)}return Wn.get(e,t,n)},set(e,t,n,r){if(e instanceof Array&&"string"==typeof t){if("length"===t)return Pn.prototype.setLength.call(e,n);const r=parseInt(t);if(!Number.isNaN(r))return Pn.prototype.set.call(e,r,n)}return Wn.set(e,t,n,r)}});class $n extends Array{toJSON(){return this}get[Symbol.toStringTag](){return"ReactiveArray"}at(e){const t=e<0?this.length+e:e;if(Yt(this,t),!(t<0||t>=this.length))return sn(this[t])}toReversed(){return Yt(this),sn(this.toReversed())}toSorted(e){return Yt(this),sn(this.toSorted(e))}toSpliced(e,t,...n){return Yt(this),void 0===t?this.toSpliced(e):this.toSpliced(e,t,...n)}with(e,t){return Yt(this),sn(this.with(e,t))}entries(){return Yt(this),bn(this.entries())}keys(){return Yt(this,"length"),this.keys()}values(){return Yt(this),mn(this.values())}[Symbol.iterator](){Yt(this);const e=this[Symbol.iterator]();return{next(){const t=e.next();return t.done?t:{value:sn(t.value),done:!1}},[Symbol.iterator](){return this},[Symbol.dispose](){}}}indexOf(e,t){Yt(this);const n=Ze(e),r=this.indexOf(n,t);return-1!==r?r:this.indexOf(e,t)}lastIndexOf(e,t){Yt(this);const n=Ze(e),r=this.lastIndexOf(n,t);return-1!==r?r:this.lastIndexOf(e,t)}includes(e,t){Yt(this);const n=Ze(e);return this.includes(n,t)||this.includes(e,t)}find(e,t){if(Yt(this),"function"==typeof e){const n=e;return sn(this.find((e,r,o)=>n.call(t,sn(e),r,o),t))}const n="number"==typeof t?t:void 0,r=this.indexOf(e,n);if(-1!==r)return sn(this[r])}findIndex(e,t){if(Yt(this),"function"==typeof e){const n=e;return this.findIndex((e,r,o)=>n.call(t,sn(e),r,o),t)}const n="number"==typeof t?t:void 0;return this.indexOf(e,n)}flat(e){return Yt(this),sn(void 0===e?this.flat():this.flat(e))}flatMap(e,t){return Yt(this),sn(this.flatMap((n,r,o)=>e.call(t,sn(n),r,o),t))}filter(e,t){return Yt(this),sn(this.filter((t,n,r)=>e(sn(t),n,r),t))}map(e,t){return Yt(this),sn(this.map((t,n,r)=>e(sn(t),n,r),t))}reduce(e,t){Yt(this);const n=void 0===t?this.reduce(e):this.reduce(e,t);return sn(n)}reduceRight(e,t){Yt(this);const n=void 0!==t?this.reduceRight(e,t):this.reduceRight(e);return sn(n)}slice(e,t){for(const n of An(e||0,t||this.length-1))Yt(this,n);return void 0===e?this.slice():void 0===t?this.slice(e):this.slice(e,t)}concat(...e){return Yt(this),sn(this.concat(...e))}join(e){return Yt(this),this.join(e)}forEach(e,t){Yt(this),this.forEach((n,r,o)=>{e.call(t,sn(n),r,o)})}every(e,t){return Yt(this),this.every((n,r,o)=>e.call(t,sn(n),r,o),t)}some(e,t){return Yt(this),this.some((n,r,o)=>e.call(t,sn(n),r,o),t)}push(...e){const t=this.length;try{return this.push(...e)}finally{Kt(this,{type:"bunch",method:"push"},An(t,t+e.length-1,{length:!0}))}}pop(){if(0!==this.length)try{return sn(this.pop())}finally{Kt(this,{type:"bunch",method:"pop"},Tn(this.length))}}shift(){if(0!==this.length)try{return sn(this.shift())}finally{Kt(this,{type:"bunch",method:"shift"},An(0,this.length+1,{length:!0}))}}unshift(...e){try{return this.unshift(...e)}finally{Kt(this,{type:"bunch",method:"unshift"},An(0,this.length-e.length,{length:!0}))}}splice(e,t,...n){const r=this.length;void 0===t&&(t=r-e);try{return sn(void 0===t?this.splice(e):this.splice(e,t,...n))}finally{Kt(this,{type:"bunch",method:"splice"},t===n.length?An(e,e+t):An(e,r+Math.max(n.length-t,0),{length:!0}))}}reverse(){try{return this.reverse()}finally{Kt(this,{type:"bunch",method:"reverse"},An(0,this.length-1))}}sort(e){e=e||((e,t)=>e.toString().localeCompare(t.toString()));try{return this.sort((t,n)=>e(sn(t),sn(n)))}finally{Kt(this,{type:"bunch",method:"sort"},An(0,this.length-1))}}fill(e,t,n){try{return void 0===t?this.fill(e):void 0===n?this.fill(e,t):this.fill(e,t,n)}finally{Kt(this,{type:"bunch",method:"fill"},An(0,this.length-1))}}copyWithin(e,t,n){try{return void 0===n?this.copyWithin(e,t):this.copyWithin(e,t,n)}finally{Kt(this,{type:"bunch",method:"copyWithin"},An(0,this.length-1))}}}class In extends WeakMap{get[Symbol.toStringTag](){return"ReactiveWeakMap"}delete(e){const t=this.has(e),n=this.delete(e);return t&&Nt(f(this),{type:"del",prop:e},e),n}get(e){return Yt(f(this),e),sn(this.get(e))}has(e){return Yt(f(this),e),this.has(e)}set(e,t){const n=this.has(e),r=this.get(e),o=sn(t);return this.set(e,o),n&&r===o||Zt(f(this),e,r,o,n),this}}class zn extends Map{get[Symbol.toStringTag](){return"ReactiveMap"}get size(){return Yt(this,"size"),this.size}clear(){const e=this.size>0;if(this.clear(),e){const e={type:"bunch",method:"clear"};Nt(this,e,"size"),Kt(f(this),e)}}entries(){return Yt(f(this)),bn(this.entries())}forEach(e,t){Yt(f(this)),this.forEach(e,t)}keys(){return Yt(f(this)),this.keys()}values(){return Yt(f(this)),mn(this.values())}[Symbol.iterator](){Yt(f(this));const e=this[Symbol.iterator]();return{next(){const t=e.next();return t.done?t:{value:[t.value[0],sn(t.value[1])],done:!1}},[Symbol.iterator](){return this},[Symbol.dispose](){}}}delete(e){const t=this.has(e),n=this.delete(e);if(t){const t={type:"del",prop:e};Nt(f(this),t,e),Nt(this,t,"size")}return n}get(e){return Yt(f(this),e),sn(this.get(e))}has(e){return Yt(f(this),e),this.has(e)}set(e,t){const n=this.has(e),r=this.get(e),o=sn(t);if(this.set(e,o),!n||r!==o){Zt(f(this),e,r,o,n);Nt(this,{type:n?"set":"add",prop:e},"size")}return this}}class Cn extends WeakSet{get[Symbol.toStringTag](){return"ReactiveWeakSet"}add(e){const t=this.has(e);return this.add(e),t||Nt(f(this),{type:"add",prop:e},e),this}delete(e){const t=this.has(e),n=this.delete(e);return t&&Nt(f(this),{type:"del",prop:e},e),n}has(e){return Yt(f(this),e),this.has(e)}}class Nn extends Set{get[Symbol.toStringTag](){return"ReactiveSet"}get size(){return Yt(this,"size"),this.size}add(e){const t=this.has(e),n=sn(e);if(this.add(n),!t){const e={type:"add",prop:n};Nt(f(this),e,n),Nt(this,e,"size")}return this}clear(){const e=this.size>0;if(this.clear(),e){const e={type:"bunch",method:"clear"};Nt(this,e,"size"),Kt(f(this),e)}}delete(e){const t=this.has(e),n=this.delete(e);if(t){const t={type:"del",prop:e};Nt(f(this),t,e),Nt(this,t,"size")}return n}has(e){return Yt(f(this),e),this.has(e)}entries(){return Yt(f(this)),bn(this.entries())}forEach(e,t){Yt(f(this)),this.forEach(e,t)}keys(){return Yt(f(this)),mn(this.keys())}values(){return Yt(f(this)),mn(this.values())}[Symbol.iterator](){Yt(f(this));const e=this[Symbol.iterator]();return{next(){const t=e.next();return t.done?t:{value:sn(t.value),done:!1}},[Symbol.iterator](){return this},[Symbol.dispose](){}}}}Qt.set(Array,$n.prototype),Qt.set(Set,Nn.prototype),Qt.set(WeakSet,Cn.prototype),Qt.set(Map,zn.prototype),Qt.set(WeakMap,In.prototype);const Kn={objectToProxy:Ue,proxyToObject:Be,effectToReactiveObjects:se,watchers:ie,objectParents:Et,objectsWithDeepWatchers:Mt,deepWatchers:xt,effectToDeepWatchedObjects:Rt,nonReactiveObjects:_t},_n=[],Vn=g({getter:(e,t,n)=>function(){const t=_n.findIndex(e=>e.object===this&&e.prop===n);if(t>-1)throw new Error(`Circular dependency detected: ${_n.slice(t).map(e=>`${e.object.constructor.name}.${String(e.prop)}`).join(" -> ")} -> again`);_n.push({object:this,prop:n});try{const t=e.call(this);return Ln(this,n,t),t}finally{_n.pop()}}});function Ln(e,t,n){Object.defineProperty(e,t,{value:n})}const Fn=Object.assign(g({method:(e,t,n)=>function(...t){return Fn.warn(this,n),e.apply(this,t)},getter:(e,t,n)=>function(){return Fn.warn(this,n),e.call(this)},setter:(e,t,n)=>function(t){return Fn.warn(this,n),e.call(this,t)},class:e=>class extends e{constructor(...e){super(...e),Fn.warn(this,"constructor")}},default:e=>g({method:(t,n,r)=>function(...n){return Fn.warn(this,r,e),t.apply(this,n)},getter:(t,n,r)=>function(){return Fn.warn(this,r,e),t.call(this)},setter:(t,n,r)=>function(n){return Fn.warn(this,r,e),t.call(this,n)},class:t=>class extends t{constructor(...t){super(...t),Fn.warn(this,"constructor",e)}}})}),{warn:(e,t,n)=>{}});var qn={version:"1.0.7"};const{version:Hn}=qn,Un="__MUTTS_INSTANCE__",Bn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global&&global;if(Bn){let e="mutts/index";const t=eval;try{if("undefined"!=typeof __filename)e=__filename;else{const n=t("import.meta");n&&n.url&&(e=n.url)}}catch(e){}const n={version:Hn,source:e,timestamp:Date.now()};if(Bn[Un]){const e=Bn[Un];throw new Error(`[Mutts] Multiple instances detected!\nExisting instance: ${JSON.stringify(e,null,2)}\nNew instance: ${JSON.stringify(n,null,2)}\nThis usually happens when 'mutts' is both installed as a dependency and bundled, or when different versions are loaded. Please check your build configuration (aliases, externals) to ensure a single source of truth.`)}Bn[Un]=n}const Zn=new Set;function Gn(e){if("function"!=typeof e)return e;const t=new Set;for(const e of Zn)t.add(e());return function(...n){const r=new Set;for(const e of t)r.add(e());try{return e.apply(this,n)}finally{for(const e of r)e()}}}t.addHook=function(e){return Zn.add(e),()=>{Zn.delete(e)}};const Xn={then:Promise.prototype.then,catch:Promise.prototype.catch,finally:Promise.prototype.finally,setTimeout:globalThis.setTimeout,setInterval:globalThis.setInterval,setImmediate:globalThis.setImmediate,requestAnimationFrame:globalThis.requestAnimationFrame,queueMicrotask:globalThis.queueMicrotask};Promise.prototype.then=function(e,t){return Xn.then.call(this,Gn(e),Gn(t))},Promise.prototype.catch=function(e){return Xn.catch.call(this,Gn(e))},Promise.prototype.finally=function(e){return Xn.finally.call(this,Gn(e))},globalThis.setTimeout=(e,...t)=>Xn.setTimeout.call(globalThis,Gn(e),...t),globalThis.setInterval=(e,...t)=>Xn.setInterval.call(globalThis,Gn(e),...t),Xn.setImmediate&&(globalThis.setImmediate=(e,...t)=>Xn.setImmediate.call(globalThis,Gn(e),...t)),Xn.requestAnimationFrame&&(globalThis.requestAnimationFrame=e=>Xn.requestAnimationFrame.call(globalThis,Gn(e))),Xn.queueMicrotask&&(globalThis.queueMicrotask=e=>{Xn.queueMicrotask.call(globalThis,Gn(e))}),e.AZone=Ce,e.ArrayReadForward=P,e.DecoratorError=h,e.Destroyable=function(e,t){var n;return e&&"function"!=typeof e&&(t=e,e=void 0),e||(e=class{}),n=class extends e{static destroy(e){const t=n.destructors.get(e);if(!t)return!1;y.unregister(e[b]),n.destructors.delete(e),Object.setPrototypeOf(e,new Proxy({},v));for(const t of Object.getOwnPropertyNames(e))delete e[t];return t(),!0}static isDestroyable(e){return n.destructors.has(e)}constructor(...e){super(...e);const r={};this[b]=r;const o=t?.destructor??this[m];if(!o)throw new w("Destructor is not defined");function s(){o(r)}n.destructors.set(this,s),y.register(this,s,r)}},n.destructors=new WeakMap,n},e.DestructionError=w,e.Eventful=class{constructor(){M.set(this,new Map),x.set(this,[])}hook(e){return O(this,x,"f").includes(e)||O(this,x,"f").push(e),()=>{O(this,x,"f").splice(O(this,x,"f").indexOf(e),1)}}on(e,t){if("object"==typeof e)for(const t of Object.keys(e))this.on(t,e[t]);else if(void 0!==t){let n=O(this,M,"f").get(e);n||(n=[],O(this,M,"f").set(e,n)),n.push(t)}return()=>this.off(e,t)}off(e,t){if("object"==typeof e)for(const t of Object.keys(e))this.off(t,e[t]);else if(null!=t){const n=O(this,M,"f").get(e);n&&O(this,M,"f").set(e,n.filter(e=>e!==t))}else O(this,M,"f").delete(e)}emit(e,...t){const n=O(this,M,"f").get(e);if(n)for(const e of n)e.apply(this,t);for(const n of O(this,x,"f"))n.call(this,e,...t)}},e.FoolProof=s,e.Indexable=T,e.IterableWeakMap=I,e.IterableWeakSet=z,e.ReactiveBase=rn,e.ReactiveError=re,e.Register=vn,e.Zone=Ne,e.ZoneAggregator=_e,e.ZoneHistory=Ke,e.addBatchCleanup=gt,e.allocated=S,e.allocatedValues=b,e.arrayEquals=function(e,t){if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},e.asyncZone=Ve,e.atomic=vt,e.biDi=function(e,t,n){"function"!=typeof t&&(n=t.set,t=t.get);let r=Symbol();return kt(le(()=>{const n=t();Ze(n)!==r&&e(n)},e)),n?vt(e=>{r=Ze(e),n(e)}):()=>{}},e.buildReactivityGraph=Pe,e.cache=Ln,e.cached=Vn,e.callOnGC=function(e){let t=!1;const n=()=>{t||(t=!0,e())};return y.register(n,e,e),n},e.chainPromise=B,e.cleanedBy=un,e.cleanup=an,e.contentRef=f,e.debounce=function(e){return g({method(t,n,r){let o=null;return function(...n){o&&clearTimeout(o),o=setTimeout(()=>{t.apply(this,n),o=null},e)}}})},e.decorator=g,e.deepCompare=c,e.deepWatch=cn,e.defer=yt,e.deprecated=Fn,e.derived=function(e){const t={value:void 0};return un(t,jt(()=>kt(function(n){t.value=e(n)})))},e.describe=function(e){return(...t)=>n=>class extends n{constructor(...n){super(...n);for(const n of t)Object.defineProperty(this,n,{...Object.getOwnPropertyDescriptor(this,n),...e})}}},e.destructor=m,e.effect=kt,e.enableDevTools=function(){"undefined"!=typeof window&&(de||(de=!0,window.__MUTTS_DEVTOOLS__={getGraph:Pe,setEffectName:Me,setObjectName:xe,registerEffect:Re,registerObject:De}))},e.forwardArray=A,e.getActivationLog=function(){return Ye},e.getActiveProjection=kn,e.getAt=R,e.getState=zt,e.immutables=Vt,e.isCached=function(e,t){return!!Object.getOwnPropertyDescriptor(e,t)},e.isConstructor=r,e.isDevtoolsEnabled=We,e.isNonReactive=qt,e.isOwnAccessor=i,e.isReactive=function(e){return Be.has(e)},e.legacyDecorator=d,e.memoize=yn,e.mixin=C,e.modernDecorator=p,e.named=u,e.organize=function(e,t,n){return Object.defineProperty(e,t,{get:n.get,set:n.set,configurable:!0,enumerable:!0}),Nt(e,{type:"set",prop:t},t),()=>delete e[t]},e.organized=function(e,t,n={}){const r=sn(e),o=sn(n),i=new Map;function c(e){const t=i.get(e);t&&(i.delete(e),t())}const a=kt(function({ascend:e}){const n=new Set;for(const e in r)n.add(e);for(const c of n)i.has(c)||e(()=>{const e=kt(function(){const e=c,n={key:e,get:()=>s.get(r,e,r),set:t=>s.set(r,e,t,r)};return Object.defineProperty(n,"value",{get:n.get,set:n.set,configurable:!0,enumerable:!0}),t(n,o)});i.set(c,e)});for(const e of Array.from(i.keys()))n.has(e)||c(e)});return un(o,()=>{a();for(const e of Array.from(i.keys()))c(e)})},e.profileInfo=Kn,e.project=Dn,e.reactive=sn,e.reactiveOptions=oe,e.register=function(e,t){return new wn(e,t)},e.registerEffectForDebug=Re,e.registerNativeReactivity=function(e,t){e.prototype[Z]=t,Ft(t)},e.registerObjectForDebug=De,e.renamed=o,e.root=Ot,e.scan=function(e,t,n){const r=sn(e),o=sn([]),i=new Map,c=sn([]),a=new WeakMap;let f=(()=>{var e;let r,o=[];return e=class{constructor(e,t){this.val=(j(this,o),e),this.prev=t}get acc(){const e=this.prev?this.prev.acc:n;return t(e,this.val)}},(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[yn],k(e,null,r,{kind:"getter",name:"acc",static:!1,private:!1,access:{has:e=>"acc"in e,get:e=>e.acc},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();function l(e){const t=i.get(e);t&&(t(),i.delete(e),jt(()=>{Reflect.deleteProperty(c,e),Reflect.deleteProperty(o,e)}))}const u=kt(function({ascend:e}){const t=r.length,n=new Map;let u;for(let l=0;l<t;l++){const t=s.get(r,l,r);if(!t||"object"!=typeof t&&"function"!=typeof t&&"symbol"!=typeof t)throw new Error("scan: items must be objects (WeakKey) for intermediate caching");const h=n.get(t)??0;n.set(t,h+1);let d=a.get(t);d||(d=[],a.set(t,d));let p=d[h];p?jt(()=>p.prev)!==u&&(p.prev=u):(p=sn(new f(t,u)),d[h]=p),c[l]!==p&&(c[l]=p),i.has(l)||e(()=>{const e=l,t=kt(function(){const t=c[e];if(t){const n=t.acc;jt(()=>{o[e]=n})}});i.set(e,t)}),u=p}for(const e of Array.from(i.keys()))e>=t&&l(e);jt(()=>{o.length!==t&&s.set(o,"length",t,o)})});return un(o,()=>{u();for(const e of i.values())e();i.clear()})},e.setAt=D,e.setEffectName=Me,e.setObjectName=xe,e.tag=l,e.throttle=function(e){return g({method(t,n,r){let o=0,s=null;return function(...n){const r=Date.now();if(r-o>=e)return s&&(clearTimeout(s),s=null),o=r,t.apply(this,n);if(!s){const i=e-(r-o),c=[...n];s=setTimeout(()=>{o=Date.now(),t.apply(this,c),s=null},i)}}}})},e.touched=Kt,e.touched1=Nt,e.trackEffect=function(e){const t=He();if(!t)throw new Error("Not in an effect");et.has(t)?et.get(t).add(e):et.set(t,new Set([e]))},e.unreactive=ln,e.untracked=jt,e.unwrap=Ze,e.watch=function(e,t,n={}){return"function"==typeof e?function(e,t,{immediate:n=!1,deep:r=!1}={}){let o,s=fn;const i=kt(le(function(i){const c=e(i);s!==c&&(s===fn?n&&t(c):t(c,s)),s=c,r&&(o&&o(),o=cn(c,e=>t(e,e)))},e));return()=>{i(),o&&o()}}(e,t,n):"object"==typeof e&&null!==e?function(e,t,{immediate:n=!1,deep:r=!1}={}){return r?cn(e,t,{immediate:n}):kt(function(){Yt(e),n&&t(e),n=!0})}(e,t,n):(()=>{throw new Error("watch: value must be a function or an object")})()},e.zip=function(...e){if(!e.length)return[];const t=Math.min(...e.map(e=>e.length)),n=[];for(let r=0;r<t;r++){const t=e.map(e=>e[r]);n.push(t)}return n}});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Mutts={})}(this,function(e){"use strict";const t={addHook(e){throw"One must import the library from the server or the client side"},sanitizePromise:e=>e},n=new Set,r=new WeakMap;function o(){const e=new Set;for(const t of n){const n=t();n&&e.add(n)}return e}function s(e,t){if("function"!=typeof e)return e;const n=t||o();return function(...t){const r=[];for(const e of n)r.push(e());try{return e.apply(this,t)}finally{if(u.queueMicrotask)u.queueMicrotask.call(globalThis,()=>{u.queueMicrotask.call(globalThis,()=>{u.queueMicrotask.call(globalThis,()=>{for(let e=r.length-1;e>=0;e--)r[e]()})})});else for(let e=r.length-1;e>=0;e--)r[e]()}}}t.addHook=function(e){return n.add(e),()=>{n.delete(e)}},t.sanitizePromise=e=>e&&"function"==typeof e.then?new Promise((t,n)=>{setTimeout(()=>{e.then(t,n)},0)}):e;const i=new WeakMap;function c(e){if(e)for(const t of Object.getOwnPropertyNames(e))if(t.startsWith("on")){const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.set&&n.configurable){const r=n.set;Object.defineProperty(e,t,{...n,set:function(e){r.call(this,s(e))}})}}}"undefined"!=typeof EventTarget&&function(e){if(!e||!e.addEventListener||!e.removeEventListener)return;const t=e.addEventListener,n=e.removeEventListener;e.addEventListener=function(e,n,r){if("function"!=typeof n)return t.call(this,e,n,r);let o=i.get(this);o||(o=new Map,i.set(this,o));let c=o.get(e);c||(c=new WeakMap,o.set(e,c));let a=c.get(n);return a||(a=s(n),c.set(n,a)),t.call(this,e,a,r)},e.removeEventListener=function(e,t,r){if("function"!=typeof t)return n.call(this,e,t,r);const o=i.get(this);if(o){const s=o.get(e);if(s){const o=s.get(t);if(o)return n.call(this,e,o,r)}}return n.call(this,e,t,r)}}(EventTarget.prototype);const a=["undefined"!=typeof EventTarget&&EventTarget.prototype,"undefined"!=typeof HTMLElement&&HTMLElement.prototype,"undefined"!=typeof Window&&Window.prototype,"undefined"!=typeof Document&&Document.prototype,"undefined"!=typeof MessagePort&&MessagePort.prototype,"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest.prototype,"undefined"!=typeof IDBRequest&&IDBRequest.prototype,"undefined"!=typeof IDBTransaction&&IDBTransaction.prototype,"undefined"!=typeof IDBDatabase&&IDBDatabase.prototype,"undefined"!=typeof FileReader&&FileReader.prototype,"undefined"!=typeof AbortSignal&&AbortSignal.prototype];for(const e of a)e&&c(e);const f=Symbol.for("mutts.originals"),l=Symbol.for("mutts.OriginalPromise");let u,h;function d(e,t){const n=r.get(this)||o(),i=u.then.call(this,s(e,n),s(t,n));return n.size>0&&r.set(i,n),i}function p(e){if("function"==typeof e){const t=new h((t,n)=>{const r=s(t),o=s(n);e(r,o)}),n=o();return r.set(t,n),t}return new h(e)}globalThis[f]?(u=globalThis[f],h=globalThis[l]):(h=globalThis.Promise,u={then:h.prototype.then,catch:h.prototype.catch,finally:h.prototype.finally,resolve:h.resolve,reject:h.reject,all:h.all,allSettled:h.allSettled,race:h.race,any:h.any,setTimeout:globalThis.setTimeout,setInterval:globalThis.setInterval,setImmediate:globalThis.setImmediate,requestAnimationFrame:globalThis.requestAnimationFrame,queueMicrotask:globalThis.queueMicrotask},globalThis[f]=u,globalThis[l]=h),u.allSettled||(u.allSettled=h.allSettled),u.any||(u.any=h.any),u.race||(u.race=h.race),Object.assign(p,h),p.prototype=h.prototype,p.resolve=function(e){const t=u.resolve.call(h,e),n=o();return n.size>0&&!r.has(t)&&r.set(t,n),t},p.reject=function(e){const t=u.reject.call(h,e),n=o();return n.size>0&&r.set(t,n),t},p.all=function(e){const t=u.all.call(h,e),n=o();return n.size>0&&r.set(t,n),t},p.allSettled=function(e){const t=u.allSettled.call(h,e),n=o();return n.size>0&&r.set(t,n),t},p.race=function(e){const t=u.race.call(h,e),n=o();return n.size>0&&r.set(t,n),t},p.any=function(e){const t=u.any.call(h,e),n=o();return n.size>0&&r.set(t,n),t},h.prototype.then!==d&&(h.prototype.then=d,h.prototype.catch=function(e){const t=r.get(this)||o(),n=u.catch.call(this,s(e,t));return t.size>0&&r.set(n,t),n},h.prototype.finally=function(e){const t=r.get(this)||o(),n=u.finally.call(this,s(e,t));return t.size>0&&r.set(n,t),n});try{Object.defineProperty(h,Symbol.species,{get:()=>p,configurable:!0})}catch(e){}globalThis.Promise=p,globalThis.setTimeout=(e,...t)=>u.setTimeout.call(globalThis,s(e),...t),globalThis.setInterval=(e,...t)=>u.setInterval.call(globalThis,s(e),...t),u.setImmediate&&(globalThis.setImmediate=(e,...t)=>u.setImmediate.call(globalThis,s(e),...t)),u.requestAnimationFrame&&(globalThis.requestAnimationFrame=e=>u.requestAnimationFrame.call(globalThis,s(e))),u.queueMicrotask&&(globalThis.queueMicrotask=e=>{u.queueMicrotask.call(globalThis,s(e))});const g=new Set([Object,Array,Date,Function,Set,Map,WeakMap,WeakSet,Promise,Error,TypeError,ReferenceError,SyntaxError,RangeError,URIError,EvalError,Reflect,Proxy,RegExp,String,Number,Boolean]);function y(e){return e&&"function"==typeof e&&(g.has(e)||e.toString?.().startsWith("class "))}function m(e,t){return Object.defineProperties(e,{name:{value:t}})}const b={get:(e,t,n)=>"undefined"!=typeof Node&&e instanceof Node?e[t]:Reflect.get(e,t,n),set:(e,t,n,r)=>"undefined"!=typeof Node&&e instanceof Node?(e[t]=n,!0):e instanceof Object||Reflect.has(e,t)?Reflect.set(e,t,n,r):(Object.defineProperty(e,t,{value:n,configurable:!0,writable:!0,enumerable:!0}),!0)};function w(e,t){const n=Object.getOwnPropertyDescriptor(e,t);return!(!n?.get&&!n?.set)}function v(e,t,n=new Map){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return e===t;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;let r=n.get(e);if(r?.has(t))return!0;if(r||(r=new Set,n.set(e,r)),r.add(t),Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!v(e[r],t[r],n))return!1;return!0}if(e instanceof Date){const n=t instanceof Date&&e.getTime()===t.getTime();return n}if(e instanceof RegExp){const n=t instanceof RegExp&&e.toString()===t.toString();return n}if(e instanceof Set){if(!(t instanceof Set)||e.size!==t.size)return!1;for(const r of e){let e=!1;for(const o of t)if(v(r,o,n)){e=!0;break}if(!e)return!1}return!0}if(e instanceof Map){if(!(t instanceof Map)||e.size!==t.size)return!1;for(const[r,o]of e)if(t.has(r)){if(!v(o,t.get(r),n))return!1}else{let e=!1;for(const[s,i]of t)if(v(r,s,n)&&v(o,i,n)){e=!0;break}if(!e)return!1}return!0}const o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;for(const r of o){if(!Object.hasOwn(t,r))return!1;if(!v(e[r],t[r],n))return!1}return!0}const S=new WeakMap;function k(e){return S.has(e)||S.set(e,Object.seal(Object.create(null,{contentOf:{value:e,writable:!1,configurable:!1}}))),S.get(e)}function j(e,t){return Object.defineProperties(t,{[Symbol.toStringTag]:{value:e,writable:!1,configurable:!1},toString:{value:()=>e,writable:!1,configurable:!1}}),t}function M(e,t){return Object.defineProperty(t,"name",{value:t.name?`${t.name}::${e}`:e,writable:!1,configurable:!1}),t}class O extends Error{constructor(e){super(e),this.name="DecoratorException"}}function E(e){return function(t,n,r,...o){if(void 0===n){if(y(t)){if(!("class"in e))throw new Error("Decorator cannot be applied to a class");return e.class(t)}}else if("object"==typeof t&&["string","symbol"].includes(typeof n)){if(!r)throw new Error("Decorator cannot be applied to a field");if("object"==typeof r&&"configurable"in r){if("get"in r||"set"in r){if(!("getter"in e)&&!("setter"in e))throw new Error("Decorator cannot be applied to a getter or setter");if("getter"in e){const o=e.getter(r.get,t,n);o&&(r.get=o)}if("setter"in e){const o=e.setter(r.set,t,n);o&&(r.set=o)}return r}if("function"==typeof r.value){if(!("method"in e))throw new Error("Decorator cannot be applied to a method");const o=e.method(r.value,t,n);return o&&(r.value=o),r}}}if(!("default"in e))throw new Error("Decorator do not have a default implementation");return e.default.call(this,t,n,r,...o)}}function x(e){return function(t,n,...r){if(!n?.kind||"string"!=typeof n.kind){if(!("default"in e))throw new Error("Decorator do not have a default implementation");return e.default.call(this,t,n,...r)}switch(n.kind){case"class":if(!("class"in e))throw new Error("Decorator cannot be applied to a class");return e.class(t);case"field":throw new Error("Decorator cannot be applied to a field");case"getter":if(!("getter"in e))throw new Error("Decorator cannot be applied to a getter");return e.getter(t,t,n.name);case"setter":if(!("setter"in e))throw new Error("Decorator cannot be applied to a setter");return e.setter(t,t,n.name);case"method":if(!("method"in e))throw new Error("Decorator cannot be applied to a method");return e.method(t,t,n.name);case"accessor":{if(!("getter"in e)&&!("setter"in e))throw new Error("Decorator cannot be applied to a getter or setter");const r={};if("getter"in e){const o=e.getter(t.get,t,n.name);o&&(r.get=o)}if("setter"in e){const o=e.setter(t.set,t,n.name);o&&(r.set=o)}return r}}}}const R=e=>{const t=x(e),n=E(e);return(e,r,...o)=>{const s=function(e,t){return"object"==typeof t&&null!==t&&"string"==typeof t.kind?"modern":"legacy"}(0,r,o[0]);return"modern"===s?t(e,r,...o):n(e,r,...o)}},T=new FinalizationRegistry(e=>e()),D=Symbol("destructor"),P=Symbol("allocated");class A extends Error{static throw(e){return()=>{throw new A(e)}}constructor(e){super(`Object is destroyed. ${e}`),this.name="DestroyedAccessError"}}const W={[Symbol.toStringTag]:"MutTs Destroyable",get:A.throw("Cannot access destroyed object"),set:A.throw("Cannot access destroyed object")};const $=R({setter:(e,t,n)=>function(t){return this[P][n]=t,e.call(this,t)}});function z(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var c,a=r.kind,f="getter"===a?"get":"setter"===a?"set":"value",l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var p={};for(var g in r)p[g]="access"===g?{}:r[g];for(var g in r.access)p.access[g]=r.access[g];p.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[d])("accessor"===a?{get:u.get,set:u.set}:u[f],p);if("accessor"===a){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(c=i(y.get))&&(u.get=c),(c=i(y.set))&&(u.set=c),(c=i(y.init))&&o.unshift(c)}else(c=i(y))&&("field"===a?o.unshift(c):u[f]=c)}l&&Object.defineProperty(l,r.name,u),h=!0}function I(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function C(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function N(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}var K,L;"function"==typeof SuppressedError&&SuppressedError;K=new WeakMap,L=new WeakMap;const q=Symbol("getAt"),H=Symbol("setAt");function _(e,t){e&&"function"!=typeof e&&(t=e,e=void 0),e||(e=class{}),t||(t={get(e){if("function"!=typeof this[q])throw new Error("Indexable class must have an [getAt] method");return this[q](e)},set(e,t){if("function"!=typeof this[H])throw new Error("Indexable class has read-only numeric index access");this[H](e,t)}});class n extends e{}return Object.setPrototypeOf(n.prototype,new Proxy(e.prototype,{[Symbol.toStringTag]:"MutTs Indexable",get(e,n,r){if(n in e){const t=Object.getOwnPropertyDescriptor(e,n)?.get;return t?t.call(r):e[n]}if("string"==typeof n){if("length"===n&&t.getLength)return t.getLength.call(r);const e=Number(n);if(!Number.isNaN(e))return t.get.call(r,e)}},set(e,n,r,o){if(n in e){const t=Object.getOwnPropertyDescriptor(e,n)?.set;return t?t.call(o,r):e[n]=r,!0}if("string"==typeof n){if("length"===n&&t.setLength)return t.setLength.call(o,r),!0;const e=Number(n);if(!Number.isNaN(e)){if(!t.set)throw new Error("Indexable class has read-only numeric index access");return t.set.call(o,e,r),!0}}return Object.defineProperty(o,n,{value:r,writable:!0,enumerable:!0,configurable:!0}),!0},has(e,n){if(n in e)return!0;if("string"==typeof n){if("length"===n&&t.getLength)return!0;const e=Number(n);if(!Number.isNaN(e))return!0}return!1},ownKeys(e){const n=Reflect.ownKeys(e);if(t.getLength){n.push("length");const e=t.getLength.call(this);for(let t=0;t<e;t++)n.push(String(t))}return n},getOwnPropertyDescriptor(e,n){if(n in e)return Object.getOwnPropertyDescriptor(e,n);if("string"==typeof n){if("length"===n&&t.getLength)return{enumerable:!1,configurable:!0,get:()=>t.getLength.call(this)};const e=Number(n);if(!Number.isNaN(e))return{enumerable:!0,configurable:!0,get:()=>t.get.call(this,e),set:t.set?n=>t.set.call(this,e,n):void 0}}}})),n}const V=Symbol("forwardArray");class F{get[V](){throw new Error("ArrayReadForward is not implemented")}get length(){return this[V].length}[Symbol.iterator](){return this[V][Symbol.iterator]()}map(e,t){return this[V].map(e,t)}filter(e,t){return this[V].filter(e,t)}reduce(e,t){return void 0!==t?this[V].reduce(e,t):this[V].reduce(e)}reduceRight(e,t){return void 0!==t?this[V].reduceRight(e,t):this[V].reduceRight(e)}forEach(e,t){this[V].forEach(e,t)}find(e,t){return this[V].find(e,t)}findIndex(e,t){return this[V].findIndex(e,t)}findLast(e,t){return this[V].findLast(e,t)}findLastIndex(e,t){return this[V].findLastIndex(e,t)}includes(e,t){return this[V].includes(e,t)}indexOf(e,t){return this[V].indexOf(e,t)}lastIndexOf(e,t){return this[V].lastIndexOf(e,t)}slice(e,t){return this[V].slice(e,t)}concat(...e){return this[V].concat(...e)}every(e,t){return this[V].every(e,t)}some(e,t){return this[V].some(e,t)}join(e){return this[V].join(e)}keys(){return this[V].keys()}values(){return this[V].values()}entries(){return this[V].entries()}toString(){return this[V].toString()}toLocaleString(e,t){return this[V].toLocaleString(e,t)}at(e){return this[V].at(e)}flat(e){return this[V].flat(e)}flatMap(e,t){return this[V].flatMap(e,t)}toReversed(){return this[V].toReversed?.()??[...this[V]].reverse()}toSorted(e){return this[V].toSorted?.(e)??[...this[V]].sort(e)}toSpliced(e,t,...n){return void 0===t?this[V].toSpliced(e):this[V].toSpliced(e,t,...n)}with(e,t){return this[V].with(e,t)}get[Symbol.unscopables](){return this[V][Symbol.unscopables]}}var B,U;class X{constructor(e){if(this.uuids=new WeakMap,this.refs={},this[B]="IterableWeakMap",this.registry=new FinalizationRegistry(e=>{delete this.refs[e]}),e)for(const[t,n]of e)this.set(t,n)}createIterator(e){const{refs:t}=this;return function*(){for(const n of Object.keys(t)){const[r,o]=t[n],s=r.deref();s?yield e(s,o):delete t[n]}}()}clear(){for(const e of Object.keys(this.refs)){const t=this.refs[e][0].deref();t&&this.registry.unregister(t)}this.uuids=new WeakMap,this.refs={}}delete(e){const t=this.uuids.get(e);return!!t&&(delete this.refs[t],this.uuids.delete(e),this.registry.unregister(e),!0)}forEach(e,t){for(const[n,r]of this)e.call(t??this,r,n,t??this)}get(e){const t=this.uuids.get(e);if(t)return this.refs[t][1]}has(e){return this.uuids.has(e)}set(e,t){let n=this.uuids.get(e);return n?this.refs[n][1]=t:(n=crypto.randomUUID(),this.uuids.set(e,n),this.refs[n]=[new WeakRef(e),t],this.registry.register(e,n,e)),this}get size(){return[...this].length}entries(){return this.createIterator((e,t)=>[e,t])}keys(){return this.createIterator((e,t)=>e)}values(){return this.createIterator((e,t)=>t)}[Symbol.iterator](){return this.entries()}}B=Symbol.toStringTag;class Z{constructor(e){if(this.uuids=new WeakMap,this.refs={},this[U]="IterableWeakSet",this.registry=new FinalizationRegistry(e=>{delete this.refs[e]}),e)for(const t of e)this.add(t)}createIterator(e){const{refs:t}=this;return function*(){for(const n of Object.keys(t)){const r=t[n].deref();r?yield e(r):delete t[n]}}()}clear(){for(const e of Object.keys(this.refs)){const t=this.refs[e].deref();t&&this.registry.unregister(t)}this.uuids=new WeakMap,this.refs={}}add(e){let t=this.uuids.get(e);return t||(t=crypto.randomUUID(),this.uuids.set(e,t),this.refs[t]=new WeakRef(e),this.registry.register(e,t,e)),this}delete(e){const t=this.uuids.get(e);return!!t&&(delete this.refs[t],this.uuids.delete(e),this.registry.unregister(e),!0)}forEach(e,t){for(const n of this)e.call(t??this,n,n,t??this)}has(e){return this.uuids.has(e)}get size(){return[...this].length}entries(){return this.createIterator(e=>[e,e])}keys(){return this.createIterator(e=>e)}values(){return this.createIterator(e=>e)}[Symbol.iterator](){return this.keys()}union(e){const t={[Symbol.iterator]:()=>e.keys()},n=this;return new Set(function*(){yield*n;for(const e of t)n.has(e)||(yield e)}())}intersection(e){const t=this;return new Set(function*(){for(const n of t)e.has(n)&&(yield n)}())}difference(e){const t=this;return new Set(function*(){for(const n of t)e.has(n)||(yield n)}())}symmetricDifference(e){const t={[Symbol.iterator]:()=>e.keys()},n=this;return new Set(function*(){for(const t of n)e.has(t)||(yield t);for(const e of t)n.has(e)||(yield e)}())}isSubsetOf(e){for(const t of this)if(!e.has(t))return!1;return!0}isSupersetOf(e){const t={[Symbol.iterator]:()=>e.keys()};for(const e of t)if(!this.has(e))return!1;return!0}isDisjointFrom(e){for(const t of this)if(e.has(t))return!1;return!0}}function G(e,t){const n=new WeakMap,r=e(Object);return n.set(Object,r),new Proxy(r,{apply(r,o,s){if(0===s.length)throw new Error("Mixin requires a base class");const i=s[0];if("function"!=typeof i)throw new Error("Mixin requires a constructor function");if(!(y(i)||i&&"function"==typeof i&&i.prototype))throw new Error("Mixin requires a valid constructor");const c=n.get(i);if(c)return c;let a=i;if(t){const e=class extends i{},n=i.prototype,r=new Proxy(n,{get(e,n,r){const o=b.get(e,n,r);return"function"!=typeof o||"string"!=typeof n||["constructor","toString","valueOf"].includes(n)?o:function(...e){const n=t(this);return o.apply(n,e)}}});Object.setPrototypeOf(e.prototype,r),a=e}const f=e(a);return n.set(i,f),f}})}U=Symbol.toStringTag;const J=(e,t)=>(...n)=>t[e](...n),Y=new WeakMap,Q=new WeakMap;function ee(e,t){Q.set(t,e),Y.set(e,t)}const te={[Symbol.toStringTag]:"MutTs PromiseChain function",get:(e,t)=>t===Symbol.toStringTag?"PromiseProxy":"string"==typeof t&&["then","catch","finally"].includes(t)?e[t]:ie(e.then(e=>e[t]))},ne=e=>({then:J("then",e),catch:J("catch",e),finally:J("finally",e)}),re={[Symbol.toStringTag]:"MutTs PromiseChain object",get(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t)?.get,o=r?r.call(n):e[t];return"function"==typeof e?o:ie(o)},apply:(e,t,n)=>ie(e.apply(t,n))};function oe(e){const t=new Proxy(e,re);return ee(e,t),t}function se(e){return e&&["function","object"].includes(typeof e)}function ie(e){if(!se(e))return e;if(Y.has(e))return Y.get(e);if(!(e instanceof Promise))return oe(e);e=e.then(e=>se(e)?oe(e):e);const t=Object.assign(function(...t){return ie(e.then(e=>this?.then?this.then(n=>e.apply(n,t)):e.apply(this,t)))},ne(e)),n=new Proxy(t,te);return ee(e,n),n}const ce=Symbol("native-reactive"),ae=Symbol("non-reactive"),fe=Symbol("unreactive-properties"),le=Symbol("all-props"),ue=Symbol("projection-info"),he=Symbol("stopped"),de=Symbol("cleanup"),pe=Symbol("root-function");var ge;e.ReactiveErrorCode=void 0,(ge=e.ReactiveErrorCode||(e.ReactiveErrorCode={})).CycleDetected="CYCLE_DETECTED",ge.MaxDepthExceeded="MAX_DEPTH_EXCEEDED",ge.MaxReactionExceeded="MAX_REACTION_EXCEEDED",ge.WriteInComputed="WRITE_IN_COMPUTED",ge.TrackingError="TRACKING_ERROR",ge.BrokenEffects="BROKEN_EFFECTS";class ye extends Error{constructor(e,t){super(e),this.debugInfo=t,this.name="ReactiveError"}get code(){return this.debugInfo?.code}get cause(){return this.debugInfo?.cause}}const me={enter:e=>{},leave:e=>{},chain:(e,t)=>{},beginChain:e=>{},endChain:()=>{},garbageCollected:e=>{},touched:(e,t,n,r)=>{},skipRunningEffect:e=>{},maxEffectChain:100,maxTriggerPerBatch:10,maxEffectReaction:"throw",onMemoizationDiscrepancy:void 0,cycleHandling:"none",isVerificationRun:!1,maxDeepWatchDepth:100,instanceMembers:!0,ignoreAccessors:!0,recursiveTouching:!0,asyncMode:"cancel",warn:(...e)=>{},introspection:{enableHistory:!1,historySize:50},zones:{setTimeout:!0,setInterval:!0,requestAnimationFrame:!0,queueMicrotask:!0}},be=new WeakMap,we=new WeakMap,ve=new WeakMap,Se=new WeakMap,ke=new WeakMap;function je(e,t){const n=ke.get(t),r=n?.deref();if(r&&r!==e){const n=t.name||"anonymous",o=r.name||"anonymous",s=e.name||"anonymous";throw new Error(`[reactive] Abusive Shared Root detected: Root '${n}' is already identifying function '${o}'. Cannot reuse it for '${s}'. Shared roots cause lost updates and broken identity logic.`)}return ke.set(t,new WeakRef(e)),Object.defineProperty(e,pe,{value:Me(t),writable:!1})}function Me(e){for(;e&&pe in e;)e=e[pe];return e}const Oe=Symbol("external-source");let Ee=!1;const xe=new Set,Re=new Set,Te=new WeakMap,De=new WeakMap;let Pe=0,Ae=0;const We=new Map;function $e(e){let t=Te.get(e);if(!t){const n=Me(e);t=n?.name?.trim()||"effect_"+ ++Pe,Te.set(e,t)}return t}function ze(e){let t=De.get(e);if(!t){const n=e?.constructor?.name;t=`${n&&"Object"!==n?n:"object"}_${++Ae}`,De.set(e,t)}return t}function Ie(e){if(!e||xe.has(e))return;xe.add(e);const t=be.get(e);if(t)for(const e of t)Ce(e)}function Ce(e){Re.has(e)||function(e){Re.add(e),ze(e)}(e)}function Ne(e,t,n,r,o,s){const i=function(e){let t=We.get(e);return t||(t=new Map,We.set(e,t)),t}(e);let c=i.get(t);c||(c=new Map,i.set(t,c));let a=c.get(n);return a||(a={label:n,object:r,prop:o,evolution:s,count:0,lastTriggered:Date.now()},c.set(n,a)),a}function Ke(e,t){Te.set(e,t)}function Le(e,t){De.set(e,t),Re.add(e)}function qe(e){e&&Ee&&Ie(e)}function He(e){Ee&&Ce(e)}function _e(e,t,n,r,o){if(me.introspection.enableHistory&&function(e,t,n,r,o){const s={id:++Xe,timestamp:Date.now(),source:e?$e(e):"External",target:$e(t),objectName:ze(n),prop:String(r),type:o.type};Ue.push(s),Ue.length>me.introspection.historySize&&Ue.shift()}(e,t,n,r,o),!Ee)return;Ie(t),e&&Ie(e);const s=function(e,t){const n=ze(e);return t===le?`${n}.*`:"symbol"==typeof t?`${n}.${t.description??t.toString()}`:`${n}.${String(t)}`}(n,r),i=Ne(e??Oe,t,s,n,r,o);i.count+=1,i.lastTriggered=Date.now(),Ce(n)}function Ve(e,t=5){const n=[];let r=e;for(let e=0;e<t;e++){let e,t="";e:for(const[n,o]of We)for(const[s,i]of o)if(s===r){let r=0;for(const o of i.values())o.lastTriggered>r&&(r=o.lastTriggered,t=o.label,e=n===Oe?void 0:n);if(e||t)break e}if(!e){if(t){n.push(`External -> (${t}) -> ${$e(r)}`);break}break}n.push(`${$e(e)} -> (${t}) -> ${$e(r)}`),r=e}return n.reverse()}function Fe(){const e=[],t=[],n=new Map,r=new Set(xe);!function(e){const t=Array.from(e);for(let n=0;n<t.length;n++){const r=t[n],o=Se.get(r);o&&!e.has(o)&&(e.add(o),t.push(o))}}(r);const{nodes:o,nodeByEffect:s}=function(e){const t=[],n=new Map,r=Array.from(e);for(const e of r){const r=$e(e),o={id:`effect_${t.length}`,label:r,type:"effect",depth:0,debugName:r};t.push(o),n.set(e,o)}const o=new Map,s=e=>{if(!e)return 0;const t=o.get(e);if(void 0!==t)return t;const n=Se.get(e),r=s(n)+(n?1:0);return o.set(e,r),r};for(const[e,t]of n){t.depth=s(e);const r=Se.get(e);if(r){const e=n.get(r);e&&(t.parentId=e.id)}}return{nodes:t,nodeByEffect:n}}(r);for(const t of o)e.push(t);for(const[e,t]of s)n.set(e,t.id);for(const t of Re){const r=`object_${e.length}`;e.push({id:r,label:ze(t),type:"state",debugName:De.get(t)}),n.set(t,r)}if(We.has(Oe)){const t="effect_external";e.push({id:t,label:"External",type:"external",depth:0}),n.set(Oe,t)}for(const e of r){const r=n.get(e);if(!r)continue;const o=be.get(e);if(o)for(const e of o){const o=n.get(e);o&&t.push({id:`${r}->${o}`,source:r,target:o,type:"dependency",label:"depends"})}}for(const[e,r]of We)for(const[o,s]of r){const r=n.get(o);if(!r)continue;const i=n.get(e);if(i)for(const e of s.values())t.push({id:`${i}->${r}:${e.label}`,source:i,target:r,type:"cause",label:e.count>1?`${e.label} (${e.count})`:e.label,count:e.count})}return{nodes:e,edges:t,meta:{generatedAt:Date.now(),devtoolsEnabled:Ee}}}function Be(){return Ee}const Ue=[];let Xe=0;var Ze;function Ge(e){return e}class Je{enter(e){const t=this.active;return this.active=e,t}leave(e){this.active=e}with(e,n){const r=this.enter(e);let o;try{o=n()}finally{this.leave(r)}return t.sanitizePromise(o)}root(e){let t=this.enter();try{return e()}finally{this.leave(t)}}get zoned(){const e=this.active;return M(`${this}@${e}`,t=>this.with(e,t))}}class Ye extends Je{}class Qe extends Je{has(e){return this.history.has(e)}some(e){for(const t of this.history)if(e(t))return!0;return!1}constructor(e=new Ye){super(),this.controlled=e,this.history=new Set;const t=this;this.present=Object.create(e,Object.getOwnPropertyDescriptors({get active(){return e.active},set active(t){e.active=t},enter(n){if(n&&t.history.has(n))throw new Error("ZoneHistory: re-entering historical zone");return void 0!==n&&t.history.add(n),{added:n,entered:e.enter(n)}},leave:n=>(void 0!==n.added&&t.history.delete(n.added),e.leave(n.entered))}))}get active(){return{present:this.controlled.active,history:new Set(this.history)}}set active(e){this.history=this.history&&new Set(this.history),this.controlled.active=e?.present}}class et extends Je{constructor(...e){super(),Ze.set(this,new Set);for(const t of e)C(this,Ze,"f").add(t)}get active(){const e=new Map;for(const t of C(this,Ze,"f"))void 0!==t.active&&e.set(t,t.active);return e}set active(e){for(const t of C(this,Ze,"f"))t.active=e?.get(t)}enter(e){const t=new Map;for(const n of C(this,Ze,"f")){const r=e?.get(n);t.set(n,Ge(n).enter(r))}return t}leave(e){for(const t of C(this,Ze,"f"))Ge(t).leave(e.get(t))}add(e){C(this,Ze,"f").add(e)}delete(e){C(this,Ze,"f").delete(e)}clear(){C(this,Ze,"f").clear()}}Ze=new WeakMap;const tt=j("async",new et);t.addHook(()=>{const e=tt.active;return()=>{const t=tt.active;return tt.active=e,()=>tt.active=t}});const nt=j("effectHistory",new Qe);j("effectHistory.present",nt.present),tt.add(nt);const rt=j("effectAggregator",new et(nt.present));function ot(e){const t=Me(e);return nt.some(e=>Me(e)===t)}function st(){return nt.present.active}const it=new WeakMap,ct=new WeakMap;function at(e){let t=e;for(;t&&"object"==typeof t&&null!==t&&ct.has(t);)t=ct.get(t);return t}function ft(e){const t=new Map;for(let n=0;n<e.length;n++){const r=e[n];if(t.has(r))return e.slice(t.get(r));t.set(r,n)}return null}function lt(e,t=20){const n=e.map(e=>e.name||"<anonymous>");if(n.length<=t)return n.join(" → ");const r=n.slice(0,5),o=n.slice(-10);return`${r.join(" → ")} ... (${n.length-15} more) ... ${o.join(" → ")}`}let ut;const ht=new Array(100);function dt(t,n,r,o){const s=Me(t);if(!ut)return;let i=ut.get(s);i||(i=new Map,ut.set(s,i));let c=i.get(n);c||(c=new Map,i.set(n,c));const a=(c.get(o)??0)+1;if(c.set(o,a),ht.unshift({effect:t,obj:n,evolution:r,prop:o}),ht.pop(),a>=me.maxTriggerPerBatch){const t=s?.name||"anonymous",n=`Aggressive trigger detected: effect "${t}" triggered ${a} times in the batch by the same cause.`;if("throw"===me.maxEffectReaction)throw new ye(n,{code:e.ReactiveErrorCode.MaxReactionExceeded,count:a,effect:t});me.warn(`[reactive] ${n}`)}}const pt=new WeakMap,gt=new WeakSet,yt=new WeakMap,mt=new WeakMap,bt=new WeakMap,wt=new WeakMap,vt=new WeakMap;function St(e,t){let n=e.get(t);return n||(n=new Z,e.set(t,n)),n}function kt(e,t,n){if(e===t)return!0;if(e===n)return!1;const r=new Set,o=[e];for(r.add(e),r.add(n);o.length>0;){const e=o.shift(),n=yt.get(e);if(n)for(const e of n){if(e===t)return!0;r.has(e)||(r.add(e),o.push(e))}}return!1}let jt;function Mt(e){return jt?.all.has(Me(e))}const Ot=new Set;function Et(e,t,n=new Set,r=[]){if(e===t)return[...r,t];if(n.has(e))return[];n.add(e);const o=[...r,e],s=yt.get(e);if(s)for(const e of s){const r=Et(e,t,n,o);if(r.length>0)return r}return[]}function xt(e,t){const n=Et(t,e);return n.length>0?[e,...n]:[]}function Rt(t,n,r){if(t[de]?.(),t[he])return;if(!jt)return;const o=Me(t);if("none"===me.cycleHandling&&jt.all.has(o)&&jt.all.delete(o),jt.all.set(o,t),n&&!r&&"none"!==me.cycleHandling){const r=Me(n);if(function(e,t){if(e===t)return!1;const n=wt.get(t);return!!n?.has(e)}(r,o)){const n=xt(r,o),s=n.length>0?`Cycle detected: ${n.map(e=>e.name||e.toString()).join(" → ")}`:`Cycle detected: ${r.name||r.toString()} → ${o.name||o.toString()} (and back)`,i=me.cycleHandling;if("strict"===i){jt.all.delete(o);const r=Ve(t),i=vt.get(o);throw new ye(`[reactive] Strict Cycle Prevention: ${s}`,{code:e.ReactiveErrorCode.CycleDetected,cycle:n.map(e=>e.name||e.toString()),details:s,causalChain:r,creationStack:i})}switch(i){case"throw":{jt.all.delete(o);const r=Ve(t),i=vt.get(o);throw new ye(`[reactive] ${s}`,{code:e.ReactiveErrorCode.CycleDetected,cycle:n.map(e=>e.name||e.toString()),details:s,causalChain:r,creationStack:i})}case"warn":return me.warn(`[reactive] ${s}`),void jt.all.delete(o);case"break":return void jt.all.delete(o)}}!function(e,t){if("none"===me.cycleHandling)return;const n=yt.get(e);if(n?.has(t))return;if(n)n.add(t);else{const n=new Z;n.add(t),yt.set(e,n)}let r=mt.get(t);if(r||(r=new Z,mt.set(t,r)),r.add(e),e===t)return;const o=St(wt,e),s=St(bt,t);o.add(t),s.add(e);const i=bt.get(e);if(i)for(const e of i)e!==t&&(St(wt,e).add(t),s.add(e));const c=wt.get(t);if(c)for(const t of c)t!==e&&(St(bt,t).add(e),o.add(t));if(i&&c)for(const e of i){const t=St(wt,e);for(const n of c)e!==n&&(t.add(n),St(bt,n).add(e))}}(r,o)}}function Tt(e){jt?Ot.add(e):e()}const Dt=Tt;function Pt(e,t,n,r,o){if(n.has(e)){const t=r.indexOf(e);return r.slice(t).concat([e])}if(t.has(e))return[];t.add(e),n.add(e),r.push(e);const s=yt.get(e);if(s)for(const e of s)if(o.all.has(e)){const s=Pt(e,t,n,r,o);if(s.length>0)return s}return r.pop(),n.delete(e),[]}function At(e){let t=null,n=null;if("none"===me.cycleHandling){const e=jt.all.entries().next().value;e&&([n,t]=e)}else for(const[e,r]of jt.all){if(0===(jt.inDegrees.get(e)??0)){t=r,n=e;break}}if(!t){if(jt.all.size>0){let e=function(e){const t=new Set,n=new Set,r=[];for(const[o]of e.all){if(t.has(o))continue;const s=Pt(o,t,n,r,e);if(s.length>0)return s}return[]}(jt);if(0===e.length)for(const[t]of jt.all){const n=wt.get(t);if(n){for(const r of n)if(r!==t&&jt.all.has(r)){const n=wt.get(r);if(n?.has(t)){e=[t,r,t];break}}if(e.length>0)break}}const t=e.length>0?`Cycle detected: ${e.map(e=>e.name||"<anonymous>").join(" → ")}`:"Cycle detected in effect batch - all effects have dependencies that prevent execution";switch(me.cycleHandling){case"throw":throw new ye(`[reactive] ${t}`);case"warn":{me.warn(`[reactive] ${t}`);const e=jt.all.values().next().value;if(e){const t=Me(e);return jt.all.delete(t),jt.inDegrees.delete(t),e()}break}case"break":{const e=jt.all.values().next().value;if(e){const t=Me(e);return jt.all.delete(t),jt.inDegrees.delete(t),e()}break}}}return null}e.push(Me(t));const r=t();return jt.all.delete(n),jt.inDegrees.delete(n),function(e,t){const n=wt.get(t);if(n)for(const t of n)if(e.all.has(t)){const n=e.inDegrees.get(t)??0;n>0&&e.inDegrees.set(t,n-1)}}(jt,n),r}function Wt(t,n){Array.isArray(t)||(t=[t]);const r=t.map(Me);if(jt){me?.chain(r,Me(st()));const e=st();for(let r=0;r<t.length;r++)Rt(t[r],e,"immediate"===n);if(n){const e={};for(let n=0;n<t.length;n++)try{const r=t[n]();void 0===r||"value"in e||(e.value=r)}finally{const e=Me(t[n]);jt.all.delete(e)}return e.value}}else{if(ut)throw new Error("Batch already in progress");ut=new Map,me.beginChain(r),jt={all:new Map,inDegrees:new Map};const o=st(),s=[],i={};try{if(n)for(let e=0;e<t.length;e++)try{const n=t[e]();void 0===n||"value"in i||(i.value=n)}finally{jt.all.delete(Me(t[e]))}else{for(let e=0;e<t.length;e++)Rt(t[e],o,!1);!function(e){if("none"===me.cycleHandling)return;const t=st(),n=t?Me(t):null;e.inDegrees.clear();for(const[t]of e.all){let r=0;const o=bt.get(t);if(o)for(const s of o)e.all.has(s)&&s!==n&&s!==t&&r++;e.inDegrees.set(t,r)}}(jt)}for(;jt.all.size>0||Ot.size>0;)if(jt.all.size>0){if(s.length>me.maxEffectChain){const t=ft(s),n=lt(s),r=t?`Max effect chain reached (cycle detected: ${lt(t)})`:`Max effect chain reached (trace: ${n})`,o=(jt?Array.from(jt.all.keys()):[]).map(e=>e.name||"<anonymous>"),i={code:e.ReactiveErrorCode.MaxDepthExceeded,effectuatedRoots:s,cycle:t,trace:n,maxEffectChain:me.maxEffectChain,queued:o.slice(0,50),queuedCount:o.length,causalChain:s.length>0?Ve(jt.all.get(s[s.length-1])):[]};switch(me.maxEffectReaction){case"throw":case"debug":throw new ye(`[reactive] ${r}`,i);case"warn":me.warn(`[reactive] ${r} (queued: ${o.slice(0,10).join(", ")}${o.length>10?", …":""})`)}}const t=At(s);void 0===t||"value"in i||(i.value=t)}else{const e=Array.from(Ot);Ot.clear();for(const t of e)t()}return i.value}catch(t){throw t instanceof ye?t:new ye("Effects are broken",{code:e.ReactiveErrorCode.BrokenEffects,cause:t})}finally{ut=void 0,jt=void 0,me.endChain()}}}const $t=R({method:e=>function(...t){const n=()=>e.apply(this,t);return Object.defineProperty(n,"name",{value:`atomic(${e.name})`}),Wt(n,"immediate")},default:e=>function(...t){const n=()=>e.apply(this,t);return Object.defineProperty(n,"name",{value:`atomic(${e.name})`}),Wt(n,"immediate")}}),zt=new FinalizationRegistry(e=>e());function It(e,t){const n=t?.asyncMode??me.asyncMode??"cancel";if(me.introspection.enableHistory){const t=(new Error).stack;if(t){const n=t.split("\n").slice(2).join("\n");vt.set(Me(e),n)}}let r=null;const o=nt.present.with(u,()=>rt.zoned),s=nt.zoned;let i=nt.present.active,c=!1,a=!1,f=null,l=null;function u(){if(r){const e=r;r=null,Ct(()=>e())}if(f)if("cancel"===n&&l)l(),l=null,f=null;else if("ignore"===n)return;if(c)return;let t,i;me.enter(Me(e));try{if(i=o(()=>e({tracked:o,ascend:s,reaction:a})),i&&"function"!=typeof i&&("object"!=typeof i||!("then"in i)))throw new ye(`[reactive] Effect returned a non-function value: ${i}`);if(i&&"object"==typeof i&&"function"==typeof i.then){const e=i;let t=null;const n=new Promise((e,n)=>{t=n}),r=new ye("[reactive] Effect canceled due to dependency change");f=Promise.race([e,n]),l=()=>{t&&t(r)}}else t=i}finally{a=!0,me.leave(e)}r=()=>{r=null,t?.();const e=be.get(u);if(e){for(const t of e){const e=we.get(t);if(e){for(const[t,n]of e.entries())n.delete(u),0===n.size&&e.delete(t);0===e.size&&we.delete(t)}}be.delete(u)}const n=ve.get(u);if(n){for(const e of n)e();ve.delete(u)}}}function h(e){return Object.defineProperties(e,{[he]:{get:()=>c},[de]:{value:()=>{if(r){const e=r;r=null,Ct(()=>e())}}}})}je(u,e),h(u),t?.opaque&&gt.add(u),Be()&&qe(u),Wt(u,"immediate"),Se.set(u,i);const d=()=>{c||(c=!0,l&&(l(),l=null,f=null),r?.(),function(e){if("none"===me.cycleHandling)return;const t=Me(e),n=bt.get(t),r=wt.get(t),o=yt.get(t);if(o){for(const e of o){const n=mt.get(e);n?.delete(t)}yt.delete(t)}const s=mt.get(t);if(s){for(const e of s){const n=yt.get(e);n?.delete(t)}mt.delete(t)}if(n)for(const e of n){const n=wt.get(e);if(n&&(n.delete(t),r))for(const o of r)kt(e,o,t)||n.delete(o)}if(r)for(const e of r){const r=bt.get(e);if(r&&(r.delete(t),n))for(const o of n)kt(o,e,t)||r.delete(o)}if(n&&r)for(const e of n){const n=wt.get(e);if(n)for(const o of r)if(!kt(e,o,t)){n.delete(o);const t=bt.get(o);t?.delete(e)}}bt.delete(t),wt.delete(t)}(u),zt.unregister(d))};if(!i){const t=h(()=>d());return zt.register(t,()=>{d(),me.garbageCollected(e)},d),t}let p=ve.get(i);p||(p=new Set,ve.set(i,p));const g=h(()=>{p.delete(g),0===p.size&&ve.delete(i),d()});return p.add(g),g}function Ct(e){return nt.present.root(e)}function Nt(e){return nt.root(e)}const Kt=new WeakMap,Lt=new WeakSet,qt=new WeakMap,Ht=new WeakMap;function _t(e,t,n){let r=Kt.get(e);r||(r=new Set,Kt.set(e,r)),r.add({parent:t,prop:n})}function Vt(e,t,n){const r=Kt.get(e);if(r){for(const e of r)if(e.parent===t&&e.prop===n){r.delete(e);break}0===r.size&&Kt.delete(e)}}function Ft(e){return!!Lt.has(e)||Ut(e)}function Bt(e,t){const n=Kt.get(e);if(n)for(const{parent:e}of n){const t=qt.get(e);if(t)for(const e of t)Wt(e);Bt(e)}}function Ut(e){const t=Kt.get(e);if(!t)return!1;for(const{parent:e}of t){if(Lt.has(e))return!0;if(Ut(e))return!0}return!1}const Xt=new WeakMap;function Zt(e,t){const n={},r=Gt(e=at(e));r&&Object.assign(r,{evolution:t,next:n}),Xt.set(e,n)}function Gt(e){e=at(e);let t=Xt.get(e);return t||(t={},Xt.set(e,t)),t}function Jt(e,t,n,r,...o){const s=st();for(const i of o)for(const o of i){const i=r.get(o);if(i)for(const r of i){if(ot(r)){me.skipRunningEffect(r);continue}n.has(r)||(n.add(r),Mt(r)||dt(r,e,t,o));const i=pt.get(r);if(_e(s,r,e,o,t),i){for(const n of i)n(e,t,o);i.delete(r)}}}}function Yt(e,t,n){Qt(e,t,[n])}function Qt(e,t,n){Zt(e=at(e),t);const r=we.get(e);if(r){const o=new Set;n?Jt(e,t,o,r,[le],n):Jt(e,t,o,r,r.keys()),me.touched(e,t,n,o),Wt(Array.from(o))}Lt.has(e)&&Bt(e)}const en=new WeakSet,tn=new Set,nn=Symbol("absent");function rn(...e){for(const t of e)t&&(t.prototype[ae]=!0);return e[0]}function on(e){if(null===e||"object"!=typeof e)return!0;if(en.has(e))return!0;if(e[ae])return!0;for(const t of tn)if(t(e))return!0;return!1}function sn(e){return function(e){return"object"==typeof e&&null!==e}(e)}function cn(e){if(sn(e)){if(Array.isArray(e))return Array.prototype;try{return e.constructor}catch{return}}}function an(e,t){return e!==t&&(!(!sn(e)||!sn(t))&&(!on(e)&&!on(t)&&cn(e)===cn(t)))}function fn(e,t,n,r,o){const s={type:o?"set":"add",prop:t};if(me.recursiveTouching&&void 0!==n&&an(n,r)){const o={obj:at(e),prop:t};!function(e){if(!e.length)return;const t=new Set,n=e[0]?.origin;let r;if(n){r=new Set;const e=we.get(n.obj);if(e){const t=new Set;Jt(n.obj,{type:"set",prop:n.prop},t,e,[le],[n.prop]);for(const e of t)r.add(e)}if(0===r.size)return}for(const{target:o,evolution:s,prop:i}of e){if(!sn(o))continue;const e=at(o);Zt(e,s);const c=we.get(e);let a;const f=[i];if(c){if(a=new Set,Jt(e,s,a,c,[le],f),n&&r){const e=new Set;for(const t of a)(r.has(t)||hn(t,r))&&e.add(t);a=e}for(const e of a)t.add(e)}me.touched(e,s,f,a),Lt.has(e)&&Bt(e)}t.size&&Wt([...t])}(un(n,r,new WeakMap,[],o)),function(e,t,n){e=at(e);const r=we.get(e);if(!r)return;const o=r.get(n);if(!o)return;const s=new Set,i=st();for(const r of o){if(!gt.has(r))continue;if(ot(r)){me.skipRunningEffect(r);continue}s.add(r),dt(r,e,t,n);const o=pt.get(r);if(_e(i,r,e,n,t),o){for(const r of o)r(e,t,n);o.delete(r)}}s.size>0&&(me.touched(e,t,[n],s),Wt(Array.from(s)))}(e,s,t)}else Yt(e,s,t)}function ln(e){const t=new Set(Reflect.ownKeys(e));let n=Object.getPrototypeOf(e);for(;n&&!Object.hasOwn(n,"constructor");){for(const e of Reflect.ownKeys(n))t.add(e);n=Object.getPrototypeOf(n)}return t}function un(e,t,n=new WeakMap,r=[],o){return an(e,t)&&sn(e)&&sn(t)?function(e,t,n){let r=e.get(t);return r||(r=new WeakSet,e.set(t,r)),!!r.has(n)||(r.add(n),!1)}(n,e,t)?r:Array.isArray(e)&&Array.isArray(t)?(function(e,t,n,r,o){const s=[],i=e.length,c=t.length,a=Math.max(i,c);for(let n=0;n<a;n++){const r=n<i,a=n<c;if(r&&!a){s.push({target:e,evolution:{type:"del",prop:n},prop:n,origin:o});continue}if(!r&&a){s.push({target:e,evolution:{type:"add",prop:n},prop:n,origin:o});continue}if(!r||!a)continue;const f=at(e[n]),l=at(t[n]);Object.is(f,l)||s.push({target:e,evolution:{type:"set",prop:n},prop:n,origin:o})}i!==c&&s.push({target:e,evolution:{type:"set",prop:"length"},prop:"length",origin:o});r.push(...s)}(e,t,0,r,o),r):(function(e,t,n,r,o){const s=ln(e),i=ln(t),c=[];for(const t of s)i.has(t)||c.push({target:e,evolution:{type:"del",prop:t},prop:t,origin:o});for(const t of i)s.has(t)||c.push({target:e,evolution:{type:"add",prop:t},prop:t,origin:o});for(const a of i){if(!s.has(a))continue;const i=at(e[a]),f=at(t[a]);an(i,f)?un(i,f,n,r,o):Object.is(i,f)||c.push({target:e,evolution:{type:"set",prop:a},prop:a,origin:o})}r.push(...c)}(e,t,n,r,o),r):r}function hn(e,t){let n=e;const r=new WeakSet;for(;n&&!r.has(n);){if(r.add(n),t.has(n))return!0;n=Se.get(n)}return!1}function dn(e,t=le){e=at(e);const n=st();if(!n||"symbol"==typeof t&&t!==le)return;let r=we.get(e);r||(r=new Map,we.set(e,r));let o=r.get(t);o||(o=new Set,r.set(t,o)),o.add(n);const s=be.get(n);s?s.add(e):be.set(n,new Set([e]))}rn(Date,RegExp,Error,Promise,Function),"undefined"!=typeof window&&(!function(...e){for(const t of e){try{Object.defineProperty(t,ae,{value:!0,writable:!1,enumerable:!1,configurable:!1})}catch{}ae in t||en.add(t)}e[0]}(window,document),rn(Node,Element,HTMLElement,EventTarget));const pn=new WeakMap,gn=[],yn={[Symbol.toStringTag]:"MutTs Reactive",get(e,t,n){if(e&&"object"==typeof e&&!Object.hasOwn(e,t)){const n=pn.get(e.constructor);if(n&&t in n){const r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(e):(...t)=>r.value.apply(e,t)}}if(t===ae)return!1;const r=at(e);if(r[fe]?.has(t)||"symbol"==typeof t)return b.get(e,t,n);const o=Reflect.has(n,t),s=o&&Object.hasOwn(n,t),i=o&&!s,c=me.ignoreAccessors&&s&&(w(n,t)||w(r,t));if(o&&(me.instanceMembers&&i&&e instanceof Object||c)||dn(e,t),i&&(!me.instanceMembers||!(e instanceof Object))){let n=wn(Object.getPrototypeOf(e));for(;n&&n!==Object.prototype&&(dn(n,t),!Object.hasOwn(n,t));){let e=wn(Object.getPrototypeOf(n));e===n&&(e=wn(Object.getPrototypeOf(at(n)))),n=e}}const a=b.get(e,t,n);if("object"==typeof a&&null!==a){const n=wn(a);return Ft(e)&&_t(n,e,t),n}return a},set(e,t,n,r){const o=at(e),s=at(r);if(o[fe]?.has(t)||o!==s)return b.set(e,t,n,r);const i=at(n);let c=nn;if(Reflect.has(s,t)){Object.getOwnPropertyDescriptor(s,t),Object.getOwnPropertyDescriptor(o,t);c=Ct(()=>Reflect.get(o,t,r))}if(Lt.has(e)&&("object"==typeof c&&null!==c&&Vt(c,e,t),"object"==typeof i&&null!==i)){_t(wn(i),e,t)}return c!==i&&b.set(e,t,i,r)&&fn(e,t,c,i,c!==nn),!0},has(t,n){if(gn.includes(t))throw new ye(`[reactive] Circular dependency detected in 'has' check for property '${String(n)}'`,{code:e.ReactiveErrorCode.CycleDetected,cycle:[]});gn.push(t),dn(t,n);const r=Reflect.has(t,n);return gn.pop(),r},deleteProperty(e,t){if(!Object.hasOwn(e,t))return!1;const n=e[t];return Lt.has(e)&&"object"==typeof n&&null!==n&&Vt(n,e,t),delete e[t],Yt(e,{type:"del",prop:t},t),Lt.has(e)&&Bt(e),!0},ownKeys:e=>(dn(e,le),Reflect.ownKeys(e))},mn=new WeakSet,bn=G(e=>class extends e{constructor(...e){return super(...e),mn.has(new.target)?vn(this):this}});function wn(e){if(!e||"object"!=typeof e)return e;const t=e;if(on(t))return t;if(ct.has(t))return t;const n=function(e){return it.get(e)}(t);if(void 0!==n)return n;const r=!(ce in t)||t instanceof t[ce]?t:new t[ce](t);r!==t&&function(e,t){ct.set(e,t)}(r,t);const o=new Proxy(r,yn);return function(e,t){it.set(e,t),ct.set(t,e)}(t,o),o}const vn=R({class(e){if(e.prototype instanceof bn)return mn.add(e),e;class t extends e{constructor(...n){return super(...n),new.target===t||mn.has(new.target)||me.warn(`${e.name} has been inherited by ${this.constructor.name} that is not reactive.\n@reactive decorator must be applied to the leaf class OR classes have to extend ReactiveBase.`),vn(this)}}return Object.defineProperty(t,"name",{value:`Reactive<${e.name}>`}),t},get:e=>wn(e),default:wn});function Sn(e,t,{immediate:n=!1}={}){if(null==e)return;if("object"!=typeof e)throw new Error("Target of deep watching must be an object");const r=je(()=>t(e),t);return It(()=>{Lt.add(e);let o=Ht.get(r);o||(o=new Set,Ht.set(r,o)),o.add(e);const s=new WeakSet;return function e(t,n=0){var r;if(!(!t||s.has(t)||(r=t,"object"!=typeof r||null===r)||n>me.maxDeepWatchDepth||on(t))){s.add(t),Lt.add(t),o.add(t);for(const r in at(t))if(Object.hasOwn(t,r)){const o=t[r];e("object"==typeof o&&null!==o?vn(o):o,n+1)}if(Array.isArray(t)||t instanceof Array){const r=t.length;for(let o=0;o<r;o++){const r=t[o];e("object"==typeof r&&null!==r?vn(r):r,n+1)}}else if(t instanceof Set)for(const r of t){e("object"==typeof r&&null!==r?vn(r):r,n+1)}else if(t instanceof Map)for(const[r,o]of t){e("object"==typeof o&&null!==o?vn(o):o,n+1)}}}(e),n&&t(e),n=!0,()=>{const e=Ht.get(r);if(e){for(const t of e){const e=qt.get(t);e?(e.delete(r),0===e.size&&(qt.delete(t),Lt.delete(t))):Lt.delete(t)}Ht.delete(r)}}})}const kn=Symbol("cleanup"),jn=Symbol("unset-yet");const Mn=R({class(e){rn(e)},default:function(e,...t){return"object"==typeof e?function(e){if(on(e=at(e)))return e;try{Object.defineProperty(e,ae,{value:!0,writable:!1,enumerable:!1,configurable:!0})}catch{}return ae in e||en.add(e),e}(e):n=>{n.prototype[fe]=new Set(n.prototype[fe]||[]),n.prototype[fe].add(e);for(const e of t)n.prototype[fe].add(e);return n}}});function On(e,t){return Object.defineProperty(e,kn,{value:t,writable:!1,enumerable:!1,configurable:!0})}const En=new WeakMap,xn=new WeakMap;function Rn(e,t){e.branches??(e.branches=new WeakMap);let n=e.branches.get(t);return n||(n={},e.branches.set(t,n)),n}function Tn(e){const t=Me(e),n=En.get(t);if(n)return n;const r={},o=je((...t)=>{const n=t;if(n.some(e=>!(e&&["object","symbol","function"].includes(typeof e))))throw new Error("memoize expects non-null object arguments");let o=r;for(const e of n)o=Rn(o,e);if(dn(o,"memoize"),"result"in o){if(me.onMemoizationDiscrepancy){const t=me.isVerificationRun;me.isVerificationRun=!0;try{const t=Ct(()=>e(...n));v(o.result,t)||me.onMemoizationDiscrepancy(o.result,t,e,n,"calculation")}finally{me.isVerificationRun=t}}return o.result}if(o.cleanup=Nt(()=>It(()=>(o.result=e(...n),()=>{delete o.result,Yt(o,{type:"invalidate",prop:n},"memoize"),o.cleanup&&(o.cleanup(),o.cleanup=void 0)}),{opaque:!0})),me.onMemoizationDiscrepancy){const t=me.isVerificationRun;me.isVerificationRun=!0;try{const t=Ct(()=>e(...n));v(o.result,t)||me.onMemoizationDiscrepancy(o.result,t,e,n,"comparison")}finally{me.isVerificationRun=t}}return o.result},e);return En.set(t,o),En.set(o,o),o}const Dn=R({getter:(e,t,n)=>function(){let r=xn.get(e);r||(r=je(m(t=>e.call(t),`${String(t?.constructor?.name??t?.name??"Object")}.${String(n)}`),{method:e,propertyKey:n,...e[pe]?{[pe]:e[pe]}:{}}),xn.set(e,r));return Tn(r)(this)},method:(e,t,n)=>function(...r){let o=xn.get(e);o||(o=je(m((t,...n)=>e.call(t,...n),`${String(t?.constructor?.name??t?.name??"Object")}.${String(n)}`),{method:e,propertyKey:n,...e[pe]?{[pe]:e[pe]}:{}}),xn.set(e,o));return Tn(o)(this,...r)},default:Tn});function*Pn(e){let t=e.next();for(;!t.done;)yield vn(t.value),t=e.next()}function*An(e){let t=e.next();for(;!t.done;){const[n,r]=t.value;yield[vn(n),vn(r)],t=e.next()}}let Wn=(()=>{var e,t,n,r,o,s,i,c,a;let f,l,u=[Mn],h=[],d=function(){class e extends(_(F,{get(e){return this[q](e)},set(e,t){this[H](e,t)},getLength(){return this.length},setLength(e){this.length=e}})){toArray(){return Array.from(this)}}return e}();var p,g,y;return l=class extends d{get[(t=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,s=new WeakMap,i=new WeakMap,c=new WeakMap,e=new WeakSet,V)](){return this.toArray()}constructor(a,f){let l;if(super(),e.add(this),t.set(this,void 0),n.set(this,void 0),r.set(this,void 0),o.set(this,new Map),s.set(this,new Map),i.set(this,new Set),c.set(this,void 0),It(({ascend:e})=>{l=e}),N(this,c,l,"f"),"function"!=typeof a)throw new Error("Register requires a key function");N(this,t,a,"f"),N(this,n,vn([]),"f"),N(this,r,vn(new Map),"f"),f&&this.push(...f)}ensureKey(n){let r=C(this,s,"f").get(n);if(r)return r.key;if(r={key:void 0},C(this,s,"f").set(n,r),C(this,c,"f").call(this,()=>{const o=It(({reaction:o})=>{const s=C(this,t,"f").call(this,n);this.assertValidKey(s);const i=r.key;o&&void 0!==i&&!Object.is(s,i)&&C(this,e,"m",a).call(this,n,i,s),r.key=s});r.stop=o,C(this,i,"f").add(o)}),void 0===r.key)throw new Error("Register key function must return a property key");return r.key}assertValidKey(e){const t=typeof e;if("string"!==t&&"number"!==t&&"symbol"!==t)throw new Error("Register key function must return a property key")}setKeyValue(e,t){const n=C(this,r,"f").get(e);void 0!==n&&n!==t&&this.cleanupValue(n),C(this,r,"f").set(e,t)}cleanupValue(e){const t=C(this,s,"f").get(e);if(!t)return;const n=t.stop;n&&(t.stop=void 0,C(this,i,"f").delete(n),n()),C(this,s,"f").delete(e)}disposeKeyEffects(){for(const e of Array.from(C(this,s,"f").keys()))this.cleanupValue(e);C(this,i,"f").clear()}incrementUsage(e){const t=C(this,o,"f").get(e)??0;C(this,o,"f").set(e,t+1)}decrementUsage(e){const t=C(this,o,"f").get(e);if(t)if(t<=1){const t=C(this,r,"f").get(e);C(this,o,"f").delete(e),C(this,r,"f").delete(e),void 0!==t&&this.cleanupValue(t)}else C(this,o,"f").set(e,t-1)}normalizeIndex(e,t=!1){const n=this.length;let r=e;if(r<0&&(r=Math.max(n+r,0)),r>n){if(!t)throw new RangeError("Index out of bounds");r=n}if(!t&&r===n)throw new RangeError("Index out of bounds");return r}assignAt(e,t,r){const o=C(this,n,"f")[e];void 0!==o&&Object.is(o,t)||(void 0!==o&&this.decrementUsage(o),C(this,n,"f")[e]=t,this.incrementUsage(t)),this.setKeyValue(t,r)}insertKeyValue(e,t,r){C(this,n,"f").splice(e,0,t),this.incrementUsage(t),this.setKeyValue(t,r)}rebuildFrom(e){this.disposeKeyEffects(),C(this,n,"f").splice(0,C(this,n,"f").length),C(this,o,"f").clear(),C(this,r,"f").clear();for(const t of e){const e=this.ensureKey(t);C(this,n,"f").push(e),this.incrementUsage(e),C(this,r,"f").set(e,t)}}get length(){return C(this,n,"f").length}[(a=function(e,t,i){if(Object.is(t,i))return;const c=C(this,r,"f").get(i);if(void 0!==c&&c!==e)throw new Error(`Register key collision for key ${String(i)}`);const a=C(this,o,"f").get(t);if(!a)return;const f=C(this,o,"f").get(i)??0;this.setKeyValue(i,e);for(let e=0;e<C(this,n,"f").length;e++)Object.is(C(this,n,"f")[e],t)&&(C(this,n,"f")[e]=i);C(this,o,"f").set(i,f+a),C(this,o,"f").delete(t),C(this,r,"f").delete(t);const l=C(this,s,"f").get(e);l&&(l.key=i)},q)](e){const t=C(this,n,"f")[e];return void 0===t?void 0:C(this,r,"f").get(t)}[H](e,t){const n=this.ensureKey(t);if(e===this.length)return void this.insertKeyValue(e,n,t);const r=this.normalizeIndex(e);this.assignAt(r,n,t)}push(...e){for(const t of e){const e=this.ensureKey(t);this.insertKeyValue(this.length,e,t)}return this.length}pop(){if(this.length)return this.removeAt(this.length-1)}shift(){if(this.length)return this.removeAt(0)}unshift(...e){let t=0;for(const n of e){const e=this.ensureKey(n);this.insertKeyValue(t++,e,n)}return this.length}splice(e,t,...o){const s=this.normalizeIndex(e,!0),i=this.length-s,c=Math.min(void 0===t?i:Math.max(t,0),i),a=[];for(const e of o)a.push(this.ensureKey(e));const f=C(this,n,"f").splice(s,c,...a),l=[];for(const e of f){if(void 0===e)continue;const t=C(this,r,"f").get(e);this.decrementUsage(e),l.push(t)}for(let e=0;e<a.length;e++){const t=a[e],n=o[e];this.incrementUsage(t),this.setKeyValue(t,n)}return l}clear(){C(this,n,"f").length=0,C(this,o,"f").clear(),C(this,r,"f").clear(),this.disposeKeyEffects()}get(e){return C(this,r,"f").get(e)}set(e,t){C(this,r,"f").has(e)&&this.setKeyValue(e,t)}remove(e){let t=this.indexOfKey(e);for(;-1!==t;)this.removeAt(t),t=this.indexOfKey(e)}removeAt(e){const[t]=C(this,n,"f").splice(e,1);if(void 0===t)return;const o=C(this,r,"f").get(t);return this.decrementUsage(t),o}keep(e){const t=new Map;for(const[o,s]of C(this,n,"f").entries()){if(t.has(s)){t.get(s)||this.removeAt(o);continue}const n=e(C(this,r,"f").get(s));t.set(s,n),n||this.removeAt(o)}}hasKey(e){return C(this,o,"f").has(e)}indexOfKey(e){return C(this,n,"f").indexOf(e)}mapKeys(){return C(this,r,"f").keys()}update(...e){for(const t of e){const e=this.ensureKey(t);C(this,r,"f").has(e)&&this.setKeyValue(e,t)}}upsert(e,...t){for(const n of t){const t=this.ensureKey(n);C(this,r,"f").has(t)?this.setKeyValue(t,n):e(n)}}entries(){const e=this;return function*(){for(let t=0;t<C(e,n,"f").length;t++){const o=C(e,r,"f").get(C(e,n,"f")[t]);void 0!==o&&(yield[t,o])}}()}[Symbol.iterator](){const e=this;return function*(){for(const t of C(e,n,"f")){const n=C(e,r,"f").get(t);void 0!==n&&(yield n)}}()}toString(){return`[Register length=${this.length}]`}at(e){const t=e<0?this.length+e:e;if(!(t<0||t>=this.length))return this[q](t)}reverse(){return C(this,n,"f").reverse(),this}sort(e){const t=e?(t,n)=>e(C(this,r,"f").get(t),C(this,r,"f").get(n)):void 0;return C(this,n,"f").sort(t),this}fill(e,t=0,n=this.length){const r=this.toArray();return r.fill(e,t,n),this.rebuildFrom(r),this}copyWithin(e,t,n){const r=this.toArray();return r.copyWithin(e,t,n),this.rebuildFrom(r),this}},p=l,"symbol"==typeof(g="RegisterClass")&&(g=g.description?"[".concat(g.description,"]"):""),Object.defineProperty(p,"name",{configurable:!0,value:y?"".concat(y," ",g):g}),(()=>{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;z(null,f={value:l},u,{kind:"class",name:l.name,metadata:e},null,h),l=f.value,e&&Object.defineProperty(l,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),I(l,h)})(),l})();const $n=Wn;const zn=new WeakMap;function In(){const e=st();return e?zn.get(e):void 0}function Cn(e){Object.defineProperty(e,"value",{get:e.get,set:e.set,configurable:!0,enumerable:!0})}function Nn(e,t,n,r){return r&&Object.defineProperty(e,ue,{value:r,writable:!1,enumerable:!1,configurable:!0}),On(e,()=>{n();for(const e of t.values())e?.();t.clear()})}function Kn(e,t){e=vn(e);const n=vn([]),r=new Map;function o(e){const t=r.get(e);t&&(r.delete(e),t(),Reflect.deleteProperty(n,e))}const s=In(),i=s?s.depth+1:0,c=It(function({ascend:c}){const a=e.length;!function(e){b.set(n,"length",e,n)}(a);const f=Array.from(r.keys());for(let o=0;o<a;o++)r.has(o)||c(()=>{const c=o,a=It(function(){const r=Ct(()=>n[c]),o={key:c,source:e,get:()=>b.get(e,c,e),set:t=>b.set(e,c,t,e),old:r};Cn(o);const s=t(o,n);n[c]=s});Ke(a,`project[${i}]:${c}`),zn.set(a,{source:e,key:c,target:n,depth:i,parent:s}),r.set(o,a)});for(const e of f)e>=a&&o(e)});return Nn(n,r,()=>c(),{source:e,target:n,apply:t,depth:i,parent:s})}function Ln(e,t){const n=vn(e),r=new Map,o=vn(r),s=new Map;function i(e){const t=s.get(e);t&&(t(),s.delete(e),o.delete(e))}const c=In(),a=c?c.depth+1:0,f=It(function({ascend:e}){const r=new Set;for(const e of n.mapKeys())r.add(e);for(const i of r)s.has(i)||e(()=>{const e=It(function(){const e=Ct(()=>o.get(i)),r={key:i,source:n,get:()=>n.get(i),set:e=>(n.set(i,e),!0),old:e};Cn(r);const s=t(r,o);o.set(i,s)});Ke(e,`project[${a}]:${String(i)}`),zn.set(e,{source:n,key:i,target:o,depth:a,parent:c}),s.set(i,e)});for(const e of Array.from(s.keys()))r.has(e)||i(e)});return Nn(o,s,()=>f(),{source:n,target:o,apply:t,depth:a,parent:c})}function qn(e,t){const n=vn(e),r=vn({}),o=new Map;function s(e){const t=o.get(e);t&&(t(),o.delete(e),Reflect.deleteProperty(r,e))}const i=In(),c=i?i.depth+1:0,a=It(function({ascend:e}){const a=new Set;for(const e in n)a.add(e);const f=Reflect.ownKeys(n);for(const e of f)a.add(e);for(const s of a)o.has(s)||e(()=>{const e=It(function(){const e=s,o=Ct(()=>r[s]),i={key:e,source:n,get:()=>b.get(n,e,n),set:t=>b.set(n,e,t,n),old:o};Cn(i);const c=t(i,r);r[e]=c});Ke(e,`project[${c}]:${String(s)}`),zn.set(e,{source:n,key:s,target:r,depth:c,parent:i}),o.set(s,e)});for(const e of Array.from(o.keys()))a.has(e)||s(e)});return Nn(r,o,()=>a(),{source:n,target:r,apply:t,depth:c,parent:i})}function Hn(e,t){const n=vn(e),r=new Map,o=vn(r),s=new Map;function i(e){const t=s.get(e);t&&(t(),s.delete(e),o.delete(e))}const c=In(),a=c?c.depth+1:0,f=It(function({ascend:e}){const r=new Set;for(const e of n.keys())r.add(e);for(const i of r)s.has(i)||e(()=>{const e=It(function(){const e=Ct(()=>o.get(i)),r={key:i,source:n,get:()=>n.get(i),set:e=>(n.set(i,e),!0),old:e};Cn(r);const s=t(r,o);o.set(i,s)});Ke(e,`project[${a}]:${String(i)}`),zn.set(e,{source:n,key:i,target:o,depth:a,parent:c}),s.set(i,e)});for(const e of Array.from(s.keys()))r.has(e)||i(e)});return Nn(o,s,()=>f(),{source:n,target:o,apply:t,depth:a,parent:c})}const _n=Object.assign(function(e,t){if(Array.isArray(e))return Kn(e,t);if(e instanceof Map)return Hn(e,t);if(e instanceof $n)return Ln(e,t);if(e&&(e.constructor===Object||void 0===e.constructor))return qn(e,t);throw new Error("Unsupported source type")},{array:Kn,register:Ln,record:qn,map:Hn});function*Vn(e,{length:t=!0}={}){t&&(yield"length"),yield e}function*Fn(e,t,{length:n=!1}={}){const r=Math.min(e,t),o=Math.max(e,t);n&&(yield"length");for(let e=r;e<=o;e++)yield e}class Bn extends Array{get(e){return dn(this,e),vn(this[e])}set(e,t){const n=e>=this.length;this[e]=t,Qt(this,{type:"set",prop:e},Vn(e,{length:n}))}getLength(){return dn(this,"length"),this.length}setLength(e){const t=this.length;try{this.length=e}finally{Qt(this,{type:"set",prop:"length"},Fn(t,e,{length:!0}))}}}const Un={get:b.get,set:b.set};Object.assign(b,{get(e,t,n){if(e instanceof Array&&"string"==typeof t){if("length"===t)return Bn.prototype.getLength.call(e);const n=parseInt(t);if(!Number.isNaN(n))return Bn.prototype.get.call(e,n)}return Un.get(e,t,n)},set(e,t,n,r){if(e instanceof Array&&"string"==typeof t){if("length"===t)return Bn.prototype.setLength.call(e,n);const r=parseInt(t);if(!Number.isNaN(r))return Bn.prototype.set.call(e,r,n)}return Un.set(e,t,n,r)}});class Xn extends Array{toJSON(){return this}get[Symbol.toStringTag](){return"ReactiveArray"}at(e){const t=e<0?this.length+e:e;if(dn(this,t),e<0&&dn(this,"length"),!(t<0||t>=this.length))return vn(this[t])}toReversed(){return dn(this),vn(this.toReversed())}toSorted(e){return dn(this),vn(this.toSorted(e))}toSpliced(e,t,...n){return dn(this),void 0===t?this.toSpliced(e):this.toSpliced(e,t,...n)}with(e,t){return dn(this),vn(this.with(e,t))}entries(){return dn(this),An(this.entries())}keys(){return dn(this,"length"),this.keys()}values(){return dn(this),Pn(this.values())}[Symbol.iterator](){dn(this);const e=this[Symbol.iterator]();return{next(){const t=e.next();return t.done?t:{value:vn(t.value),done:!1}},[Symbol.iterator](){return this},[Symbol.dispose](){}}}indexOf(e,t){const n=this.length;let r=void 0===t?0:t;r<0&&(r=Math.max(n+r,0));const o=at(e);for(;r<n;r++){dn(this,r);const t=this[r];if(t===e||t===o||at(t)===o)return r}return dn(this,"length"),-1}lastIndexOf(e,t){const n=this.length;let r=void 0===t?n-1:t;r>=n&&(r=n-1),r<0&&(r=Math.max(n+r,-1));const o=at(e);for(;r>=0;r--){dn(this,r);const t=this[r];if(t===e||t===o||at(t)===o)return r}return dn(this,"length"),-1}includes(e,t){return-1!==this.indexOf(e,t)}find(e,t){if("function"==typeof e){const n=e,r=this.length;for(let e=0;e<r;e++){dn(this,e);const r=vn(this[e]);if(n.call(t,r,e,this))return r}return void dn(this,"length")}const n="number"==typeof t?t:void 0,r=this.indexOf(e,n);if(-1!==r)return vn(this[r])}findIndex(e,t){if("function"==typeof e){const n=e,r=this.length;for(let e=0;e<r;e++){dn(this,e);const r=vn(this[e]);if(n.call(t,r,e,this))return e}return dn(this,"length"),-1}const n="number"==typeof t?t:void 0;return this.indexOf(e,n)}flat(e){return dn(this),vn(void 0===e?this.flat():this.flat(e))}flatMap(e,t){return dn(this),vn(this.flatMap((n,r,o)=>e.call(t,vn(n),r,o),t))}filter(e,t){return dn(this),vn(this.filter((t,n,r)=>e(vn(t),n,r),t))}map(e,t){return dn(this),vn(this.map((t,n,r)=>e(vn(t),n,r),t))}reduce(e,t){dn(this);const n=void 0===t?this.reduce(e):this.reduce(e,t);return vn(n)}reduceRight(e,t){dn(this);const n=void 0!==t?this.reduceRight(e,t):this.reduceRight(e);return vn(n)}slice(e,t){for(const n of Fn(e||0,t||this.length-1))dn(this,n);return void 0===e?this.slice():void 0===t?this.slice(e):this.slice(e,t)}concat(...e){return dn(this),vn(this.concat(...e))}join(e){return dn(this),this.join(e)}forEach(e,t){dn(this),this.forEach((n,r,o)=>{e.call(t,vn(n),r,o)})}every(e,t){const n=this.length;for(let r=0;r<n;r++)if(dn(this,r),!e.call(t,vn(this[r]),r,this))return!1;return dn(this,"length"),!0}some(e,t){const n=this.length;for(let r=0;r<n;r++)if(dn(this,r),e.call(t,vn(this[r]),r,this))return!0;return dn(this,"length"),!1}push(...e){const t=this.length;try{return this.push(...e)}finally{Qt(this,{type:"bunch",method:"push"},Fn(t,t+e.length-1,{length:!0}))}}pop(){if(0!==this.length)try{return vn(this.pop())}finally{Qt(this,{type:"bunch",method:"pop"},Vn(this.length))}}shift(){if(0!==this.length)try{return vn(this.shift())}finally{Qt(this,{type:"bunch",method:"shift"},Fn(0,this.length+1,{length:!0}))}}unshift(...e){try{return this.unshift(...e)}finally{Qt(this,{type:"bunch",method:"unshift"},Fn(0,this.length-e.length,{length:!0}))}}splice(e,t,...n){const r=this.length;let o=e;o=o<0?Math.max(r+o,0):Math.min(o,r);let s=t;s=void 0===s?r-o:Math.max(0,Math.min(s,r-o));try{return vn(void 0===t?this.splice(e):this.splice(e,t,...n))}finally{Qt(this,{type:"bunch",method:"splice"},s===n.length?Fn(o,o+s-1):Fn(o,r+Math.max(n.length-s,0),{length:!0}))}}reverse(){try{return this.reverse()}finally{Qt(this,{type:"bunch",method:"reverse"},Fn(0,this.length-1))}}sort(e){e=e||((e,t)=>e.toString().localeCompare(t.toString()));try{return this.sort((t,n)=>e(vn(t),vn(n)))}finally{Qt(this,{type:"bunch",method:"sort"},Fn(0,this.length-1))}}fill(e,t,n){const r=this.length;let o=void 0===t?0:t;o=o<0?Math.max(r+o,0):Math.min(o,r);let s=void 0===n?r:n;s=s<0?Math.max(r+s,0):Math.min(s,r);try{return void 0===t?this.fill(e):void 0===n?this.fill(e,t):this.fill(e,t,n)}finally{s>o&&Qt(this,{type:"bunch",method:"fill"},Fn(o,s-1))}}copyWithin(e,t,n){try{return void 0===n?this.copyWithin(e,t):this.copyWithin(e,t,n)}finally{const r=this.length;let o=e;o<0?o=Math.max(r+o,0):o>=r&&(o=r);let s=t;s<0?s=Math.max(r+s,0):s>=r&&(s=r);let i=void 0===n?r:n;i<0?i=Math.max(r+i,0):i>=r&&(i=r);const c=Math.min(i-s,r-o);c>0&&Qt(this,{type:"bunch",method:"copyWithin"},Fn(o,o+c-1))}}}class Zn extends WeakMap{get[Symbol.toStringTag](){return"ReactiveWeakMap"}delete(e){const t=this.has(e),n=this.delete(e);return t&&Yt(k(this),{type:"del",prop:e},e),n}get(e){return dn(k(this),e),vn(this.get(e))}has(e){return dn(k(this),e),this.has(e)}set(e,t){const n=this.has(e),r=this.get(e),o=vn(t);return this.set(e,o),n&&r===o||fn(k(this),e,r,o,n),this}}class Gn extends Map{get[Symbol.toStringTag](){return"ReactiveMap"}get size(){return dn(this,"size"),this.size}clear(){const e=this.size>0;if(this.clear(),e){const e={type:"bunch",method:"clear"};Yt(this,e,"size"),Qt(k(this),e)}}entries(){return dn(k(this)),An(this.entries())}forEach(e,t){dn(k(this)),this.forEach(e,t)}keys(){return dn(k(this)),this.keys()}values(){return dn(k(this)),Pn(this.values())}[Symbol.iterator](){dn(k(this));const e=this[Symbol.iterator]();return{next(){const t=e.next();return t.done?t:{value:[t.value[0],vn(t.value[1])],done:!1}},[Symbol.iterator](){return this},[Symbol.dispose](){}}}delete(e){const t=this.has(e),n=this.delete(e);if(t){const t={type:"del",prop:e};Yt(k(this),t,e),Yt(this,t,"size")}return n}get(e){return dn(k(this),e),vn(this.get(e))}has(e){return dn(k(this),e),this.has(e)}set(e,t){const n=this.has(e),r=this.get(e),o=vn(t);if(this.set(e,o),!n||r!==o){fn(k(this),e,r,o,n);Yt(this,{type:n?"set":"add",prop:e},"size")}return this}}class Jn extends WeakSet{get[Symbol.toStringTag](){return"ReactiveWeakSet"}add(e){const t=this.has(e);return this.add(e),t||Yt(k(this),{type:"add",prop:e},e),this}delete(e){const t=this.has(e),n=this.delete(e);return t&&Yt(k(this),{type:"del",prop:e},e),n}has(e){return dn(k(this),e),this.has(e)}}class Yn extends Set{get[Symbol.toStringTag](){return"ReactiveSet"}get size(){return dn(this,"size"),this.size}add(e){const t=this.has(e),n=vn(e);if(this.add(n),!t){const e={type:"add",prop:n};Yt(k(this),e,n),Yt(this,e,"size")}return this}clear(){const e=this.size>0;if(this.clear(),e){const e={type:"bunch",method:"clear"};Yt(this,e,"size"),Qt(k(this),e)}}delete(e){const t=this.has(e),n=this.delete(e);if(t){const t={type:"del",prop:e};Yt(k(this),t,e),Yt(this,t,"size")}return n}has(e){return dn(k(this),e),this.has(e)}entries(){return dn(k(this)),An(this.entries())}forEach(e,t){dn(k(this)),this.forEach(e,t)}keys(){return dn(k(this)),Pn(this.keys())}values(){return dn(k(this)),Pn(this.values())}[Symbol.iterator](){dn(k(this));const e=this[Symbol.iterator]();return{next(){const t=e.next();return t.done?t:{value:vn(t.value),done:!1}},[Symbol.iterator](){return this},[Symbol.dispose](){}}}}pn.set(Array,Xn.prototype),pn.set(Set,Yn.prototype),pn.set(WeakSet,Jn.prototype),pn.set(Map,Gn.prototype),pn.set(WeakMap,Zn.prototype);const Qn={objectToProxy:it,proxyToObject:ct,effectToReactiveObjects:be,watchers:we,objectParents:Kt,objectsWithDeepWatchers:Lt,deepWatchers:qt,effectToDeepWatchedObjects:Ht,nonReactiveObjects:en},er=[],tr=R({getter:(e,t,n)=>function(){const t=er.findIndex(e=>e.object===this&&e.prop===n);if(t>-1)throw new Error(`Circular dependency detected: ${er.slice(t).map(e=>`${e.object.constructor.name}.${String(e.prop)}`).join(" -> ")} -> again`);er.push({object:this,prop:n});try{const t=e.call(this);return nr(this,n,t),t}finally{er.pop()}}});function nr(e,t,n){Object.defineProperty(e,t,{value:n})}const rr=Object.assign(R({method:(e,t,n)=>function(...t){return rr.warn(this,n),e.apply(this,t)},getter:(e,t,n)=>function(){return rr.warn(this,n),e.call(this)},setter:(e,t,n)=>function(t){return rr.warn(this,n),e.call(this,t)},class:e=>class extends e{constructor(...e){super(...e),rr.warn(this,"constructor")}},default:e=>R({method:(t,n,r)=>function(...n){return rr.warn(this,r,e),t.apply(this,n)},getter:(t,n,r)=>function(){return rr.warn(this,r,e),t.call(this)},setter:(t,n,r)=>function(n){return rr.warn(this,r,e),t.call(this,n)},class:t=>class extends t{constructor(...t){super(...t),rr.warn(this,"constructor",e)}}})}),{warn:(e,t,n)=>{}});var or={version:"1.0.8"};const{version:sr}=or,ir="__MUTTS_INSTANCE__",cr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global&&global;if(cr){let e="mutts/index";const t=eval;try{if("undefined"!=typeof __filename)e=__filename;else{const n=t("import.meta");n&&n.url&&(e=n.url)}}catch(e){}const n={version:sr,source:e,timestamp:Date.now()};if(cr[ir]){const e=cr[ir];throw new Error(`[Mutts] Multiple instances detected!\nExisting instance: ${JSON.stringify(e,null,2)}\nNew instance: ${JSON.stringify(n,null,2)}\nThis usually happens when 'mutts' is both installed as a dependency and bundled, or when different versions are loaded. Please check your build configuration (aliases, externals) to ensure a single source of truth.`)}cr[ir]=n}e.AZone=Je,e.ArrayReadForward=F,e.DecoratorError=O,e.Destroyable=function(e,t){var n;return e&&"function"!=typeof e&&(t=e,e=void 0),e||(e=class{}),n=class extends e{static destroy(e){const t=n.destructors.get(e);if(!t)return!1;T.unregister(e[P]),n.destructors.delete(e),Object.setPrototypeOf(e,new Proxy({},W));for(const t of Object.getOwnPropertyNames(e))delete e[t];return t(),!0}static isDestroyable(e){return n.destructors.has(e)}constructor(...e){super(...e);const r={};this[P]=r;const o=t?.destructor??this[D];if(!o)throw new A("Destructor is not defined");function s(){o(r)}n.destructors.set(this,s),T.register(this,s,r)}},n.destructors=new WeakMap,n},e.DestructionError=A,e.Eventful=class{constructor(){K.set(this,new Map),L.set(this,[])}hook(e){return C(this,L,"f").includes(e)||C(this,L,"f").push(e),()=>{C(this,L,"f").splice(C(this,L,"f").indexOf(e),1)}}on(e,t){if("object"==typeof e)for(const t of Object.keys(e))this.on(t,e[t]);else if(void 0!==t){let n=C(this,K,"f").get(e);n||(n=[],C(this,K,"f").set(e,n)),n.push(t)}return()=>this.off(e,t)}off(e,t){if("object"==typeof e)for(const t of Object.keys(e))this.off(t,e[t]);else if(null!=t){const n=C(this,K,"f").get(e);n&&C(this,K,"f").set(e,n.filter(e=>e!==t))}else C(this,K,"f").delete(e)}emit(e,...t){const n=C(this,K,"f").get(e);if(n)for(const e of n)e.apply(this,t);for(const n of C(this,L,"f"))n.call(this,e,...t)}},e.FoolProof=b,e.Indexable=_,e.IterableWeakMap=X,e.IterableWeakSet=Z,e.ReactiveBase=bn,e.ReactiveError=ye,e.Register=$n,e.Zone=Ye,e.ZoneAggregator=et,e.ZoneHistory=Qe,e.addBatchCleanup=Tt,e.allocated=$,e.allocatedValues=P,e.arrayEquals=function(e,t){if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},e.asyncHook=e=>t.addHook(e),e.asyncHooks=t,e.asyncZone=tt,e.atomic=$t,e.biDi=function(e,t,n){"function"!=typeof t&&(n=t.set,t=t.get);let r=Symbol();return It(je(()=>{const n=t();at(n)!==r&&e(n)},e)),n?$t(e=>{r=at(e),n(e)}):()=>{}},e.buildReactivityGraph=Fe,e.cache=nr,e.cached=tr,e.callOnGC=function(e){let t=!1;const n=()=>{t||(t=!0,e())};return T.register(n,e,e),n},e.chainPromise=ie,e.cleanedBy=On,e.cleanup=kn,e.contentRef=k,e.debounce=function(e){return R({method(t,n,r){let o=null;return function(...n){o&&clearTimeout(o),o=setTimeout(()=>{t.apply(this,n),o=null},e)}}})},e.decorator=R,e.deepCompare=v,e.deepWatch=Sn,e.defer=Dt,e.deprecated=rr,e.derived=function(e){const t={value:void 0};return On(t,Ct(()=>It(function(n){t.value=e(n)})))},e.describe=function(e){return(...t)=>n=>class extends n{constructor(...n){super(...n);for(const n of t)Object.defineProperty(this,n,{...Object.getOwnPropertyDescriptor(this,n),...e})}}},e.destructor=D,e.effect=It,e.effectAggregator=rt,e.enableDevTools=function(){"undefined"!=typeof window&&(Ee||(Ee=!0,window.__MUTTS_DEVTOOLS__={getGraph:Fe,setEffectName:Ke,setObjectName:Le,registerEffect:qe,registerObject:He}))},e.forwardArray=V,e.getActivationLog=function(){return ht},e.getActiveEffect=st,e.getActiveProjection=In,e.getAt=q,e.getState=Gt,e.immutables=tn,e.isCached=function(e,t){return!!Object.getOwnPropertyDescriptor(e,t)},e.isConstructor=y,e.isDevtoolsEnabled=Be,e.isNonReactive=on,e.isOwnAccessor=w,e.isReactive=function(e){return ct.has(e)},e.legacyDecorator=E,e.memoize=Dn,e.mixin=G,e.modernDecorator=x,e.named=M,e.organize=function(e,t,n){return Object.defineProperty(e,t,{get:n.get,set:n.set,configurable:!0,enumerable:!0}),Yt(e,{type:"set",prop:t},t),()=>delete e[t]},e.organized=function(e,t,n={}){const r=vn(e),o=vn(n),s=new Map;function i(e){const t=s.get(e);t&&(s.delete(e),t())}const c=It(function({ascend:e}){const n=new Set;for(const e in r)n.add(e);for(const i of n)s.has(i)||e(()=>{const e=It(function(){const e=i,n={key:e,get:()=>b.get(r,e,r),set:t=>b.set(r,e,t,r)};return Object.defineProperty(n,"value",{get:n.get,set:n.set,configurable:!0,enumerable:!0}),t(n,o)});s.set(i,e)});for(const e of Array.from(s.keys()))n.has(e)||i(e)});return On(o,()=>{c();for(const e of Array.from(s.keys()))i(e)})},e.profileInfo=Qn,e.project=_n,e.reactive=vn,e.reactiveOptions=me,e.register=function(e,t){return new Wn(e,t)},e.registerEffectForDebug=qe,e.registerNativeReactivity=function(e,t){e.prototype[ce]=t,rn(t)},e.registerObjectForDebug=He,e.renamed=m,e.resolve=function(e){const t=vn([]);return On(t,It(()=>{const n=e();t.length!==n.length&&(t.length=n.length);for(let e=0;e<n.length;e++)t[e]!==n[e]&&(t[e]=n[e])}))},e.root=Nt,e.scan=function(e,t,n){const r=vn(e),o=vn([]),s=new Map,i=vn([]),c=new WeakMap;let a=(()=>{var e;let r,o=[];return e=class{constructor(e,t){this.val=(I(this,o),e),this.prev=t}get acc(){const e=this.prev?this.prev.acc:n;return t(e,this.val)}},(()=>{const t="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;r=[Dn],z(e,null,r,{kind:"getter",name:"acc",static:!1,private:!1,access:{has:e=>"acc"in e,get:e=>e.acc},metadata:t},null,o),t&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})})(),e})();function f(e){const t=s.get(e);t&&(t(),s.delete(e),Ct(()=>{Reflect.deleteProperty(i,e),Reflect.deleteProperty(o,e)}))}const l=It(function({ascend:e}){const t=r.length,n=new Map;let l;for(let f=0;f<t;f++){const t=b.get(r,f,r);if(!t||"object"!=typeof t&&"function"!=typeof t&&"symbol"!=typeof t)throw new Error("scan: items must be objects (WeakKey) for intermediate caching");const u=n.get(t)??0;n.set(t,u+1);let h=c.get(t);h||(h=[],c.set(t,h));let d=h[u];d?Ct(()=>d.prev)!==l&&(d.prev=l):(d=vn(new a(t,l)),h[u]=d),i[f]!==d&&(i[f]=d),s.has(f)||e(()=>{const e=f,t=It(function(){const t=i[e];if(t){const n=t.acc;Ct(()=>{o[e]=n})}});s.set(e,t)}),l=d}for(const e of Array.from(s.keys()))e>=t&&f(e);Ct(()=>{o.length!==t&&b.set(o,"length",t,o)})});return On(o,()=>{l();for(const e of s.values())e();s.clear()})},e.setAt=H,e.setEffectName=Ke,e.setObjectName=Le,e.tag=j,e.throttle=function(e){return R({method(t,n,r){let o=0,s=null;return function(...n){const r=Date.now();if(r-o>=e)return s&&(clearTimeout(s),s=null),o=r,t.apply(this,n);if(!s){const i=e-(r-o),c=[...n];s=setTimeout(()=>{o=Date.now(),t.apply(this,c),s=null},i)}}}})},e.touched=Qt,e.touched1=Yt,e.trackEffect=function(e){const t=st();if(!t)throw new Error("Not in an effect");pt.has(t)?pt.get(t).add(e):pt.set(t,new Set([e]))},e.unreactive=Mn,e.untracked=Ct,e.unwrap=at,e.watch=function(e,t,n={}){return"function"==typeof e?function(e,t,{immediate:n=!1,deep:r=!1}={}){let o,s=jn;const i=It(je(function(i){const c=e(i);s!==c&&(s===jn?n&&t(c):t(c,s)),s=c,r&&(o&&o(),o=Sn(c,e=>t(e,e)))},e));return()=>{i(),o&&o()}}(e,t,n):"object"==typeof e&&null!==e?function(e,t,{immediate:n=!1,deep:r=!1}={}){return r?Sn(e,t,{immediate:n}):It(function(){dn(e),n&&t(e),n=!0})}(e,t,n):(()=>{throw new Error("watch: value must be a function or an object")})()},e.zip=function(...e){if(!e.length)return[];const t=Math.min(...e.map(e=>e.length)),n=[];for(let r=0;r<t;r++){const t=e.map(e=>e[r]);n.push(t)}return n}});
2
2
  //# sourceMappingURL=mutts.umd.js.map