@jasonshimmy/custom-elements-runtime 3.7.2 → 3.7.4

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 (46) hide show
  1. package/dist/custom-elements-runtime.cjs.js +1 -1
  2. package/dist/custom-elements-runtime.es.js +3 -3
  3. package/dist/custom-elements-runtime.jit-css.cjs.js +1 -1
  4. package/dist/custom-elements-runtime.jit-css.es.js +2 -2
  5. package/dist/custom-elements-runtime.router.cjs.js +1 -1
  6. package/dist/custom-elements-runtime.router.cjs.js.map +1 -1
  7. package/dist/custom-elements-runtime.router.es.js +3 -3
  8. package/dist/custom-elements-runtime.router.es.js.map +1 -1
  9. package/dist/custom-elements-runtime.ssr-middleware.cjs.js +1 -1
  10. package/dist/custom-elements-runtime.ssr-middleware.es.js +1 -1
  11. package/dist/custom-elements-runtime.ssr.cjs.js +1 -1
  12. package/dist/custom-elements-runtime.ssr.es.js +2 -2
  13. package/dist/custom-elements-runtime.vite-plugin.cjs.js +1 -1
  14. package/dist/custom-elements-runtime.vite-plugin.es.js +1 -1
  15. package/dist/helpers-BQ37xfhc.cjs +5 -0
  16. package/dist/helpers-BQ37xfhc.cjs.map +1 -0
  17. package/dist/{helpers-BiGdX-3A.js → helpers-llht6g11.js} +5 -2
  18. package/dist/helpers-llht6g11.js.map +1 -0
  19. package/dist/{hooks-yP009oF9.js → hooks-BZwRvrjJ.js} +146 -131
  20. package/dist/hooks-BZwRvrjJ.js.map +1 -0
  21. package/dist/hooks-DTyLoDNI.cjs +2 -0
  22. package/dist/hooks-DTyLoDNI.cjs.map +1 -0
  23. package/dist/runtime/hooks.d.ts +0 -13
  24. package/dist/runtime/reactive.d.ts +1 -0
  25. package/dist/{ssr-CUT0FqUz.cjs → ssr-DkMl-vjb.cjs} +2 -2
  26. package/dist/{ssr-CUT0FqUz.cjs.map → ssr-DkMl-vjb.cjs.map} +1 -1
  27. package/dist/{ssr-COmrqY64.js → ssr-WD-KTNsB.js} +3 -3
  28. package/dist/{ssr-COmrqY64.js.map → ssr-WD-KTNsB.js.map} +1 -1
  29. package/dist/{tag-utils-CMy95A4Z.cjs → tag-utils-BiaxgxbY.cjs} +2 -2
  30. package/dist/{tag-utils-CMy95A4Z.cjs.map → tag-utils-BiaxgxbY.cjs.map} +1 -1
  31. package/dist/{tag-utils-DVutXfzj.js → tag-utils-DMHsC8t3.js} +2 -2
  32. package/dist/{tag-utils-DVutXfzj.js.map → tag-utils-DMHsC8t3.js.map} +1 -1
  33. package/dist/template-compiler-D3r3ajIB.cjs +19 -0
  34. package/dist/template-compiler-D3r3ajIB.cjs.map +1 -0
  35. package/dist/{template-compiler-BkR0G45f.js → template-compiler-D7BToKVe.js} +262 -252
  36. package/dist/template-compiler-D7BToKVe.js.map +1 -0
  37. package/package.json +1 -1
  38. package/dist/helpers-BiGdX-3A.js.map +0 -1
  39. package/dist/helpers-hGU9czPG.cjs +0 -5
  40. package/dist/helpers-hGU9czPG.cjs.map +0 -1
  41. package/dist/hooks-CACte2Ir.cjs +0 -2
  42. package/dist/hooks-CACte2Ir.cjs.map +0 -1
  43. package/dist/hooks-yP009oF9.js.map +0 -1
  44. package/dist/template-compiler-BkR0G45f.js.map +0 -1
  45. package/dist/template-compiler-EdgxOr6e.cjs +0 -19
  46. package/dist/template-compiler-EdgxOr6e.cjs.map +0 -1
@@ -1,19 +0,0 @@
1
- const e=require(`./logger-Dkht1dCX.cjs`),t=require(`./namespace-helpers-yYIb7INq.cjs`),n=require(`./helpers-hGU9czPG.cjs`),r=require(`./css-utils-CFeP8SK1.cjs`),i=require(`./custom-elements-runtime.directives.cjs.js`),a=require(`./custom-elements-runtime.transitions.cjs.js`),o=require(`./tag-utils-CMy95A4Z.cjs`),s=require(`./hooks-CACte2Ir.cjs`);function c(t,r,i){if(i)for(let[a,o]of Object.entries(i)){let i,s={};if(Array.isArray(o)?(i=o[0],s=o[1]||{}):i=o,r.set(a,{callback:i,options:s,oldValue:n.i(t,a)}),s.immediate)try{let e=n.i(t,a);i(e,void 0,t)}catch(t){e.t(`Error in immediate watcher for "${a}":`,t)}}}function l(t,r,i,a){let o=(e,t)=>{if(e===t)return!0;if(typeof e!=typeof t||typeof e!=`object`||!e||t===null)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length?e.every((e,n)=>o(e,t[n])):!1;let n=e,r=t,i=Object.keys(n||{}),a=Object.keys(r||{});return i.length===a.length?i.every(e=>o(n[e],r[e])):!1},s=r.get(i);if(s&&!o(a,s.oldValue))try{s.callback(a,s.oldValue,t),s.oldValue=a}catch(t){e.t(`Error in watcher for "${i}":`,t)}for(let[a,s]of r.entries())if(s.options.deep&&i.startsWith(a+`.`))try{let e=n.i(t,a);o(e,s.oldValue)||(s.callback(e,s.oldValue,t),s.oldValue=e)}catch(t){e.t(`Error in deep watcher for "${a}":`,t)}}function u(e,t){return t===Boolean?e===``||e===`true`:t===Number?Number(e):e}function d(e,t,r){if(t)for(let i in t){let a=t[i],o=n.p(i),s=e.getAttribute(o);if(a.type===Function&&typeof e[i]==`function`)r[i]=e[i];else if(s!==null)r[i]=u(s,a.type);else if(e[i]!==void 0)try{let t=e[i];if(a.type===String&&t&&typeof t==`object`)try{r[i]=u(String(t),a.type)}catch{r[i]=t}else a.type===Boolean&&typeof t==`boolean`||a.type===Number&&typeof t==`number`||a.type===Function&&typeof t==`function`?r[i]=t:r[i]=u(String(t),a.type)}catch{r[i]=e[i]}else `default`in a&&a.default!==void 0&&(r[i]=a.default)}}function f(e,t,r){if(!t.props){try{let t=r?._hookCallbacks?.props||{},i=Array.from(new Set([...Object.keys(e||{}),...Object.keys(t||{})]));for(let a of i){if(typeof a!=`string`||a.startsWith(`_`))continue;let i=Object.getOwnPropertyDescriptor(r,a);if(!(!Object.prototype.hasOwnProperty.call(t,a)&&i&&(i.get||i.set||!i.configurable)))try{Object.defineProperty(r,a,{enumerable:!0,configurable:!0,get(){try{let t=n.p(a),r=e.getAttribute(t);if(r!==null)return r;let i=e[a],o;return o=n._(i)||i&&typeof i==`object`&&`value`in i&&!(typeof Node<`u`&&i instanceof Node)?i.value:i,o}catch{return e[a]}}})}catch{}}}catch{}return}d(e,t.props,r)}function p(e,t,n,r){e.onConnected&&!n&&(e.onConnected(t),r(!0))}function m(e,t,n,r,i,a,o,s){e.onDisconnected&&e.onDisconnected(t),n.forEach(e=>e()),r(),i(),a(!1),o(null),s(!1)}function h(e,t,n,r,i){e.onAttributeChanged&&e.onAttributeChanged(t,n,r,i)}var g=class{static cleanupFunctions=new WeakMap;static addListener(e,t,n,r){e.addEventListener(t,n,r);let i={event:t,handler:n,wrapper:n,options:r,cleanup:()=>e.removeEventListener(t,n,r),addedAt:Date.now()};this.cleanupFunctions.has(e)||this.cleanupFunctions.set(e,[]),this.cleanupFunctions.get(e).push(i)}static removeListener(e,t,n,r){e.removeEventListener(t,n,r);let i=this.cleanupFunctions.get(e);if(i)for(let r=0;r<i.length;r++){let a=i[r];if(a.event===t&&a.handler===n){i.splice(r,1),i.length===0&&this.cleanupFunctions.delete(e);return}}}static cleanup(e){let t=this.cleanupFunctions.get(e);t&&(t.forEach(e=>{try{e.cleanup()}catch{}}),this.cleanupFunctions.delete(e))}static cleanupAll(){this.cleanupFunctions=new WeakMap}static hasListeners(e){let t=this.cleanupFunctions.get(e);return!!(t&&t.length>0)}static getListenerCount(e){let t=this.cleanupFunctions.get(e);return t?t.length:0}static getListenerInfo(e){let t=this.cleanupFunctions.get(e);return t?t.map(e=>({event:e.event,handler:e.handler,wrapper:e.wrapper,options:e.options})):[]}},_=class{map=new Map;maxSize;constructor(e){this.maxSize=Math.max(1,e)}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}set(e,t){if(this.map.has(e)&&this.map.delete(e),this.map.set(e,t),this.map.size>this.maxSize){let e=this.map.keys().next().value;this.map.delete(e)}}has(e){return this.map.has(e)}clear(){this.map.clear()}get size(){return this.map.size}},v=new _((()=>{if(typeof navigator<`u`&&`deviceMemory`in navigator){let e=navigator.deviceMemory;if(e)return Math.min(1e3,Math.max(200,e*100))}return(()=>{try{return globalThis.process?.env?.NODE_ENV===`test`}catch{return!1}})()?100:500})()),y=new Set(`true.false.null.undefined.typeof.instanceof.in.of.new.delete.void.throw.return.this.class.extends.import.export.from.as.async.await.yield.if.else.for.while.do.switch.case.break.continue.try.catch.finally.let.const.var.function.NaN.Infinity`.split(`.`)),b=class{static cache=new _(1e3);static dangerousPatterns=[/constructor/i,/prototype/i,/__proto__/i,/\bfunction\b/i,/eval/i,/import/i,/require/i,/window/i,/document/i,/global/i,/process/i,/setTimeout/i,/setInterval/i,/fetch/i,/XMLHttpRequest/i];static evaluate(t,n){let r=this.cache.get(t);if(r){if(!r.isSecure){e.r(`Blocked cached dangerous expression:`,t);return}return r.evaluator(n)}let i=this.createEvaluator(t);if(this.cache.set(t,i),!i.isSecure){e.r(`Blocked dangerous expression:`,t);return}return i.evaluator(n)}static createEvaluator(t){if(this.hasDangerousPatterns(t)||t.length>1e3)return{evaluator:()=>void 0,isSecure:!1};try{return{evaluator:this.createSafeEvaluator(t),isSecure:!0}}catch(n){return e.r(`Failed to create evaluator for expression:`,t,n),{evaluator:()=>void 0,isSecure:!1}}}static hasDangerousPatterns(e){return this.dangerousPatterns.some(t=>t.test(e))}static createSafeEvaluator(e){let t=e.trim();if(t.startsWith(`{`)&&t.endsWith(`}`))return this.createObjectEvaluator(e);if(/^ctx\.[a-zA-Z0-9_.]+$/.test(e.trim())){let t=e.trim().slice(4);return e=>n.i(e,t)}return e.includes(`ctx`)||/[+\-*/%<>=&|?:[\]]/.test(e)?this.createSimpleEvaluator(e):t=>n.i(t,e)}static createObjectEvaluator(e){let t=e.trim().slice(1,-1),r=this.parseObjectProperties(t);return e=>{let t={};for(let{key:i,value:a}of r)try{a.startsWith(`ctx.`)?t[i]=n.i(e,a.slice(4)):t[i]=this.evaluateSimpleValue(a,e)}catch{t[i]=void 0}return t}}static parseObjectProperties(e){let t=[],n=[],r=0,i=null,a=0;for(let t=0;t<e.length;t++){let o=e[t];if(i){if(o===`\\`){t++;continue}o===i&&(i=null)}else o===`"`||o===`'`?i=o:o===`(`||o===`[`||o===`{`?r++:o===`)`||o===`]`||o===`}`?r--:o===`,`&&r===0&&(n.push(e.slice(a,t)),a=t+1)}n.push(e.slice(a));for(let e of n){let n=-1,r=0,i=null;for(let t=0;t<e.length;t++){let a=e[t];if(i){if(a===`\\`){t++;continue}a===i&&(i=null)}else if(a===`"`||a===`'`)i=a;else if(a===`(`||a===`[`||a===`{`)r++;else if(a===`)`||a===`]`||a===`}`)r--;else if(a===`:`&&r===0){n=t;break}}if(n===-1)continue;let a=e.slice(0,n).trim(),o=e.slice(n+1).trim(),s=a.replace(/^['"]|['"]$/g,``);t.push({key:s,value:o})}return t}static createSimpleEvaluator(e){return t=>{try{let r=e,i=[];r=r.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,e=>`<<#${i.push(e)-1}#>>`);let a=r.match(/ctx\.[\w.]+/g)||[];for(let e of a){let a=n.i(t,e.slice(4));if(a===void 0)return;let o=i.push(JSON.stringify(a))-1;r=r.split(e).join(`<<#${o}#>>`)}let o=r.match(/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g)||[];for(let e of o){if(e.startsWith(`ctx.`))continue;let a=n.i(t,e);if(a===void 0)return;let o=i.push(JSON.stringify(a))-1;r=r.split(e).join(`<<#${o}#>>`)}let s=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g,c,l=new Set;for(;(c=s.exec(r))!==null;){let e=c[1];if(y.has(e)||/^[0-9]+$/.test(e)||e===`ctx`||l.has(e))continue;l.add(e);let a=n.i(t,e);if(a===void 0)return;let o=JSON.stringify(a),u=i.push(o)-1;r=e.includes(`.`)?r.split(e).join(`<<#${u}#>>`):r.replace(RegExp(`\\b`+e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)+`\\b`,`g`),`<<#${u}#>>`),s.lastIndex=0}r=r.replace(/<<#(\d+)#>>/g,(e,t)=>i[Number(t)]);try{return this.evaluateBasicExpression(r)}catch{return}}catch{return}}}static evaluateBasicExpression(e){let t=this.tokenize(e),n=0;function r(){return t[n]}function i(e){let r=t[n++];if(e&&!r)throw Error(`Unexpected token EOF, expected ${e}`);if(e&&r&&r.type!==e&&r.value!==e)throw Error(`Unexpected token ${r.type}/${r.value}, expected ${e}`);return r}function a(){return p()}function o(e){if(typeof e==`number`)return e;if(e==null)return NaN;if(typeof e==`boolean`)return e?1:0;let t=Number(e);return Number.isNaN(t)?NaN:t}function s(e,t){return typeof e==`string`||typeof t==`string`?String(e)+String(t):o(e)+o(t)}function c(e,t){return o(e)-o(t)}function l(e,t){return o(e)*o(t)}function u(e,t){return o(e)/o(t)}function d(e,t){return o(e)%o(t)}function f(e,t,n){if(typeof t==`number`&&typeof n==`number`)switch(e){case`>`:return t>n;case`<`:return t<n;case`>=`:return t>=n;case`<=`:return t<=n;default:return!1}let r=String(t),i=String(n);switch(e){case`>`:return r>i;case`<`:return r<i;case`>=`:return r>=i;case`<=`:return r<=i;default:return!1}}function p(){let e=m(),t=r();if(t&&t.value===`?`){i(`?`);let t=a();i(`:`);let n=a();return e?t:n}return e}function m(){let e=h();for(;;){let t=r();if(!t||t.value!==`||`)break;i(`OP`);let n=h();e||=n}return e}function h(){let e=g();for(;;){let t=r();if(!t||t.value!==`&&`)break;i(`OP`);let n=g();e&&=n}return e}function g(){let e=_();for(;;){let t=r();if(!t||![`==`,`!=`,`===`,`!==`].includes(t.value))break;let n=i(`OP`).value,a=_();switch(n){case`==`:e=e==a;break;case`!=`:e=e!=a;break;case`===`:e=e===a;break;case`!==`:e=e!==a;break}}return e}function _(){let e=v();for(;;){let t=r();if(!t||![`>`,`<`,`>=`,`<=`].includes(t.value))break;let n=i(`OP`).value,a=v();switch(n){case`>`:e=f(`>`,e,a);break;case`<`:e=f(`<`,e,a);break;case`>=`:e=f(`>=`,e,a);break;case`<=`:e=f(`<=`,e,a);break}}return e}function v(){let e=y();for(;;){let t=r();if(!t||t.value!==`+`&&t.value!==`-`)break;let n=i(`OP`).value,a=y();e=n===`+`?s(e,a):c(e,a)}return e}function y(){let e=b();for(;;){let t=r();if(!t||t.value!==`*`&&t.value!==`/`&&t.value!==`%`)break;let n=i(`OP`).value,a=b();switch(n){case`*`:e=l(e,a);break;case`/`:e=u(e,a);break;case`%`:e=d(e,a);break}}return e}function b(){let e=r();return e&&e.value===`!`?(i(`OP`),!b()):e&&e.value===`-`?(i(`OP`),c(0,b())):x()}function x(){let e=r();if(e){if(e.type===`NUMBER`)return i(`NUMBER`),Number(e.value);if(e.type===`STRING`)return i(`STRING`),e.value.slice(1,-1);if(e.type===`IDENT`)return i(`IDENT`),e.value===`true`?!0:e.value===`false`?!1:e.value===`null`?null:void 0;if(e.value===`[`){i(`PUNC`);let e=[];for(;;){let t=r();if(!t||t.value===`]`)break;e.push(a());let n=r();n&&n.value===`,`&&i(`PUNC`)}return i(`PUNC`),e}if(e.value===`(`){i(`PUNC`);let e=a();return i(`PUNC`),e}throw Error(`Unexpected token in expression`)}}return a()}static tokenize(e){let t=[],n=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g,r;for(;(r=n.exec(e))!==null;){let e=r[1];e&&(/^\d/.test(e)?t.push({type:`NUMBER`,value:e}):/^"/.test(e)||/^'/.test(e)?t.push({type:`STRING`,value:e}):/^[a-zA-Z_]/.test(e)?t.push({type:`IDENT`,value:e}):/^[()?:,[\]]$/.test(e)?t.push({type:`PUNC`,value:e}):t.push({type:`OP`,value:e}))}return t}static evaluateSimpleValue(e,t){return e===`true`?!0:e===`false`?!1:isNaN(Number(e))?e.startsWith(`ctx.`)?n.i(t,e.slice(4)):e.startsWith(`"`)&&e.endsWith(`"`)||e.startsWith(`'`)&&e.endsWith(`'`)?e.slice(1,-1):e:Number(e)}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}};function x(e,t){return Array.isArray(e)&&Array.isArray(t)?JSON.stringify([...e].sort())!==JSON.stringify([...t].sort()):e!==t}function S(e,t,r,i,a){if(e){let e=t.value;if(a&&typeof e==`object`&&e){let n={...e};n[a]=r,t.value=n}else t.value=r}else n.d(i._state||i,t,r)}function C(e,t,n,r){if(typeof e._requestRender==`function`&&e._requestRender(),typeof e._triggerWatchers==`function`){let i=t?`reactiveState`:n;e._triggerWatchers(i,r)}}function w(e,t,r){let i=`update:${n.p(t)}`,a=`update:${t}`,o=new CustomEvent(i,{detail:r,bubbles:!0,cancelable:!0}),s=new CustomEvent(a,{detail:r,bubbles:!0,cancelable:!0});e.dispatchEvent(o),e.dispatchEvent(s)}function T(e,r,i,a){let o=i;if(n.l(()=>{if(typeof e.setAttribute==`function`)try{e[r]=o}catch{}else e[r]=o}),o==null||typeof o==`string`||typeof o==`number`||typeof o==`boolean`){let i=n.u(o);i===null?n.l(()=>{typeof e.removeAttribute==`function`&&t.r(e,n.p(r))}):n.l(()=>{typeof e.setAttribute==`function`&&t.i(e,n.p(r),String(i))})}}function E(e,t,r,i){if(e){let e=t.value;return i&&typeof e==`object`&&e?e[i]:e}else return n.i(r._state||r,t)}function D(e){return typeof e==`object`&&!!e&&`value`in e}function O(e){return typeof e==`object`&&e&&`value`in e?e.value:e}function k(e,t,n){if(!e)return;e.attrs||={};let r=e.attrs;r[t]=n}function A(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement}function j(e){return typeof e==`object`&&e&&`value`in e?j(e.value):!(typeof e==`object`&&e||e===!1||e===`false`||e==null||e===0)}function ee(e){return e.substring(2,3).toLowerCase()+e.substring(3)}function M(e){return typeof e==`boolean`||e===`true`||e===`false`}function te(e,t,r,i,a,o,s,c){if(!o)return;let l=t.includes(`lazy`),u=t.includes(`trim`),d=t.includes(`number`),f=()=>{if(n._(e)){let t=e.value;return c&&s&&(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement)&&typeof t==`object`&&t?t[c]:t}return n.i(o?._state||o,e)},p=f(),m=`text`;s instanceof HTMLInputElement?m=i?.type||s.type||`text`:s instanceof HTMLSelectElement?m=`select`:s instanceof HTMLTextAreaElement&&(m=`textarea`);let h=s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement,_=h?m===`checkbox`||m===`radio`?`checked`:`value`:c??`modelValue`;if(m===`checkbox`)Array.isArray(p)?r[_]=p.includes(String(s?.getAttribute(`value`)??i?.value??``)):r[_]=p===(s?.getAttribute(`true-value`)??!0);else if(m===`radio`)r[_]=p===(i?.value??``);else if(m===`select`)if(s&&s.hasAttribute(`multiple`)&&s instanceof HTMLSelectElement){let e=Array.isArray(p)?p.map(String):[];queueMicrotask(()=>{Array.from(s.options).forEach(t=>{t.selected=e.includes(t.value)})}),r[_]=Array.isArray(p)?p:[]}else r[_]=p;else if(!h&&n._(e))r[_]=e;else{r[_]=p;try{let e=n.p(_);i&&(i[e]=p)}catch{}}let v=l||m===`checkbox`||m===`radio`||m===`select`?`change`:`input`,y=t=>{if(t.isComposing||a._isComposing)return;let r=globalThis.process,i=!!r&&r.env?.NODE_ENV===`test`||typeof window<`u`&&globalThis.__vitest__;if(t.isTrusted===!1&&!i)return;let s=t.target;if(!s||s._modelUpdating)return;let l=s.value;if(m===`checkbox`){let e=f();if(Array.isArray(e)){let t=s.getAttribute(`value`)??``,n=Array.from(e);if(s.checked)n.includes(t)||n.push(t);else{let e=n.indexOf(t);e>-1&&n.splice(e,1)}l=n}else{let e=s.getAttribute(`true-value`)??!0,t=s.getAttribute(`false-value`)??!1;l=s.checked?e:t}}else if(m===`radio`)l=s.getAttribute(`value`)??s.value;else if(m===`select`&&s.multiple)l=Array.from(s.selectedOptions).map(e=>e.value);else if(u&&typeof l==`string`&&(l=l.trim()),d){let e=Number(l);isNaN(e)||(l=e)}let p=f();if(x(l,p)){s._modelUpdating=!0;try{S(n._(e),e,l,o,c),C(o,n._(e),e,l),s&&w(s,_,l)}finally{queueMicrotask(()=>s._modelUpdating=!1)}}};if(h){if(a[v]){let e=a[v];s&&g.removeListener(s,v,e)}a[v]=y}else{let t=`update:${n.p(_)}`,r=`update:${_}`;if(a[t]){let e=a[t];s&&g.removeListener(s,t,e)}if(a[r]){let e=a[r];s&&g.removeListener(s,r,e)}if(a[t]=t=>{let r=t.detail,i=r===void 0?void 0:r;if(i===void 0){let e=t.target;if(e&&typeof e==`object`&&`value`in e)try{i=e.value}catch{i=void 0}}let a=E(n._(e),e,o,c);if(x(i,a)){S(n._(e),e,i,o,c),C(o,n._(e),e,i);let r=t.target;r&&T(r,_,n._(e)?e:i,n._(e))}},n._(e)&&typeof e.value==`object`&&e.value!==null){let i;try{i=Reflect.ownKeys(e.value)}catch{i=Object.keys(e.value)}let c=i.filter(e=>typeof e==`string`&&!String(e).startsWith(`_`)&&e!==`constructor`),l=new Set(c.map(e=>`update:${n.p(e)}`));for(let e of Object.keys(a))e.startsWith(`update:`)&&e!==t&&e!==r&&!l.has(e)&&(s&&g.removeListener(s,e,a[e]),delete a[e]);for(let r of c){let i=String(r),c=`update:${n.p(i)}`,l=`update:${i}`;c!==t&&(a[c]&&s&&(g.removeListener(s,c,a[c]),delete a[c]),a[c]=t=>{let r=t.detail===void 0?t.target?.value:t.detail;if(!x(r,n._(e)?e.value[i]:n.i(o?._state||o,e)))return;if(n._(e)){let t={...e.value};t[i]=r,e.value=t}else n.d(o?._state||o,e,r);C(o,n._(e),e,r);let a=t.currentTarget||s||t.target;a&&T(a,_,n._(e)?e:r,n._(e))},a[l]=a[c])}}a[r]=a[t]}(m===`text`||m===`textarea`)&&(a.compositionstart=()=>a._isComposing=!0,a.compositionend=t=>{a._isComposing=!1;let r=t.target;r&&queueMicrotask(()=>{let t=r.value,i=o?._state||o,a=n.i(i,e),s=t;if(u&&(s=s.trim()),d){let e=Number(s);isNaN(e)||(s=e)}if(x(s,a)){r._modelUpdating=!0;try{n.d(i,e,s),C(o,n._(e),e,s)}finally{queueMicrotask(()=>r._modelUpdating=!1)}}})})}function ne(e,t,r,i,a){if(typeof e==`object`&&e)for(let[i,o]of Object.entries(e))if(i.startsWith(`data-`)||i.startsWith(`aria-`)||i===`class`)r[i]=o;else if(i===`disabled`&&a&&A(a)){let e=o&&typeof o==`object`&&`value`in o;(()=>{try{return n._(o)}catch{return!1}})()||e?t[i]=o:r[i]=o}else t[i]=o;else if(typeof e==`string`){if(!i)return;try{let o=N(e,i);if(typeof o==`object`&&o){for(let[e,i]of Object.entries(o))if(e.startsWith(`data-`)||e.startsWith(`aria-`)||e===`class`)r[e]=i;else if(e===`disabled`&&a&&A(a)){let a=i&&typeof i==`object`&&`value`in i;(()=>{try{return n._(i)}catch{return!1}})()||a?t[e]=i:r[e]=i}else t[e]=i;return}else{r[e]=o;return}}catch{r[e]=n.i(i,e)}}}function re(e,t,n){let r;if(typeof e==`string`){if(!n)return;r=N(e,n)}else r=e;let i=String(t.style||``),a=i;if(!r)if(i){let e=String(i).split(`;`).filter(Boolean),t=e.findIndex(e=>e.trim().startsWith(`display:`));t>=0?e[t]=`display: none`:e.push(`display: none`),a=e.join(`; `)}else a=`display: none`;else if(i){let e=String(i).split(`;`).map(e=>e.trim()).filter(Boolean),t=e.findIndex(e=>e.startsWith(`display:`));t>=0&&e[t]===`display: none`&&(e.splice(t,1),a=e.length>0?e.join(`; `)+`;`:``)}a!==i&&(a?t.style=a:t.style=void 0)}function N(e,t){return b.evaluate(e,t)}function ie(e,t,r,i){let a;if(typeof e==`string`){if(!r)return;a=N(e,r)}else a=e;try{if(a&&typeof a==`object`){if(n._(a))a=a.value;else if(`value`in a&&a.value!==void 0){let e=a.value;e instanceof Node||(a=e)}}}catch{}let o=[];if(typeof a==`string`)o=[a];else if(Array.isArray(a))o=a.filter(Boolean);else if(typeof a==`object`&&a)for(let[e,t]of Object.entries(a))t&&o.push(e);let s=o.join(` `),c=i&&i.class||t.class||``,l=c?`${c} ${s}`.trim():s.trim();l?t.class=l:t.class=void 0}function ae(e,t,n){let r;if(typeof e==`string`){if(!n)return;r=N(e,n)}else r=e;let i=``;if(typeof r==`string`)i=r;else if(r&&typeof r==`object`){let e=[];for(let[t,n]of Object.entries(r))if(n!=null&&n!==``){let r=t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),i=[`width`,`height`,`top`,`right`,`bottom`,`left`,`margin`,`margin-top`,`margin-right`,`margin-bottom`,`margin-left`,`padding`,`padding-top`,`padding-right`,`padding-bottom`,`padding-left`,`font-size`,`line-height`,`border-width`,`border-radius`,`min-width`,`max-width`,`min-height`,`max-height`],a=String(n);typeof n==`number`&&i.includes(r)&&(a=`${n}px`),e.push(`${r}: ${a}`)}i=e.join(`; `)+(e.length>0?`;`:``)}let a=String(t.style||``);t.style=a+(a&&!a.endsWith(`;`)?`; `:``)+i}function oe(e,t,r){let i=e;typeof e==`string`&&r&&(i=N(e,r)),n._(i)?t.reactiveRef=i:t.ref=i}function se(e,t,r,i){let a={},o={...i||{}},s={};for(let[n,c]of Object.entries(e)){let{value:e,modifiers:l,arg:u}=c;if(n===`model`||n.startsWith(`model:`)){let i=n.split(`:`);te(e,l,a,o,s,t,r,i.length>1?i[1]:u);continue}switch(n){case`bind`:ne(e,a,o,t,r);break;case`show`:re(e,o,t);break;case`class`:ie(e,o,t,i);break;case`style`:ae(e,o,t);break;case`ref`:oe(e,a,t);break;case`when`:break}}try{if(Object.prototype.hasOwnProperty.call(a,`disabled`)&&r&&A(r)){let e=a.disabled,t=e&&typeof e==`object`&&`value`in e,r=!1;try{r=n._(e)}catch{r=!1}!t&&!r&&(o.disabled=e,delete a.disabled)}}catch{}return{props:a,attrs:o,listeners:s}}function P(e){return e?e.split(/\s+/).filter(Boolean):[]}function F(e,t){if(t.length===0)return;let n=t.filter(t=>t&&!e.classList.contains(t));n.length>0&&e.classList.add(...n)}function I(e,t){if(t.length===0)return;let n=t.filter(Boolean);n.length>0&&e.classList.remove(...n)}function ce(e){let t=window.getComputedStyle(e),n=t.transitionDuration||`0s`,r=t.transitionDelay||`0s`,i=e=>{let t=parseFloat(e);return e.includes(`ms`)?t:t*1e3};return i(n)+i(r)}function le(e,t){return new Promise(n=>{let r=t??ce(e);if(r<=0){n();return}let i=!1,a=()=>{i||(i=!0,e.removeEventListener(`transitionend`,o),e.removeEventListener(`transitioncancel`,o),n())},o=()=>a();e.addEventListener(`transitionend`,o),e.addEventListener(`transitioncancel`,o),setTimeout(a,r+50)})}async function L(t,n){let{classes:r,hooks:i,css:a,duration:o}=n;if(i?.onBeforeEnter)try{i.onBeforeEnter(t)}catch(t){e.t(`Transition onBeforeEnter error:`,t)}if(!a)return i?.onEnter?new Promise(n=>{let r=i.onEnter;typeof r==`function`?r(t,()=>{if(i?.onAfterEnter)try{i.onAfterEnter(t)}catch(t){e.t(`Transition onAfterEnter error:`,t)}n()}):n()}):void 0;let s=P(r?.enterFrom),c=P(r?.enterActive),l=P(r?.enterTo);F(t,s),t.offsetHeight,F(t,c),t.offsetHeight;let u;if(i?.onEnter){let n=new Promise(e=>{u=e});try{let e=i.onEnter;typeof e==`function`&&e(t,()=>{u&&u()})}catch(t){e.t(`Transition onEnter error:`,t)}u&&await n}await new Promise(e=>requestAnimationFrame(()=>e())),t.offsetHeight,I(t,s),F(t,l),t.offsetHeight,await new Promise(e=>requestAnimationFrame(()=>e()));let d;if(typeof o==`number`?d=o:o&&typeof o==`object`&&`enter`in o&&(d=o.enter),await le(t,d),I(t,c),i?.onAfterEnter)try{i.onAfterEnter(t)}catch(t){e.t(`Transition onAfterEnter error:`,t)}}async function R(t,n){let{classes:r,hooks:i,css:a,duration:o}=n;if(i?.onBeforeLeave)try{i.onBeforeLeave(t)}catch(t){e.t(`Transition onBeforeLeave error:`,t)}if(!a)return i?.onLeave?new Promise(n=>{let r=i.onLeave;typeof r==`function`?r(t,()=>{if(i?.onAfterLeave)try{i.onAfterLeave(t)}catch(t){e.t(`Transition onAfterLeave error:`,t)}n()}):n()}):void 0;let s=P(r?.leaveFrom),c=P(r?.leaveActive),l=P(r?.leaveTo);F(t,s),t.offsetHeight,F(t,c);let u;if(i?.onLeave){let n=new Promise(e=>{u=e});try{let e=i.onLeave;typeof e==`function`&&e(t,()=>{u&&u()})}catch(t){e.t(`Transition onLeave error:`,t)}u&&await n}await new Promise(e=>requestAnimationFrame(()=>e())),I(t,s),F(t,l);let d;if(typeof o==`number`?d=o:o&&typeof o==`object`&&`leave`in o&&(d=o.leave),await le(t,d),I(t,c),I(t,l),I(t,s),i?.onAfterLeave)try{i.onAfterLeave(t)}catch(t){e.t(`Transition onAfterLeave error:`,t)}}var ue=new WeakMap,de=new WeakMap;function z(e){if(!e)return;let t=ue.get(e);if(t!==void 0)return t;try{let t=e;if(t&&t.key!=null)return String(t.key)}catch{}if(e instanceof Element){let t=e.getAttribute(`data-anchor-key`);if(t)return t}}function B(e,r){try{ue.set(e,r)}catch{}try{e.key=r}catch{}try{if(e instanceof Element){let i=n.u(r);i!==null&&t.i(e,`data-anchor-key`,i)}}catch{}}function fe(e){if(!e)return;let t=de.get(e);if(t!==void 0)return t;try{let t=e;if(t&&t._transitionGroup!=null)return t._transitionGroup}catch{}}function pe(e,t){try{de.set(e,t)}catch{}try{e._transitionGroup=t}catch{}}var V=new WeakMap;function H(e,t){if(t){if(e instanceof Element){g.cleanup(e);let n=[];for(let r in t)t[r]===e&&n.push(r);for(let e of n)delete t[e]}if(e.hasChildNodes()){let n=e.childNodes;for(let e=n.length-1;e>=0;e--)H(n[e],t)}}}function U(e,t,r){if(typeof e==`string`)return;let i=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),a=e.props?.ref??(e.props?.props&&e.props.props.ref);if(i)try{if(n._(i)||typeof i==`object`&&`value`in i)i.value=t;else if(typeof i==`function`)i(t);else if(typeof i==`string`&&r)try{let e=String(i);r[e]=t}catch{}}catch{}else if(a&&r)try{let e=String(a);r[e]=t}catch{}}function W(e,t){if(Array.isArray(e)){let n=new Set,r=new Map;return e.map(e=>{if(!e||typeof e!=`object`)return e;let i=e.props?.key??e.key;if(!i){let n=e.tag||`node`,r=[e.props?.attrs?.id,e.props?.attrs?.name,e.props?.attrs?.[`data-key`],e.props?.props?.id,e.props?.props?.name,e.props?.props?.dataKey,e.props?.props?.[`data-key`]].find(e=>e!=null)??``;i=r?`${t}:${n}:${r}`:`${t}:${n}`}let a=i;if(n.has(a)){let e=(r.get(a)??1)+1;r.set(a,e),a=`${i}#${e}`}r.set(i,(r.get(i)??0)+1),n.add(a);let o=e.children;return Array.isArray(o)&&(o=W(o,a)),{...e,key:a,children:o}})}let n=e,r=n.props?.key??n.key??t,i=n.children;return Array.isArray(i)&&(i=W(i,r)),{...n,key:r,children:i}}function me(e,r,i,a){let o=i.directives??{},s=i.attrs?{...i.attrs}:{},c=se(o,a,e,s),l={...r.props||{},...i.props||{},...c.props||{}},u={...s||{},...c.attrs||{}},d=r.props??{},f=l,p=!!(i?.isCustomElement??r?.isCustomElement??!1),m=!1,h=new Set;for(let e in d)h.add(e);for(let e in f)h.add(e);for(let a of h){let o=d[a],s=f[a],c=o,l=s;if(n.l(()=>{n._(o)?c=o.peek():D(o)&&(c=o.value)}),n.l(()=>{n._(s)?l=s.peek():D(s)&&(l=s.value)}),!(o===s&&c===l))if(m=!0,a===`value`&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)){let t=O(s),n=t==null?``:String(t);e.value!==n&&(e.value=n)}else if(a===`checked`&&e instanceof HTMLInputElement)e.checked=!!O(s);else if(a.startsWith(`on`)&&typeof s==`function`){let t=ee(a);typeof o==`function`&&g.removeListener(e,t,o),typeof s==`function`&&g.addListener(e,t,s);try{if(t&&t.startsWith(`update:`)){let r=t.split(`:`,2)[1],i=f[r],a=[];try{if(n._(i)){let e=i.value;a=e&&typeof e==`object`?Object.keys(e):[]}else i&&typeof i==`object`&&(a=Object.keys(i))}catch{a=[]}let o=a.filter(e=>typeof e==`string`&&!e.startsWith(`_`)&&e!==`constructor`);for(let t of o){let a=`update:${t}`,o=e=>{let a=e.detail===void 0?e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement?e.target.value:void 0:e.detail,o={...n._(i)?i.value||{}:f[r]||{},[t]:a};try{typeof s==`function`&&s({detail:o})}catch{}};n.l(()=>{g.addListener(e,a,o)})}}}catch{}}else if(s==null)t.r(e,a);else{let n=i?.isCustomElement??r?.isCustomElement??!1;if(n||a in e)try{e[a]=s,a===`disabled`&&s===!1&&!n&&A(e)&&t.r(e,`disabled`)}catch{}else s===!1&&t.r(e,a)}}let _=c.listeners??{},v=V.get(e)??{};for(let[t,n]of Object.entries(v))g.removeListener(e,t,n);for(let[t,n]of Object.entries(_))g.addListener(e,t,n);Object.keys(_).length>0?V.set(e,_):V.delete(e);let y={...r.attrs??{}},b=u,x=c&&c.attrs||{};if(Object.prototype.hasOwnProperty.call(x,`class`)&&typeof e.getAttribute==`function`){let t=e.getAttribute(`class`);t!==null&&(y.class=t)}if(Object.prototype.hasOwnProperty.call(x,`style`)&&typeof e.getAttribute==`function`){let t=e.getAttribute(`style`);t!==null&&(y.style=t)}try{if(Object.prototype.hasOwnProperty.call(x,`class`)&&x.class===void 0&&typeof e.getAttribute==`function`){let t=e.getAttribute(`class`);t!==null&&(y.class=t)}if(Object.prototype.hasOwnProperty.call(x,`style`)&&x.style===void 0&&typeof e.getAttribute==`function`){let t=e.getAttribute(`style`);t!==null&&(y.style=t)}try{if(typeof e.getAttribute==`function`){let t=e.getAttribute(`class`);try{e instanceof HTMLInputElement&&e.type===`text`&&t!==null&&t!==y.class&&(y.class=t)}catch{}}}catch{}}catch{}for(let i in{...y,...b}){let a=y[i],o=b[i],s=a,c=o;if(n._(a)&&(s=a.peek()),n._(o)&&(c=o.peek()),s!==c)if(m=!0,c==null||c===!1)n.l(()=>{t.r(e,i)}),k(r,i,void 0),i===`value`&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement?n.l(()=>{e.value=``}):e instanceof HTMLProgressElement&&n.l(()=>{e.value=0})),i===`checked`&&e instanceof HTMLInputElement&&n.l(()=>{e.checked=!1}),i===`disabled`&&A(e)&&n.l(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=!1)});else{if(i===`value`){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){n.l(()=>{e.value=c??``});continue}else if(e instanceof HTMLSelectElement){n.l(()=>{e.value=c??``});continue}else if(e instanceof HTMLProgressElement){n.l(()=>{e.value=Number(c)});continue}}if(i===`checked`&&e instanceof HTMLInputElement){n.l(()=>{e.checked=!!c});continue}if(i===`style`){let a=n.u(c);a!==null&&t.i(e,i,String(a)),k(r,i,c);continue}if(i===`class`){let a=n.u(c);a!==null&&t.i(e,i,String(a)),k(r,i,c);continue}if(i===`disabled`&&A(e)){n.l(()=>{let t=j(c);(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=t)}),j(c)?n.l(()=>{t.i(e,i,``)}):n.l(()=>{t.r(e,i)});continue}let a=e.namespaceURI===`http://www.w3.org/2000/svg`;if(p&&!a&&i.includes(`-`))if(n.a(i)){let a=n.u(o??c);if(a!==null){try{t.i(e,i,String(a))}catch{}k(r,i,c)}}else{let a=n.f(i);try{let t=e;t[a]=n._(o)?o:c,k(r,i,c)}catch{let r=n.u(o??c);r!==null&&t.i(e,i,String(r))}}else if(!a&&i in e)try{let t=e;t[i]=n._(o)?o:c,k(r,i,c)}catch{let a=n.u(c);a!==null&&(t.i(e,i,String(a)),k(r,i,c))}else{let a=n.u(c);a!==null&&(t.i(e,i,String(a)),k(r,i,c))}}}try{if(A(e)){let r=l.disabled,i;try{let e=Object.prototype.hasOwnProperty.call(c.props||{},`disabled`),t=r&&typeof r==`object`&&`value`in r,a=!1;n.l(()=>{a=!!n._(r)});let o=M(r);i=a||t||e||o?r:u.disabled}catch{i=u.disabled}let a=j(i);n.l(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=a)}),a?n.l(()=>{t.i(e,`disabled`,``)}):n.l(()=>{t.r(e,`disabled`)})}}catch{}if(p&&m){let t=e;n.l(()=>{t._applyProps?.(t._cfg)}),n.l(()=>{typeof t.requestRender==`function`?t.requestRender():typeof t._render==`function`&&t._render?.(t._cfg)})}}function G(r,i,a,o=null){if(typeof r==`string`)return document.createTextNode(r);if(r.tag===`#text`){let e=document.createTextNode(typeof r.children==`string`?r.children:``);return r.key!=null&&B(e,r.key),e}if(r.tag===`#raw`){let t=typeof r.children==`string`?r.children:``;return e.r(`[#raw] Inserting unsanitized HTML. Ensure the content is trusted or sanitized before use — unsanitized input can lead to XSS vulnerabilities.`),document.createRange().createContextualFragment(t)}if(r.tag===`#anchor`){let e=r,t=Array.isArray(e.children)?e.children:[],n=document.createTextNode(``),s=document.createTextNode(``);e.key!=null&&(B(n,`${e.key}:start`),B(s,`${e.key}:end`)),e._startNode=n,e._endNode=s;let c=document.createDocumentFragment();c.appendChild(n);for(let n of t){let t=G(n,i,a,o);if(e.key!=null&&t instanceof Element&&!t.hasAttribute(`data-anchor-key`)){let r=n;r&&typeof r==`object`&&r.key!=null||B(t,String(e.key))}c.appendChild(t)}return c.appendChild(s),c}let s=r&&typeof r==`object`&&r.props&&r.props.attrs?r.props.attrs:void 0,c=(s&&typeof s.xmlns==`string`?String(s.xmlns):void 0)??o??t.n[r.tag]??null,l=c?document.createElementNS(c,r.tag):document.createElement(r.tag);r.key!=null&&B(l,r.key),r.props&&r.props?._transitionGroup&&pe(l,r.props?._transitionGroup);let{props:u={},attrs:d={},directives:f={}}=r.props??{},p=se(f,i,l instanceof HTMLElement?l:void 0,d),m={...u,...p.props},h={...d,...p.attrs};try{let e=n.u((h&&h.class)??(m&&m.class)??(r.props&&r.props.attrs&&r.props.attrs.class)??(r.props&&r.props.props&&r.props.props.class));if(e!==null){let n=String(e).trim();n&&t.i(l,`class`,n)}}catch{}try{if(m.disabled!==void 0&&l&&A(l)){let e=m.disabled,t=e&&typeof e==`object`&&`value`in e,r=!1;try{r=n._(e)}catch{r=!1}!t&&!r&&n.l(()=>{h.disabled=e,delete m.disabled})}}catch{}let _=l.namespaceURI===`http://www.w3.org/2000/svg`;for(let e in h){let i=h[e];if(typeof e!=`string`||/\[object Object\]/.test(e))continue;let a=O(i);if(typeof a==`boolean`)a?t.i(l,e,``):n.l(()=>{t.r(l,e)});else if(a!=null){if(e===`disabled`&&A(l)){let r=m.disabled,i=j(M(r)?r:a);n.l(()=>{l.disabled=i}),i?n.l(()=>{t.i(l,e,``)}):n.l(()=>{t.r(l,e)});continue}if(!_&&e===`value`&&(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement||l instanceof HTMLProgressElement))try{l instanceof HTMLProgressElement?l.value=Number(a):l.value=String(a??``)}catch{let r=n.u(a);r!==null&&t.i(l,e,String(r))}else if(!_&&e===`checked`&&l instanceof HTMLInputElement)try{l.checked=!!a}catch{let r=n.u(a);r!==null&&t.i(l,e,String(r))}else if(!_&&e in l)try{l[e]=a,e===`disabled`&&a===!1&&A(l)&&t.r(l,`disabled`),k(r.props,e,a)}catch{let r=n.u(a);r!==null&&t.i(l,e,String(r))}else if((r.props?.isCustomElement??!1)&&!_&&e.includes(`-`)){let r=n.f(e);try{l[r]=a}catch{let r=n.u(a);r!==null&&t.i(l,e,String(r))}}else{let r=n.u(a);r!==null&&t.i(l,e,String(r))}}}for(let e in m){let i=m[e];if(!(typeof e!=`string`||/\[object Object\]/.test(e)))if(e===`value`&&(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement)){let e=typeof i==`object`&&i&&D(i)?i.value:i;n.l(()=>{l.value=String(e??``)})}else if(e.startsWith(`on`)&&typeof i==`function`){let t=ee(e),n=t.includes(`:`)?(()=>{let e=t.split(`:`),n=e[1];if(n.includes(`-`)){let t=n.split(`-`).map((e,t)=>t===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join(``);return`${e[0]}:${t}`}else{let t=n.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();return`${e[0]}:${t}`}})():t;p.listeners&&(p.listeners[t]||p.listeners[n])||g.addListener(l,t,i)}else if(e.startsWith(`on`)&&i===void 0)continue;else if(i==null||i===!1)t.r(l,e);else{let a=r.props?.isCustomElement??!1,o=typeof i==`object`&&i&&n._(i)?i:D(i)&&i.value!==void 0?i.value:i;if(e===`class`||e===`style`){try{let r=n.u(o);r!==null&&t.i(l,e,String(r))}catch{}continue}if(a||e in l)try{let r=typeof i==`object`&&i&&n._(i)?i:D(i)?i.value:i;if(e===`disabled`&&A(l)){let i=j(m.disabled===void 0?r:m.disabled);n.l(()=>{l.disabled=i}),i?n.l(()=>{t.i(l,e,``)}):n.l(()=>{t.r(l,e)});continue}try{if(typeof l[e]==`boolean`){let t=r;t=typeof r==`string`?r===`false`?!1:r===`true`?!0:!!r&&r!==``:!!r,l[e]=t}else l[e]=r}catch{l[e]=r}}catch{}}}let v=p.listeners??{};for(let[e,t]of Object.entries(v))g.addListener(l,e,t);Object.keys(v).length>0&&V.set(l,v),U({...r,props:{...r.props,...p.props}},l,a);try{let e=l;if(typeof e._applyProps==`function`)try{e._applyProps(e._cfg)}catch{}typeof e.requestRender==`function`?e.requestRender():typeof e._render==`function`&&e._render(e._cfg)}catch{}if(Array.isArray(r.children)){let e=r.tag===`foreignObject`&&c===`http://www.w3.org/2000/svg`?null:l.namespaceURI??null;for(let t of r.children)l.appendChild(G(t,i,a,e))}else typeof r.children==`string`&&(l.textContent=r.children);try{if(l instanceof HTMLSelectElement&&h&&Object.prototype.hasOwnProperty.call(h,`value`))try{l.value=String(h.value??``)}catch{}}catch{}try{if(A(l)){let e=m.disabled,r=h.disabled,i=e&&typeof e==`object`&&`value`in e,a=!1;try{a=!!n._(e)}catch{a=!1}let o=j(a||i||M(e)?e:r);n.l(()=>{l.disabled=o}),o?n.l(()=>{t.i(l,`disabled`,``)}):n.l(()=>{t.r(l,`disabled`)})}}catch{}return l}function he(t,n,r,i,a){if(typeof r==`string`){t.textContent!==r&&(t.textContent=r);return}if(!Array.isArray(r))return;let o=t.childNodes,s=[];for(let e=0;e<o.length;e++)s.push(o[e]);let c=Array.isArray(n)?n:[],l=fe(t);if(l){let n=e=>{if(typeof e==`string`)return e.startsWith(`each-`)?e.substring(5):e;if(typeof e==`number`)return String(e)},a=[],o=[];for(let e of r)if(e&&e.tag===`#anchor`){let t=Array.isArray(e.children)?e.children:[];for(let r of t){let t=n(r.key??e.key??`unknown`);a.push({...r,key:t})}}else e&&a.push({...e,key:n(e.key)});for(let e of c)if(e&&e.tag===`#anchor`){let t=Array.isArray(e.children)?e.children:[];for(let r of t){let t=n(r.key??e.key??`unknown`);o.push({...r,key:t})}}else e&&o.push({...e,key:n(e.key)});if(a.some(e=>e&&e.key!=null)||o.some(e=>e&&e.key!=null)){let r=new Map,c=new Map;for(let e of o)if(e&&e.key!=null){let t=String(e.key);r.set(t,e)}for(let e=0;e<s.length;e++){let t=s[e],r=z(t);if(r=n(r),r!=null&&t instanceof Element&&t.nodeType===Node.ELEMENT_NODE){let e=typeof r==`string`&&r.includes(`:`)?r.substring(0,r.lastIndexOf(`:`)):r;e=String(e),c.set(e,t)}}let u=new Set,d=new Map,f=s.length>0;if(l.moveClass&&f)for(let e=0;e<s.length;e++){let t=s[e];if(t instanceof HTMLElement&&t.parentElement){let e=t.getBoundingClientRect();d.set(t,e)}}let p=[];for(let n of a){let a=n.key;if(a==null)continue;a=String(a);let o=r.get(a),s=c.get(a);if(s&&o){let e=K(s,o,n,i);u.add(s),B(e,String(a)),p.push({node:e,key:a,newVNode:n,oldVNode:o,isNew:!1})}else{s=G(n,i,void 0,t instanceof Element?t.namespaceURI??null:null),B(s,String(a)),t.appendChild(s);let r=f||l.appear===!0;s instanceof HTMLElement&&r&&L(s,l).catch(t=>{e.t(`Enter transition error:`,t)}),p.push({node:s,key:a,newVNode:n,isNew:!0})}}let m=[];for(let n=0;n<s.length;n++){let r=s[n],i=z(r);if(!u.has(r)&&i!=null&&r instanceof HTMLElement){let n=R(r,l).then(()=>{t.contains(r)&&t.removeChild(r)}).catch(n=>{e.t(`Leave transition error:`,n),t.contains(r)&&t.removeChild(r)});m.push(n)}}if(m.length===0){let e=t.firstChild;for(let{node:n}of p)n!==e&&t.insertBefore(n,e),e=n.nextSibling;if(l.moveClass&&d.size>0){let e=[];for(let{node:t,isNew:n}of p)if(!n&&t instanceof HTMLElement){let n=d.get(t);if(n){let r=t.getBoundingClientRect(),i=n.left-r.left,a=n.top-r.top;if(i!==0||a!==0){let n=l.moveClass.split(/\s+/).filter(e=>e);e.push({node:t,deltaX:i,deltaY:a,moveClasses:n})}}}if(e.length>0){for(let{node:t,deltaX:n,deltaY:r}of e)t.style.transform=`translate(${n}px, ${r}px)`,t.style.transitionProperty=`none`;t.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{for(let{node:t,moveClasses:n}of e)for(let e of n)t.classList.add(e);requestAnimationFrame(()=>{let t=l.moveClass||``,n=t.match(/duration-(\d+)/),r=n?`${n[1]}ms`:`300ms`,i=t.match(/ease-(out|in|in-out|linear)/),a=i?`ease-${i[1]}`:`ease-out`;for(let{node:t}of e)t.style.transition=`transform ${r} ${a}`;requestAnimationFrame(()=>{for(let{node:t,moveClasses:n}of e){t.style.removeProperty(`transform`);let e=()=>{for(let e of n)t.classList.remove(e);t.style.removeProperty(`transition`),t.removeEventListener(`transitionend`,e),t.removeEventListener(`transitioncancel`,e)};t.addEventListener(`transitionend`,e,{once:!0}),t.addEventListener(`transitioncancel`,e,{once:!0})}})})})})}}}return}}let u=new Map;for(let e of c)e&&e.key!=null&&u.set(e.key,e);let d=new Map;for(let e=0;e<s.length;e++){let t=s[e],n=z(t);n!=null&&d.set(n,t)}let f=new Set,p=t.firstChild;function m(e,t){let n=e;for(;n&&(f.add(n),n!==t);)n=n.nextSibling}function h(n,r,a,o,s,c=!0){let l=[],u=n.nextSibling;for(;u&&u!==r;)l.push(u),u=u.nextSibling;let d=Array.isArray(a)?a:[];if(o.some(e=>e&&e.key!=null)||d.some(e=>e&&e.key!=null)){let r=new Map,a=new Map;for(let e of d)e&&e.key!=null&&r.set(e.key,e);for(let e of l){let t=z(e);t!=null&&a.set(t,e)}let u=s&&s.state===`visible`&&d.length===0&&o.length>0,f=new Set,p=n.nextSibling;for(let n of o){if(typeof n==`object`&&n.tag===`#anchor`){let e=n.key,o=`${e}:start`,s=`${e}:end`,c=a.get(o),l=a.get(s),u=Array.isArray(n.children)?n.children:[],d=r.get(e),m,g;if(c&&l&&t.contains(c))m=c,g=l,h(m,g,d?.children,u);else{m=document.createTextNode(``),g=document.createTextNode(``),B(m,o),B(g,s),t.insertBefore(m,p);for(let e of u){let n=G(e,i,void 0,t instanceof Element?t.namespaceURI??null:null);t.insertBefore(n,p),f.add(n)}t.insertBefore(g,p)}let _=m;for(;_&&(f.add(_),_!==g);)_=_.nextSibling;n._startNode=m,n._endNode=g,p=g.nextSibling;continue}let o;if(n.key!=null&&a.has(n.key)){let c=r.get(n.key);o=K(a.get(n.key),c,n,i),f.add(o),s&&o instanceof HTMLElement&&u&&s.appear&&L(o,s).catch(t=>{e.t(`Transition enter error (appear):`,t)}),o!==p&&t.contains(o)&&t.insertBefore(o,p)}else o=G(n,i,void 0,t instanceof Element?t.namespaceURI??null:null),t.insertBefore(o,p),f.add(o),s&&o instanceof HTMLElement&&c&&L(o,s).catch(t=>{e.t(`Transition enter error:`,t)});p=o.nextSibling}for(let n of l)!f.has(n)&&t.contains(n)&&(s&&n instanceof HTMLElement&&c?R(n,s).then(()=>{t.contains(n)&&t.removeChild(n)}).catch(r=>{e.t(`Transition leave error:`,r),t.contains(n)&&t.removeChild(n)}):t.removeChild(n))}else{let n=Math.min(d.length,o.length);for(let e=0;e<n;e++){let n=d[e],r=o[e],a=K(l[e],n,r,i);a!==l[e]&&(t.insertBefore(a,l[e]),t.removeChild(l[e]))}for(let a=n;a<o.length;a++){let n=G(o[a],i,void 0,t instanceof Element?t.namespaceURI??null:null);t.insertBefore(n,r),s&&n instanceof HTMLElement&&c&&L(n,s).catch(t=>{e.t(`Transition enter error:`,t)})}for(let r=n;r<l.length;r++){let n=l[r];s&&n instanceof HTMLElement&&c?R(n,s).then(()=>{t.contains(n)&&t.removeChild(n)}).catch(r=>{e.t(`Transition leave error:`,r),t.contains(n)&&t.removeChild(n)}):t.removeChild(n)}}}for(let n of r){let r;if(n.tag===`#anchor`){let r=n.key,o=`${r}:start`,s=`${r}:end`,c=d.get(o),l=d.get(s),f=Array.isArray(n.children)?n.children:[];if(c||(c=document.createTextNode(``),B(c,o)),l||(l=document.createTextNode(``),B(l,s)),n._startNode=c,n._endNode=l,!t.contains(c)||!t.contains(l)){t.insertBefore(c,p);let r=n._transition,o=!(r&&r.state===`visible`&&f.length>0)||r.appear;for(let n of f){let s=G(n,i,a,t instanceof Element?t.namespaceURI??null:null);t.insertBefore(s,p),r&&s instanceof HTMLElement&&o&&L(s,r).catch(t=>{e.t(`Transition enter error:`,t)})}t.insertBefore(l,p)}else{let e=n._transition,t=u.get(r)._transition,i=t&&t.state!==e?.state,a=e&&e.state===`visible`&&f.length>0&&!i,o=i||!a||e?.appear===!0;h(c,l,u.get(r)?.children,f,e,o)}m(c,l),p=l.nextSibling;continue}if(n.key!=null&&d.has(n.key)){let e=u.get(n.key);r=K(d.get(n.key),e,n,i,a),f.add(r),r!==p&&t.contains(r)&&(p&&!t.contains(p)&&(p=null),t.insertBefore(r,p))}else r=G(n,i,a,t instanceof Element?t.namespaceURI??null:null),p&&!t.contains(p)&&(p=null),t.insertBefore(r,p),f.add(r);p=r.nextSibling}for(let e=0;e<s.length;e++){let n=s[e];!f.has(n)&&t.contains(n)&&(H(n,a),t.removeChild(n))}}function K(e,t,n,r,i){if(t&&typeof t!=`string`&&t.props?.ref&&i&&H(e,i),t===n)return e;if(typeof n==`string`){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==n&&(e.textContent=n),e;{let t=document.createTextNode(n);return e.parentNode?.replaceChild(t,e),t}}if(n&&typeof n!=`string`&&n.tag===`#anchor`){let t=n,a=Array.isArray(t.children)?t.children:[],o=t._startNode??document.createTextNode(``),s=t._endNode??document.createTextNode(``);t.key!=null&&(B(o,`${t.key}:start`),B(s,`${t.key}:end`)),t._startNode=o,t._endNode=s;let c=document.createDocumentFragment();c.appendChild(o);for(let t of a){let n=G(t,r,i,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);c.appendChild(n)}return c.appendChild(s),e.parentNode?.replaceChild(c,e),o}if(!n){H(e,i);let t=document.createComment(`removed`);return e.parentNode?.replaceChild(t,e),t}if(!t||typeof t==`string`){H(e,i);let t=G(n,r,i,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return U(n,t,i),e.parentNode?.replaceChild(t,e),t}if(n.tag===`#anchor`){let t=Array.isArray(n.children)?n.children:[],a=n._startNode??document.createTextNode(``),o=n._endNode??document.createTextNode(``);n.key!=null&&(B(a,`${n.key}:start`),B(o,`${n.key}:end`)),n._startNode=a,n._endNode=o;let s=document.createDocumentFragment();s.appendChild(a);for(let n of t)s.appendChild(G(n,r,i,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null));return s.appendChild(o),e.parentNode?.replaceChild(s,e),a}if(typeof t!=`string`&&typeof n!=`string`&&t.tag===n.tag&&t.key===n.key){let a=e;return me(a,t.props||{},n.props||{},r),he(a,t.children,n.children,r,i),U(n,a,i),a}if(typeof t!=`string`&&typeof n!=`string`&&t.tag===n.tag&&(t.tag&&String(t.tag).includes(`-`)||n.props&&n.props.isCustomElement||t.props&&t.props.isCustomElement))try{let a=e;return me(a,t.props||{},n.props||{},r),U(n,a,i),a}catch{}H(e,i);let a=G(n,r,i,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return U(n,a,i),e.parentNode?.replaceChild(a,e),a}function ge(e,t,n,r){let i;Array.isArray(t)?t.length===1?(i=t[0],i&&typeof i==`object`&&i.key==null&&(i={...i,key:`__root__`})):i={tag:`div`,key:`__root__`,children:t}:(i=t,i&&typeof i==`object`&&i.key==null&&(i={...i,key:`__root__`})),i&&typeof i==`object`&&i.tag===`#anchor`&&(i={tag:`div`,key:`__anchor_root__`,props:{attrs:{"data-anchor-block-root":``,key:`__anchor_root__`}},children:[i]}),i=W(i,String(i.key??`root`));let a=e._prevVNode??null,o=e._prevDom??e.firstChild??null,s;a&&o?typeof a!=`string`&&typeof i!=`string`&&a.tag===i.tag&&a.key===i.key?s=K(o,a,i,n,r):(s=G(i,n,r,e.host instanceof Element?e.host.namespaceURI??null:null),e.replaceChild(s,o)):(s=G(i,n,r,e.host instanceof Element?e.host.namespaceURI??null:null),e.firstChild?e.replaceChild(s,e.firstChild):e.appendChild(s));let c=[];for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes[t];n!==s&&n.nodeName!==`STYLE`&&(H(n,r),c.push(n))}c.forEach(t=>e.removeChild(t)),e._prevVNode=i&&typeof i==`object`&&i.props?{...i,props:{...i.props,attrs:i.props.attrs?{...i.props.attrs}:void 0,props:i.props.props?{...i.props.props}:void 0}}:i,e._prevDom=s}var q=[],_e=new WeakMap,J=new WeakMap,ve=new Map;function ye(e){if(typeof CSSStyleSheet>`u`||!(`replaceSync`in CSSStyleSheet.prototype))return null;let t=ve.get(e);if(t)return t;try{let t=new CSSStyleSheet;return t.replaceSync(e),ve.set(e,t),t}catch{return null}}function be(e,t){J.has(e)||J.set(e,new Set),J.get(e).add(t)}function xe(e,t){let n=J.get(e);n&&(n.delete(t),n.size===0&&J.delete(e))}function Se(t,n,r,i,a,o,s,c){if(t){q.push(r);try{let l=n.render(r);if(l instanceof Promise){o(!0);let n=t.host.isConnected,u=t,d=u._asyncRenderToken=(u._asyncRenderToken??0)+1;l.then(e=>{n&&!t.host.isConnected||u._asyncRenderToken===d&&(o(!1),s(null),Ce(t,e,r,i,a),c(t.innerHTML))}).catch(r=>{if(n&&!t.host.isConnected||u._asyncRenderToken!==d)return;o(!1);let i=r instanceof Error?r:Error(String(r));e.t(`[${t.host.tagName.toLowerCase()}] Async render error:`,i),s(i)});return}Ce(t,l,r,i,a),c(t.innerHTML)}catch(n){let r=n instanceof Error?n:Error(String(n));e.t(`[${t.host.tagName.toLowerCase()}] Render error:`,r),s(r)}finally{q.pop()}}}function Ce(e,t,n,r,i){e&&(ge(e,Array.isArray(t)?t:[t],n,r),i(e.innerHTML))}function we(t,r,i,a,o,s,c){s!==null&&clearTimeout(s);let l=Date.now()-r<16,{isVitest:u,isCypress:d,isTest:f}=n.T(),p=(u||f)&&!d;if(l){let t=i+1;o(t);let n=f?50:10,r=f?100:25,a=p?12:50;if(t===n&&!f)e.r(`⚠️ Component rendering frequently. Performance may be impacted.
2
- Common causes:
3
- • State updates during render cycle
4
- • Event handlers with immediate function calls
5
- • Missing effect dependencies`);else if(t===r&&!f)e.r(`⚠️ Component is re-rendering rapidly. Applying throttling.
6
- This might indicate:
7
- • Event handler calling function immediately: @click="\${fn()}" should be @click="\${fn}"
8
- • State modification during render
9
- • Missing dependencies in computed/watch`);else if(t>=a){e.t(`🛑 Infinite render loop detected. Stopping to prevent browser freeze.
10
- Possible causes:
11
- • State updates triggering immediate re-renders
12
- • Computed values changing during evaluation
13
- • Circular dependencies in reactive system`),c(null);return}}else o(0);let m=0;f||(i>=40?m=500:i>=25?m=100:i>=15&&(m=16));let h=()=>{a(Date.now());try{t()}catch(t){e.t(`Error during render execution:`,t)}finally{c(null)}};m>0?c(setTimeout(h,m)):f?h():(c({}),queueMicrotask(h))}function Te(e,t){let n=t;try{let t=J.get(e);if(t?.size)for(let e of t)try{let t=e.lastHtmlStringForJitCSS;t?.trim()&&(n+=`
14
- `+t)}catch{}else{let t=e.querySelectorAll(`*`);for(let e of t)try{let t=e.lastHtmlStringForJitCSS;t?.trim()&&(n+=`
15
- `+t)}catch{}}}catch{}return n}function Ee(e){return`adoptedStyleSheets`in e&&typeof CSSStyleSheet<`u`&&`replaceSync`in CSSStyleSheet.prototype}function De(e,n){let r=e.querySelector(`style[data-cer-runtime]`);r||(r=document.createElement(`style`),t.i(r,`data-cer-runtime`,`true`),e.appendChild(r));try{r.textContent=n}catch{}}function Oe(e,t,n,i,o){if(!e)return;let s=Te(e,n);if(_e.get(e)===s)return;_e.set(e,s);let c=r.r(e)?r.i(s):``,l=r.n(),u=t._computedStyle,d=Ee(e),f=a.getTransitionStyleSheet(),p=``;if(!d)try{f?.cssRules&&(p=Array.from(f.cssRules).map(e=>e.cssText).join(`
16
- `))}catch{p=``}if(!c?.trim()&&!u&&!l){if(o(null),d)e.adoptedStyleSheets=[r.u(),f];else{De(e,r.d(`${r.d(r.a)}\n${p}`));try{e.adoptedStyleSheets=[r.u(),f]}catch{}}return}let m=``;if(u&&(m+=u+`
17
- `),c&&(m+=c+`
18
- `),m=r.f(m),m=r.d(m),d){let t=!c?.trim()&&!!u,n;t?(n=ye(m),n||=new CSSStyleSheet):(n=i,n||=new CSSStyleSheet);try{t||n.replaceSync(m);let i=[r.u(),f];l&&i.push(l),i.push(n),e.adoptedStyleSheets=i,o(t?null:n);return}catch{}}De(e,r.d(`${r.d(r.a)}\n${p}\n${m}`));try{let t=[r.u(),f];if(l&&t.push(l),typeof CSSStyleSheet<`u`)try{let e=new CSSStyleSheet;e.replaceSync(m),t.push(e)}catch{t.push({cssRules:[],replaceSync:()=>{}})}e.adoptedStyleSheets=t}catch{}o(null)}function ke(r,i){if(!i.render)throw Error(`Component must have a render function`);return typeof window>`u`?class{constructor(){}}:class extends HTMLElement{context;_refs={};_listeners=[];_watchers=new Map;_renderTimeoutId=null;_mounted=!1;_hasError=!1;_initializing=!0;_componentId;_styleSheet=null;_lastHtmlStringForJitCSS=``;get lastHtmlStringForJitCSS(){return this._lastHtmlStringForJitCSS}get hasError(){return this._hasError}get isLoading(){return this._templateLoading}get lastError(){return this._templateError}_cfg;_lastRenderTime=0;_renderCount=0;_templateLoading=!1;_templateError=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:`open`}),this._cfg=t.o.get(r)||i,this._componentId=`${r}-${crypto.randomUUID()}`;let e=this._initContext(i),a=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!1,enumerable:!1,configurable:!1})};a(e,`refs`,this._refs),a(e,`requestRender`,()=>this.requestRender()),a(e,`_requestRender`,()=>this._requestRender()),a(e,`_componentId`,this._componentId),a(e,`_triggerWatchers`,(e,t)=>this._triggerWatchers(e,t)),this.context=e,n.l(()=>{a(e,`_host`,this)}),a(this.context,`emit`,(e,t,r)=>{let i={detail:t,bubbles:!0,composed:!0,...r||{}},a=new CustomEvent(e,i);this.dispatchEvent(a);let o=e.indexOf(`:`);if(o>0){let t=e.substring(0,o),r=e.substring(o+1),a=r.includes(`-`)?`${t}:${r.split(`-`).map((e,t)=>t===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join(``)}`:`${t}:${r.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}`;a!==e&&n.l(()=>{this.dispatchEvent(new CustomEvent(a,i))})}return!a.defaultPrevented});let o=t.o.get(r)||i;for(let e in o){let t=o[e];typeof t==`function`&&(this.context[e]=(...e)=>t(...e,this.context))}if(o.props)for(let e in o.props){let t=this[e];Object.defineProperty(this,e,{get(){return t},set(n){let r=t;t=n,this.context[e]=n,this._initializing||(this._applyProps(o),r!==n&&this._requestRender())},enumerable:!0,configurable:!0})}this._initializing=!1,this._initWatchers(o),this._applyProps(o),this._render(o)}connectedCallback(){this._runLogicWithinErrorBoundary(i,()=>{let e=this.getRootNode();e&&e!==document&&`host`in e&&be(e,this);let t=this.getAttribute(`data-cer-hydrate`);if(t!==`none`){if(t===`idle`){let e=()=>this._hydrateNow(i);typeof requestIdleCallback<`u`?requestIdleCallback(e):setTimeout(e,200);return}if(t===`visible`){new IntersectionObserver((e,t)=>{e.some(e=>e.isIntersecting)&&(t.disconnect(),this._hydrateNow(i))},{rootMargin:`0px`,threshold:0}).observe(this);return}this._applyProps(i),this._requestRender(),p(i,this.context,this._mounted,e=>{this._mounted=e})}})}_hydrateNow(e){this._runLogicWithinErrorBoundary(e,()=>{this._applyProps(e),this._requestRender(),p(e,this.context,this._mounted,e=>{this._mounted=e})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(i,()=>{let e=this.getRootNode();e&&e!==document&&`host`in e&&xe(e,this),m(i,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},e=>{this._templateLoading=e},e=>{this._templateError=e},e=>{this._mounted=e}),n.v.cleanup(this._componentId)})}attributeChangedCallback(e,t,n){this._runLogicWithinErrorBoundary(i,()=>{this._applyProps(i),t!==n&&this._requestRender(),h(i,e,t,n,this.context)})}static get observedAttributes(){return i.props?Object.keys(i.props).map(n.p):[]}_render(e){this._runLogicWithinErrorBoundary(e,()=>{Se(this.shadowRoot,e,this.context,this._refs,e=>{this._lastHtmlStringForJitCSS=e,typeof this.onHtmlStringUpdate==`function`&&this?.onHtmlStringUpdate?.(e)},e=>{this._templateLoading=e,this?.onLoadingStateChange?.(e)},e=>{this._templateError=e,this?.onErrorStateChange?.(e)},t=>this._applyStyle(e,t))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{n.O(()=>{we(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,e=>{this._lastRenderTime=e},e=>{this._renderCount=e},this._renderTimeoutId,e=>{this._renderTimeoutId=e})},this._componentId)})}_applyStyle(e,t){this._runLogicWithinErrorBoundary(e,()=>{Oe(this.shadowRoot,this.context,t,this._styleSheet,e=>{this._styleSheet=e})})}_runLogicWithinErrorBoundary(t,n){try{n(),this._hasError=!1}catch(n){this._hasError=!0;try{let r=this.tagName?.toLowerCase?.()||`<unknown>`,i=this._componentId||`<unknown-id>`,a={};if(t&&t.props)for(let e of Object.keys(t.props))try{let t=this.context[e];t instanceof Node?a[e]=`[DOM Node: ${t.nodeName}]`:typeof t==`object`&&t?a[e]=Object.keys(t).length>5?`[object(${Object.keys(t).length} keys)]`:t:a[e]=t}catch{a[e]=`[unreadable]`}e.t(`Error rendering component <${r}> (id=${i}):`,n),e.t(`Component props snapshot:`,a),e.r("Common causes: accessing properties of null/undefined inside template interpolations; expensive or throwing expressions inside templates that evaluate eagerly. Fixes: use optional chaining (obj?.prop), guard with ternary, or use the runtime lazy overload: when(cond, () => html`...`).")}catch{}if(t.onError&&t.onError(n,this.context),this.tagName.toLowerCase()!==`cer-error-boundary`){let e=this.parentElement;if(!e){let t=this.getRootNode();t instanceof ShadowRoot&&(e=t.host.parentElement)}for(;e;){if(e.tagName.toLowerCase()===`cer-error-boundary`){e._cerHandleChildError?.(n);break}let t=e.parentElement;if(!t){let n=e.getRootNode();n instanceof ShadowRoot&&(t=n.host.parentElement)}e=t}}}}_initContext(e){try{let t=this;function r(i,a=``){if(Array.isArray(i))return new Proxy(i,{get(r,i,o){let s=Reflect.get(r,i,o);return typeof s==`function`&&typeof i==`string`&&[`push`,`pop`,`shift`,`unshift`,`splice`,`sort`,`reverse`].includes(i)?function(...i){let o=s.apply(r,i);if(!t._initializing){let i=a||`root`;t._triggerWatchers(i,r),n.O(()=>t._render(e),t._componentId)}return o}:s},set(r,i,o){if(r[String(i)]=o,!t._initializing){let r=a?`${a}.${String(i)}`:String(i);t._triggerWatchers(r,o),n.O(()=>t._render(e),t._componentId)}return!0},deleteProperty(r,i){if(delete r[String(i)],!t._initializing){let r=a?`${a}.${String(i)}`:String(i);t._triggerWatchers(r,void 0),n.O(()=>t._render(e),t._componentId)}return!0}});if(i&&typeof i==`object`){if(n._(i))return i;for(let e in i){let t=a?`${a}.${e}`:e;i[e]=r(i[e],t)}return new Proxy(i,{set(i,o,s){let c=a?`${a}.${String(o)}`:String(o);return i[String(o)]=r(s,c),t._initializing||(t._triggerWatchers(c,i[String(o)]),n.O(()=>t._render(e),t._componentId)),!0},get(e,t,n){return Reflect.get(e,t,n)}})}return i}return r({...e.props?Object.fromEntries(Object.entries(e.props).map(([e,t])=>[e,t.default])):{}})}catch{return{}}}_initWatchers(e){this._runLogicWithinErrorBoundary(e,()=>{c(this.context,this._watchers,{})})}_triggerWatchers(e,t){l(this.context,this._watchers,e,t)}_applyProps(e){this._runLogicWithinErrorBoundary(e,()=>{f(this,e,this.context)})}}}function Y(t,n,r,i){for(let a of r)try{a(...i)}catch(r){e.t(`[${t}] Error in ${n} lifecycle hook:`,r)}}function Ae(r,a,c){t.a();let l=o.t(r),u={},d={props:{},hydrate:c?.hydrate,onConnected:t=>{if(u.onConnected)try{u.onConnected(t)}catch(t){e.t(`[${l}] Error in onConnected lifecycle hook:`,t)}},onDisconnected:t=>{if(u.onDisconnected)try{u.onDisconnected(t)}catch(t){e.t(`[${l}] Error in onDisconnected lifecycle hook:`,t)}},onAttributeChanged:(t,n,r,i)=>{if(u.onAttributeChanged)try{u.onAttributeChanged(t,n,r,i)}catch(t){e.t(`[${l}] Error in onAttributeChanged lifecycle hook:`,t)}},onError:(t,n)=>{if(u.onError&&t)try{u.onError(t,n)}catch(t){e.t(`[${l}] Error in onError handler (the error handler itself threw):`,t)}},render:e=>{let r=e,o=r._componentId||`${l}-${crypto.randomUUID()}`;n.v.setCurrentComponent(o,()=>{e.requestRender&&e.requestRender()});try{Object.defineProperty(e,`_hookCallbacks`,{value:{},writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,`_computedStyle`,{value:void 0,writable:!0,enumerable:!1,configurable:!0}),s.c(e),i.resetWhenCounter();let n;try{n=a()}catch(e){try{let t=r._hookCallbacks?.onError;if(Array.isArray(t))for(let n of t)try{n(e)}catch{}else if(typeof t==`function`)try{t(e)}catch{}}catch{}try{let t=r._host;if(t?.parentElement){let n=t.parentElement;for(;n;){if(n.tagName.toLowerCase()===`cer-error-boundary`){n._cerHandleChildError?.(e);break}let t=n.parentElement;if(!t){let e=n.getRootNode();typeof ShadowRoot<`u`&&e instanceof ShadowRoot&&(t=e.host.parentElement)}n=t}}}catch{}throw e}if(n==null)throw Error(`[${l}] Component render function did not return a value. Make sure your component returns an html\`...\` template.`);if(r._hookCallbacks){let e=r._hookCallbacks;if(e.onConnected){let t=e.onConnected;u.onConnected=e=>{Y(l,`useOnConnected`,t,[e])}}if(e.onDisconnected){let t=e.onDisconnected;u.onDisconnected=e=>{Y(l,`useOnDisconnected`,t,[e])}}if(e.onAttributeChanged){let t=e.onAttributeChanged;u.onAttributeChanged=(e,n,r,i)=>{Y(l,`useOnAttributeChanged`,t,[e,n,r,i])}}if(e.onError){let t=e.onError;u.onError=e=>{Y(l,`useOnError`,t,[e])}}if(e.props&&!Object.keys(d.props??{}).length){let n=e.props;d.props=Object.fromEntries(Object.entries(n).map(([e,t])=>[e,{type:typeof t==`boolean`?Boolean:typeof t==`number`?Number:typeof t==`string`?String:Function,default:t}])),t.o.set(l,d)}}return n}finally{s.t(),n.v.clearCurrentComponent()}}};if(t.o.set(l,d),typeof window<`u`){try{let r={_hookCallbacks:{},requestRender:()=>{},emit:()=>!0};s.c(r),n.S(),i.resetWhenCounter();try{a()}catch(t){try{let n=r?._hookCallbacks?.onError;if(Array.isArray(n))for(let e of n)try{e(t)}catch{}else if(typeof n==`function`)try{n(t)}catch{}e.t(`Error during component discovery render <${l}>:`,t),e.r(`Error occurred during initial component discovery render. Consider guarding expensive expressions or using lazy factories for directives like when().`)}catch{}throw t}finally{n.C(),s.t()}if(r._hookCallbacks?.props){let e=r._hookCallbacks.props;d.props=Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{type:typeof t==`boolean`?Boolean:typeof t==`number`?Number:typeof t==`string`?String:Function,default:t}])),t.o.set(l,d)}}catch(t){e.r(`[${l}] Failed to register component. Check your component definition for errors.`,t)}typeof customElements<`u`&&!customElements.get(l)&&customElements.define(l,ke(l,d))}}function X(e,t={},n,r){return{tag:e,key:r??t.key,props:t,children:n}}function Z(e){return!!e&&typeof e==`object`&&(e.type===`AnchorBlock`||e.tag===`#anchor`)}function Q(e){return typeof e==`object`&&!!e&&`tag`in e&&!Z(e)}function je(e,t){return e.key==null?{...e,key:t}:e}function Me(t,n){if(t==null){e.r(`⚠️ Event handler for '@${n}' is ${t}. This will prevent the event from working. Use a function reference instead: @${n}="\${functionName}"`);return}typeof t!=`function`&&e.r(`🚨 Potential infinite loop detected! Event handler for '@${n}' appears to be the result of a function call (${typeof t}) instead of a function reference. Change @${n}="\${functionName()}" to @${n}="\${functionName}" to pass the function reference instead of calling it immediately.`),t===void 0&&typeof t!=`function`&&e.r(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${n}="\${fn}" not @${n}="\${fn()}"`)}function Ne(e,t=[],r={}){let i={},a={},o={},s=[],c=/([:@#]?)([a-zA-Z0-9-:.]+)(?:\s*=\s*("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|([^\s>]+)))?/g,l;for(;l=c.exec(e);){let e=l[1],c=l[2],u=``;for(let e=3;e<l.length;e++)if(l[e]!==void 0){u=l[e];break}u.length>=2&&(u[0]===`"`&&u[u.length-1]===`"`||u[0]===`'`&&u[u.length-1]===`'`)&&(u=u.slice(1,-1));let d=!/=/.test(l[0]),f=u.match(/^{{(\d+)}}$/),p=!f&&/{{(\d+)}}/.test(u),m=d?!0:f?t[Number(f[1])]??null:p?u.replace(/{{(\d+)}}/g,(e,n)=>String(t[Number(n)]??``)):u;!f&&!p&&(m===`true`?m=!0:m===`false`?m=!1:m===`null`?m=null:isNaN(Number(m))||(m=Number(m)));let h=[`model`,`bind`,`show`,`class`,`style`,`ref`,`when`];if(e===`:`){let[e,t]=c.split(`:`),[r,...l]=e.split(`.`);if(h.includes(r)){let e=[...l],n=r===`model`&&t?`model:${t}`:r;o[n]={value:m,modifiers:e,arg:t}}else if(c===`disabled`){let e=m;e&&n._(e)&&(e=e.value);let t=typeof e;if(e===``||t===`boolean`||t===`string`&&(e===`true`||e===`false`)||e==null||t===`number`)i[c]=e;else{let e=m;e&&n._(e)&&(e=e.value),a[c]=e}s.push(c)}else{let e=m;e&&n._(e)&&(e=e.value),a[c]=e,s.push(c)}}else if(e===`@`){let[e,...t]=c.split(`.`),n=t;Me(m,e);let a=typeof m==`function`?m:typeof r[m]==`function`?r[m]:void 0;if(a){let t=r=>{if(n.includes(`prevent`)&&r.preventDefault(),n.includes(`stop`)&&r.stopPropagation(),!(n.includes(`self`)&&r.target!==r.currentTarget))return n.includes(`once`)&&r.currentTarget?.removeEventListener(e,t),a(r)},r=`on`+e.charAt(0).toUpperCase()+e.slice(1);i[r]=t}}else c===`ref`?i.ref=m:a[c]=m}return{props:i,attrs:a,directives:o,bound:s}}function $(e){if(!Q(e)||Z(e))return e;let t=e.props?.directives;if(t&&t.when){let r=t.when.value,i=n._(r)?r.value:r,a={...t};delete a.when;let o={...e.props};Object.keys(a).length>0?o.directives=a:delete o.directives;let s={...e,props:o};return Array.isArray(s.children)&&(s.children=s.children.map(e=>typeof e==`object`&&e?$(e):e)),{tag:`#anchor`,key:e.key==null?`when-${e.tag}`:`when-${e.key}`,children:i?[s]:[]}}if(Array.isArray(e.children)){let t=e.children.map(e=>typeof e==`object`&&e?$(e):e);return{...e,children:t}}return e}function Pe(e,t,r){let i=q.length>0?q[q.length-1]:void 0,a=r??i,o=!r&&t.length===0,s=o?e.join(`<!--TEMPLATE_DELIM-->`):null;if(o&&s){let e=v.get(s);if(e)return e}function c(e,t){return X(`#text`,{},e,t)}function l(e,t,r=!1){let i=typeof e==`string`?n.n(e):e;return!r&&typeof i==`string`&&/[\r\n]/.test(i)&&(i=i.replace(/\s+/g,` `)),X(`#text`,{},i,t)}let u=``;for(let n=0;n<e.length;n++)u+=e[n],n<t.length&&(u+=`{{${n}}}`);let d=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,f=[],p,m=[],h=null,g={},_,y=0,b=[],x=new Set([`pre`,`code`,`textarea`,`script`,`style`]);function S(){if(h&&x.has(h.toLowerCase()))return!0;for(let e of f)if(x.has(e.tag.toLowerCase()))return!0;return!1}function C(e){if(!e||typeof e!=`object`||Z(e))return;let t=e,n=g;if(t.props||t.attrs){let e=t;e.props&&(n.props||={},Object.assign(n.props,e.props)),e.attrs&&(n.attrs||={},Object.keys(e.attrs).forEach(t=>{if(t===`style`&&n.attrs.style){let t=String(n.attrs.style).replace(/;?\s*$/,``),r=String(e.attrs.style).replace(/^;?\s*/,``);n.attrs.style=t+`; `+r}else if(t===`class`&&n.attrs.class){let t=String(n.attrs.class).trim().split(/\s+/).filter(Boolean),r=String(e.attrs.class).trim().split(/\s+/).filter(Boolean),i=[...new Set([...t,...r])];n.attrs.class=i.join(` `)}else n.attrs[t]=e.attrs[t]}))}else n.props||={},Object.assign(n.props,t)}function w(e,t){let r=h?m:b;if(Z(e)){let n=e.key??t,i=e.children;r.push({...e,key:n,children:i});return}if(Q(e)){r.push(je(e,void 0));return}if(Array.isArray(e)){if(e.length===0)return;for(let i=0;i<e.length;i++){let a=e[i];Z(a)||Q(a)||Array.isArray(a)?w(a,`${t}-${i}`):typeof a==`object`&&a?n.o(a)?r.push(X(`#raw`,{},a.__rawHTML,`${t}-${i}`)):C(a):r.push(c(String(a),`${t}-${i}`))}return}if(typeof e==`object`&&e){if(n.o(e)){let n=e.__rawHTML??``;r.push(X(`#raw`,{},n,t));return}C(e);return}r.push(c(String(e),t))}let T=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);for(;p=d.exec(u);)if(!(p[0].startsWith(`<!--`)&&p[0].endsWith(`-->`))){if(p[1]){let e=p[1],r=p[0][1]===`/`,i=p[0][p[0].length-2]===`/`||T.has(e),{props:o,attrs:s,directives:c,bound:l}=Ne(p[2]||``,t,a??{}),u={props:{},attrs:{}};for(let e in o)u.props[e]=o[e];for(let e in s)u.attrs[e]=s[e];u.attrs&&Object.prototype.hasOwnProperty.call(u.attrs,`key`)&&!(u.props&&Object.prototype.hasOwnProperty.call(u.props,`key`))&&n.l(()=>{u.props.key=u.attrs.key});try{let t={input:[`value`,`checked`,`readonly`,`required`,`placeholder`,`maxlength`,`minlength`],textarea:[`value`,`readonly`,`required`,`placeholder`,`maxlength`,`minlength`],select:[`value`,`required`,`multiple`],option:[`selected`,`value`],video:[`muted`,`autoplay`,`controls`,`loop`,`playsinline`],audio:[`muted`,`autoplay`,`controls`,`loop`],img:[`src`,`alt`,`width`,`height`],button:[`type`,`name`,`value`,`autofocus`,`form`]},r=e.toLowerCase(),i=t[r]??[];if(u.attrs){for(let e of i)if(l&&l.includes(e)&&e in u.attrs&&!(u.props&&e in u.props)){let t=u.attrs[e];if(t&&n._(t))t=t.value,u.props[e]=t,delete u.attrs[e];else if(t&&typeof t==`object`&&`value`in t&&!(t instanceof Node))try{let n=t.value;u.props[e]=(r===`select`||r===`option`)&&e===`value`?String(n):n,delete u.attrs[e]}catch{}else{let n=typeof t;if(e===`disabled`)(t===``||n===`boolean`||n===`string`&&(t===`true`||t===`false`)||t==null||n===`number`)&&(u.props[e]=t,delete u.attrs[e]);else if(t===``||n===`string`||n===`number`||n===`boolean`||t==null){let n=(r===`select`||r===`option`)&&e===`value`?String(t):t;u.props[e]=n,delete u.attrs[e]}}}}if(e.includes(`-`)||a?.__customElements?.has?.(e)){if(u.isCustomElement=!0,l&&u.attrs){let e=new Set([`id`,`name`,`data-key`,`key`]);for(let t of l)if(t in u.attrs&&!(u.props&&t in u.props)){let r=t.includes(`-`)?n.f(t):t,i=u.attrs[t];if(u.props[r]=i,e.has(t)||n.a(t))try{let e=n.u(u.attrs[t]);e===null?delete u.attrs[t]:u.attrs[t]=e}catch{delete u.attrs[t]}else delete u.attrs[t]}}try{if(u.attrs&&!(u.props&&`modelValue`in u.props)){let e=u.attrs[`model-value`]??u.attrs.modelValue;e!==void 0&&(u.props.modelValue=e)}}catch{}}}catch{}if(c&&Object.keys(c).some(e=>e===`model`||e.startsWith(`model:`)))try{let t=globalThis[Symbol.for(`cer.registry`)],r=!!(t&&typeof t.has==`function`&&t.has(e)),i=a,o=!!(i&&(i.__customElements instanceof Set&&i.__customElements.has(e)||Array.isArray(i.__isCustomElements)&&i.__isCustomElements.includes(e)));if(e.includes(`-`)||o||r)for(let e of Object.keys(c)){if(e!==`model`&&!e.startsWith(`model:`))continue;let t=c[e],r=t.arg??(e.includes(`:`)?e.split(`:`,2)[1]:void 0),i=t.value,o=r??`modelValue`,s=n.i,l=n.d,d=a?._state||a,f;if(typeof i==`string`&&d)f=s(d,i);else if(f=i,n._(i))try{i.value}catch{}u.props[o]=f;try{let e=n.p(o);u.attrs||={},f!=null&&(typeof f==`string`||typeof f==`number`||typeof f==`boolean`)&&(u.attrs[e]=f)}catch{}u.isCustomElement=!0;let p=`update:${n.p(o)}`.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),m=`on`+p.charAt(0).toUpperCase()+p.slice(1);u.props[m]=function(e){let t=e.detail===void 0?e.target?e.target.value:void 0:e.detail;if(d)if(i&&n._(i)){let e=i.value;if(Array.isArray(t)&&Array.isArray(e)?JSON.stringify([...t].sort())!==JSON.stringify([...e].sort()):t!==e){i.value=t;try{let e=a;if(e){let t=e.requestRender,n=e._requestRender;typeof t==`function`?t():typeof n==`function`&&n()}}catch{}}}else{let e=s(d||{},typeof i==`string`?i:String(i));if(Array.isArray(t)&&Array.isArray(e)?JSON.stringify([...t].sort())!==JSON.stringify([...e].sort()):t!==e){l(d||{},typeof i==`string`?i:String(i),t);try{let e=a;if(e){let t=e.requestRender,n=e._requestRender;typeof t==`function`?t():typeof n==`function`&&n()}}catch{}}}},delete c[e]}}catch{}if(Object.keys(c).length>0&&(u.directives={...c}),r){let e=m.some(e=>typeof e==`object`&&e.tag!==`#text`),t=m;if(e&&m.length>0){let e=0;for(;e<m.length;){let t=m[e];if(!Q(t)||t.tag!==`#text`||typeof t.children!=`string`||t.children.trim()!==``)break;e++}let n=m.length-1;for(;n>=0;){let e=m[n];if(!Q(e)||e.tag!==`#text`||typeof e.children!=`string`||e.children.trim()!==``)break;n--}t=e===0&&n===m.length-1?m:e>n?[]:m.slice(e,n+1)}let n=X(h,g,t.length===1&&Q(t[0])&&t[0].tag===`#text`?typeof t[0].children==`string`?t[0].children:``:t.length?t:void 0,_),r=f.pop();r?(h=r.tag,g=r.props,_=r.key,m=r.children,m.push(n)):(b.push(n),h=null,g={},_=void 0,m=[])}else i?h?m.push(X(e,u,void 0,void 0)):b.push(X(e,u,void 0,void 0)):(h&&f.push({tag:h,props:g,children:m,key:_}),h=e,g=u,m=[])}else if(p[3]!==void 0){let e=Number(p[3]),n=t[e];w(n,`interp-${e}`)}else if(p[4]){let e=p[4],n=h?m:b,r=e.split(/({{\d+}})/);for(let e of r){if(!e)continue;let r=e.match(/^{{(\d+)}}$/);if(r){let e=Number(r[1]),n=t[e];w(n,`interp-${e}`)}else{let t=`text-${y++}`,r=S();n.push(l(e,t,r))}}}}let E=b.filter(e=>Q(e)&&e.tag===`#text`?typeof e.children==`string`&&e.children.trim()!==``:!0).map(e=>$(e));if(E.length===1){let e=E[0];return o&&s&&v.set(s,e),e}else if(E.length>1){let e=E;return o&&s&&v.set(s,e),e}return X(`div`,{},``,`fallback-root`)}function Fe(e,...t){if(n.w())return[];let r=t[t.length-1];return Pe(e,t,typeof r==`object`&&r&&!Array.isArray(r)?r:void 0)}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Fe}});
19
- //# sourceMappingURL=template-compiler-EdgxOr6e.cjs.map