create-prisma-php-app 5.1.0-alpha.11 → 5.1.0-alpha.13

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.
@@ -1 +1 @@
1
- var hi=Object.defineProperty,pi=(e,t,s)=>t in e?hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,m=(e,t,s)=>pi(e,"symbol"!=typeof t?t+"":t,s);class fi{constructor(e){m(this,"hooks",[]),m(this,"currentIndex",0),m(this,"onStateChange"),m(this,"pendingLayoutEffects",[]),m(this,"pendingEffects",[]),m(this,"currentEffectPhase",null),m(this,"pendingSynchronousRenderUpdate",!1),m(this,"pendingSynchronousLayoutUpdate",!1),m(this,"pendingUpdate",!1),m(this,"hasScheduledRender",!1),m(this,"batchedUpdates",new Set),m(this,"portalRegistrations",[]),m(this,"disposed",!1),this.onStateChange=e}loadState(e){this.hooks=[...e]}getHooks(){return this.hooks}prepareRender(){this.disposed||(this.currentIndex=0,this.pendingLayoutEffects=[],this.pendingEffects=[],this.currentEffectPhase=null,this.portalRegistrations=[])}startRenderPhase(){this.disposed||(this.currentEffectPhase="render")}finishRenderPhase(){"render"===this.currentEffectPhase&&(this.currentEffectPhase=null);const e=this.pendingSynchronousRenderUpdate;return this.pendingSynchronousRenderUpdate=!1,e&&this.batchedUpdates.clear(),e}runLayoutEffects(){if(this.disposed)return this.pendingLayoutEffects=[],!1;const e=this.pendingLayoutEffects;this.pendingLayoutEffects=[],this.currentEffectPhase="layout",e.forEach(e=>{var t;null==(t=e.previousCleanup)||t.call(e)}),e.forEach(e=>{const t=e.callback();this.hooks[e.hookIndex]={deps:e.deps,cleanup:"function"==typeof t?t:void 0,effectType:"layout"}}),this.currentEffectPhase=null;const t=this.pendingSynchronousLayoutUpdate;return this.pendingSynchronousLayoutUpdate=!1,t&&this.batchedUpdates.clear(),t}runEffects(){if(this.disposed)return void(this.pendingEffects=[]);const e=this.pendingEffects;this.pendingEffects=[],this.currentEffectPhase="effect",e.forEach(e=>{var t;null==(t=e.previousCleanup)||t.call(e)}),e.forEach(e=>{const t=e.callback();this.hooks[e.hookIndex]={deps:e.deps,cleanup:"function"==typeof t?t:void 0,effectType:"effect"}}),this.currentEffectPhase=null}dispose(){if(this.disposed)return;this.disposed=!0,this.pendingLayoutEffects=[],this.pendingEffects=[],this.pendingUpdate=!1,this.hasScheduledRender=!1,this.batchedUpdates.clear(),this.portalRegistrations=[];const e=e=>{const t=e.cleanup;if("function"==typeof t)try{t()}finally{e.cleanup=void 0}};this.hooks.forEach(t=>{!t||"object"!=typeof t||"layout"===t.effectType&&e(t)}),this.hooks.forEach(t=>{!t||"object"!=typeof t||"effect"===t.effectType&&e(t)}),this.hooks.forEach(t=>{!t||"object"!=typeof t||t.effectType||e(t)}),this.hooks=[],this.currentIndex=0}usePortal(e,t){const s=this.currentIndex++;void 0===this.hooks[s]&&(this.hooks[s]={sourceParent:null});const i=this.hooks[s];return this.portalRegistrations.push({ref:e,target:t??null,info:i}),i}getPortalRegistrations(){return this.portalRegistrations}useState(e){const t=this.currentIndex++;if(void 0===this.hooks[t]){const s=this.hooks,i=t,n=this.batchedUpdates,r=()=>this.scheduleUpdate(),a=e=>{const t=s[i];if(this.disposed||void 0===t)return;let a=e;"function"==typeof e&&(a=e(t.__state)),Object.is(t.__state,a)||(t.__state=a,n.add(i),r())};this.hooks[t]={__state:this.resolveInitialState(e),__setter:a}}const s=this.hooks[t];if("object"!=typeof s||null===s||!("__state"in s)){const e=s,i=this.hooks,n=t,r=this.batchedUpdates,a=()=>this.scheduleUpdate(),o=e=>{const t=i[n];if(this.disposed||void 0===t)return;let s=e;"function"==typeof e&&(s=e(t.__state)),Object.is(t.__state,s)||(t.__state=s,r.add(n),a())};this.hooks[t]={__state:e,__setter:o}}return[this.hooks[t].__state,this.hooks[t].__setter]}resolveInitialState(e){return"function"==typeof e?e():e}scheduleUpdate(){if(!this.disposed){if("render"===this.currentEffectPhase)return void(this.pendingSynchronousRenderUpdate=!0);if("layout"===this.currentEffectPhase)return void(this.pendingSynchronousLayoutUpdate=!0);this.hasScheduledRender=!0,this.pendingUpdate||(this.pendingUpdate=!0,queueMicrotask(()=>{if(this.pendingUpdate=!1,this.disposed)return this.hasScheduledRender=!1,void this.batchedUpdates.clear();this.hasScheduledRender&&(this.hasScheduledRender=!1,this.batchedUpdates.clear(),this.onStateChange())}))}}useRef(e=null){const t=this.currentIndex++;return void 0===this.hooks[t]&&(this.hooks[t]={current:e}),this.hooks[t]}useMemo(e,t){const s=this.currentIndex++,i=this.hooks[s];if(!i||this.areDepsDifferent(i.deps,t)){const i=e();return this.hooks[s]={value:i,deps:t},i}return i.value}useCallback(e,t){const s=this.currentIndex++,i=this.hooks[s];return!i||this.areDepsDifferent(i.deps,t)?(this.hooks[s]={callback:e,deps:t},e):i.callback}useReducer(e,t,s){const i=this.currentIndex++;if(void 0===this.hooks[i]){const n={state:s?s(t):t,reducer:e,dispatch:null};n.dispatch=e=>{if(this.disposed)return;const t=n.reducer(n.state,e);Object.is(n.state,t)||(n.state=t,this.scheduleUpdate())},this.hooks[i]=n}const n=this.hooks[i];return n.reducer=e,[n.state,n.dispatch]}useEffect(e,t){const s=this.currentIndex++,i=this.hooks[s];(!i||!t||!i.deps||this.areDepsDifferent(i.deps,t))&&this.pendingEffects.push({hookIndex:s,deps:t,callback:e,previousCleanup:"function"==typeof(null==i?void 0:i.cleanup)?i.cleanup:void 0})}useLayoutEffect(e,t){const s=this.currentIndex++,i=this.hooks[s];(!i||!t||!i.deps||this.areDepsDifferent(i.deps,t))&&this.pendingLayoutEffects.push({hookIndex:s,deps:t,callback:e,previousCleanup:"function"==typeof(null==i?void 0:i.cleanup)?i.cleanup:void 0})}areDepsDifferent(e,t){return e.length!==t.length||t.some((t,s)=>!Object.is(t,e[s]))}}class C{static saveState(e,t){e&&this.states.set(e,t)}static getState(e){return this.states.get(e)}static removeState(e){this.states.delete(e)}static saveScope(e,t){this.scopes.set(e,t)}static getScope(e){return this.scopes.get(e)}static getRootAncestor(e){let t=e;const s=new Set;for(;t&&!s.has(t);){s.add(t);const e=this.parents.get(t);if(!e)return t;t=e}return null}static resolveComponentId(e,t=null){if(!e)return null;if("app"!==e)return e;const s=new Set;let i=t,n=null;for(;i&&!s.has(i);){if(s.add(i),i.startsWith("page_"))return i;const e=this.parents.get(i)??null;if(!e){n=i;break}i=e}if(n)return n;for(const[e,t]of this.parents.entries())if(null===t&&this.scopes.has(e))return e;const r=this.scopes.keys().next().value;return"string"==typeof r?r:null}static getResolvedScope(e,t=null){const s=this.resolveComponentId(e,t);return s?this.scopes.get(s):void 0}static getResolvedScopeWithAncestors(e,t=null){const s=this.resolveComponentId(e,t);if(!s)return;const i=new Set,n=[];let r=s;for(;r&&!i.has(r);){i.add(r);const e=this.scopes.get(r);e&&n.push(e),r=this.parents.get(r)??null}return 0!==n.length?Object.assign({},...n.reverse()):void 0}static removeScope(e){this.scopes.delete(e)}static registerInstance(e,t){var s;const i=this.instances.get(e);i&&i!==t&&(null==(s=i.destroy)||s.call(i)),this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static removeInstance(e){this.instances.delete(e)}static saveParent(e,t){e&&this.parents.set(e,t)}static getParent(e){return this.parents.get(e)}static removeParent(e){if(!this.parents.has(e))return;const t=this.parents.get(e)??null;this.parents.forEach((s,i)=>{s===e&&this.parents.set(i,t)}),this.parents.delete(e)}static saveContextValues(e,t){const s=this.contextValues.get(e)??new Map,i=new Set;return s.forEach((e,s)=>{t.has(s)||i.add(s)}),t.forEach((e,t)=>{s.has(t)&&Object.is(s.get(t),e)||i.add(t)}),t.size>0?this.contextValues.set(e,new Map(t)):this.contextValues.delete(e),Array.from(i)}static resolveContext(e,t){let s=e;for(;s;){const e=this.contextValues.get(s);if(null!=e&&e.has(t))return{providerId:s,value:e.get(t)};s=this.parents.get(s)??null}return{providerId:null,value:t.defaultValue}}static updateContextDependencies(e,t){const s=new Set(t),i=this.consumerContexts.get(e)??new Set;i.forEach(t=>{s.has(t)||this.removeContextConsumer(t,e)}),s.forEach(t=>{i.has(t)||this.addContextConsumer(t,e)}),s.size>0?this.consumerContexts.set(e,s):this.consumerContexts.delete(e)}static getConsumersForContextsInSubtree(e,t){const s=new Set;for(const i of t){const t=this.contextConsumers.get(i);t&&t.forEach(t=>{t!==e&&this.isAncestor(e,t)&&s.add(t)})}return s}static removeContextTracking(e){const t=this.contextValues.get(e),s=t?this.getConsumersForContextsInSubtree(e,t.keys()):new Set;this.contextValues.delete(e);const i=this.consumerContexts.get(e);return i&&(i.forEach(t=>{this.removeContextConsumer(t,e)}),this.consumerContexts.delete(e)),this.removeParent(e),s}static saveTemplate(e,t){this.templates.has(e)||this.templates.set(e,t)}static getTemplate(e){return this.templates.get(e)}static saveOwnedTemplates(e,t){this.ownedTemplateData.has(e)||this.ownedTemplateData.set(e,t)}static getOwnedTemplates(e){return this.ownedTemplateData.get(e)}static clear(){this.states.clear(),this.scopes.clear(),this.instances.clear(),this.parents.clear(),this.templates.clear(),this.ownedTemplateData.clear(),this.contextValues.clear(),this.consumerContexts.clear(),this.contextConsumers.clear()}static getStats(){return{states:this.states.size,scopes:this.scopes.size,instances:this.instances.size,parents:this.parents.size,templates:this.templates.size,ownedData:this.ownedTemplateData.size,contextValues:this.contextValues.size,contextConsumers:this.contextConsumers.size}}static addContextConsumer(e,t){const s=this.contextConsumers.get(e)??new Set;s.add(t),this.contextConsumers.set(e,s)}static removeContextConsumer(e,t){const s=this.contextConsumers.get(e);s&&(s.delete(t),0===s.size&&this.contextConsumers.delete(e))}static isAncestor(e,t){let s=this.parents.get(t)??null;for(;s;){if(s===e)return!0;s=this.parents.get(s)??null}return!1}}m(C,"states",new Map),m(C,"scopes",new Map),m(C,"instances",new Map),m(C,"parents",new Map),m(C,"templates",new Map),m(C,"ownedTemplateData",new Map),m(C,"contextValues",new Map),m(C,"consumerContexts",new Map),m(C,"contextConsumers",new Map);const et=new Set(["class","for","while","if","else","return","function","var","let","const","import","export","this","debugger","delete","typeof","void","new","in","instanceof","do","try","catch","finally","switch","case","default","break","continue","yield","await","with","super","enum","extends","implements","interface","package","private","protected","public","static"]),di=new Set(["Array","Object","String","Number","Boolean","Math","JSON","Date","RegExp","Error","Map","Set","WeakMap","WeakSet","Promise","Symbol","BigInt","parseInt","parseFloat","isNaN","isFinite","encodeURI","decodeURI","encodeURIComponent","decodeURIComponent","console","window","document","undefined","null","NaN","Infinity","pp","true","false","setTimeout","setInterval","clearTimeout","clearInterval","requestAnimationFrame","cancelAnimationFrame","fetch","alert","confirm","prompt"]),wt=new Set(["hidden","disabled","checked","selected","readonly","required","open","autofocus","multiple","ismap","noValidate","defer","async","autoplay","controls","loop","muted","default","reversed","scoped","seamless","sortable","translate","draggable","contenteditable","spellcheck"]);function dt(e){return e.includes("-")?e.replace(/-([a-z])/g,e=>e[1].toUpperCase()):e}const mt=new WeakMap,mi=/^[A-Za-z_$][\w$]*$/;function gi(e){return mi.test(e)&&!et.has(e)}function me(e){const t=mt.get(e);if(t)return t;const s=Object.keys(e).filter(gi),i={keys:s,keySig:s.join("\0")};return mt.set(e,i),i}function ge(e,t){const s=new Array(t.length);for(let i=0;i<t.length;i++)s[i]=e[t[i]];return s}const de=new Map,xi=500;let Ge=null,Ve=null;function vi(e){Ve||(Ve=document.createElement("template")),Ve.innerHTML=e;const t=Array.from(Ve.content.childNodes).filter(e=>e.nodeType===Node.TEXT_NODE?(e.textContent??"").trim().length>0:e.nodeType===Node.ELEMENT_NODE);if(1!==t.length)return null;const s=t[0];return s instanceof HTMLTemplateElement&&s.hasAttribute("pp-owner")?s.innerHTML:null}function yi(e){let t=U(e),s=!1;for(;;){const e=vi(t);if(null===e)break;t=e,s=!0}return s?t:null}function kt(e){if(!e.includes("<textarea"))return e;const t=e.includes("pp-owner"),s=document.createElement("template");s.innerHTML=e;let i=!1;return s.content.querySelectorAll("textarea").forEach(e=>{const s=e;if(t){const e=yi(s.value);if(null!==e)return s.textContent=e,void(i=!0)}s.value.length>0&&0===s.value.trim().length&&(s.textContent="",i=!0)}),i?s.innerHTML:e}function U(e){if(!e.includes("&"))return e;if(de.has(e))return de.get(e);Ge||(Ge=document.createElement("textarea"));const t=Ge;t.innerHTML=e;let s=t.value,i=0;for(;s.includes("&")&&i++<10;){t.innerHTML=s;const e=t.value;if(e===s)break;s=e}if(de.size>=xi){const e=de.keys().next().value;void 0!==e&&de.delete(e)}return de.set(e,s),s}const ee="data-pp-fragment-root";function At(e){const t=String(e??"").trim().toLowerCase();switch(t){case"table":return{prefix:`<table ${ee}="">`,suffix:"</table>",rootSelector:`table[${ee}]`};case"thead":case"tbody":case"tfoot":return{prefix:`<table><${t} ${ee}="">`,suffix:`</${t}></table>`,rootSelector:`${t}[${ee}]`};case"tr":return{prefix:`<table><tbody><tr ${ee}="">`,suffix:"</tr></tbody></table>",rootSelector:`tr[${ee}]`};case"colgroup":return{prefix:`<table><colgroup ${ee}="">`,suffix:"</colgroup></table>",rootSelector:`colgroup[${ee}]`};default:return{prefix:"",suffix:"",rootSelector:null}}}function bi(e){const t=At(e);return{wrap:e=>`${t.prefix}${e}${t.suffix}`,unwrap:e=>{if(!t.prefix&&!t.suffix)return e;const s=document.createElement("template");if(s.innerHTML=e,t.rootSelector){const e=s.content.querySelector(t.rootSelector);if(e)return e.innerHTML}return e}}}function Me(e,t){const s=At(t),i=document.createElement("template");if(i.innerHTML=kt(`${s.prefix}${e}${s.suffix}`),!s.rootSelector)return{root:i.content,toHtml:()=>i.innerHTML};const n=i.content.querySelector(s.rootSelector);return n?(n.removeAttribute(ee),{root:n,toHtml:()=>n.innerHTML}):{root:i.content,toHtml:()=>i.innerHTML}}function _i(e,t){if(e===t)return!0;if(!e||!t||"object"!=typeof e||"object"!=typeof t)return!1;const s=Object.keys(e),i=s.length;let n=0;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&(n++,n>i))return!1;if(n!==i)return!1;for(let n=0;n<i;n++){const i=s[n];if(e[i]!==t[i])return!1}return!0}class Ci{constructor(e,t,s){m(this,"root"),m(this,"getScope"),m(this,"canBindElement"),m(this,"handlerCache",new Map),this.root=e,this.getScope=t,this.canBindElement=s??(e=>this.isRootOwnedElement(e))}clearCache(){this.handlerCache.clear()}resolveEventOwnerScope(e){const t=this.root.getAttribute("pp-component");return C.getResolvedScopeWithAncestors(e,t)}bindEvents(e){(e||this.fallbackCollectEventElements()).forEach(e=>{this.canBindElement(e)&&this.bindElementEvents(e)})}isRootOwnedElement(e){var t;if(e===this.root)return!0;let s=e.closest("[pp-component]");return e===s&&(s=(null==(t=e.parentElement)?void 0:t.closest("[pp-component]"))??null),s===this.root}bindElementEvents(e){const t=e.getAttribute("pp-event-owner");t&&e.removeAttribute("pp-event-owner");const s=[];Array.from(e.attributes).forEach(i=>{if(i.name.startsWith("on")&&!i.name.includes("-")){const n=i.name.slice(2).toLowerCase();let r=i.value.trim();const a=r.match(/^\{([\s\S]*)\}$/);a&&(r=a[1].trim()),s.push(i.name);const o=`__pp_bound_${n}`;if(e[o]===r)return;e[o]=r;const c=e[`__pp_handler_${n}`];c&&e.removeEventListener(n,c);const l=s=>{var i;if(t){const i=this.resolveEventOwnerScope(t);if(i)return void this.executeHandlerWithScope(r,s,i,e)}let n=e.closest("[pp-component]");n===e&&(n=(null==(i=e.parentElement)?void 0:i.closest("[pp-component]"))??null);const a=(null==n?void 0:n.getAttribute("pp-component"))||null;if(a){const t=C.getScope(a);if(t)return void this.executeHandlerWithScope(r,s,t,e)}this.executeHandler(r,s,e)};e[`__pp_handler_${n}`]=l,e.addEventListener(n,l)}}),s.forEach(t=>{e.removeAttribute(t)})}fallbackCollectEventElements(){const e=new Set,t=this.root.attributes;for(let s=0;s<t.length;s++)if(t[s].name.startsWith("on")&&!t[s].name.includes("-")){e.add(this.root);break}const s=this.root.querySelectorAll("*");for(let t=0;t<s.length;t++){const i=s[t],n=i.attributes;for(let t=0;t<n.length;t++)if(n[t].name.startsWith("on")&&!n[t].name.includes("-")){e.add(i);break}}return e}executeHandler(e,t,s){this.executeHandlerWithScope(e,t,this.getScope(),s)}executeHandlerWithScope(e,t,s,i){const n=me(s),r=n.keys,a=ge(s,r);try{const s=this.getCompiledHandler(e,r,n.keySig).call(i??t.currentTarget??null,...a,t);"function"==typeof s&&s(t)}catch(t){console.error("[PP-ERROR] Handler failed:",t),console.error("Code:",e)}}getCompiledHandler(e,t,s){const i=e+"|"+s;if(!this.handlerCache.has(i)){if(this.handlerCache.size>500){const e=this.handlerCache.keys().next().value;e&&this.handlerCache.delete(e)}const s="\n const e = event;\n const $event = event;\n const target = event?.target;\n const currentTarget = event?.currentTarget;\n const el = event?.currentTarget;\n ";let n;try{n=new Function(...t,"event",`"use strict";${s} return (${e})`)}catch{n=new Function(...t,"event",`"use strict";${s} ${e}`)}this.handlerCache.set(i,n)}return this.handlerCache.get(i)}}var Si=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],Tt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Ei="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Pt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Xe={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Qe="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",wi={5:Qe,"5module":Qe+" export import",6:Qe+" const class extends export import super"},ki=/^in(stanceof)?$/,Ai=new RegExp("["+Pt+"]"),Ti=new RegExp("["+Pt+Ei+"]");function tt(e,t){for(var s=65536,i=0;i<t.length;i+=2){if((s+=t[i])>e)return!1;if((s+=t[i+1])>=e)return!0}return!1}function Z(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&Ai.test(String.fromCharCode(e)):!1!==t&&tt(e,Tt)))}function ae(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&Ti.test(String.fromCharCode(e)):!1!==t&&(tt(e,Tt)||tt(e,Si)))))}var T=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function j(e,t){return new T(e,{beforeExpr:!0,binop:t})}var K={beforeExpr:!0},H={startsExpr:!0},at={};function w(e,t){return void 0===t&&(t={}),t.keyword=e,at[e]=new T(e,t)}var u={num:new T("num",H),regexp:new T("regexp",H),string:new T("string",H),name:new T("name",H),privateId:new T("privateId",H),eof:new T("eof"),bracketL:new T("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new T("]"),braceL:new T("{",{beforeExpr:!0,startsExpr:!0}),braceR:new T("}"),parenL:new T("(",{beforeExpr:!0,startsExpr:!0}),parenR:new T(")"),comma:new T(",",K),semi:new T(";",K),colon:new T(":",K),dot:new T("."),question:new T("?",K),questionDot:new T("?."),arrow:new T("=>",K),template:new T("template"),invalidTemplate:new T("invalidTemplate"),ellipsis:new T("...",K),backQuote:new T("`",H),dollarBraceL:new T("${",{beforeExpr:!0,startsExpr:!0}),eq:new T("=",{beforeExpr:!0,isAssign:!0}),assign:new T("_=",{beforeExpr:!0,isAssign:!0}),incDec:new T("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new T("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:j("||",1),logicalAND:j("&&",2),bitwiseOR:j("|",3),bitwiseXOR:j("^",4),bitwiseAND:j("&",5),equality:j("==/!=/===/!==",6),relational:j("</>/<=/>=",7),bitShift:j("<</>>/>>>",8),plusMin:new T("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:j("%",10),star:j("*",10),slash:j("/",10),starstar:new T("**",{beforeExpr:!0}),coalesce:j("??",1),_break:w("break"),_case:w("case",K),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",K),_do:w("do",{isLoop:!0,beforeExpr:!0}),_else:w("else",K),_finally:w("finally"),_for:w("for",{isLoop:!0}),_function:w("function",H),_if:w("if"),_return:w("return",K),_switch:w("switch"),_throw:w("throw",K),_try:w("try"),_var:w("var"),_const:w("const"),_while:w("while",{isLoop:!0}),_with:w("with"),_new:w("new",{beforeExpr:!0,startsExpr:!0}),_this:w("this",H),_super:w("super",H),_class:w("class",H),_extends:w("extends",K),_export:w("export"),_import:w("import",H),_null:w("null",H),_true:w("true",H),_false:w("false",H),_in:w("in",{beforeExpr:!0,binop:7}),_instanceof:w("instanceof",{beforeExpr:!0,binop:7}),_typeof:w("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:w("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:w("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},q=/\r\n?|\n|\u2028|\u2029/,Pi=new RegExp(q.source,"g");function ye(e){return 10===e||13===e||8232===e||8233===e}function It(e,t,s){void 0===s&&(s=e.length);for(var i=t;i<s;i++){var n=e.charCodeAt(i);if(ye(n))return i<s-1&&13===n&&10===e.charCodeAt(i+1)?i+2:i+1}return-1}var Rt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,D=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Nt=Object.prototype,Ii=Nt.hasOwnProperty,Ri=Nt.toString,be=Object.hasOwn||function(e,t){return Ii.call(e,t)},gt=Array.isArray||function(e){return"[object Array]"===Ri.call(e)},xt=Object.create(null);function ne(e){return xt[e]||(xt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function te(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var Ni=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Pe=function(e,t){this.line=e,this.column=t};Pe.prototype.offset=function(e){return new Pe(this.line,this.column+e)};var Ue=function(e,t,s){this.start=t,this.end=s,null!==e.sourceFile&&(this.source=e.sourceFile)};function Lt(e,t){for(var s=1,i=0;;){var n=It(e,i,t);if(n<0)return new Pe(s,t-i);++s,i=n}}var it={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},vt=!1;function Li(e){var t={};for(var s in it)t[s]=e&&be(e,s)?e[s]:it[s];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!vt&&"object"==typeof console&&console.warn&&(vt=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),(!e||null==e.allowHashBang)&&(t.allowHashBang=t.ecmaVersion>=14),gt(t.onToken)){var i=t.onToken;t.onToken=function(e){return i.push(e)}}return gt(t.onComment)&&(t.onComment=Vi(t,t.onComment)),t}function Vi(e,t){return function(s,i,n,r,a,o){var c={type:s?"Block":"Line",value:i,start:n,end:r};e.locations&&(c.loc=new Ue(this,a,o)),e.ranges&&(c.range=[n,r]),t.push(c)}}var Ie=1,_e=2,ot=4,Vt=8,ut=16,Mt=32,qe=64,Ot=128,he=256,Re=512,$e=Ie|_e|he;function ct(e,t){return _e|(e?ot:0)|(t?Vt:0)}var De=0,lt=1,se=2,Dt=3,Bt=4,Ft=5,L=function(e,t,s){this.options=e=Li(e),this.sourceFile=e.sourceFile,this.keywords=ne(wi[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var i="";!0!==e.allowReserved&&(i=Xe[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(i+=" await")),this.reservedWords=ne(i);var n=(i?i+" ":"")+Xe.strict;this.reservedWordsStrict=ne(n),this.reservedWordsStrictBind=ne(n+" "+Xe.strictBind),this.input=String(t),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf("\n",s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(q).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=u.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Ie),this.regexpState=null,this.privateNameStack=[]},Y={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};L.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Y.inFunction.get=function(){return(this.currentVarScope().flags&_e)>0},Y.inGenerator.get=function(){return(this.currentVarScope().flags&Vt)>0},Y.inAsync.get=function(){return(this.currentVarScope().flags&ot)>0},Y.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(he|Re))return!1;if(t&_e)return(t&ot)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Y.allowSuper.get=function(){return(this.currentThisScope().flags&qe)>0||this.options.allowSuperOutsideMethod},Y.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ot)>0},Y.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Y.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(he|Re)||t&_e&&!(t&ut))return!0}return!1},Y.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&he)>0},L.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var s=this,i=0;i<e.length;i++)s=e[i](s);return s},L.parse=function(e,t){return new this(t,e).parse()},L.parseExpressionAt=function(e,t,s){var i=new this(s,e,t);return i.nextToken(),i.parseExpression()},L.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(L.prototype,Y);var F=L.prototype,Mi=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;F.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){D.lastIndex=e,e+=D.exec(this.input)[0].length;var t=Mi.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){D.lastIndex=e+t[0].length;var s=D.exec(this.input),i=s.index+s[0].length,n=this.input.charAt(i);return";"===n||"}"===n||q.test(s[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||"!"===n&&"="===this.input.charAt(i+1))}e+=t[0].length,D.lastIndex=e,e+=D.exec(this.input)[0].length,";"===this.input[e]&&e++}},F.eat=function(e){return this.type===e&&(this.next(),!0)},F.isContextual=function(e){return this.type===u.name&&this.value===e&&!this.containsEsc},F.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},F.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},F.canInsertSemicolon=function(){return this.type===u.eof||this.type===u.braceR||q.test(this.input.slice(this.lastTokEnd,this.start))},F.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},F.semicolon=function(){!this.eat(u.semi)&&!this.insertSemicolon()&&this.unexpected()},F.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},F.expect=function(e){this.eat(e)||this.unexpected()},F.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var We=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};F.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var s=t?e.parenthesizedAssign:e.parenthesizedBind;s>-1&&this.raiseRecoverable(s,t?"Assigning to rvalue":"Parenthesized pattern")}},F.checkExpressionErrors=function(e,t){if(!e)return!1;var s=e.shorthandAssign,i=e.doubleProto;if(!t)return s>=0||i>=0;s>=0&&this.raise(s,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")},F.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},F.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var y=L.prototype;y.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==u.eof;){var s=this.parseStatement(null,!0,t);e.body.push(s)}if(this.inModule)for(var i=0,n=Object.keys(this.undefinedExports);i<n.length;i+=1){var r=n[i];this.raiseRecoverable(this.undefinedExports[r].start,"Export '"+r+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var ht={kind:"loop"},Oi={kind:"switch"};y.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;D.lastIndex=this.pos;var t=D.exec(this.input),s=this.pos+t[0].length,i=this.input.charCodeAt(s);if(91===i||92===i)return!0;if(e)return!1;if(123===i||i>55295&&i<56320)return!0;if(Z(i,!0)){for(var n=s+1;ae(i=this.input.charCodeAt(n),!0);)++n;if(92===i||i>55295&&i<56320)return!0;var r=this.input.slice(s,n);if(!ki.test(r))return!0}return!1},y.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;D.lastIndex=this.pos;var e,t=D.exec(this.input),s=this.pos+t[0].length;return!(q.test(this.input.slice(this.pos,s))||"function"!==this.input.slice(s,s+8)||s+8!==this.input.length&&(ae(e=this.input.charCodeAt(s+8))||e>55295&&e<56320))},y.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;D.lastIndex=this.pos;var s=D.exec(this.input),i=this.pos+s[0].length;if(q.test(this.input.slice(this.pos,i)))return!1;if(e){var n,r=i+5;if("using"!==this.input.slice(i,r)||r===this.input.length||ae(n=this.input.charCodeAt(r))||n>55295&&n<56320)return!1;D.lastIndex=r;var a=D.exec(this.input);if(a&&q.test(this.input.slice(r,r+a[0].length)))return!1}if(t){var o,c=i+2;if(!("of"!==this.input.slice(i,c)||c!==this.input.length&&(ae(o=this.input.charCodeAt(c))||o>55295&&o<56320)))return!1}var l=this.input.charCodeAt(i);return Z(l,!0)||92===l},y.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},y.isUsing=function(e){return this.isUsingKeyword(!1,e)},y.parseStatement=function(e,t,s){var i,n=this.type,r=this.startNode();switch(this.isLet(e)&&(n=u._var,i="let"),n){case u._break:case u._continue:return this.parseBreakContinueStatement(r,n.keyword);case u._debugger:return this.parseDebuggerStatement(r);case u._do:return this.parseDoStatement(r);case u._for:return this.parseForStatement(r);case u._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case u._class:return e&&this.unexpected(),this.parseClass(r,!0);case u._if:return this.parseIfStatement(r);case u._return:return this.parseReturnStatement(r);case u._switch:return this.parseSwitchStatement(r);case u._throw:return this.parseThrowStatement(r);case u._try:return this.parseTryStatement(r);case u._const:case u._var:return i=i||this.value,e&&"var"!==i&&this.unexpected(),this.parseVarStatement(r,i);case u._while:return this.parseWhileStatement(r);case u._with:return this.parseWithStatement(r);case u.braceL:return this.parseBlock(!0,r);case u.semi:return this.parseEmptyStatement(r);case u._export:case u._import:if(this.options.ecmaVersion>10&&n===u._import){D.lastIndex=this.pos;var a=D.exec(this.input),o=this.pos+a[0].length,c=this.input.charCodeAt(o);if(40===c||46===c)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===u._import?this.parseImport(r):this.parseExport(r,s);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var l=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(l)return t&&"script"===this.options.sourceType&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),"await using"===l&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,l),this.semicolon(),this.finishNode(r,"VariableDeclaration");var h=this.value,p=this.parseExpression();return n===u.name&&"Identifier"===p.type&&this.eat(u.colon)?this.parseLabeledStatement(r,h,p,e):this.parseExpressionStatement(r,p)}},y.parseBreakContinueStatement=function(e,t){var s="break"===t;this.next(),this.eat(u.semi)||this.insertSemicolon()?e.label=null:this.type!==u.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i<this.labels.length;++i){var n=this.labels[i];if((null==e.label||n.name===e.label.name)&&(null!=n.kind&&(s||"loop"===n.kind)||e.label&&s))break}return i===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,s?"BreakStatement":"ContinueStatement")},y.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},y.parseDoStatement=function(e){return this.next(),this.labels.push(ht),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(u._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(u.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},y.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ht),this.enterScope(0),this.expect(u.parenL),this.type===u.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var s=this.isLet();if(this.type===u._var||this.type===u._const||s){var i=this.startNode(),n=s?"let":this.value;return this.next(),this.parseVar(i,!0,n),this.finishNode(i,"VariableDeclaration"),this.parseForAfterInit(e,i,t)}var r=this.isContextual("let"),a=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var c=this.startNode();return this.next(),"await using"===o&&this.next(),this.parseVar(c,!0,o),this.finishNode(c,"VariableDeclaration"),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,h=new We,p=this.start,d=t>-1?this.parseExprSubscripts(h,"await"):this.parseExpression(!0,h);return this.type===u._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===u._in&&this.unexpected(t),e.await=!0):a&&this.options.ecmaVersion>=8&&(d.start!==p||l||"Identifier"!==d.type||"async"!==d.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),r&&a&&this.raise(d.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(d,!1,h),this.checkLValPattern(d),this.parseForIn(e,d)):(this.checkExpressionErrors(h,!0),t>-1&&this.unexpected(t),this.parseFor(e,d))},y.parseForAfterInit=function(e,t,s){return(this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===t.declarations.length?(this.options.ecmaVersion>=9&&(this.type===u._in?s>-1&&this.unexpected(s):e.await=s>-1),this.parseForIn(e,t)):(s>-1&&this.unexpected(s),this.parseFor(e,t))},y.parseFunctionStatement=function(e,t,s){return this.next(),this.parseFunction(e,Te|(s?0:st),!1,t)},y.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(u._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},y.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(u.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},y.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(u.braceL),this.labels.push(Oi),this.enterScope(0);for(var t,s=!1;this.type!==u.braceR;)if(this.type===u._case||this.type===u._default){var i=this.type===u._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(s&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),s=!0,t.test=null),this.expect(u.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},y.parseThrowStatement=function(e){return this.next(),q.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Di=[];y.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?Mt:0),this.checkLValPattern(e,t?Bt:se),this.expect(u.parenR),e},y.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===u._catch){var t=this.startNode();this.next(),this.eat(u.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(u._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},y.parseVarStatement=function(e,t,s){return this.next(),this.parseVar(e,!1,t,s),this.semicolon(),this.finishNode(e,"VariableDeclaration")},y.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(ht),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},y.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},y.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},y.parseLabeledStatement=function(e,t,s,i){for(var n=0,r=this.labels;n<r.length;n+=1){r[n].name===t&&this.raise(s.start,"Label '"+t+"' is already declared")}for(var a=this.type.isLoop?"loop":this.type===u._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var c=this.labels[o];if(c.statementStart!==e.start)break;c.statementStart=this.start,c.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(i?-1===i.indexOf("label")?i+"label":i:"label"),this.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")},y.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},y.parseBlock=function(e,t,s){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(u.braceL),e&&this.enterScope(0);this.type!==u.braceR;){var i=this.parseStatement(null);t.body.push(i)}return s&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},y.parseFor=function(e,t){return e.init=t,this.expect(u.semi),e.test=this.type===u.semi?null:this.parseExpression(),this.expect(u.semi),e.update=this.type===u.parenR?null:this.parseExpression(),this.expect(u.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},y.parseForIn=function(e,t){var s=this.type===u._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!s||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(u.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")},y.parseVar=function(e,t,s,i){for(e.declarations=[],e.kind=s;;){var n=this.startNode();if(this.parseVarId(n,s),this.eat(u.eq)?n.init=this.parseMaybeAssign(t):i||"const"!==s||this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of")?i||"using"!==s&&"await using"!==s||!(this.options.ecmaVersion>=17)||this.type===u._in||this.isContextual("of")?i||"Identifier"===n.id.type||t&&(this.type===u._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+s+" declaration"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(u.comma))break}return e},y.parseVarId=function(e,t){e.id="using"===t||"await using"===t?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?lt:se,!1)};var Te=1,st=2,Ht=4;function Bi(e,t){var s=t.key.name,i=e[s],n="true";return"MethodDefinition"===t.type&&("get"===t.kind||"set"===t.kind)&&(n=(t.static?"s":"i")+t.kind),"iget"===i&&"iset"===n||"iset"===i&&"iget"===n||"sget"===i&&"sset"===n||"sset"===i&&"sget"===n?(e[s]="true",!1):!!i||(e[s]=n,!1)}function Be(e,t){var s=e.computed,i=e.key;return!s&&("Identifier"===i.type&&i.name===t||"Literal"===i.type&&i.value===t)}y.parseFunction=function(e,t,s,i,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===u.star&&t&st&&this.unexpected(),e.generator=this.eat(u.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&Te&&(e.id=t&Ht&&this.type!==u.name?null:this.parseIdent(),e.id&&!(t&st)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?lt:se:Dt));var r=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ct(e.async,e.generator)),t&Te||(e.id=this.type===u.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,s,!1,n),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&Te?"FunctionDeclaration":"FunctionExpression")},y.parseFunctionParams=function(e){this.expect(u.parenL),e.params=this.parseBindingList(u.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},y.parseClass=function(e,t){this.next();var s=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.enterClassBody(),n=this.startNode(),r=!1;for(n.body=[],this.expect(u.braceL);this.type!==u.braceR;){var a=this.parseClassElement(null!==e.superClass);a&&(n.body.push(a),"MethodDefinition"===a.type&&"constructor"===a.kind?(r&&this.raiseRecoverable(a.start,"Duplicate constructor in the same class"),r=!0):a.key&&"PrivateIdentifier"===a.key.type&&Bi(i,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=s,this.next(),e.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},y.parseClassElement=function(e){if(this.eat(u.semi))return null;var t=this.options.ecmaVersion,s=this.startNode(),i="",n=!1,r=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(u.braceL))return this.parseClassStaticBlock(s),s;this.isClassElementNameStart()||this.type===u.star?o=!0:i="static"}if(s.static=o,!i&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==u.star||this.canInsertSemicolon()?i="async":r=!0),!i&&(t>=9||!r)&&this.eat(u.star)&&(n=!0),!i&&!r&&!n){var c=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=c:i=c)}if(i?(s.computed=!1,s.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),s.key.name=i,this.finishNode(s.key,"Identifier")):this.parseClassElementName(s),t<13||this.type===u.parenL||"method"!==a||n||r){var l=!s.static&&Be(s,"constructor"),h=l&&e;l&&"method"!==a&&this.raise(s.key.start,"Constructor can't have get/set modifier"),s.kind=l?"constructor":a,this.parseClassMethod(s,n,r,h)}else this.parseClassField(s);return s},y.isClassElementNameStart=function(){return this.type===u.name||this.type===u.privateId||this.type===u.num||this.type===u.string||this.type===u.bracketL||this.type.keyword},y.parseClassElementName=function(e){this.type===u.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},y.parseClassMethod=function(e,t,s,i){var n=e.key;"constructor"===e.kind?(t&&this.raise(n.start,"Constructor can't be a generator"),s&&this.raise(n.start,"Constructor can't be an async method")):e.static&&Be(e,"prototype")&&this.raise(n.start,"Classes may not have a static property named prototype");var r=e.value=this.parseMethod(t,s,i);return"get"===e.kind&&0!==r.params.length&&this.raiseRecoverable(r.start,"getter should have no params"),"set"===e.kind&&1!==r.params.length&&this.raiseRecoverable(r.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===r.params[0].type&&this.raiseRecoverable(r.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},y.parseClassField=function(e){return Be(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Be(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(u.eq)?(this.enterScope(Re|qe),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},y.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(he|qe);this.type!==u.braceR;){var s=this.parseStatement(null);e.body.push(s)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},y.parseClassId=function(e,t){this.type===u.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,se,!1)):(!0===t&&this.unexpected(),e.id=null)},y.parseClassSuper=function(e){e.superClass=this.eat(u._extends)?this.parseExprSubscripts(null,!1):null},y.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},y.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,s=e.used;if(this.options.checkPrivateFields)for(var i=this.privateNameStack.length,n=0===i?null:this.privateNameStack[i-1],r=0;r<s.length;++r){var a=s[r];be(t,a.name)||(n?n.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}},y.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==u.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},y.parseExport=function(e,t){if(this.next(),this.eat(u.star))return this.parseExportAllDeclaration(e,t);if(this.eat(u._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==u.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var s=0,i=e.specifiers;s<i.length;s+=1){var n=i[s];this.checkUnreserved(n.local),this.checkLocalExport(n.local),"Literal"===n.local.type&&this.raise(n.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},y.parseExportDeclaration=function(e){return this.parseStatement(null)},y.parseExportDefaultDeclaration=function(){var e;if(this.type===u._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Te|Ht,!1,e)}if(this.type===u._class){var s=this.startNode();return this.parseClass(s,"nullableID")}var i=this.parseMaybeAssign();return this.semicolon(),i},y.checkExport=function(e,t,s){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),be(e,t)&&this.raiseRecoverable(s,"Duplicate export '"+t+"'"),e[t]=!0)},y.checkPatternExport=function(e,t){var s=t.type;if("Identifier"===s)this.checkExport(e,t,t.start);else if("ObjectPattern"===s)for(var i=0,n=t.properties;i<n.length;i+=1){var r=n[i];this.checkPatternExport(e,r)}else if("ArrayPattern"===s)for(var a=0,o=t.elements;a<o.length;a+=1){var c=o[a];c&&this.checkPatternExport(e,c)}else"Property"===s?this.checkPatternExport(e,t.value):"AssignmentPattern"===s?this.checkPatternExport(e,t.left):"RestElement"===s&&this.checkPatternExport(e,t.argument)},y.checkVariableExport=function(e,t){if(e)for(var s=0,i=t;s<i.length;s+=1){var n=i[s];this.checkPatternExport(e,n.id)}},y.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},y.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},y.parseExportSpecifiers=function(e){var t=[],s=!0;for(this.expect(u.braceL);!this.eat(u.braceR);){if(s)s=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;t.push(this.parseExportSpecifier(e))}return t},y.parseImport=function(e){return this.next(),this.type===u.string?(e.specifiers=Di,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===u.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},y.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,se),this.finishNode(e,"ImportSpecifier")},y.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,se),this.finishNode(e,"ImportDefaultSpecifier")},y.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,se),this.finishNode(e,"ImportNamespaceSpecifier")},y.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===u.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(u.comma)))return e;if(this.type===u.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(u.braceL);!this.eat(u.braceR);){if(t)t=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;e.push(this.parseImportSpecifier())}return e},y.parseWithClause=function(){var e=[];if(!this.eat(u._with))return e;this.expect(u.braceL);for(var t={},s=!0;!this.eat(u.braceR);){if(s)s=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;var i=this.parseImportAttribute(),n="Identifier"===i.key.type?i.key.name:i.key.value;be(t,n)&&this.raiseRecoverable(i.key.start,"Duplicate attribute key '"+n+"'"),t[n]=!0,e.push(i)}return e},y.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===u.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(u.colon),this.type!==u.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},y.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===u.string){var e=this.parseLiteral(this.value);return Ni.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},y.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},y.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var G=L.prototype;G.toAssignable=function(e,t,s){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",s&&this.checkPatternErrors(s,!0);for(var i=0,n=e.properties;i<n.length;i+=1){var r=n[i];this.toAssignable(r,t),"RestElement"===r.type&&("ArrayPattern"===r.argument.type||"ObjectPattern"===r.argument.type)&&this.raise(r.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",s&&this.checkPatternErrors(s,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,s);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else s&&this.checkPatternErrors(s,!0);return e},G.toAssignableList=function(e,t){for(var s=e.length,i=0;i<s;i++){var n=e[i];n&&this.toAssignable(n,t)}if(s){var r=e[s-1];6===this.options.ecmaVersion&&t&&r&&"RestElement"===r.type&&"Identifier"!==r.argument.type&&this.unexpected(r.argument.start)}return e},G.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},G.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==u.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},G.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case u.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(u.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case u.braceL:return this.parseObj(!0)}return this.parseIdent()},G.parseBindingList=function(e,t,s,i){for(var n=[],r=!0;!this.eat(e);)if(r?r=!1:this.expect(u.comma),t&&this.type===u.comma)n.push(null);else{if(s&&this.afterTrailingComma(e))break;if(this.type===u.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),n.push(a),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}n.push(this.parseAssignableListItem(i))}return n},G.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},G.parseBindingListItem=function(e){return e},G.parseMaybeDefault=function(e,t,s){if(s=s||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(u.eq))return s;var i=this.startNodeAt(e,t);return i.left=s,i.right=this.parseMaybeAssign(),this.finishNode(i,"AssignmentPattern")},G.checkLValSimple=function(e,t,s){void 0===t&&(t=De);var i=t!==De;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(i?"Binding ":"Assigning to ")+e.name+" in strict mode"),i&&(t===se&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),s&&(be(s,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),s[e.name]=!0),t!==Ft&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":i&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return i&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,s);default:this.raise(e.start,(i?"Binding":"Assigning to")+" rvalue")}},G.checkLValPattern=function(e,t,s){switch(void 0===t&&(t=De),e.type){case"ObjectPattern":for(var i=0,n=e.properties;i<n.length;i+=1){var r=n[i];this.checkLValInnerPattern(r,t,s)}break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var c=o[a];c&&this.checkLValInnerPattern(c,t,s)}break;default:this.checkLValSimple(e,t,s)}},G.checkLValInnerPattern=function(e,t,s){switch(void 0===t&&(t=De),e.type){case"Property":this.checkLValInnerPattern(e.value,t,s);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,s);break;case"RestElement":this.checkLValPattern(e.argument,t,s);break;default:this.checkLValPattern(e,t,s)}};var X=function(e,t,s,i,n){this.token=e,this.isExpr=!!t,this.preserveSpace=!!s,this.override=i,this.generator=!!n},I={b_stat:new X("{",!1),b_expr:new X("{",!0),b_tmpl:new X("${",!1),p_stat:new X("(",!1),p_expr:new X("(",!0),q_tmpl:new X("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new X("function",!1),f_expr:new X("function",!0),f_expr_gen:new X("function",!0,!1,null,!0),f_gen:new X("function",!1,!1,null,!0)},Ce=L.prototype;Ce.initialContext=function(){return[I.b_stat]},Ce.curContext=function(){return this.context[this.context.length-1]},Ce.braceIsBlock=function(e){var t=this.curContext();return t===I.f_expr||t===I.f_stat||(e!==u.colon||t!==I.b_stat&&t!==I.b_expr?e===u._return||e===u.name&&this.exprAllowed?q.test(this.input.slice(this.lastTokEnd,this.start)):e===u._else||e===u.semi||e===u.eof||e===u.parenR||e===u.arrow||(e===u.braceL?t===I.b_stat:e!==u._var&&e!==u._const&&e!==u.name&&!this.exprAllowed):!t.isExpr)},Ce.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},Ce.updateContext=function(e){var t,s=this.type;s.keyword&&e===u.dot?this.exprAllowed=!1:(t=s.updateContext)?t.call(this,e):this.exprAllowed=s.beforeExpr},Ce.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},u.parenR.updateContext=u.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===I.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},u.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?I.b_stat:I.b_expr),this.exprAllowed=!0},u.dollarBraceL.updateContext=function(){this.context.push(I.b_tmpl),this.exprAllowed=!0},u.parenL.updateContext=function(e){var t=e===u._if||e===u._for||e===u._with||e===u._while;this.context.push(t?I.p_stat:I.p_expr),this.exprAllowed=!0},u.incDec.updateContext=function(){},u._function.updateContext=u._class.updateContext=function(e){!e.beforeExpr||e===u._else||e===u.semi&&this.curContext()!==I.p_stat||e===u._return&&q.test(this.input.slice(this.lastTokEnd,this.start))||(e===u.colon||e===u.braceL)&&this.curContext()===I.b_stat?this.context.push(I.f_stat):this.context.push(I.f_expr),this.exprAllowed=!1},u.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},u.backQuote.updateContext=function(){this.curContext()===I.q_tmpl?this.context.pop():this.context.push(I.q_tmpl),this.exprAllowed=!1},u.star.updateContext=function(e){if(e===u._function){var t=this.context.length-1;this.context[t]===I.f_expr?this.context[t]=I.f_expr_gen:this.context[t]=I.f_gen}this.exprAllowed=!0},u.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==u.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var S=L.prototype;function Ut(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&Ut(e.expression)}function rt(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&rt(e.expression)||"ParenthesizedExpression"===e.type&&rt(e.expression)}S.checkPropClash=function(e,t,s){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var i,n=e.key;switch(n.type){case"Identifier":i=n.name;break;case"Literal":i=String(n.value);break;default:return}var r=e.kind;if(this.options.ecmaVersion>=6)return void("__proto__"===i&&"init"===r&&(t.proto&&(s?s.doubleProto<0&&(s.doubleProto=n.start):this.raiseRecoverable(n.start,"Redefinition of __proto__ property")),t.proto=!0));var a=t[i="$"+i];if(a)("init"===r?this.strict&&a.init||a.get||a.set:a.init||a[r])&&this.raiseRecoverable(n.start,"Redefinition of property");else a=t[i]={init:!1,get:!1,set:!1};a[r]=!0}},S.parseExpression=function(e,t){var s=this.start,i=this.startLoc,n=this.parseMaybeAssign(e,t);if(this.type===u.comma){var r=this.startNodeAt(s,i);for(r.expressions=[n];this.eat(u.comma);)r.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(r,"SequenceExpression")}return n},S.parseMaybeAssign=function(e,t,s){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var i=!1,n=-1,r=-1,a=-1;t?(n=t.parenthesizedAssign,r=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new We,i=!0);var o=this.start,c=this.startLoc;(this.type===u.parenL||this.type===u.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);var l=this.parseMaybeConditional(e,t);if(s&&(l=s.call(this,l,o,c)),this.type.isAssign){var h=this.startNodeAt(o,c);return h.operator=this.value,this.type===u.eq&&(l=this.toAssignable(l,!1,t)),i||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===u.eq?this.checkLValPattern(l):this.checkLValSimple(l),h.left=l,this.next(),h.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(h,"AssignmentExpression")}return i&&this.checkExpressionErrors(t,!0),n>-1&&(t.parenthesizedAssign=n),r>-1&&(t.trailingComma=r),l},S.parseMaybeConditional=function(e,t){var s=this.start,i=this.startLoc,n=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return n;if(this.eat(u.question)){var r=this.startNodeAt(s,i);return r.test=n,r.consequent=this.parseMaybeAssign(),this.expect(u.colon),r.alternate=this.parseMaybeAssign(e),this.finishNode(r,"ConditionalExpression")}return n},S.parseExprOps=function(e,t){var s=this.start,i=this.startLoc,n=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||n.start===s&&"ArrowFunctionExpression"===n.type?n:this.parseExprOp(n,s,i,-1,e)},S.parseExprOp=function(e,t,s,i,n){var r=this.type.binop;if(null!=r&&(!n||this.type!==u._in)&&r>i){var a=this.type===u.logicalOR||this.type===u.logicalAND,o=this.type===u.coalesce;o&&(r=u.logicalAND.binop);var c=this.value;this.next();var l=this.start,h=this.startLoc,p=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,n),l,h,r,n),d=this.buildBinary(t,s,e,p,c,a||o);return(a&&this.type===u.coalesce||o&&(this.type===u.logicalOR||this.type===u.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(d,t,s,i,n)}return e},S.buildBinary=function(e,t,s,i,n,r){"PrivateIdentifier"===i.type&&this.raise(i.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=s,a.operator=n,a.right=i,this.finishNode(a,r?"LogicalExpression":"BinaryExpression")},S.parseMaybeUnary=function(e,t,s,i){var n,r=this.start,a=this.startLoc;if(this.isContextual("await")&&this.canAwait)n=this.parseAwait(i),t=!0;else if(this.type.prefix){var o=this.startNode(),c=this.type===u.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,c,i),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(o.argument):this.strict&&"delete"===o.operator&&Ut(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):"delete"===o.operator&&rt(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,n=this.finishNode(o,c?"UpdateExpression":"UnaryExpression")}else if(t||this.type!==u.privateId){if(n=this.parseExprSubscripts(e,i),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(r,a);l.operator=this.value,l.prefix=!1,l.argument=n,this.checkLValSimple(n),this.next(),n=this.finishNode(l,"UpdateExpression")}}else(i||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),n=this.parsePrivateIdent(),this.type!==u._in&&this.unexpected();return s||!this.eat(u.starstar)?n:t?void this.unexpected(this.lastTokStart):this.buildBinary(r,a,n,this.parseMaybeUnary(null,!1,!1,i),"**",!1)},S.parseExprSubscripts=function(e,t){var s=this.start,i=this.startLoc,n=this.parseExprAtom(e,t);if("ArrowFunctionExpression"===n.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return n;var r=this.parseSubscripts(n,s,i,!1,t);return e&&"MemberExpression"===r.type&&(e.parenthesizedAssign>=r.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=r.start&&(e.parenthesizedBind=-1),e.trailingComma>=r.start&&(e.trailingComma=-1)),r},S.parseSubscripts=function(e,t,s,i,n){for(var r=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,s,i,r,a,n);if(o.optional&&(a=!0),o===e||"ArrowFunctionExpression"===o.type){if(a){var c=this.startNodeAt(t,s);c.expression=o,o=this.finishNode(c,"ChainExpression")}return o}e=o}},S.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(u.arrow)},S.parseSubscriptAsyncArrow=function(e,t,s,i){return this.parseArrowExpression(this.startNodeAt(e,t),s,!0,i)},S.parseSubscript=function(e,t,s,i,n,r,a){var o=this.options.ecmaVersion>=11,c=o&&this.eat(u.questionDot);i&&c&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(u.bracketL);if(l||c&&this.type!==u.parenL&&this.type!==u.backQuote||this.eat(u.dot)){var h=this.startNodeAt(t,s);h.object=e,l?(h.property=this.parseExpression(),this.expect(u.bracketR)):this.type===u.privateId&&"Super"!==e.type?h.property=this.parsePrivateIdent():h.property=this.parseIdent("never"!==this.options.allowReserved),h.computed=!!l,o&&(h.optional=c),e=this.finishNode(h,"MemberExpression")}else if(!i&&this.eat(u.parenL)){var p=new We,d=this.yieldPos,f=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var g=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1,p);if(n&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=d,this.awaitPos=f,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,s,g,a);this.checkExpressionErrors(p,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=f||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var v=this.startNodeAt(t,s);v.callee=e,v.arguments=g,o&&(v.optional=c),e=this.finishNode(v,"CallExpression")}else if(this.type===u.backQuote){(c||r)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var y=this.startNodeAt(t,s);y.tag=e,y.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(y,"TaggedTemplateExpression")}return e},S.parseExprAtom=function(e,t,s){this.type===u.slash&&this.readRegexp();var i,n=this.potentialArrowAt===this.start;switch(this.type){case u._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),i=this.startNode(),this.next(),this.type===u.parenL&&!this.allowDirectSuper&&this.raise(i.start,"super() call outside constructor of a subclass"),this.type!==u.dot&&this.type!==u.bracketL&&this.type!==u.parenL&&this.unexpected(),this.finishNode(i,"Super");case u._this:return i=this.startNode(),this.next(),this.finishNode(i,"ThisExpression");case u.name:var r=this.start,a=this.startLoc,o=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&"async"===c.name&&!this.canInsertSemicolon()&&this.eat(u._function))return this.overrideContext(I.f_expr),this.parseFunction(this.startNodeAt(r,a),0,!1,!0,t);if(n&&!this.canInsertSemicolon()){if(this.eat(u.arrow))return this.parseArrowExpression(this.startNodeAt(r,a),[c],!1,t);if(this.options.ecmaVersion>=8&&"async"===c.name&&this.type===u.name&&!o&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(u.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,a),[c],!0,t)}return c;case u.regexp:var l=this.value;return(i=this.parseLiteral(l.value)).regex={pattern:l.pattern,flags:l.flags},i;case u.num:case u.string:return this.parseLiteral(this.value);case u._null:case u._true:case u._false:return(i=this.startNode()).value=this.type===u._null?null:this.type===u._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case u.parenL:var h=this.start,p=this.parseParenAndDistinguishExpression(n,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),p;case u.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(u.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case u.braceL:return this.overrideContext(I.b_expr),this.parseObj(!1,e);case u._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case u._class:return this.parseClass(this.startNode(),!1);case u._new:return this.parseNew();case u.backQuote:return this.parseTemplate();case u._import:return this.options.ecmaVersion>=11?this.parseExprImport(s):this.unexpected();default:return this.parseExprAtomDefault()}},S.parseExprAtomDefault=function(){this.unexpected()},S.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===u.parenL&&!e)return this.parseDynamicImport(t);if(this.type===u.dot){var s=this.startNodeAt(t.start,t.loc&&t.loc.start);return s.name="import",t.meta=this.finishNode(s,"Identifier"),this.parseImportMeta(t)}this.unexpected()},S.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(u.parenR)?e.options=null:(this.expect(u.comma),this.afterTrailingComma(u.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(u.parenR)||(this.expect(u.comma),this.afterTrailingComma(u.parenR)||this.unexpected())));else if(!this.eat(u.parenR)){var t=this.start;this.eat(u.comma)&&this.eat(u.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},S.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},S.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=null!=t.value?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},S.parseParenExpression=function(){this.expect(u.parenL);var e=this.parseExpression();return this.expect(u.parenR),e},S.shouldParseArrow=function(e){return!this.canInsertSemicolon()},S.parseParenAndDistinguishExpression=function(e,t){var s,i=this.start,n=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a,o=this.start,c=this.startLoc,l=[],h=!0,p=!1,d=new We,f=this.yieldPos,m=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==u.parenR;){if(h?h=!1:this.expect(u.comma),r&&this.afterTrailingComma(u.parenR,!0)){p=!0;break}if(this.type===u.ellipsis){a=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}l.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var g=this.lastTokEnd,v=this.lastTokEndLoc;if(this.expect(u.parenR),e&&this.shouldParseArrow(l)&&this.eat(u.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=m,this.parseParenArrowList(i,n,l,t);(!l.length||p)&&this.unexpected(this.lastTokStart),a&&this.unexpected(a),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=m||this.awaitPos,l.length>1?((s=this.startNodeAt(o,c)).expressions=l,this.finishNodeAt(s,"SequenceExpression",g,v)):s=l[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(i,n);return y.expression=s,this.finishNode(y,"ParenthesizedExpression")}return s},S.parseParenItem=function(e){return e},S.parseParenArrowList=function(e,t,s,i){return this.parseArrowExpression(this.startNodeAt(e,t),s,!1,i)};var Fi=[];S.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===u.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var s=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),s&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var i=this.start,n=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),i,n,!0,!1),this.eat(u.parenL)?e.arguments=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Fi,this.finishNode(e,"NewExpression")},S.parseTemplateElement=function(e){var t=e.isTagged,s=this.startNode();return this.type===u.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),s.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),s.tail=this.type===u.backQuote,this.finishNode(s,"TemplateElement")},S.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var s=this.startNode();this.next(),s.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(s.quasis=[i];!i.tail;)this.type===u.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(u.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(u.braceR),s.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(s,"TemplateLiteral")},S.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===u.name||this.type===u.num||this.type===u.string||this.type===u.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===u.star)&&!q.test(this.input.slice(this.lastTokEnd,this.start))},S.parseObj=function(e,t){var s=this.startNode(),i=!0,n={};for(s.properties=[],this.next();!this.eat(u.braceR);){if(i)i=!1;else if(this.expect(u.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(u.braceR))break;var r=this.parseProperty(e,t);e||this.checkPropClash(r,n,t),s.properties.push(r)}return this.finishNode(s,e?"ObjectPattern":"ObjectExpression")},S.parseProperty=function(e,t){var s,i,n,r,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(u.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(a.argument=this.parseMaybeAssign(!1,t),this.type===u.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||t)&&(n=this.start,r=this.startLoc),e||(s=this.eat(u.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(a)?(i=!0,s=this.options.ecmaVersion>=9&&this.eat(u.star),this.parsePropertyName(a)):i=!1,this.parsePropertyValue(a,e,s,i,n,r,t,o),this.finishNode(a,"Property")},S.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var s="get"===e.kind?0:1;if(e.value.params.length!==s){var i=e.value.start;"get"===e.kind?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},S.parsePropertyValue=function(e,t,s,i,n,r,a,o){(s||i)&&this.type===u.colon&&this.unexpected(),this.eat(u.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init"):this.options.ecmaVersion>=6&&this.type===u.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(s,i),e.kind="init"):t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===u.comma||this.type===u.braceR||this.type===u.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((s||i)&&this.unexpected(),this.checkUnreserved(e.key),"await"===e.key.name&&!this.awaitIdentPos&&(this.awaitIdentPos=n),t?e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key)):this.type===u.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected():((s||i)&&this.unexpected(),this.parseGetterSetter(e))},S.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(u.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(u.bracketR),e.key;e.computed=!1}return e.key=this.type===u.num||this.type===u.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},S.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},S.parseMethod=function(e,t,s){var i=this.startNode(),n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ct(t,i.generator)|qe|(s?Ot:0)),this.expect(u.parenL),i.params=this.parseBindingList(u.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(i,"FunctionExpression")},S.parseArrowExpression=function(e,t,s,i){var n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(ct(s,!1)|ut),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,i),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")},S.parseFunctionBody=function(e,t,s,i){var n=t&&this.type!==u.braceL,r=this.strict,a=!1;if(n)e.body=this.parseMaybeAssign(i),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!r||o)&&((a=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var c=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!r&&!a&&!t&&!s&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Ft),e.body=this.parseBlock(!1,void 0,a&&!r),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},S.isSimpleParamList=function(e){for(var t=0,s=e;t<s.length;t+=1){if("Identifier"!==s[t].type)return!1}return!0},S.checkParams=function(e,t){for(var s=Object.create(null),i=0,n=e.params;i<n.length;i+=1){var r=n[i];this.checkLValInnerPattern(r,lt,t?null:s)}},S.parseExprList=function(e,t,s,i){for(var n=[],r=!0;!this.eat(e);){if(r)r=!1;else if(this.expect(u.comma),t&&this.afterTrailingComma(e))break;var a=void 0;s&&this.type===u.comma?a=null:this.type===u.ellipsis?(a=this.parseSpread(i),i&&this.type===u.comma&&i.trailingComma<0&&(i.trailingComma=this.start)):a=this.parseMaybeAssign(!1,i),n.push(a)}return n},S.checkUnreserved=function(e){var t=e.start,s=e.end,i=e.name;(this.inGenerator&&"yield"===i&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===i&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&$e)&&"arguments"===i&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&("arguments"===i||"await"===i)&&this.raise(t,"Cannot use "+i+" in class static initialization block"),this.keywords.test(i)&&this.raise(t,"Unexpected keyword '"+i+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,s).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(!this.inAsync&&"await"===i&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+i+"' is reserved"))},S.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),"await"===t.name&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},S.parseIdentNode=function(){var e=this.startNode();return this.type===u.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,("class"===e.name||"function"===e.name)&&(this.lastTokEnd!==this.lastTokStart+1||46!==this.input.charCodeAt(this.lastTokStart))&&this.context.pop(),this.type=u.name):this.unexpected(),e},S.parsePrivateIdent=function(){var e=this.startNode();return this.type===u.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},S.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===u.semi||this.canInsertSemicolon()||this.type!==u.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(u.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},S.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var Fe=L.prototype;Fe.raise=function(e,t){var s=Lt(this.input,e);t+=" ("+s.line+":"+s.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var i=new SyntaxError(t);throw i.pos=e,i.loc=s,i.raisedAt=this.pos,i},Fe.raiseRecoverable=Fe.raise,Fe.curPosition=function(){if(this.options.locations)return new Pe(this.curLine,this.pos-this.lineStart)};var oe=L.prototype,Hi=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};oe.enterScope=function(e){this.scopeStack.push(new Hi(e))},oe.exitScope=function(){this.scopeStack.pop()},oe.treatFunctionsAsVarInScope=function(e){return e.flags&_e||!this.inModule&&e.flags&Ie},oe.declareName=function(e,t,s){var i=!1;if(t===se){var n=this.currentScope();i=n.lexical.indexOf(e)>-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&n.flags&Ie&&delete this.undefinedExports[e]}else if(t===Bt){this.currentScope().lexical.push(e)}else if(t===Dt){var r=this.currentScope();i=this.treatFunctionsAsVar?r.lexical.indexOf(e)>-1:r.lexical.indexOf(e)>-1||r.var.indexOf(e)>-1,r.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var o=this.scopeStack[a];if(o.lexical.indexOf(e)>-1&&!(o.flags&Mt&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){i=!0;break}if(o.var.push(e),this.inModule&&o.flags&Ie&&delete this.undefinedExports[e],o.flags&$e)break}i&&this.raiseRecoverable(s,"Identifier '"+e+"' has already been declared")},oe.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},oe.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},oe.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&($e|Re|he))return t}},oe.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&($e|Re|he)&&!(t.flags&ut))return t}};var je=function(e,t,s){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new Ue(e,s)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Ne=L.prototype;function qt(e,t,s,i){return e.type=t,e.end=s,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=s),e}Ne.startNode=function(){return new je(this,this.start,this.startLoc)},Ne.startNodeAt=function(e,t){return new je(this,e,t)},Ne.finishNode=function(e,t){return qt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Ne.finishNodeAt=function(e,t,s,i){return qt.call(this,e,t,s,i)},Ne.copyNode=function(e){var t=new je(this,e.start,this.startLoc);for(var s in e)t[s]=e[s];return t};var Ui="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",$t="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Wt=$t+" Extended_Pictographic",jt=Wt,Kt=Wt+" EBase EComp EMod EPres ExtPict",zt=Kt,qi=Kt,$i={9:$t,10:Wt,11:Wt,12:Kt,13:Kt,14:qi},Wi="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",ji={9:"",10:"",11:"",12:"",13:"",14:Wi},yt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Gt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Xt=Gt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Qt=Xt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Zt=Qt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Yt=Zt+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Ki=Yt+" "+Ui,zi={9:Gt,10:Xt,11:Qt,12:Zt,13:Yt,14:Ki},Jt={};function Gi(e){var t=Jt[e]={binary:ne($i[e]+" "+yt),binaryOfStrings:ne(ji[e]),nonBinary:{General_Category:ne(yt),Script:ne(zi[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Ze=0,bt=[9,10,11,12,13,14];Ze<bt.length;Ze+=1){var Xi=bt[Ze];Gi(Xi)}var v=L.prototype,He=function(e,t){this.parent=e,this.base=t||this};He.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var s=e;s;s=s.parent)if(t.base===s.base&&t!==s)return!0;return!1},He.prototype.sibling=function(){return new He(this.parent,this.base)};var J=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Jt[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function Qi(e){for(var t in e)return!0;return!1}function Zi(e){return 105===e||109===e||115===e}function ei(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Yi(e){return Z(e,!0)||36===e||95===e}function Ji(e){return ae(e,!0)||36===e||95===e||8204===e||8205===e}function ti(e){return e>=65&&e<=90||e>=97&&e<=122}function es(e){return e>=0&&e<=1114111}J.prototype.reset=function(e,t,s){var i=-1!==s.indexOf("v"),n=-1!==s.indexOf("u");this.start=0|e,this.source=t+"",this.flags=s,i&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=n&&this.parser.options.ecmaVersion>=9)},J.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},J.prototype.at=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return-1;var n=s.charCodeAt(e);if(!t&&!this.switchU||n<=55295||n>=57344||e+1>=i)return n;var r=s.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n},J.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return i;var n,r=s.charCodeAt(e);return!t&&!this.switchU||r<=55295||r>=57344||e+1>=i||(n=s.charCodeAt(e+1))<56320||n>57343?e+1:e+2},J.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},J.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},J.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},J.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},J.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var s=this.pos,i=0,n=e;i<n.length;i+=1){var r=n[i],a=this.at(s,t);if(-1===a||a!==r)return!1;s=this.nextIndex(s,t)}return this.pos=s,!0},v.validateRegExpFlags=function(e){for(var t=e.validFlags,s=e.flags,i=!1,n=!1,r=0;r<s.length;r++){var a=s.charAt(r);-1===t.indexOf(a)&&this.raise(e.start,"Invalid regular expression flag"),s.indexOf(a,r+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===a&&(i=!0),"v"===a&&(n=!0)}this.options.ecmaVersion>=15&&i&&n&&this.raise(e.start,"Invalid regular expression flag")},v.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Qi(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},v.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,s=e.backReferenceNames;t<s.length;t+=1){var i=s[t];e.groupNames[i]||e.raise("Invalid named capture referenced")}},v.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new He(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},v.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},v.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},v.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var s=!1;if(this.options.ecmaVersion>=9&&(s=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!s,!0}return e.pos=t,!1},v.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},v.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},v.regexp_eatBracedQuantifier=function(e,t){var s=e.pos;if(e.eat(123)){var i=0,n=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue),e.eat(125)))return-1!==n&&n<i&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=s}return!1},v.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},v.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},v.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var s=this.regexp_eatModifiers(e),i=e.eat(45);if(s||i){for(var n=0;n<s.length;n++){var r=s.charAt(n);s.indexOf(r,n+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(i){var a=this.regexp_eatModifiers(e);!s&&!a&&58===e.current()&&e.raise("Invalid regular expression modifiers");for(var o=0;o<a.length;o++){var c=a.charAt(o);(a.indexOf(c,o+1)>-1||s.indexOf(c)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},v.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},v.regexp_eatModifiers=function(e){for(var t="",s=0;-1!==(s=e.current())&&Zi(s);)t+=te(s),e.advance();return t},v.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},v.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},v.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!ei(t)&&(e.lastIntValue=t,e.advance(),!0)},v.regexp_eatPatternCharacters=function(e){for(var t=e.pos,s=0;-1!==(s=e.current())&&!ei(s);)e.advance();return e.pos!==t},v.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},v.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,s=e.groupNames[e.lastStringValue];if(s)if(t)for(var i=0,n=s;i<n.length;i+=1){n[i].separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(s||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},v.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},v.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=te(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=te(e.lastIntValue);return!0}return!1},v.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),Yi(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},v.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),Ji(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},v.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},v.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var s=e.lastIntValue;if(e.switchU)return s>e.maxBackReference&&(e.maxBackReference=s),!0;if(s<=e.numCapturingParens)return!0;e.pos=t}return!1},v.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},v.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},v.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},v.regexp_eatZero=function(e){return 48===e.current()&&!Ke(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},v.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},v.regexp_eatControlLetter=function(e){var t=e.current();return!!ti(t)&&(e.lastIntValue=t%32,e.advance(),!0)},v.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var s=e.pos,i=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(i&&n>=55296&&n<=56319){var r=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=1024*(n-55296)+(a-56320)+65536,!0}e.pos=r,e.lastIntValue=n}return!0}if(i&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&es(e.lastIntValue))return!0;i&&e.raise("Invalid unicode escape"),e.pos=s}return!1},v.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},v.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};var ii=0,ie=1,z=2;function ts(e){return 100===e||68===e||115===e||83===e||119===e||87===e}function si(e){return ti(e)||95===e}function is(e){return si(e)||Ke(e)}function ss(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}function rs(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}function ns(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}function Ke(e){return e>=48&&e<=57}function ri(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function ni(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function ai(e){return e>=48&&e<=55}v.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(ts(t))return e.lastIntValue=-1,e.advance(),ie;var s=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((s=80===t)||112===t)){var i;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(i=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return s&&i===z&&e.raise("Invalid property name"),i;e.raise("Invalid property name")}return ii},v.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var s=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,s,i),ie}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n)}return ii},v.regexp_validateUnicodePropertyNameAndValue=function(e,t,s){be(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(s)||e.raise("Invalid property value")},v.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?ie:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?z:void e.raise("Invalid property name")},v.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";si(t=e.current());)e.lastStringValue+=te(t),e.advance();return""!==e.lastStringValue},v.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";is(t=e.current());)e.lastStringValue+=te(t),e.advance();return""!==e.lastStringValue},v.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},v.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),s=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&s===z&&e.raise("Negated character class may contain strings"),!0}return!1},v.regexp_classContents=function(e){return 93===e.current()?ie:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),ie)},v.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var s=e.lastIntValue;e.switchU&&(-1===t||-1===s)&&e.raise("Invalid character class"),-1!==t&&-1!==s&&t>s&&e.raise("Range out of order in character class")}}},v.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var s=e.current();(99===s||ai(s))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return 93!==i&&(e.lastIntValue=i,e.advance(),!0)},v.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},v.regexp_classSetExpression=function(e){var t,s=ie;if(!this.regexp_eatClassSetRange(e))if(t=this.regexp_eatClassSetOperand(e)){t===z&&(s=z);for(var i=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?t!==z&&(s=ie):e.raise("Invalid character in character class");if(i!==e.pos)return s;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(i!==e.pos)return s}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return s;t===z&&(s=z)}},v.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var s=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;return-1!==s&&-1!==i&&s>i&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},v.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?ie:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},v.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var s=e.eat(94),i=this.regexp_classContents(e);if(e.eat(93))return s&&i===z&&e.raise("Negated character class may contain strings"),i;e.pos=t}if(e.eat(92)){var n=this.regexp_eatCharacterClassEscape(e);if(n)return n;e.pos=t}return null},v.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var s=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return s}else e.raise("Invalid escape");e.pos=t}return null},v.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===z&&(t=z);return t},v.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?ie:z},v.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e))||(e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1));var s=e.current();return!(s<0||s===e.lookahead()&&ss(s)||rs(s))&&(e.advance(),e.lastIntValue=s,!0)},v.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!ns(t)&&(e.lastIntValue=t,e.advance(),!0)},v.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ke(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},v.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},v.regexp_eatDecimalDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;Ke(s=e.current());)e.lastIntValue=10*e.lastIntValue+(s-48),e.advance();return e.pos!==t},v.regexp_eatHexDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;ri(s=e.current());)e.lastIntValue=16*e.lastIntValue+ni(s),e.advance();return e.pos!==t},v.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var s=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*s+e.lastIntValue:e.lastIntValue=8*t+s}else e.lastIntValue=t;return!0}return!1},v.regexp_eatOctalDigit=function(e){var t=e.current();return ai(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},v.regexp_eatFixedHexDigits=function(e,t){var s=e.pos;e.lastIntValue=0;for(var i=0;i<t;++i){var n=e.current();if(!ri(n))return e.pos=s,!1;e.lastIntValue=16*e.lastIntValue+ni(n),e.advance()}return!0};var pt=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Ue(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},E=L.prototype;function as(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function oi(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}E.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new pt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},E.getToken=function(){return this.next(),new pt(this)},typeof Symbol<"u"&&(E[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===u.eof,value:t}}}}),E.nextToken=function(){var e=this.curContext();return(!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(u.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},E.readToken=function(e){return Z(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},E.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},E.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(-1===s&&this.raise(this.pos-2,"Unterminated comment"),this.pos=s+2,this.options.locations)for(var i=void 0,n=t;(i=It(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=i;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,s),t,this.pos,e,this.curPosition())},E.skipLineComment=function(e){for(var t=this.pos,s=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!ye(i);)i=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,s,this.curPosition())},E.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&Rt.test(String.fromCharCode(e))))break e;++this.pos}}},E.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var s=this.type;this.type=e,this.value=t,this.updateContext(s)},E.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(u.ellipsis)):(++this.pos,this.finishToken(u.dot))},E.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(u.assign,2):this.finishOp(u.slash,1)},E.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),s=1,i=42===e?u.star:u.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++s,i=u.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(u.assign,s+1):this.finishOp(i,s)},E.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(u.assign,3);return this.finishOp(124===e?u.logicalOR:u.logicalAND,2)}return 61===t?this.finishOp(u.assign,2):this.finishOp(124===e?u.bitwiseOR:u.bitwiseAND,1)},E.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(u.assign,2):this.finishOp(u.bitwiseXOR,1)},E.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!q.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(u.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(u.assign,2):this.finishOp(u.plusMin,1)},E.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),s=1;return t===e?(s=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+s)?this.finishOp(u.assign,s+1):this.finishOp(u.bitShift,s)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(s=2),this.finishOp(u.relational,s)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},E.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(u.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(u.arrow)):this.finishOp(61===e?u.eq:u.prefix,1)},E.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var s=this.input.charCodeAt(this.pos+2);if(s<48||s>57)return this.finishOp(u.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(u.assign,3);return this.finishOp(u.coalesce,2)}}return this.finishOp(u.question,1)},E.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,Z(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(u.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+te(e)+"'")},E.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(u.parenL);case 41:return++this.pos,this.finishToken(u.parenR);case 59:return++this.pos,this.finishToken(u.semi);case 44:return++this.pos,this.finishToken(u.comma);case 91:return++this.pos,this.finishToken(u.bracketL);case 93:return++this.pos,this.finishToken(u.bracketR);case 123:return++this.pos,this.finishToken(u.braceL);case 125:return++this.pos,this.finishToken(u.braceR);case 58:return++this.pos,this.finishToken(u.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(u.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(u.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+te(e)+"'")},E.finishOp=function(e,t){var s=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,s)},E.readRegexp=function(){for(var e,t,s=this.pos;;){this.pos>=this.input.length&&this.raise(s,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(q.test(i)&&this.raise(s,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var n=this.input.slice(s,this.pos);++this.pos;var r=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(r);var o=this.regexpState||(this.regexpState=new J(this));o.reset(s,n,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var c=null;try{c=new RegExp(n,a)}catch{}return this.finishToken(u.regexp,{pattern:n,flags:a,value:c})},E.readInt=function(e,t,s){for(var i=this.options.ecmaVersion>=12&&void 0===t,n=s&&48===this.input.charCodeAt(this.pos),r=this.pos,a=0,o=0,c=0,l=t??1/0;c<l;++c,++this.pos){var h=this.input.charCodeAt(this.pos),p=void 0;if(i&&95===h)n&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===o&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===c&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=h;else{if((p=h>=97?h-97+10:h>=65?h-65+10:h>=48&&h<=57?h-48:1/0)>=e)break;o=h,a=a*e+p}}return i&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===r||null!=t&&this.pos-r!==t?null:a},E.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var s=this.readInt(e);return null==s&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(s=oi(this.input.slice(t,this.pos)),++this.pos):Z(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(u.num,s)},E.readNumber=function(e){var t=this.pos;!e&&null===this.readInt(10,void 0,!0)&&this.raise(t,"Invalid number");var s=this.pos-t>=2&&48===this.input.charCodeAt(t);s&&this.strict&&this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!s&&!e&&this.options.ecmaVersion>=11&&110===i){var n=oi(this.input.slice(t,this.pos));return++this.pos,Z(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(u.num,n)}s&&/[89]/.test(this.input.slice(t,this.pos))&&(s=!1),46===i&&!s&&(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),(69===i||101===i)&&!s&&((43===(i=this.input.charCodeAt(++this.pos))||45===i)&&++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),Z(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var r=as(this.input.slice(t,this.pos),s);return this.finishToken(u.num,r)},E.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},E.readString=function(e){for(var t="",s=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t+=this.input.slice(s,this.pos),t+=this.readEscapedChar(!1),s=this.pos):8232===i||8233===i?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(ye(i)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(s,this.pos++),this.finishToken(u.string,t)};var ui={};E.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==ui)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},E.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ui;this.raise(e,t)},E.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var s=this.input.charCodeAt(this.pos);if(96===s||36===s&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==u.template&&this.type!==u.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(u.template,e)):36===s?(this.pos+=2,this.finishToken(u.dollarBraceL)):(++this.pos,this.finishToken(u.backQuote));if(92===s)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(ye(s)){switch(e+=this.input.slice(t,this.pos),++this.pos,s){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(s)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},E.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(u.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},E.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return te(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var s=this.pos-1;this.invalidStringToken(s,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(i,8);return n>255&&(i=i.slice(0,-1),n=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),("0"!==i||56===t||57===t)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return ye(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},E.readHexChar=function(e){var t=this.pos,s=this.readInt(16,e);return null===s&&this.invalidStringToken(t,"Bad character escape sequence"),s},E.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,s=this.pos,i=this.options.ecmaVersion>=6;this.pos<this.input.length;){var n=this.fullCharCodeAtPos();if(ae(n,i))this.pos+=n<=65535?1:2;else{if(92!==n)break;this.containsEsc=!0,e+=this.input.slice(s,this.pos);var r=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?Z:ae)(a,i)||this.invalidStringToken(r,"Invalid Unicode escape"),e+=te(a),s=this.pos}t=!1}return e+this.input.slice(s,this.pos)},E.readWord=function(){var e=this.readWord1(),t=u.name;return this.keywords.test(e)&&(t=at[e]),this.finishToken(t,e)};var os="8.15.0";function Ye(e,t){return L.parse(e,t)}function us(e,t,s){return L.parseExpressionAt(e,t,s)}function Je(e,t,s,i,n){var r=[];s||(s=g),function e(i,n,a){var o=a||i.type,c=i!==r[r.length-1];c&&r.push(i),s[o](i,n,e),t[o]&&t[o](i,n||r,r),c&&r.pop()}(e,i,n)}function ft(e,t,s){s(e,t)}function pe(e,t,s){}L.acorn={Parser:L,version:os,defaultOptions:it,Position:Pe,SourceLocation:Ue,getLineInfo:Lt,Node:je,TokenType:T,tokTypes:u,keywordTypes:at,TokContext:X,tokContexts:I,isIdentifierChar:ae,isIdentifierStart:Z,Token:pt,isNewLine:ye,lineBreak:q,lineBreakG:Pi,nonASCIIwhitespace:Rt};var g={};g.Program=g.BlockStatement=g.StaticBlock=function(e,t,s){for(var i=0,n=e.body;i<n.length;i+=1){s(n[i],t,"Statement")}},g.Statement=ft,g.EmptyStatement=pe,g.ExpressionStatement=g.ParenthesizedExpression=g.ChainExpression=function(e,t,s){return s(e.expression,t,"Expression")},g.IfStatement=function(e,t,s){s(e.test,t,"Expression"),s(e.consequent,t,"Statement"),e.alternate&&s(e.alternate,t,"Statement")},g.LabeledStatement=function(e,t,s){return s(e.body,t,"Statement")},g.BreakStatement=g.ContinueStatement=pe,g.WithStatement=function(e,t,s){s(e.object,t,"Expression"),s(e.body,t,"Statement")},g.SwitchStatement=function(e,t,s){s(e.discriminant,t,"Expression");for(var i=0,n=e.cases;i<n.length;i+=1){s(n[i],t)}},g.SwitchCase=function(e,t,s){e.test&&s(e.test,t,"Expression");for(var i=0,n=e.consequent;i<n.length;i+=1){s(n[i],t,"Statement")}},g.ReturnStatement=g.YieldExpression=g.AwaitExpression=function(e,t,s){e.argument&&s(e.argument,t,"Expression")},g.ThrowStatement=g.SpreadElement=function(e,t,s){return s(e.argument,t,"Expression")},g.TryStatement=function(e,t,s){s(e.block,t,"Statement"),e.handler&&s(e.handler,t),e.finalizer&&s(e.finalizer,t,"Statement")},g.CatchClause=function(e,t,s){e.param&&s(e.param,t,"Pattern"),s(e.body,t,"Statement")},g.WhileStatement=g.DoWhileStatement=function(e,t,s){s(e.test,t,"Expression"),s(e.body,t,"Statement")},g.ForStatement=function(e,t,s){e.init&&s(e.init,t,"ForInit"),e.test&&s(e.test,t,"Expression"),e.update&&s(e.update,t,"Expression"),s(e.body,t,"Statement")},g.ForInStatement=g.ForOfStatement=function(e,t,s){s(e.left,t,"ForInit"),s(e.right,t,"Expression"),s(e.body,t,"Statement")},g.ForInit=function(e,t,s){"VariableDeclaration"===e.type?s(e,t):s(e,t,"Expression")},g.DebuggerStatement=pe,g.FunctionDeclaration=function(e,t,s){return s(e,t,"Function")},g.VariableDeclaration=function(e,t,s){for(var i=0,n=e.declarations;i<n.length;i+=1){s(n[i],t)}},g.VariableDeclarator=function(e,t,s){s(e.id,t,"Pattern"),e.init&&s(e.init,t,"Expression")},g.Function=function(e,t,s){e.id&&s(e.id,t,"Pattern");for(var i=0,n=e.params;i<n.length;i+=1){s(n[i],t,"Pattern")}s(e.body,t,e.expression?"Expression":"Statement")},g.Pattern=function(e,t,s){"Identifier"===e.type?s(e,t,"VariablePattern"):"MemberExpression"===e.type?s(e,t,"MemberPattern"):s(e,t)},g.VariablePattern=pe,g.MemberPattern=ft,g.RestElement=function(e,t,s){return s(e.argument,t,"Pattern")},g.ArrayPattern=function(e,t,s){for(var i=0,n=e.elements;i<n.length;i+=1){var r=n[i];r&&s(r,t,"Pattern")}},g.ObjectPattern=function(e,t,s){for(var i=0,n=e.properties;i<n.length;i+=1){var r=n[i];"Property"===r.type?(r.computed&&s(r.key,t,"Expression"),s(r.value,t,"Pattern")):"RestElement"===r.type&&s(r.argument,t,"Pattern")}},g.Expression=ft,g.ThisExpression=g.Super=g.MetaProperty=pe,g.ArrayExpression=function(e,t,s){for(var i=0,n=e.elements;i<n.length;i+=1){var r=n[i];r&&s(r,t,"Expression")}},g.ObjectExpression=function(e,t,s){for(var i=0,n=e.properties;i<n.length;i+=1){s(n[i],t)}},g.FunctionExpression=g.ArrowFunctionExpression=g.FunctionDeclaration,g.SequenceExpression=function(e,t,s){for(var i=0,n=e.expressions;i<n.length;i+=1){s(n[i],t,"Expression")}},g.TemplateLiteral=function(e,t,s){for(var i=0,n=e.quasis;i<n.length;i+=1){s(n[i],t)}for(var r=0,a=e.expressions;r<a.length;r+=1){s(a[r],t,"Expression")}},g.TemplateElement=pe,g.UnaryExpression=g.UpdateExpression=function(e,t,s){s(e.argument,t,"Expression")},g.BinaryExpression=g.LogicalExpression=function(e,t,s){s(e.left,t,"Expression"),s(e.right,t,"Expression")},g.AssignmentExpression=g.AssignmentPattern=function(e,t,s){s(e.left,t,"Pattern"),s(e.right,t,"Expression")},g.ConditionalExpression=function(e,t,s){s(e.test,t,"Expression"),s(e.consequent,t,"Expression"),s(e.alternate,t,"Expression")},g.NewExpression=g.CallExpression=function(e,t,s){if(s(e.callee,t,"Expression"),e.arguments)for(var i=0,n=e.arguments;i<n.length;i+=1){s(n[i],t,"Expression")}},g.MemberExpression=function(e,t,s){s(e.object,t,"Expression"),e.computed&&s(e.property,t,"Expression")},g.ExportNamedDeclaration=g.ExportDefaultDeclaration=function(e,t,s){e.declaration&&s(e.declaration,t,"ExportNamedDeclaration"===e.type||e.declaration.id?"Statement":"Expression"),e.source&&s(e.source,t,"Expression")},g.ExportAllDeclaration=function(e,t,s){e.exported&&s(e.exported,t),s(e.source,t,"Expression")},g.ImportDeclaration=function(e,t,s){for(var i=0,n=e.specifiers;i<n.length;i+=1){s(n[i],t)}s(e.source,t,"Expression")},g.ImportExpression=function(e,t,s){s(e.source,t,"Expression")},g.ImportSpecifier=g.ImportDefaultSpecifier=g.ImportNamespaceSpecifier=g.Identifier=g.PrivateIdentifier=g.Literal=pe,g.TaggedTemplateExpression=function(e,t,s){s(e.tag,t,"Expression"),s(e.quasi,t,"Expression")},g.ClassDeclaration=g.ClassExpression=function(e,t,s){return s(e,t,"Class")},g.Class=function(e,t,s){e.id&&s(e.id,t,"Pattern"),e.superClass&&s(e.superClass,t,"Expression"),s(e.body,t)},g.ClassBody=function(e,t,s){for(var i=0,n=e.body;i<n.length;i+=1){s(n[i],t)}},g.MethodDefinition=g.PropertyDefinition=g.Property=function(e,t,s){e.computed&&s(e.key,t,"Expression"),e.value&&s(e.value,t,"Expression")};class W{static pruneCache(e){e.size>this.MAX_CACHE_SIZE&&Array.from(e.keys()).slice(0,e.size-this.MAX_CACHE_SIZE/2).forEach(t=>e.delete(t))}static clearCaches(){this.expressionCache.clear(),this.variableCache.clear(),this.bindingsCache.clear(),this.loopVariableCache.clear()}static extractStateBindings(e){if(this.bindingsCache.has(e))return[...this.bindingsCache.get(e)];const t=new Set;try{Je(Ye(e,{ecmaVersion:2020}),{FunctionDeclaration(e,s){s.length<=2&&e.id&&e.id.name&&t.add(e.id.name)},VariableDeclaration(e,s){s.length>2||e.declarations.forEach(e=>{var s,i,n,r,a;"CallExpression"!==(null==(s=e.init)?void 0:s.type)||"pp"!==(null==(n=null==(i=e.init.callee)?void 0:i.object)?void 0:n.name)||"state"!==(null==(a=null==(r=e.init.callee)?void 0:r.property)?void 0:a.name)?("Identifier"===e.id.type&&t.add(e.id.name),"ObjectPattern"===e.id.type&&e.id.properties.forEach(e=>{var s,i;"Property"===e.type&&"Identifier"===(null==(s=e.value)?void 0:s.type)&&t.add(e.value.name),"RestElement"===e.type&&"Identifier"===(null==(i=e.argument)?void 0:i.type)&&t.add(e.argument.name)})):"ArrayPattern"===e.id.type&&e.id.elements.forEach(e=>{"Identifier"===(null==e?void 0:e.type)&&t.add(e.name)})})}})}catch(e){console.error("[PP-ERROR] AstParser Failed",e)}const s=Array.from(t);return this.pruneCache(this.bindingsCache),this.bindingsCache.set(e,s),s}static extractUsedVariables(e,t){const s=e+"|"+Array.from(t).sort().join(",");if(this.variableCache.has(s))return new Set(this.variableCache.get(s));const i=new Set;try{Je(Ye(`(${e})`,{ecmaVersion:2020}),{Identifier(e,s){if(!t.has(e.name)){if(s.length>1){const t=s[s.length-2];if("MemberExpression"===t.type&&t.property===e&&!t.computed||"Property"===t.type&&t.key===e&&!t.computed&&!t.shorthand)return}i.add(e.name)}}})}catch{}return this.pruneCache(this.variableCache),this.variableCache.set(s,i),new Set(i)}static isValidExpression(e){if(!e.trim())return!1;if(this.expressionCache.has(e))return this.expressionCache.get(e);let t=!1;try{us(`(${e})`,0,{ecmaVersion:2020}),t=!0}catch{t=!1}return this.pruneCache(this.expressionCache),this.expressionCache.set(e,t),t}static analyzeLoopVariableUsage(e,t){const s=e+"|"+t;if(this.loopVariableCache.has(s))return[...this.loopVariableCache.get(s)];const i=[];try{Je(Ye(e,{ecmaVersion:2020}),{Identifier(e,s){if(e.name!==t)return;let n=!1,r=!1,a=e.start,o=e.end;if(s.length>=2){const t=s[s.length-2];if("MemberExpression"===t.type&&t.property===e&&!t.computed||"Property"===t.type&&t.key===e&&!t.computed&&!t.shorthand)return;if("Property"===t.type&&t.shorthand&&(n=!0,s.length>=3)){const e=s[s.length-3];"ObjectExpression"===e.type&&1===e.properties.length&&(r=!0,a=e.start,o=e.end)}}i.push({start:a,end:o,isShorthand:n,isUnwrap:r})}})}catch{}return this.pruneCache(this.loopVariableCache),this.loopVariableCache.set(s,i),[...i]}}m(W,"expressionCache",new Map),m(W,"variableCache",new Map),m(W,"bindingsCache",new Map),m(W,"loopVariableCache",new Map),m(W,"MAX_CACHE_SIZE",1e3);class ve{static escapeTemplateLiteralText(e){return e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}static getRuntimeEscaperSource(){return"\nconst __pp_escape_html = (value) => String(value)\n .split('&').join('&amp;')\n .split('<').join('&lt;')\n .split('>').join('&gt;')\n .split('\"').join('&quot;')\n .split(\"'\").join('&#39;');\nconst __pp_raw_html = (value) => ({ __ppRawHtml: String(value) });\nconst __pp_render_value = (value) => {\n if (typeof value === 'boolean' || value == null) return '';\n if (value && typeof value === 'object' && Object.prototype.hasOwnProperty.call(value, '__ppRawHtml')) return value.__ppRawHtml;\n if (Array.isArray(value)) return value.map(__pp_render_value).join('');\n return __pp_escape_html(value);\n};\n"}static escapeTemplateLiteralTextPreservingInterpolations(e){let t="",s=0,i=0;for(;s<e.length;){if("$"===e[s]&&"{"===e[s+1]){const n=this.findClosingBrace(e,s+1);if(-1!==n){t+=this.escapeTemplateLiteralText(e.slice(i,s)),t+=e.slice(s,n+1),s=n+1,i=s;continue}}s++}return t+=this.escapeTemplateLiteralText(e.slice(i)),t}static clearCache(){this.cache.clear()}static pruneCache(){if(this.cache.size>this.MAX_CACHE_SIZE){const e=this.cache.size-Math.floor(this.MAX_CACHE_SIZE/2);let t=0;for(const s of this.cache.keys()){if(t>=e)break;this.cache.delete(s),t++}}}static transformSpreadAttributes(e){const t=new Map;let s=0;const i=document.createElement("template");i.innerHTML=e;const n=e=>{if(e.nodeType===Node.ELEMENT_NODE){const i=e;if(Array.from(i.childNodes).forEach(n),i.hasAttribute("pp-spread")){const e=i.getAttribute("pp-spread")||"";i.removeAttribute("pp-spread");const n=e.match(/^\s*\{\s*\.\.\.(.+?)\s*\}\s*$/);if(n){const e=U(n[1].trim()),r=`___pp_spread_${s++}___`,a=`\${ (() => {\n const __obj = ${e};\n if (!__obj || typeof __obj !== 'object') return '';\n return Object.entries(__obj)\n .map(([k, v]) => {\n if (v == null) return '';\n const __attrName = String(k);\n if (!/^[^\\s"'<>/=]+$/.test(__attrName) || /^on/i.test(__attrName)) return '';\n const __escapedValue = String(v)\n .split('&').join('&amp;')\n .split('"').join('&quot;')\n .split("'").join('&#39;')\n .split('<').join('&lt;')\n .split('>').join('&gt;');\n return __attrName + '="' + __escapedValue + '"';\n })\n .filter(Boolean)\n .join(' ');\n })() }`;t.set(r,a),i.setAttribute(r,"")}}}};return Array.from(i.content.childNodes).forEach(n),{html:i.innerHTML,spreadReplacements:t}}static expandSpreadPlaceholders(e,t){let s=e;return t.forEach((e,t)=>{s=s.split(`${t}=""`).join(e),s=s.split(t).join(e)}),s}static transformRefAttributes(e){if(!e.includes("pp-ref"))return e;const t=document.createElement("template");t.innerHTML=e;const s=document.createTreeWalker(t.content,NodeFilter.SHOW_ELEMENT);let i=s.nextNode();for(;i;){const e=i;if(e.hasAttribute("pp-ref")){const t=(e.getAttribute("pp-ref")||"").match(/^\s*\{([\s\S]+)\}\s*$/);if(t){const s=U(t[1].trim());e.removeAttribute("pp-ref"),e.setAttribute("data-pp-ref",`{ __pp_ref(${s}) }`)}}i=s.nextNode()}return t.innerHTML}static transformComponentTags(e){const t=document.createElement("template");t.innerHTML=e;const s=e=>{if(e.nodeType!==Node.ELEMENT_NODE)return;const t=e,i=t.tagName.toLowerCase();if(Array.from(t.childNodes).forEach(s),i.includes(".")){const e=document.createDocumentFragment();for(e.appendChild(document.createTextNode(`{${i}}`));t.firstChild;)e.appendChild(t.firstChild);t.replaceWith(e)}};return Array.from(t.content.childNodes).forEach(s),t.innerHTML}static transformContextProviderTags(e){if(!/\.provider\b/i.test(e))return e;let t="",s=0;for(;s<e.length;){const i=e.slice(s).match(/^<([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\.Provider)\b([^>]*)>/i);if(!i){t+=e[s],s+=1;continue}const n=i[1],r=i[2]??"",a=s+i[0].length,o=this.findMatchingContextProviderClose(e,a);if(!o){t+=e[s],s+=1;continue}const c=this.transformContextProviderTags(e.slice(a,o.start));t+=`<pp-context-provider data-pp-context-token="{ __pp_context_token(__pp_context_lookup(${`'${n.replace(/\.Provider$/i,"").replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`})) }" data-pp-context-value="{ __pp_context_value(${this.extractContextProviderValueExpression(r)}) }">`+c+"</pp-context-provider>",s=o.end}return t}static findMatchingContextProviderClose(e,t){this.CONTEXT_PROVIDER_TAG_PATTERN.lastIndex=t;let s,i=1;for(;s=this.CONTEXT_PROVIDER_TAG_PATTERN.exec(e);){const e=s[0];if(i+=e.startsWith("</")?-1:1,0===i)return{start:s.index,end:s.index+e.length}}return null}static extractContextProviderValueExpression(e){const t=e.match(/\bvalue\s*=\s*(?:"([\s\S]*?)"|'([\s\S]*?)'|([^\s>]+))/i);if(!t)return"undefined";const s=t[1]??t[2]??t[3]??"",i=U(s.trim()).match(/^\{([\s\S]*)\}$/);return i?i[1].trim():JSON.stringify(s)}static normalizeTextareaValueAttributes(e){if(!e.includes("<textarea")||!e.includes("value="))return e;const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("textarea").forEach(e=>{const t=e,s=t.getAttribute("value");null!==s&&(t.textContent=s,t.removeAttribute("value"))}),t.innerHTML}static transformStyleAliasAttributes(e){if(!e.includes("pp-style"))return e;const t=document.createElement("template");t.innerHTML=e;const s=document.createTreeWalker(t.content,NodeFilter.SHOW_ELEMENT);let i=s.nextNode();for(;i;){const e=i;if(e.hasAttribute("pp-style")){const t=e.getAttribute("pp-style")??"",s=e.getAttribute("style")??"";e.removeAttribute("pp-style");const i=this.mergeStyleAttributeValues(s,t);i.length>0&&e.setAttribute("style",i)}i=s.nextNode()}return t.innerHTML}static mergeStyleAttributeValues(e,t){const s=e.trim(),i=t.trim().replace(/^;+\s*/,"");return s?i?`${s.endsWith(";")?s:`${s};`} ${i}`:s:i}static transformSelectValueAttributes(e){if(!e.includes("<select")||!e.includes("value="))return e;const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("select").forEach(e=>{const t=e,s=t.getAttribute("value");if(null===s)return;const i=s.match(/^\s*\{([\s\S]+)\}\s*$/);if(!i)return;const n=U(i[1].trim());t.removeAttribute("value"),t.setAttribute("data-pp-select-value",`{ __pp_select_value(${n}) }`)}),t.innerHTML}static transformDefaultValueAttributes(e){if(!e.includes("default"))return e;const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("input, textarea, select").forEach(e=>{const t=e,s=t.getAttribute("defaultvalue");if(null===s)return;const i=s.match(/^\s*\{([\s\S]+)\}\s*$/);if(!i)return;const n=U(i[1].trim());t.removeAttribute("defaultvalue"),t.setAttribute("data-pp-default-value",`{ __pp_default_value(${n}) }`)}),t.innerHTML}static transformDefaultCheckedAttributes(e){if(!e.includes("default"))return e;const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("input").forEach(e=>{const t=e,s=t.getAttribute("defaultchecked");if(null===s)return;const i=s.match(/^\s*\{([\s\S]+)\}\s*$/);if(!i)return;const n=U(i[1].trim());t.removeAttribute("defaultchecked"),t.setAttribute("data-pp-default-checked",`{ __pp_default_checked(${n}) }`)}),t.innerHTML}static compile(e,t){const s=(e||"").replace(/\r\n/g,"\n").replace(/\r/g,"\n"),i=e=>{let t=2166136261;for(let s=0;s<e.length;s++)t^=e.charCodeAt(s),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t.toString(16).padStart(8,"0")},n=t.join("\0"),r=`t${i(s)}|k${i(n)}|n${t.length}`;if(this.cache.has(r))return this.cache.get(r);const a=this.transformContextProviderTags(s),{maskedTemplate:o,placeholders:c}=this.maskComplexComponents(a),{maskedHtml:l,placeholders:h}=this.maskLiteralElements(o,"style","STYLE"),{maskedHtml:p,placeholders:u}=this.maskLiteralElements(l,"code","CODE",e=>!this.isPureBindingLiteral(e.innerHTML)),{maskedHtml:d,placeholders:f}=this.maskLiteralElements(p,"script","SCRIPT"),m=this.transformComponentTags(d),g=this.transformStyleAliasAttributes(m),v=this.normalizeTextareaValueAttributes(kt(g)),y=this.transformSelectValueAttributes(v),x=this.transformDefaultValueAttributes(y),_=this.transformDefaultCheckedAttributes(x),{html:b,spreadReplacements:C}=this.transformSpreadAttributes(_),S=this.transformRefAttributes(b),{html:E,loopReplacements:w}=this.processStructuralDirectives(S);let k=this.transformBooleanAttributes(E);(()=>{let e=!0;for(;e;)e=!1,w.forEach((t,s)=>{const i=k;k=k.split("${"+s+"}").join("${"+t+"}"),k=k.split(s).join("{ __pp_raw_html("+t+") }"),k!==i&&(e=!0)})})();const A=new Set;let T=this.getRuntimeEscaperSource()+"return `",P=0,I="";for(;P<k.length;){const e=k[P];if("o"===e||"O"===e){const e=k.slice(P,P+20).toLowerCase().match(/^on\w+\s*=\s*(["'])/);if(e){const t=k.slice(P,P+e[0].length),s=t[t.length-1];let i=P+e[0].length;for(;i<k.length&&(k[i]!==s||"\\"===k[i-1]);)i++;I+=k.slice(P,i+1),P=i+1;continue}}if("{"===e){const e=this.findClosingBrace(k,P);if(-1!==e){const t=k.slice(P+1,e),s=U(t);if(W.isValidExpression(s)){T+=this.escapeTemplateLiteralText(I),I="";const t=W.extractUsedVariables(s,di);for(const e of t)/^___PP_LOOP_\d+___$/.test(e)||A.add(e);const i=s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g," ");T+=`\${ (() => {\n try {\n const __res = (${s});\n return __pp_render_value(__res);\n } catch(e) {\n console.error("[PP-ERROR] Template Expression Failed: \\"${i}\\"", e);\n return '';\n }\n })() }`,P=e+1;continue}t.trim().length>0&&console.warn(`[PP-WARN] Interpolation skipped. Invalid Syntax in: "{${s}}"`)}}I+=e,P++}T+=this.escapeTemplateLiteralText(I),T+="`;",T=this.expandSpreadPlaceholders(T,C);const R=t.slice();try{const e=new Function(...R,T),t=(...t)=>{let s=e(...t);return s=this.restorePlaceholders(s,f),s=this.restorePlaceholders(s,u),s=this.restorePlaceholders(s,h),c.forEach((e,t)=>{s=s.replace(t,e)}),s};return this.pruneCache(),this.cache.set(r,t),t}catch(e){return console.error("[PP-ERROR] Compilation Failed",e),()=>"Error in Template"}}static maskLiteralElements(e,t,s,i=()=>!0){const n=document.createElement("template");n.innerHTML=e;const r=new Map;let a=0;return n.content.querySelectorAll(t).forEach(e=>{if(!i(e))return;const t=`__PP_${s}_${a++}__`;r.set(t,e.outerHTML),e.replaceWith(document.createTextNode(t))}),{maskedHtml:n.innerHTML,placeholders:r}}static isPureBindingLiteral(e){return/^\s*\{[\s\S]*\}\s*$/.test(e)}static restorePlaceholders(e,t){let s=e;return t.forEach((e,t)=>{s=s.replace(t,e)}),s}static transformBooleanAttributes(e){let t="",s=0;for(;s<e.length;){let i=!1;for(const n of wt){const r=`${n}="{`,a=`${n}='{`;if(e.startsWith(r,s)){i=!0;const a=s+r.length-1,o=this.findClosingBrace(e,a);if(-1!==o&&'"'===e[o+1]){const i=U(e.slice(a+1,o)),r=i.replace(/\\/g,"\\\\").replace(/'/g,"\\'");t+=`{ (() => { const __ppAttr = (${i}); if (typeof __ppAttr === 'boolean') return __pp_raw_html(__ppAttr ? '${n}' : ''); if (__ppAttr == null) return ''; if (typeof __ppAttr === 'string' || typeof __ppAttr === 'number' || typeof __ppAttr === 'bigint') return __pp_raw_html('${n}="' + __pp_escape_html(__ppAttr) + '"'); return __pp_raw_html('${n}="{${r}}"'); })() }`,s=o+2;break}}else if(e.startsWith(a,s)){i=!0;const r=s+a.length-1,o=this.findClosingBrace(e,r);if(-1!==o&&"'"===e[o+1]){const i=U(e.slice(r+1,o)),a=i.replace(/\\/g,"\\\\").replace(/'/g,"\\'");t+=`{ (() => { const __ppAttr = (${i}); if (typeof __ppAttr === 'boolean') return __pp_raw_html(__ppAttr ? '${n}' : ''); if (__ppAttr == null) return ''; if (typeof __ppAttr === 'string' || typeof __ppAttr === 'number' || typeof __ppAttr === 'bigint') return __pp_raw_html('${n}="' + __pp_escape_html(__ppAttr) + '"'); return __pp_raw_html('${n}="{${a}}"'); })() }`,s=o+2;break}}}i||(t+=e[s],s++)}return t}static captureLoopVariablesInEventHandlers(e,t,s,i,n=!1,r=[]){let a="",o=0;for(;o<e.length;){const c=e.slice(o,o+40).toLowerCase().match(/^on\w+\s*=\s*(["'])/);if(c){const l=c[0].length,h=e.slice(o,o+l),p=h[h.length-1],u=o+l;let d=u;for(;d<e.length&&(e[d]!==p||"\\"===e[d-1]);)d++;const f=h.slice(0,-2).trim();let m=e.slice(u,d);m=this.rewriteLoopEventHandlerCode(m,t,s,i,n,r),a+=`${f}=${p}${m}${p}`,o=d+1;continue}a+=e[o],o++}return a}static rewriteLoopEventHandlerCode(e,t,s,i,n,r=[]){const a=e.match(/^\{([\s\S]*)\}$/),o=a?a[1]:e;let c=s,l=o;r.forEach(e=>{c=this.applyLoopContextRewrites(c,e),l=this.applyLoopContextRewrites(l,e)});const h={iterator:t,collectionName:c,indexVar:i,userDefinedIndex:n};return l=this.applyLoopContextRewrites(l,h),[...r,h].forEach(e=>{const t=this.getLoopIndexToken(e.indexVar);l=l.split(t).join(`\${${e.indexVar}}`)}),a?`{${l}}`:l}static getLoopIndexToken(e){return`__PP_LOOP_IDX_${e}__`}static applyLoopContextRewrites(e,t){const s=this.getLoopIndexToken(t.indexVar);let i=e;return t.userDefinedIndex&&(i=this.replaceLoopIdentifierUsages(i,t.indexVar,s)),this.replaceLoopIdentifierUsages(i,t.iterator,`(${t.collectionName})[${s}]`)}static replaceLoopIdentifierUsages(e,t,s){const i=W.analyzeLoopVariableUsage(e,t).slice().sort((e,t)=>t.start-e.start);if(0===i.length)return e;let n=e;return i.forEach(e=>{const i=e.isShorthand?this.buildShorthandReplacement(t,s,e.isUnwrap):s;n=n.slice(0,e.start)+i+n.slice(e.end)}),n}static buildShorthandReplacement(e,t,s){return s?`{ ${e}: ${t} }`:`${e}: ${t}`}static processStructuralDirectives(e){if(!e.includes("pp-for"))return{html:e,loopReplacements:new Map};const t=document.createElement("template");t.innerHTML=e;const s=new Map;let i=0,n=0;const r=(e,t=[])=>{const a=Array.from(e.childNodes);for(const e of a){if(e.nodeType!==Node.ELEMENT_NODE)continue;const a=e;if("TEMPLATE"===a.tagName){const e=a,o=e.getAttribute("pp-for")||"";let c=null;if(e.hasAttribute("pp-for")){const e=o.match(/^\s*\(\s*(.+?)\s*,\s*(.+?)\s*\)\s+in\s+(.+?)\s*$/),t=o.match(/^\s*(.+?)\s+in\s+(.+?)\s*$/);let s,i,r,a=!1;if(e)s=e[1].trim(),i=e[2].trim(),r=e[3].trim(),a=!0;else{if(!t)continue;s=t[1].trim(),r=t[2].trim(),i="__pp_idx_"+n++}c={iterator:s,collectionName:r,indexVar:i,userDefinedIndex:a}}if(r(e.content,c?[...t,c]:t),c){const{iterator:n,collectionName:r,indexVar:a,userDefinedIndex:o}=c;let l=e.innerHTML;l=this.transformContextProviderTags(l),l=this.transformComponentTags(l),l=this.transformRefAttributes(l),l=this.transformStyleAliasAttributes(l),l=this.captureLoopVariablesInEventHandlers(l,n,r,a,o,t),l=l.replace(/___PP_LOOP_\d+___/g,e=>"${"+e+"}"),l=l.replace(/\r/g,""),l=this.transformBooleanAttributes(l),l=this.transformInterpolations(l),l=this.escapeTemplateLiteralTextPreservingInterpolations(l);const h=`(Array.isArray(${r}) ? ${r} : []).map(${`(${n}, ${a})`} => \`${l}\`).join('')`,p=`___PP_LOOP_${i++}___`;s.set(p,h),e.replaceWith(document.createTextNode(p));continue}continue}r(a,t)}};return r(t.content),{html:t.innerHTML,loopReplacements:s}}static transformInterpolations(e){let t="",s=0;for(;s<e.length;){if("o"===e[s]||"O"===e[s]){const i=e.slice(s,s+20).toLowerCase().match(/^on\w+\s*=\s*(["'])/);if(i){const n=e.slice(s,s+i[0].length),r=n[n.length-1];let a=s+i[0].length;for(;a<e.length&&(e[a]!==r||"\\"===e[a-1]);)a++;t+=e.slice(s,a+1),s=a+1;continue}}if("{"===e[s]){if(s>0&&"$"===e[s-1]){t+="{",s++;continue}const i=this.findClosingBrace(e,s);if(-1!==i){const n=U(e.slice(s+1,i));if(W.isValidExpression(n)){t+="${__pp_render_value("+n+")}",s=i+1;continue}}}t+=e[s],s++}return t}static maskComplexComponents(e){if(!e.includes("pp-component="))return{maskedTemplate:e,placeholders:new Map};const t=document.createElement("template");t.innerHTML=e;const s=new Map;let i=0;const n=e=>{if(e instanceof Element&&e.hasAttribute("pp-component")){const t=!!e.querySelector("script"),n=!!e.querySelector("template[pp-owner]");if(t||n){const t=`__PP_CHILD_${i++}__`;return s.set(t,e.outerHTML),void e.replaceWith(document.createTextNode(t))}}Array.from(e.children).forEach(e=>n(e))};return n(t.content),{maskedTemplate:t.innerHTML,placeholders:s}}static findClosingBrace(e,t){let s=0,i=null;for(let n=t;n<e.length;n++){const t=e[n];let r=!1;if(n>0&&"\\"===e[n-1]){let t=0,s=n-1;for(;s>=0&&"\\"===e[s];)t++,s--;t%2!=0&&(r=!0)}if(i)t===i&&!r&&(i=null);else if(r||'"'!==t&&"'"!==t&&"`"!==t)if("{"!==t||r){if("}"===t&&!r&&(s--,0===s))return n}else s++;else i=t}return-1}}m(ve,"cache",new Map),m(ve,"MAX_CACHE_SIZE",200),m(ve,"CONTEXT_PROVIDER_TAG_PATTERN",/<\/?([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\.Provider)\b[^>]*>/gi);const cs=Symbol.for("pp.context");let Oe=null;function ls(e){if(!e||"object"!=typeof e||!("value"in e))throw new Error("Context.Provider expects an object like { value, children? }.");return e}function hs(e,t){const s=Oe;Oe=e;try{return t()}finally{Oe=s}}function ps(e){const t={$$typeof:cs,defaultValue:e,Provider:e=>{const s=ls(e),i=Oe;if(!i)throw new Error("Context.Provider() can only be used while a component is rendering.");return i(t,s.value),s.children??null}};return t}const _t=new Set(["data-state","data-open","style","aria-hidden","hidden","inert"]),Ct=new Set(["alert-dialog-content","alert-dialog-overlay","alert-dialog-portal","dialog-content","dialog-overlay","dialog-portal","popover-content","sheet-content","sheet-overlay","sheet-portal","tooltip-content"]),fs=["script","domDiff","bindEvents","bindRefs","bootstrapNested","portals","restoreFocus","layoutEffects","effects","total"];function St(){return typeof performance<"u"&&"function"==typeof performance.now?performance.now():Date.now()}const V=class e{constructor(e){m(this,"el"),m(this,"id"),m(this,"rawTemplate"),m(this,"renderFunction"),m(this,"templateFn",null),m(this,"hooksSystem"),m(this,"eventManager"),m(this,"latestScope",{}),m(this,"__ppRefStore",new Map),m(this,"__ppRefSeq",0),m(this,"__ppRefCaptureIdsByElement",new WeakMap),m(this,"__ppRefExprsByElement",new WeakMap),m(this,"__ppRefBindingSeq",0),m(this,"activeRefBindings",new Map),m(this,"__ppSelectValueStore",new Map),m(this,"__ppSelectValueSeq",0),m(this,"__ppContextTokenStore",new Map),m(this,"__ppContextTokenSeq",0),m(this,"__ppContextValueStore",new Map),m(this,"__ppContextValueSeq",0),m(this,"__ppDefaultValueStore",new Map),m(this,"__ppDefaultValueSeq",0),m(this,"__ppDefaultCheckedStore",new Map),m(this,"__ppDefaultCheckedSeq",0),m(this,"registeredResetForms",new Set),m(this,"passiveEffectsVersion",0),m(this,"isRendering",!1),m(this,"props",{}),m(this,"ownedChildren",new Map),m(this,"lastRenderedHtml",""),m(this,"renderCount",0),m(this,"trackedPortals",new Map),m(this,"parentId",null),m(this,"initialChildrenHtml",""),m(this,"pendingEventElements",new Set),m(this,"traversalCache",null),m(this,"pendingProvidedContexts",new Map),m(this,"pendingContextTokens",new Set),m(this,"activeContextProviderBoundaryIds",new Set),m(this,"contextRefreshPending",!1),m(this,"_lastRawScopeKeySig",""),m(this,"_lastSortedKeys",[]),m(this,"_lastSortedScopeKeySig",""),m(this,"_cachedHooksAPI",null),m(this,"_propFnCache",new Map),m(this,"_interpolationFnCache",new Map),m(this,"_scopeEvalFnCache",new Map),m(this,"_refEvalFnCache",new Map),this.el=e,this.id=this.el.getAttribute("pp-component")||"",this.id||(this.id="anon_"+Math.random().toString(36).substring(2,9),this.el.setAttribute("pp-component",this.id)),this.props=Array.from(this.el.attributes).reduce((e,t)=>{const s=t.name;if(s.startsWith("on")||"pp-component"===s)return e;const i=dt(s);return et.has(i)||(e[i]=t.value),e},{}),C.registerInstance(this.id,this),this.syncParentId(),this.props=this.computePropsFromAttributes();let t=C.getTemplate(this.id);const s=C.getOwnedTemplates(this.id);t?s&&(this.ownedChildren=s):(this.extractOwnedTemplates(),t=this.el.innerHTML,C.saveTemplate(this.id,t),C.saveOwnedTemplates(this.id,this.ownedChildren)),this.initialChildrenHtml=t,this.props.children=this.initialChildrenHtml,this.hooksSystem=new fi(()=>{this.isRendering||this.render()});const i=C.getState(this.id);i&&this.hooksSystem.loadState(i);const n=Me(this.initialChildrenHtml,this.el.tagName.toLowerCase()),r=this.findOwnScript(n.root),a=(null==r?void 0:r.textContent)||"";r&&r.remove(),this.rawTemplate=n.toHtml(),this.renderFunction=this.createRenderFunction(a),this.eventManager=new Ci(this.el,()=>this.latestScope,e=>this.isManagedEventElement(e)),this.render()}syncParentId(){var e;const t=this.el.__ppRuntimeParentId,s=null==(e=this.el.parentElement)?void 0:e.closest("[pp-component]");this.parentId=void 0!==t?t:s?s.getAttribute("pp-component"):null,C.saveParent(this.id,this.parentId)}static setPerfEnabled(e){this.perfEnabled=e}static getPerfEnabled(){return this.perfEnabled}static resetPerfStats(){this.perfStats.clear()}static getPerfStats(){return Object.fromEntries(this.perfStats.entries())}static createEmptyPerfEntry(){const e={};return fs.forEach(t=>{e[t]={count:0,totalMs:0,maxMs:0}}),{renderCount:0,phases:e}}recordPerfPhase(t,s){if(!e.perfEnabled)return;let i=e.perfStats.get(this.id);i||(i=e.createEmptyPerfEntry(),e.perfStats.set(this.id,i));const n=i.phases[t];n.count++,n.totalMs+=s,n.maxMs=Math.max(n.maxMs,s)}startPerfTimer(){return e.perfEnabled?St():0}endPerfTimer(t,s){e.perfEnabled&&this.recordPerfPhase(t,St()-s)}findOwnScript(e){const t=Array.from(e.children);for(const e of t){if("script"===e.tagName.toLowerCase()&&"text/pp"===e.getAttribute("type"))return e;if(e.hasAttribute("pp-component"))continue;const t=this.findOwnScript(e);if(t)return t}return null}interpolateAttrString(e,t){const s=me(t),i=s.keys,n=ge(t,i),r=s.keySig;return e.replace(/\{([\s\S]*?)\}/g,(e,t)=>{const s=U(String(t).trim());try{const e=this.getCachedFunction(this._interpolationFnCache,s,i,r,300)(...n);return"boolean"==typeof e||null==e?"":Array.isArray(e)?e.join(""):String(e)}catch(e){return console.warn(`[PP-WARN] Failed attribute interpolation for {${s}}`,e),""}})}applyAttributeInterpolations(e,t){const s=me(t),i=s.keys,n=ge(t,i),r=s.keySig;for(const s of Array.from(e.attributes)){const a=s.name;if("pp-component"===a||a.startsWith("on"))continue;const o=s.value;if(!o.includes("{"))continue;if(!/^\s*\{[\s\S]*\}\s*$/.test(o)){const s=this.interpolateAttrString(o,t);s!==o&&e.setAttribute(a,s);continue}const c=o.match(/^\s*\{([\s\S]*)\}\s*$/);if(!c)continue;const l=U(c[1].trim());if(!W.isValidExpression(l))continue;let h;try{h=this.getCachedFunction(this._scopeEvalFnCache,l,i,r,300)(...n)}catch(e){console.error(`[PP-ERROR] Failed to eval "${l}"`,e);continue}if(wt.has(a.toLowerCase())&&"boolean"==typeof h){h?e.setAttribute(a,""):e.removeAttribute(a);continue}const p=typeof h;null==h?e.removeAttribute(a):("string"===p||"number"===p||"boolean"===p||"bigint"===p)&&e.setAttribute(a,String(h))}}computePropsFromAttributes(){const e=this.parentId?C.getResolvedScopeWithAncestors(this.parentId,this.id):void 0,t=e?me(e):null,s=(null==t?void 0:t.keys)??[],i=e?ge(e,s):[],n=this.el.__ppRawBindings,r=new Set([...Array.from(this.el.attributes).map(e=>e.name),...n?Object.keys(n):[]]),a=(null==t?void 0:t.keySig)??"",o=t=>{if(e)try{const e=t+"|"+a;let n=this._propFnCache.get(e);if(!n){if(n=new Function(...s,`"use strict"; return (${t});`),this._propFnCache.size>200){const e=this._propFnCache.keys().next().value;void 0!==e&&this._propFnCache.delete(e)}this._propFnCache.set(e,n)}return n(...i)}catch(e){return void console.warn(`[PP-WARN] Failed to evaluate prop expression "{${t}}" for component "${this.id}"`,e)}};return Array.from(r).reduce((t,s)=>{if(s.startsWith("on")&&!s.includes("-")||"pp-component"===s)return t;const i=dt(s);if(et.has(i))return t;const r=this.el.attributes.getNamedItem(s),a=(null==n?void 0:n[s])??(null==r?void 0:r.value);if(void 0===a)return t;if(""===a)return t[i]=!0,t;if(e){const s=a.match(/^\s*\{([\s\S]*)\}\s*$/);if(s){const e=U(s[1].trim());if(W.isValidExpression(e))return t[i]=o(e),t}if(a.includes("{"))return t[i]=this.interpolateAttrString(a,e),t}return t[i]=a,t},{})}refreshPropsFromParent(e=!1){const t=this.computePropsFromAttributes();t.children=this.initialChildrenHtml,e||!_i(this.props,t)||0!==this.ownedChildren.size?(this.props=t,this.isRendering||this.render()):this.bootstrapNestedComponents()}extractOwnedTemplates(){const e=this.el.querySelectorAll("template[pp-owner]");let t=0;e.forEach(e=>{var s,i;if((null==(s=e.parentElement)?void 0:s.closest("[pp-component]"))!==this.el)return;const n=e.getAttribute("pp-owner");if(n){const s=`__PP_OWNED_${this.id}_${t++}__`;this.ownedChildren.set(s,{ownerId:n,content:e.innerHTML,contextTag:(null==(i=e.parentElement)?void 0:i.tagName.toLowerCase())??null});const r=document.createComment(s);e.replaceWith(r)}})}replaceOwnedPlaceholder(e,t,s){const i=`\x3c!--${t}--\x3e`;return e.includes(i)?e.replace(i,s):e.replace(t,s)}maskNestedOwnedTemplates(e,t=null){const s=new Map,i=Me(e,t);let n=0;const r=i.root.querySelectorAll("[pp-component] > template[pp-owner]");for(const e of Array.from(r)){const t=`__PP_NESTED_TPL_${n++}__`;s.set(t,e.outerHTML),e.replaceWith(document.createComment(t))}return{content:i.toHtml(),placeholders:s}}restoreMaskedOwnedTemplates(e,t){if(0===t.size)return;const s=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),i=[];let n=s.nextNode();for(;n;){const e=n,r=t.get(e.data||"");if(r){const t=document.createElement("template");t.innerHTML=r;const s=t.content.firstChild;s&&i.push({node:e,replacement:s})}n=s.nextNode()}i.forEach(({node:e,replacement:t})=>{e.replaceWith(t)})}materializeTemplateComponentBoundaries(e){const t=[];e instanceof HTMLTemplateElement&&e.hasAttribute("pp-component")&&t.push(e),e.querySelectorAll("template[pp-component]").forEach(e=>t.push(e)),t.forEach(e=>{const t=e.content.cloneNode(!0),s=t.firstElementChild;s?(Array.from(e.attributes).forEach(e=>{"pp-owner"!==e.name&&s.setAttribute(e.name,e.value)}),e.replaceWith(t)):e.replaceWith(document.createComment("pp-empty-template-component"))})}renderOwnedContent(e,t,s){const{content:i,placeholders:n}=this.maskNestedOwnedTemplates(e.content,e.contextTag),r=me(s).keys,a=ge(s,r),o=bi(e.contextTag),c=ve.compile(o.wrap(i),r);let l=o.unwrap(c(...a));for(const[e,t]of n)l=this.replaceOwnedPlaceholder(l,e,t);return this.markOwnedBindings(l,t,e.contextTag)}resolveOwnedTemplateOwner(e,t=this.id){const s=C.resolveComponentId(e,t);if(!s)return null;const i=C.getResolvedScopeWithAncestors(e,t);return i?{ownerId:s,scope:i}:null}resolveOwnedChildren(e){if(!e.includes("__PP_OWNED_"))return e;this.ownedChildren.forEach((t,s)=>{const i=this.resolveOwnedTemplateOwner(t.ownerId);if(i){const n=this.renderOwnedContent(t,i.ownerId,i.scope);e=this.replaceOwnedPlaceholder(e,s,n)}else e=this.replaceOwnedPlaceholder(e,s,t.content)});const t=/__PP_OWNED_([^_]+(?:_[^_]+)*)_(\d+)__/g;let s;for(;null!==(s=t.exec(e));){const i=s[0],n=s[1],r=C.getOwnedTemplates(n);if(r&&r.has(i)){const s=r.get(i),a=this.resolveOwnedTemplateOwner(s.ownerId,n);if(a){const t=this.renderOwnedContent(s,a.ownerId,a.scope);e=this.replaceOwnedPlaceholder(e,i,t)}else e=this.replaceOwnedPlaceholder(e,i,s.content);t.lastIndex=0}}return e}markOwnedBindings(e,t,s=null){const i=Me(e,s),n=document.createTreeWalker(i.root,NodeFilter.SHOW_ELEMENT);let r=n.nextNode();for(;r;){const e=r;Array.from(e.attributes).some(e=>e.name.startsWith("on"))&&e.setAttribute("pp-event-owner",t),e.hasAttribute("data-pp-ref")&&e.setAttribute("pp-ref-owner",t),r=n.nextNode()}return i.toHtml()}getCachedFunction(e,t,s,i,n){const r=t+"|"+i;let a=e.get(r);if(!a){if(a=new Function(...s,`"use strict"; return (${t});`),e.size>n){const t=e.keys().next().value;void 0!==t&&e.delete(t)}e.set(r,a)}return a}createRenderFunction(e){const t=W.extractStateBindings(e);return new Function("pp",`\n "use strict";\n ${e}\n return { ${t.join(", ")} };\n `)}updateRefValue(e,t,s){try{"function"==typeof e?e(t):e&&"object"==typeof e&&"current"in e&&(e.current=t)}catch(e){console.warn(s,e)}}clearRefValue(e,t){this.updateRefValue(e,null,t)}attachRefValue(e,t,s){this.updateRefValue(e,t,s)}ensureRefBindingId(e,t){const s="captured"===t?"__ppCapturedRefBindingId":"__ppPlainRefBindingId";return e[s]||(e[s]=`pprefbind_${this.id}_${t}_${++this.__ppRefBindingSeq}`),e[s]}resolveCapturedRefValue(e,t){if(this.__ppRefStore.has(e))return this.__ppRefStore.get(e);if(!t||t===this.id)return;const s=C.getInstance(t);return s&&s.__ppRefStore.has(e)?s.__ppRefStore.get(e):void 0}resolvePlainRefValue(e,t,s,i){const n=this.latestScope[e];if("function"==typeof n||n&&"object"==typeof n&&"current"in n)return n;try{return this.getCachedFunction(this._refEvalFnCache,e,t,i,200)(...s)}catch{return}}commitRefBindings(e){for(const[t,s]of this.activeRefBindings.entries()){const i=e.get(t);i?(s.value!==i.value||s.element!==i.element)&&this.clearRefValue(s.value,"[PP-WARN] Ref cleanup failed"):this.clearRefValue(s.value,"[PP-WARN] Ref cleanup failed")}for(const[t,s]of e.entries()){const e=this.activeRefBindings.get(t);e&&e.value===s.value&&e.element===s.element||this.attachRefValue(s.value,s.element,"[PP-WARN] Ref attachment failed")}this.activeRefBindings=e}clearAllRefBindings(){for(const e of this.activeRefBindings.values())this.clearRefValue(e.value,"[PP-WARN] Ref cleanup failed");this.activeRefBindings.clear()}createRefCaptureFunction(){return this.__ppRefStore=new Map,this.__ppRefSeq=0,e=>{const t=`ppref_${this.id}_${++this.__ppRefSeq}`;return this.__ppRefStore.set(t,e),t}}createSelectValueCaptureFunction(){return this.__ppSelectValueStore=new Map,this.__ppSelectValueSeq=0,e=>{const t=`ppselect_${this.id}_${++this.__ppSelectValueSeq}`;return this.__ppSelectValueStore.set(t,e),t}}createContextTokenCaptureFunction(){return this.__ppContextTokenStore=new Map,this.__ppContextTokenSeq=0,e=>{const t=`ppcontexttoken_${this.id}_${++this.__ppContextTokenSeq}`;return this.__ppContextTokenStore.set(t,e),t}}createContextValueCaptureFunction(){return this.__ppContextValueStore=new Map,this.__ppContextValueSeq=0,e=>{const t=`ppcontextvalue_${this.id}_${++this.__ppContextValueSeq}`;return this.__ppContextValueStore.set(t,e),t}}createContextLookupFunction(){const e=(e,t)=>{if(null==e)return;if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const s=Object.keys(Object(e)).find(e=>e.toLowerCase()===t.toLowerCase());return s?e[s]:void 0};return t=>{const s=String(t).split(".").map(e=>e.trim()).filter(Boolean);if(0===s.length)return;const[i,...n]=s;let r;"globalthis"===i.toLowerCase()?r=globalThis:"window"===i.toLowerCase()?r=typeof window<"u"?window:globalThis:(r=e(this.latestScope,i),void 0===r&&(r=e(globalThis,i)));for(const t of n)r=e(r,t);return r}}createDefaultValueCaptureFunction(){return this.__ppDefaultValueStore=new Map,this.__ppDefaultValueSeq=0,e=>{const t=`ppdefaultvalue_${this.id}_${++this.__ppDefaultValueSeq}`;return this.__ppDefaultValueStore.set(t,e),t}}createDefaultCheckedCaptureFunction(){return this.__ppDefaultCheckedStore=new Map,this.__ppDefaultCheckedSeq=0,e=>{const t=`ppdefaultchecked_${this.id}_${++this.__ppDefaultCheckedSeq}`;return this.__ppDefaultCheckedStore.set(t,e),t}}consumeContext(e){return this.pendingContextTokens.add(e),C.resolveContext(this.parentId,e).value}registerProvidedContext(e,t){this.pendingProvidedContexts.set(e,t)}requestContextRefresh(){this.contextRefreshPending||(this.contextRefreshPending=!0,queueMicrotask(()=>{if(this.contextRefreshPending=!1,C.getInstance(this.id)===this){if(this.isRendering)return void this.requestContextRefresh();this.forceUpdate()}}))}refreshContextConsumers(e){var t;for(const s of e){const e=C.getInstance(s);null==(t=null==e?void 0:e.requestContextRefresh)||t.call(e)}}makeHooksAPI(){return this._cachedHooksAPI?this._cachedHooksAPI.props=this.props:this._cachedHooksAPI={state:e=>this.hooksSystem.useState(e),effect:(e,t)=>this.hooksSystem.useEffect(e,t),layoutEffect:(e,t)=>this.hooksSystem.useLayoutEffect(e,t),ref:(e=null)=>this.hooksSystem.useRef(e),memo:(e,t)=>this.hooksSystem.useMemo(e,t),callback:(e,t)=>this.hooksSystem.useCallback(e,t),reducer:(e,t,s)=>s?this.hooksSystem.useReducer(e,t,s):this.hooksSystem.useReducer(e,t),context:e=>this.consumeContext(e),portal:(e,t)=>this.hooksSystem.usePortal(e,t),props:this.props},this._cachedHooksAPI}syncTrackedPortals(e){if(0===this.trackedPortals.size)return;const t=this.hooksSystem.getPortalRegistrations();if(0===t.length)return;const s=new Map,i=new Map;e.querySelectorAll("*").forEach(e=>{const t=e,n=t.getAttribute("data-pp-ref");if(n){const e=s.get(n);e?e.push(t):s.set(n,[t])}const r=t.getAttribute("pp-ref");if(r){const e=i.get(r);e?e.push(t):i.set(r,[t])}});const n=new Map;for(const[e,t]of this.__ppRefStore.entries()){if(!t||"object"!=typeof t||!("current"in t))continue;const s=t,i=n.get(s);i?i.push(e):n.set(s,[e])}const r=new Map;for(const[e,t]of Object.entries(this.latestScope)){if(!t||"object"!=typeof t||!("current"in t))continue;const s=t,i=r.get(s);i?i.push(e):r.set(s,[e])}const a=(e,t)=>{for(const s of t){const t=e.get(s);if(!t||0===t.length)continue;const i=t.shift()??null;if(0===t.length&&e.delete(s),i)return i}return null},o=[];for(const e of t){const t=e.ref.current;if(!t||!this.trackedPortals.has(t))continue;const c=n.get(e.ref)??[];let l=a(s,c);if(!l){const t=r.get(e.ref)??[];l=a(i,t)}if(!l)continue;const h=this.trackedPortals.get(t);o.push({liveElement:t,sourceElement:l,placeholderText:h.placeholder.data||`pp-portal:${this.id}`})}0!==o.length&&(o.forEach(({sourceElement:e,placeholderText:t})=>{e.replaceWith(document.createComment(t))}),o.forEach(({liveElement:e,sourceElement:t})=>{this.morphTrackedPortalRoot(e,t)}))}morphTrackedPortalRoot(e,t){if(e.tagName!==t.tagName){const s=e.parentNode;if(!s)return;const i=t.cloneNode(!0),n=this.trackedPortals.get(e);return s.replaceChild(i,e),this.collectEventElements(i),void(n&&(this.trackedPortals.delete(e),this.trackedPortals.set(i,{...n,element:i})))}this.syncAttributes(e,t,!0),this.hasEventAttributes(e)&&this.pendingEventElements.add(e),this.morphChildren(e,t)}applyPortals(){const e=this.hooksSystem.getPortalRegistrations(),t=new Set;let s=!1;for(const i of e){const e=i.ref.current;if(!e)continue;const n=i.target??document.body;t.add(e);const r=this.trackedPortals.get(e);if(null!=r&&r.placeholder.parentNode){r.target!==n&&(n.appendChild(e),r.target=n,s=!0);continue}null===i.info.sourceParent&&e.parentNode instanceof Element&&(i.info.sourceParent=e.parentNode);const a=document.createComment(`pp-portal:${this.id}`);e.parentNode&&e.parentNode.insertBefore(a,e),n.appendChild(e),s=!0,this.trackedPortals.set(e,{element:e,placeholder:a,target:n})}for(const[e,i]of this.trackedPortals)t.has(e)||(i.placeholder.parentNode?(i.placeholder.parentNode.insertBefore(e,i.placeholder),i.placeholder.remove()):e.parentNode&&e.remove(),this.trackedPortals.delete(e),s=!0);s&&this.invalidateTraversalCache()}render(){var t;if(this.isRendering)return;this.isRendering=!0,this.renderCount++;const s=this.startPerfTimer();if(e.perfEnabled){let t=e.perfStats.get(this.id);t||(t=e.createEmptyPerfEntry(),e.perfStats.set(this.id,t)),t.renderCount++}try{this.pendingProvidedContexts=new Map,this.pendingContextTokens=new Set;const e=this.saveFocusState();this.hooksSystem.prepareRender();const s=this.makeHooksAPI(),i=globalThis.pp,n=(null==(t=null==i?void 0:i.createComponentRuntime)?void 0:t.call(i,s))??s,r=this.startPerfTimer();this.hooksSystem.startRenderPhase();let a,o=!1;try{a=hs((e,t)=>this.registerProvidedContext(e,t),()=>this.renderFunction(n))}finally{o=this.hooksSystem.finishRenderPhase()}if(this.endPerfTimer("script",r),o)return this.isRendering=!1,void this.render();C.saveState(this.id,this.hooksSystem.getHooks()),this.latestScope={...this.props,...a},this.latestScope.__pp_ref=this.createRefCaptureFunction(),this.latestScope.__pp_select_value=this.createSelectValueCaptureFunction(),this.latestScope.__pp_context_token=this.createContextTokenCaptureFunction(),this.latestScope.__pp_context_value=this.createContextValueCaptureFunction(),this.latestScope.__pp_context_lookup=this.createContextLookupFunction(),this.latestScope.__pp_default_value=this.createDefaultValueCaptureFunction(),this.latestScope.__pp_default_checked=this.createDefaultCheckedCaptureFunction(),C.saveScope(this.id,this.latestScope);const c=me(this.latestScope),l=c.keys,h=c.keySig;let p,u;h===this._lastRawScopeKeySig?(p=this._lastSortedKeys,u=this._lastSortedScopeKeySig):(p=l.length>1?[...l].sort():l.slice(),u=p.join("\0"),this._lastRawScopeKeySig=h,this._lastSortedKeys=p,this._lastSortedScopeKeySig=u);const d=ge(this.latestScope,p);this.templateFn||(this.templateFn=ve.compile(this.rawTemplate,p));let f=this.templateFn(...d);if(f=this.resolveOwnedChildren(f),this.lastRenderedHtml!==f){const e=this.startPerfTimer();this.applyDomDiff(f),this.endPerfTimer("domDiff",e),this.lastRenderedHtml=f}if(this.hasEventAttributes(this.el)&&this.pendingEventElements.add(this.el),this.pendingEventElements.size>0){const e=this.pendingEventElements;this.pendingEventElements=new Set;const t=this.startPerfTimer();this.eventManager.bindEvents(e),this.endPerfTimer("bindEvents",t)}const m=this.startPerfTimer();this.bindRefs(p,d,u),this.endPerfTimer("bindRefs",m);const g=C.saveContextValues(this.id,this.pendingProvidedContexts);C.updateContextDependencies(this.id,this.pendingContextTokens);const v=g.length>0?C.getConsumersForContextsInSubtree(this.id,g):null,y=this.startPerfTimer();this.bootstrapNestedComponents(),this.endPerfTimer("bootstrapNested",y);const x=this.startPerfTimer();this.applyPortals(),this.endPerfTimer("portals",x),this.bindUncontrolledInputDefaults(),this.bindUncontrolledFormResets(),this.bindControlledSelectValues();const _=this.startPerfTimer();this.restoreFocusState(e),this.endPerfTimer("restoreFocus",_);const b=this.startPerfTimer(),S=this.hooksSystem.runLayoutEffects();if(this.endPerfTimer("layoutEffects",b),S)return this.isRendering=!1,void this.render();this.schedulePassiveEffects(),null!=v&&v.size&&this.refreshContextConsumers(v)}catch(e){console.error("[PP-ERROR] Render Cycle Failed",e)}finally{this.endPerfTimer("total",s),this.isRendering=!1}}schedulePassiveEffects(){const e=++this.passiveEffectsVersion;queueMicrotask(()=>{if(this.passiveEffectsVersion!==e||C.getInstance(this.id)!==this)return;const t=this.startPerfTimer();this.hooksSystem.runEffects(),this.endPerfTimer("effects",t)})}applyDomDiff(e){if(typeof SVGElement<"u"&&this.el instanceof SVGElement){const t=(new DOMParser).parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${e}</svg>`,"image/svg+xml").documentElement,s=document.createDocumentFragment();return Array.from(t.childNodes).forEach(e=>{s.appendChild(document.importNode(e,!0))}),this.morphChildren(this.el,s),void this.invalidateTraversalCache()}const{content:t,placeholders:s}=this.maskNestedOwnedTemplates(e,this.el.tagName.toLowerCase()),i=Me(t,this.el.tagName.toLowerCase()).root;this.restoreMaskedOwnedTemplates(i,s),this.materializeTemplateComponentBoundaries(i),this.syncTrackedPortals(i),this.morphChildren(this.el,i),this.invalidateTraversalCache()}isInsideTrackedPortal(e){for(const[t]of this.trackedPortals)if(t===e||t.contains(e))return!0;return!1}isEffectManagedSurfaceElement(e,t){const s=e.getAttribute("data-slot");if(s&&Ct.has(s))return!0;const i=null==t?void 0:t.getAttribute("data-slot");return!!i&&Ct.has(i)}createNestedBoundaryId(t){return e.nestedBoundarySequence+=1,`${t}__pp${e.nestedBoundarySequence.toString(36)}`}getBoundaryBaseId(e){const t=e,s=e.getAttribute("pp-component");return!t.__ppBaseComponentId&&s&&(t.__ppBaseComponentId=s),t.__ppBaseComponentId??s}ensureBoundaryIdentity(e){var t;const s=e,i=e.getAttribute("pp-component")||"";if(s.__ppRuntimeComponentId)return i!==s.__ppRuntimeComponentId&&e.setAttribute("pp-component",s.__ppRuntimeComponentId),s.__ppBaseComponentId||(s.__ppBaseComponentId=i||s.__ppRuntimeComponentId),s.__ppRuntimeComponentId;if(!i)return"";s.__ppBaseComponentId=i;const n=C.getInstance(i);if(n&&n.el&&n.el!==e){if(n.el.isConnected){const t=this.createNestedBoundaryId(i);return s.__ppRuntimeComponentId=t,e.setAttribute("pp-component",t),t}null==(t=n.destroy)||t.call(n)}return s.__ppRuntimeComponentId=i,i}syncNestedBoundaryAttributes(e,t){const s=t.getAttribute("pp-component"),i=this.getBoundaryBaseId(e);if(!s||i&&s!==i)return!1;this.syncAttributes(e,t,!1,!0);const n=e;return n.__ppRuntimeComponentId&&e.getAttribute("pp-component")!==n.__ppRuntimeComponentId&&e.setAttribute("pp-component",n.__ppRuntimeComponentId),!0}morphChildren(e,t){if(this.hasKeyedDirectChildren(e)||this.hasKeyedDirectChildren(t))return void this.morphKeyedChildren(e,t);let s=e.firstChild,i=t.firstChild;for(;s||i;){const t=(null==s?void 0:s.nextSibling)??null,n=(null==i?void 0:i.nextSibling)??null;if(i){if(!s){const t=i.cloneNode(!0);e.appendChild(t),t.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(t),i=n;continue}if(s.nodeType!==i.nodeType){const r=i.cloneNode(!0);e.replaceChild(r,s),r.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(r),s=t,i=n;continue}if(s.nodeType!==Node.TEXT_NODE){if(s.nodeType===Node.ELEMENT_NODE){const r=s,a=i;if(r.tagName!==a.tagName){const r=i.cloneNode(!0);e.replaceChild(r,s),r.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(r),s=t,i=n;continue}if(r.hasAttribute("pp-component")&&r!==this.el){if(!this.syncNestedBoundaryAttributes(r,a)){const r=i.cloneNode(!0);e.replaceChild(r,s),r.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(r),s=t,i=n;continue}this.hasEventAttributes(r)&&this.pendingEventElements.add(r),s=t,i=n;continue}const o=this.isInsideTrackedPortal(r);if(this.syncAttributes(r,a,o),this.hasEventAttributes(r)&&this.pendingEventElements.add(r),r instanceof HTMLTextAreaElement){s=t,i=n;continue}this.morphChildren(r,a)}s=t,i=n}else s.textContent!==i.textContent&&(s.textContent=i.textContent),s=t,i=n}else s&&e.removeChild(s),s=t}}hasKeyedDirectChildren(e){const t=e.childNodes;for(let e=0;e<t.length;e++){const s=t[e];if(null!==this.getNodeKey(s))return!0}return!1}getNodeKey(e){if(e.nodeType!==Node.ELEMENT_NODE)return null;const t=e.getAttribute("key");return t&&t.length>0?t:null}areNodesCompatible(e,t){if(e.nodeType!==t.nodeType)return!1;if(e.nodeType!==Node.ELEMENT_NODE)return!0;const s=t;if(e.tagName!==s.tagName)return!1;const i=this.getNodeKey(e),n=this.getNodeKey(t);return null===i&&null===n||null!==i&&i===n}morphKeyedChildren(e,t){const s=Array.from(e.childNodes),i=Array.from(t.childNodes),n=this.collectDuplicateKeys(i),r=new Map,a=[];n.length>0&&console.warn(`[PP-WARN] Duplicate key values detected: ${n.join(", ")}`),s.forEach(e=>{const t=this.getNodeKey(e);if(null===t)return void a.push(e);const s=r.get(t);s?s.push(e):r.set(t,[e])});let o=e.firstChild;i.forEach(t=>{const s=this.getNodeKey(t);let i;if(null!==s){const e=r.get(s);for(;e&&e.length>0;){const s=e.shift();if(this.areNodesCompatible(s,t)){i=s;break}a.push(s)}}else{const e=a.findIndex(e=>this.areNodesCompatible(e,t));-1!==e&&(i=a.splice(e,1)[0])}if(i)i!==o&&e.insertBefore(i,o);else{const s=t.cloneNode(!0);e.insertBefore(s,o),s.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(s),i=s}this.morphNode(i,t),o=i.nextSibling}),a.forEach(t=>{t.parentNode===e&&e.removeChild(t)}),r.forEach(t=>{t.forEach(t=>{t.parentNode===e&&e.removeChild(t)})})}collectDuplicateKeys(e){const t=new Set,s=new Set;return e.forEach(e=>{const i=this.getNodeKey(e);if(null!==i){if(t.has(i))return void s.add(i);t.add(i)}}),Array.from(s.values())}morphNode(e,t){if(e.nodeType!==t.nodeType){const s=e.parentNode;if(!s)return;const i=t.cloneNode(!0);return s.replaceChild(i,e),void(i.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(i))}if(e.nodeType===Node.TEXT_NODE)return void(e.textContent!==t.textContent&&(e.textContent=t.textContent));if(e.nodeType!==Node.ELEMENT_NODE)return;const s=e,i=t;if(s.tagName!==i.tagName){const e=s.parentNode;if(!e)return;const i=t.cloneNode(!0);return e.replaceChild(i,s),void(i.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(i))}if(s.hasAttribute("pp-component")&&s!==this.el){if(!this.syncNestedBoundaryAttributes(s,i)){const e=s.parentNode;if(!e)return;const i=t.cloneNode(!0);return e.replaceChild(i,s),void(i.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(i))}return void(this.hasEventAttributes(s)&&this.pendingEventElements.add(s))}const n=this.isInsideTrackedPortal(s);this.syncAttributes(s,i,n),this.hasEventAttributes(s)&&this.pendingEventElements.add(s),!(s instanceof HTMLTextAreaElement)&&this.morphChildren(s,i)}collectEventElements(e){this.hasEventAttributes(e)&&this.pendingEventElements.add(e);for(let t=0;t<e.children.length;t++)this.collectEventElements(e.children[t])}hasEventAttributes(e){const t=e.attributes;for(let e=0;e<t.length;e++)if(t[e].name.startsWith("on")&&!t[e].name.includes("-"))return!0;return!1}isManagedEventElement(e){if(this.isElementOwnedByTree(e,this.el))return!0;for(const[t]of this.trackedPortals)if(this.isElementOwnedByTree(e,t))return!0;return!1}isElementOwnedByTree(e,t){if(e===t)return!0;if(!t.contains(e))return!1;let s=e,i=!0;for(;s&&s!==t;){if(!i&&s.hasAttribute("pp-component"))return!1;s=s.parentElement,i=!1}return s===t}invalidateTraversalCache(){this.traversalCache=null}getTraversalCache(){if(this.traversalCache)return this.traversalCache;const e=[],t=[],s=[],i=[],n=new Set,r=[],a=(e,t)=>{r.push(e)};a(this.el);for(const[e]of this.trackedPortals)a(e);for(;r.length>0;){const a=r.pop();if(n.has(a))continue;n.add(a);const o=a,c=a!==this.el&&a.hasAttribute("pp-component");if(e.push(o),(a.hasAttribute("data-pp-ref")||a.hasAttribute("pp-ref")||this.__ppRefCaptureIdsByElement.has(o)||this.__ppRefExprsByElement.has(o))&&i.push(o),(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement)&&s.push(o),c)t.push(o);else for(let e=a.children.length-1;e>=0;e--)r.push(a.children[e])}return this.traversalCache={ownedElements:e,childBoundaries:t,managedInputs:s,refElements:i},this.traversalCache}collectManagedInputs(){return this.getTraversalCache().managedInputs}syncAttributes(e,t,s=!1,i=!1){const n=s||this.isEffectManagedSurfaceElement(e,t),r=e,a=e.attributes;for(let s=a.length-1;s>=0;s--){const o=a[s].name;if(!(i&&"pp-component"===o||t.hasAttribute(o))){if(n&&_t.has(o)||"value"===o&&e instanceof HTMLInputElement&&r.__ppHasUncontrolledDefaultValue||"checked"===o&&e instanceof HTMLInputElement&&r.__ppHasUncontrolledDefaultChecked||"selected"===o&&e instanceof HTMLOptionElement&&r.__ppHasUncontrolledDefaultSelected)continue;e.removeAttribute(o),"data-pp-ref"===o&&this.__ppRefCaptureIdsByElement.delete(e),"pp-ref"===o&&this.__ppRefExprsByElement.delete(e)}}const o=t.attributes;for(let t=0;t<o.length;t++){const s=o[t];n&&_t.has(s.name)||i&&"pp-component"===s.name||(e.getAttribute(s.name)!==s.value&&e.setAttribute(s.name,s.value),"value"===s.name&&(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement)&&e.value!=s.value&&(e.value=s.value))}if(e instanceof HTMLTextAreaElement&&t instanceof HTMLTextAreaElement&&!r.__ppHasUncontrolledDefaultValue){const s=t.getAttribute("value"),i=s??t.value,n=s??t.defaultValue;e.value!==i&&(e.value=i),e.defaultValue!==n&&(e.defaultValue=n)}}bindRefs(e,t,s){const i=this.getTraversalCache(),n=new Map;for(let r=0;r<i.refElements.length;r++){const a=i.refElements[r],o=a,c=a!==this.el&&a.hasAttribute("pp-component"),l=a.getAttribute("data-pp-ref"),h=a.getAttribute("pp-ref-owner");let p=null;if(l)this.__ppRefStore.has(l)?(a.removeAttribute("data-pp-ref"),this.__ppRefCaptureIdsByElement.set(a,l),p=l):c||(a.removeAttribute("data-pp-ref"),this.__ppRefCaptureIdsByElement.set(a,l),p=l);else{const e=this.__ppRefCaptureIdsByElement.get(a);e&&this.__ppRefStore.has(e)?p=e:e&&this.__ppRefCaptureIdsByElement.delete(a)}if(p){const e=this.resolveCapturedRefValue(p,h);if("function"==typeof e||e&&"object"==typeof e&&"current"in e){const t=this.ensureRefBindingId(o,"captured");n.set(t,{element:a,value:e})}else l&&p.startsWith(`ppref_${this.id}_`)&&console.warn(`[PP-WARN] Missing captured ref for id="${p}"`)}const u=a.getAttribute("pp-ref");let d=u;if(d=u||(this.__ppRefExprsByElement.get(a)||null),!d)continue;const f=this.resolvePlainRefValue(d,e,t,s);if("function"==typeof f||f&&"object"==typeof f&&"current"in f){u&&a.removeAttribute("pp-ref"),this.__ppRefExprsByElement.set(a,d);const e=this.ensureRefBindingId(o,"plain");n.set(e,{element:a,value:f});continue}u&&c||(u&&(a.removeAttribute("pp-ref"),this.__ppRefExprsByElement.set(a,d)),Object.prototype.hasOwnProperty.call(this.latestScope,d)||console.warn(`[PP-WARN] Could not resolve pp-ref="${d}"`))}this.commitRefBindings(n)}bindControlledSelectValues(){const e=this.collectManagedInputs();for(let t=0;t<e.length;t++){const s=e[t];if(!(s instanceof HTMLSelectElement))continue;const i=s,n=s.getAttribute("data-pp-select-value");let r=null;n?(s.removeAttribute("data-pp-select-value"),i.__ppSelectValueCaptureId=n,r=n):i.__ppSelectValueCaptureId&&this.__ppSelectValueStore.has(i.__ppSelectValueCaptureId)?r=i.__ppSelectValueCaptureId:i.__ppSelectValueCaptureId&&delete i.__ppSelectValueCaptureId,r&&this.applyControlledSelectValue(s,this.__ppSelectValueStore.get(r))}}bindUncontrolledInputDefaults(){const e=this.collectManagedInputs();for(let t=0;t<e.length;t++){const s=e[t];if(s.__ppManagedInputMounted)this.resolveDefaultValueBinding(s),s instanceof HTMLInputElement&&this.resolveDefaultCheckedBinding(s);else{const e=this.resolveDefaultValueBinding(s);if(void 0!==e&&this.applyUncontrolledDefaultValue(s,e),s instanceof HTMLInputElement){const e=this.resolveDefaultCheckedBinding(s);void 0!==e&&this.applyUncontrolledDefaultChecked(s,e)}}s.__ppManagedInputMounted=!0}}bindUncontrolledFormResets(){const e=this.collectManagedInputs(),t=new Set;for(let s=0;s<e.length;s++){const i=e[s],n=i.closest("form");n instanceof HTMLFormElement&&this.isUncontrolledResetManagedElement(i)&&(t.add(n),this.registerResetHandler(n))}for(const e of this.registeredResetForms)t.has(e)||this.unregisterResetHandler(e);this.registeredResetForms=t}registerResetHandler(e){const t=e;if(t.__ppResetCallbacks||(t.__ppResetCallbacks=new Map),t.__ppResetCallbacks.set(this.id,()=>{this.restoreUncontrolledFormDefaults(e)}),t.__ppOriginalReset)return;t.__ppOriginalReset=e.reset;const s=this.id;e.reset=function(){var e,i;null==(e=t.__ppOriginalReset)||e.call(this),null==(i=t.__ppResetCallbacks)||i.forEach((e,i)=>{var n;C.getInstance(i)||i===s?e():null==(n=t.__ppResetCallbacks)||n.delete(i)})}}unregisterResetHandler(e){var t;const s=e;null==(t=s.__ppResetCallbacks)||t.delete(this.id),!(s.__ppResetCallbacks&&s.__ppResetCallbacks.size>0)&&(s.__ppOriginalReset&&(e.reset=s.__ppOriginalReset,delete s.__ppOriginalReset),delete s.__ppResetCallbacks)}restoreUncontrolledFormDefaults(e){const t=this.collectManagedInputs();for(let s=0;s<t.length;s++){const i=t[s],n=i;if(i.closest("form")===e){if(i instanceof HTMLSelectElement){this.restoreUncontrolledSelectState(i);continue}(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)&&n.__ppHasUncontrolledDefaultValue&&(i.value=i.defaultValue),i instanceof HTMLInputElement&&n.__ppHasUncontrolledDefaultChecked&&(i.checked=i.defaultChecked)}}}restoreUncontrolledSelectState(e){const t=Array.from(e.options);if(e.multiple)return void t.forEach(e=>{e.selected=e.defaultSelected});const s=t.find(e=>e.defaultSelected);s?e.value=s.value:t.length>0&&(e.selectedIndex=0)}isUncontrolledResetManagedElement(e){const t=e;return!(!t.__ppHasUncontrolledDefaultValue&&!t.__ppHasUncontrolledDefaultChecked)||e instanceof HTMLSelectElement&&Array.from(e.options).some(e=>e.defaultSelected)}resolveDefaultValueBinding(e){const t=e.getAttribute("data-pp-default-value");if(t){if(e.removeAttribute("data-pp-default-value"),e.__ppDefaultValueCaptureId=t,this.__ppDefaultValueStore.has(t))return this.__ppDefaultValueStore.get(t)}else if(e.__ppDefaultValueCaptureId){if(this.__ppDefaultValueStore.has(e.__ppDefaultValueCaptureId))return this.__ppDefaultValueStore.get(e.__ppDefaultValueCaptureId);delete e.__ppDefaultValueCaptureId}if(e.hasAttribute("defaultvalue"))return e.getAttribute("defaultvalue")}resolveDefaultCheckedBinding(e){const t=e.getAttribute("data-pp-default-checked");if(t){if(e.removeAttribute("data-pp-default-checked"),e.__ppDefaultCheckedCaptureId=t,this.__ppDefaultCheckedStore.has(t))return this.__ppDefaultCheckedStore.get(t)}else if(e.__ppDefaultCheckedCaptureId){if(this.__ppDefaultCheckedStore.has(e.__ppDefaultCheckedCaptureId))return this.__ppDefaultCheckedStore.get(e.__ppDefaultCheckedCaptureId);delete e.__ppDefaultCheckedCaptureId}if(e.hasAttribute("defaultchecked"))return e.getAttribute("defaultchecked")}applyUncontrolledDefaultValue(e,t){if(e instanceof HTMLSelectElement)return void this.applyUncontrolledDefaultSelectValue(e,t);const s=null==t?"":String(t);e.defaultValue!==s&&(e.defaultValue=s),e.value!==s&&(e.value=s),e.__ppHasUncontrolledDefaultValue=!0}applyUncontrolledDefaultSelectValue(e,t){const s=this.normalizeControlledSelectValues(t),i=e.multiple?new Set(s):new Set(s.length>0?[s[0]]:[]);for(let t=0;t<e.options.length;t++){const s=e.options[t],n=s,r=i.has(s.value);s.defaultSelected!==r&&(s.defaultSelected=r),s.selected!==r&&(s.selected=r),r?n.__ppHasUncontrolledDefaultSelected=!0:delete n.__ppHasUncontrolledDefaultSelected}if(!e.multiple){const t=s.length>0?s[0]:"";e.value!==t&&(e.value=t)}}applyUncontrolledDefaultChecked(e,t){const s=this.normalizeDefaultCheckedValue(t);e.defaultChecked!==s&&(e.defaultChecked=s),e.checked!==s&&(e.checked=s),e.__ppHasUncontrolledDefaultChecked=!0}normalizeDefaultCheckedValue(e){if("string"==typeof e){const t=e.trim().toLowerCase();if(""===t||"true"===t)return!0;if("false"===t||"0"===t||"off"===t||"no"===t)return!1}return!!e}applyControlledSelectValue(e,t){if(e.multiple){const s=new Set(this.normalizeControlledSelectValues(t));for(let t=0;t<e.options.length;t++){const i=e.options[t],n=s.has(i.value);i.selected!==n&&(i.selected=n)}return}const s=null==t?"":String(t);e.value!==s&&(e.value=s)}normalizeControlledSelectValues(e){return null==e?[]:Array.isArray(e)?e.filter(e=>null!=e).map(e=>String(e)):[String(e)]}bootstrapNestedComponents(){const e=new Set,t=new Set,s=(i,n)=>{Array.from(i.children).forEach(i=>{const r=i;if(r.hasAttribute("pp-component"))return void this.bootstrapNestedComponentBoundary(r,n);const a=this.syncContextProviderBoundary(r,n,e,t);s(r,a??n)})};s(this.el,this.id),this.trackedPortals.forEach(({element:e})=>{s(e,this.id)}),this.activeContextProviderBoundaryIds.forEach(s=>{e.has(s)||C.removeContextTracking(s).forEach(e=>t.add(e))}),this.activeContextProviderBoundaryIds=e,t.size>0&&this.refreshContextConsumers(t)}bootstrapNestedComponentBoundary(t,s){const i=this.ensureBoundaryIdentity(t);if(!i)return;if(t.__ppRawBindings){const e=t.__ppRawBindings;for(const[s,i]of Object.entries(e))t.setAttribute(s,i)}else{const e={};for(const s of Array.from(t.attributes))s.value.includes("{")&&"pp-component"!==s.name&&!s.name.startsWith("on")&&(e[s.name]=s.value);t.__ppRawBindings=e}const n=C.getResolvedScopeWithAncestors(s,this.id)??this.latestScope;this.applyAttributeInterpolations(t,n);const r=C.getInstance(i);if(null!=r&&r.refreshPropsFromParent){const e=r.parentId!==s;return r.parentId=s,C.saveParent(i,s),r.el!==t&&(!t.__ppRawBindings&&r.el.__ppRawBindings&&(t.__ppRawBindings=r.el.__ppRawBindings),r.el=t),void r.refreshPropsFromParent(e)}if(!C.getState(i)){t.__ppRuntimeParentId=s;try{new e(t)}finally{delete t.__ppRuntimeParentId}}}syncContextProviderBoundary(e,t,s,i){if("pp-context-provider"!==e.tagName.toLowerCase())return null;const n=this.resolveContextProviderBoundary(e);if(!n)return null;s.add(n.boundaryId),C.saveParent(n.boundaryId,t);const r=C.saveContextValues(n.boundaryId,new Map([[n.context,n.value]]));return r.length>0&&C.getConsumersForContextsInSubtree(n.boundaryId,r).forEach(e=>i.add(e)),n.boundaryId}resolveContextProviderBoundary(e){const t=e,s=e.getAttribute("data-pp-context-token")??t.__ppContextTokenCaptureId??null,i=e.getAttribute("data-pp-context-value")??t.__ppContextValueCaptureId??null;if(!s||!i)return null;t.__ppContextTokenCaptureId=s,t.__ppContextValueCaptureId=i,e.removeAttribute("data-pp-context-token"),e.removeAttribute("data-pp-context-value");const n=this.__ppContextTokenStore.get(s);return n?{boundaryId:this.ensureContextProviderBoundaryId(t),context:n,value:this.__ppContextValueStore.get(i)}:null}ensureContextProviderBoundaryId(e){return e.__ppContextBoundaryId||(e.__ppContextBoundaryId=`ppctx_${this.id}_${Math.random().toString(36).slice(2,10)}`),e.__ppContextBoundaryId}saveFocusState(){const e=document.activeElement;if(!e)return null;const t=this.el.contains(e),s=!t&&Array.from(this.trackedPortals.values()).some(t=>t.element.contains(e));if(!t&&!s)return null;const i=this.collectManagedInputs().indexOf(e);if(-1===i)return null;const n=this.getTextSelectionState(e);return{element:e,index:i,selectionStart:n.selectionStart,selectionEnd:n.selectionEnd}}isTextSelectionControl(e){return e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&["text","search","url","tel","password"].includes(e.type)}getTextSelectionState(e){if(!this.isTextSelectionControl(e))return{selectionStart:null,selectionEnd:null};try{return{selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}}catch{return{selectionStart:null,selectionEnd:null}}}restoreFocusState(e){if(!e)return;const t=e.element,s=t&&t.isConnected&&(this.el.contains(t)||Array.from(this.trackedPortals.values()).some(e=>e.element.contains(t)))?t:this.collectManagedInputs()[e.index];if(s&&(s.focus(),null!==e.selectionStart&&null!==e.selectionEnd&&this.isTextSelectionControl(s)))try{s.setSelectionRange(e.selectionStart,e.selectionEnd)}catch(e){console.warn("Could not restore cursor position",e)}}forceUpdate(){this.lastRenderedHtml="",this.render()}destroy(){for(const e of this.registeredResetForms)this.unregisterResetHandler(e);this.registeredResetForms.clear(),this.hooksSystem.dispose(),this.clearAllRefBindings();for(const[,e]of this.trackedPortals)e.element.parentNode&&e.element.remove(),e.placeholder.parentNode&&e.placeholder.remove();this.trackedPortals.clear(),this.activeContextProviderBoundaryIds.forEach(e=>{C.removeContextTracking(e)}),this.activeContextProviderBoundaryIds.clear();const e=C.removeContextTracking(this.id);this.eventManager.clearCache(),C.removeState(this.id),C.removeScope(this.id),C.removeInstance(this.id),e.forEach(e=>{var t;const s=C.getInstance(e);null==(t=null==s?void 0:s.requestContextRefresh)||t.call(s)})}};m(V,"nestedBoundarySequence",0),m(V,"perfEnabled",!1),m(V,"perfStats",new Map);let le=V;const Et={bootstrap:()=>{Array.from(document.querySelectorAll("[pp-component]")).filter(e=>{var t;return!(null!=(t=e.parentElement)&&t.closest("[pp-component]"))}).forEach(e=>{new le(e)})}},xe=class e{constructor(){m(this,"activeAbortController",null),m(this,"navigationEnabled",!1),m(this,"boundHandleLinkClick",null),m(this,"boundHandlePopState",null),m(this,"isNavigating",!1),m(this,"loadedDynamicScripts",new Set),m(this,"RESET_SCROLL_ATTR","pp-reset-scroll"),m(this,"mounted",!1)}mount(){this.mounted||(this.mounted=!0,this.disableTransitions(),Et.bootstrap(),this.restoreBodyAccessibility(),this.enableTransitions(),this.enableSPANavigation())}createComponentRuntime(t){const s={};for(const t of e.PUBLIC_METHODS){const e=this[t];"function"==typeof e?s[t]=e.bind(this):void 0!==e&&(s[t]=e)}return Object.assign({},s,t)}createContext(e){return ps(e)}enablePerf(){le.setPerfEnabled(!0)}disablePerf(){le.setPerfEnabled(!1)}getPerfStats(){return le.getPerfStats()}resetPerfStats(){le.resetPerfStats()}getCsrfToken(){const e=document.cookie.match(/(?:^|;\s*)prisma_php_csrf=([^;]*)/);return e?decodeURIComponent(e[1]):""}resolveRpcUrl(e){const t=window.location.pathname.replace(/\/+$/,"")||"/";return new URL(e??t,window.location.origin)}resolveRpcCredentials(e,t){return t||(e.origin===window.location.origin?"same-origin":"include")}async ensureCsrfToken(e,t,s){let i=this.getCsrfToken();if(""!==i||"omit"===t)return i;const n=new URL(s??e.toString(),window.location.origin);return await fetch(n.toString(),{method:"GET",credentials:t,cache:"no-store",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/html, application/json, */*"}}),i=this.getCsrfToken(),i}disableTransitions(){const e=document.createElement("style");e.id="pp-disable-transitions",e.textContent="\n *, *::before, *::after {\n transition: none !important;\n animation: none !important;\n }\n ",document.head.insertBefore(e,document.head.firstChild)}enableTransitions(){const e=document.getElementById("pp-disable-transitions");e&&e.remove()}restoreBodyAccessibility(){document.body.style.transition="",document.body.style.opacity="1",document.body.style.pointerEvents="auto",document.body.style.userSelect="auto",document.body.removeAttribute("inert"),document.body.setAttribute("aria-busy","false")}static resetInstance(){this.instance&&(this.instance.navigationEnabled&&this.instance.disableSPANavigation(),this.instance.activeAbortController&&(this.instance.activeAbortController.abort(),this.instance.activeAbortController=null),this.instance=null)}static getInstance(){return this.instance||(this.instance=new e),this.instance}enableSPANavigation(){this.navigationEnabled||"true"!==document.body.getAttribute("pp-spa")||(this.navigationEnabled=!0,this.boundHandleLinkClick=this.handleLinkClick.bind(this),this.boundHandlePopState=this.handlePopState.bind(this),document.addEventListener("click",this.boundHandleLinkClick),window.addEventListener("popstate",this.boundHandlePopState))}disableSPANavigation(){this.navigationEnabled=!1,this.boundHandleLinkClick&&(document.removeEventListener("click",this.boundHandleLinkClick),this.boundHandleLinkClick=null),this.boundHandlePopState&&(window.removeEventListener("popstate",this.boundHandlePopState),this.boundHandlePopState=null)}handleLinkClick(e){if(!this.navigationEnabled)return;const t=this.getNavigationTarget(e.target);if(!t)return;const s=t.closest("a");if(s&&s.href)try{const t=new URL(s.href),i=t.origin!==window.location.origin,n=t.pathname===window.location.pathname&&t.search===window.location.search,r="false"===s.getAttribute("pp-spa");if(i||"_blank"===s.target||s.hasAttribute("download")||r||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;if(e.preventDefault(),n){const s=t.hash;if(s){e.preventDefault(),history.pushState(null,"",t.pathname+t.search+s);const i=document.querySelector(s);return void(i&&i.scrollIntoView({behavior:"smooth"}))}}this.navigateTo(t.pathname+t.search+t.hash)}catch(e){console.error("Link click navigation error:",e)}}getNavigationTarget(e){return e instanceof Element?e:e instanceof Node?e.parentElement:null}async handlePopState(){const e=window.location.pathname+window.location.search+window.location.hash;await this.navigateTo(e,!1)}async navigateTo(e,t=!0){this.isNavigating=!0;const s=this.saveScrollPositions();try{this.dispatchNavigationEvent("start",e),await this.showLoadingTransition();const i=await this.fetchPageContent(e);if("hardReload"in i)return void(window.location.href=i.hardReload);if("redirect"in i)return void await this.navigateTo(i.redirect,t);const n=i;this.updateBrowserHistory(e,t);const r=document.getElementById("loading-file-1B87E"),a="startViewTransition"in document,o=this.getResetScrollConfig(n);!r&&a?await this.updatePageContentWithViewTransition(n):await this.updatePageContent(n),this.resetGlobalCaches(),Et.bootstrap(),this.handleScrollRestoration(s,o),await this.handleNavigationCompletion(),this.dispatchNavigationEvent("complete",e)}catch(t){this.handleNavigationError(e,t)}finally{this.isNavigating=!1}}resetGlobalCaches(){C.clear(),W.clearCaches(),ve.clearCache()}getResetScrollConfig(e){if("true"===e.body.getAttribute(this.RESET_SCROLL_ATTR))return{mode:"global",resetElementKeys:new Set,resetWindow:!1};const t=e.querySelectorAll(`[${this.RESET_SCROLL_ATTR}]`),s=new Set;let i=!1;if(t.length>0)for(const e of Array.from(t))if("true"===e.getAttribute(this.RESET_SCROLL_ATTR)){const t=this.getElementKeyFromElement(e);s.add(t),i=!0}return i||s.size>0?{mode:"none",resetElementKeys:s,resetWindow:i}:{mode:"none",resetElementKeys:new Set,resetWindow:!1}}getElementKeyFromElement(e){return e.id?e.id:e.className?e.className:e.tagName}handleScrollRestoration(e,t){requestAnimationFrame(()=>{if("global"===t.mode)return window.scrollTo(0,0),document.documentElement.scrollTop=0,document.documentElement.scrollLeft=0,void document.querySelectorAll("*").forEach(e=>{(e.scrollTop||e.scrollLeft)&&(e.scrollTop=0,e.scrollLeft=0)});if(t.resetWindow)window.scrollTo(0,0),document.documentElement.scrollTop=0,document.documentElement.scrollLeft=0;else{const t=e.window;t&&window.scrollTo(t.scrollLeft,t.scrollTop)}document.querySelectorAll("*").forEach(s=>{const i=s.tagName.toLowerCase();if(t.resetWindow&&("html"===i||"body"===i))return;const n=this.getElementKey(s);t.resetElementKeys.has(n)?(s.scrollTop=0,s.scrollLeft=0):e[n]&&(s.scrollTop=e[n].scrollTop,s.scrollLeft=e[n].scrollLeft)})})}saveScrollPositions(){const e={window:{scrollTop:window.scrollY||document.documentElement.scrollTop,scrollLeft:window.scrollX||document.documentElement.scrollLeft}};return document.querySelectorAll("*").forEach(t=>{(t.scrollTop||t.scrollLeft)&&(e[this.getElementKey(t)]={scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})}),e}getElementKey(e){return e.id||e.className||e.tagName}async updatePageContentWithViewTransition(e){e.title&&(document.title=e.title),await this.reconcileHead(e);const t=e.body.innerHTML;if(this.syncBodyAttributes(e.body),this.isNavigating||!document.startViewTransition)return void(document.body.innerHTML=t);const s=document.startViewTransition(()=>{document.body.innerHTML=t});try{await s.finished}catch(e){console.warn("View transition failed, continuing anyway:",e)}}dispatchNavigationEvent(e,t,s){const i=`pp:navigation:${e}`,n=s?{url:t,error:s}:{url:t};document.dispatchEvent(new CustomEvent(i,{detail:n}))}async showLoadingTransition(){const e=document.getElementById("loading-file-1B87E");if(e){const t=this.findLoadingElement(e,window.location.pathname);if(t)return void await this.updateContentWithTransition(t)}const t=document.querySelector("[pp-loading-content='true']")||document.body;t&&!("startViewTransition"in document)&&await this.fadeOut(t,250)}async fetchPageContent(e){const t=new URL(e,window.location.origin).hash,s=await fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest","X-PP-Navigation":"true",Accept:"text/html"}});if(!s.ok)throw new Error(`Navigation failed: ${s.status} ${s.statusText}`);const i=s.headers.get("X-PP-Root-Layout"),n=document.querySelector('meta[name="pp-root-layout"]'),r=n?n.getAttribute("content"):null;if(i&&r&&i!==r)return{hardReload:e};if(s.redirected){const e=new URL(s.url);if(t&&e.searchParams.has("next")){const s=e.searchParams.get("next");s&&!s.includes("#")&&e.searchParams.set("next",s+t)}return{redirect:e.pathname+e.search+e.hash}}const a=this.getRedirectUrlFromResponse(s);if(a)return{redirect:a};const o=await s.text();return(new DOMParser).parseFromString(o,"text/html")}getRedirectUrlFromResponse(e){const t=e.headers.get("X-PP-Redirect");if(t)return t;const s=e.headers.get("Location"),i=e.status;return s&&i>=300&&i<400?s:null}updateBrowserHistory(e,t){t&&history.pushState(null,"",e)}async updatePageContent(e){e.title&&(document.title=e.title),await this.reconcileHead(e);const t=e.body;this.syncBodyAttributes(t),document.body.innerHTML=t.innerHTML}syncBodyAttributes(e){e&&(Array.from(document.body.attributes).forEach(e=>{"style"!==e.name&&document.body.removeAttribute(e.name)}),Array.from(e.attributes).forEach(e=>{"style"!==e.name&&document.body.setAttribute(e.name,e.value)}))}async handleNavigationCompletion(){const e=document.querySelector("[pp-loading-content='true']")||document.body;this.fadeIn(e,150),setTimeout(()=>{this.restoreBodyAccessibility()},50);const t=window.location.hash;t&&requestAnimationFrame(()=>{const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})})}handleNavigationError(e,t){console.error("Navigation error:",t),this.restoreBodyAccessibility(),this.dispatchNavigationEvent("error",e,t),window.location.href=e}findLoadingElement(e,t){let s=t;for(;;){const t=e.querySelector(`div[pp-loading-url='${s}']`);if(t)return t;if("/"===s)break;const i=s.lastIndexOf("/");s=i<=0?"/":s.substring(0,i)}return e.querySelector("div[pp-loading-url='/' ]")}async updateContentWithTransition(e){const t=document.querySelector("[pp-loading-content='true']")||document.body;if(!t)return;const{fadeIn:s,fadeOut:i}=this.parseTransition(e);await this.fadeOut(t,i),t.innerHTML=e.innerHTML,this.fadeIn(t,s)}parseTransition(e){let t=250,s=250;const i=e.querySelector("[pp-loading-transition]"),n=null==i?void 0:i.getAttribute("pp-loading-transition");if(n){let e=JSON.parse(n);e&&"object"==typeof e?(t=this.parseTime(e.fadeIn??t),s=this.parseTime(e.fadeOut??s)):console.warn("pp-loading-transition is not valid JSON → default values (250 ms) will be used. String:",n)}return{fadeIn:t,fadeOut:s}}fadeOut(e,t){return new Promise(s=>{e.style.transition=`opacity ${t}ms ease-out`,setTimeout(()=>{e.style.transition="",s()},t)})}fadeIn(e,t){e.style.transition=`opacity ${t}ms ease-in`,setTimeout(()=>{e.style.transition=""},t)}parseTime(e){if("number"==typeof e)return e;const t=e.match(/^(\d+)(ms|s|m)?$/);if(t){const e=parseInt(t[1],10);switch(t[2]||"ms"){case"ms":default:return e;case"s":return 1e3*e;case"m":return 60*e*1e3}}return 0}async reconcileHead(e){const t="pp-dynamic-script",s="pp-dynamic-link";document.head.querySelectorAll("[pp-dynamic-meta]").forEach(e=>e.remove()),document.head.querySelectorAll(`[${s}]`).forEach(e=>e.remove()),document.head.querySelectorAll(`[${t}]`).forEach(e=>e.remove());const i=[];Array.from(e.head.children).forEach(e=>{var n;switch(e.tagName){case"SCRIPT":{if(!e.hasAttribute(t))break;const s=e.src;if(s&&this.loadedDynamicScripts.has(s))break;const n=document.createElement("script");if(Array.from(e.attributes).forEach(e=>{e.name!==t&&n.setAttribute(e.name,e.value)}),s){const e=new Promise((e,t)=>{n.addEventListener("load",()=>{this.loadedDynamicScripts.add(s),e()}),n.addEventListener("error",()=>{console.error("Failed to load dynamic script:",s),t(new Error(`Failed to load dynamic script: ${s}`))})});i.push(e)}else n.textContent=e.textContent;n.setAttribute(t,"true"),document.head.appendChild(n);break}case"META":{const t=e;if(t.getAttribute("charset")||"viewport"===t.name)break;const s=t.name?`meta[name="${t.name}"]`:`meta[property="${t.getAttribute("property")}"]`,i=t.cloneNode(!0),r=document.head.querySelector(s);r?document.head.replaceChild(i,r):document.head.insertBefore(i,(null==(n=document.head.querySelector("title"))?void 0:n.nextSibling)||null);break}case"TITLE":{const t=e.cloneNode(!0),s=document.head.querySelector("title");s?document.head.replaceChild(t,s):document.head.appendChild(t);break}case"LINK":{const t=e;if("icon"===t.rel){const e=t.cloneNode(!0),s=document.head.querySelector('link[rel="icon"]');s?document.head.replaceChild(e,s):document.head.appendChild(e)}else t.hasAttribute(s)&&document.head.appendChild(t.cloneNode(!0));break}}}),i.length&&await Promise.allSettled(i)}async redirect(e){if(e)try{const t=new URL(e,window.location.origin);t.origin!==window.location.origin?window.location.href=e:this.navigationEnabled?await this.navigateTo(t.pathname+t.search+t.hash):window.location.href=e}catch(e){console.error("Redirect error:",e)}}async fetchFunction(e,t={},s=!1){let i=null;const n="boolean"==typeof s?{abortPrevious:s}:s;try{n.abortPrevious&&this.activeAbortController&&(this.activeAbortController.abort(),this.activeAbortController=null),i=new AbortController,n.abortPrevious&&(this.activeAbortController=i);const s=this.resolveRpcUrl(n.url),r=this.resolveRpcCredentials(s,n.credentials),a={"X-CSRF-Token":await this.ensureCsrfToken(s,r,n.csrfUrl),"X-PP-Function":e,"PP-Wire-Request":"true","X-Requested-With":"XMLHttpRequest",Accept:"application/json, text/event-stream"};let o;if(Object.values(t).some(e=>e instanceof File||e instanceof FileList&&e.length>0)){const e=new FormData;for(const[s,i]of Object.entries(t))i instanceof File?e.append(s,i):i instanceof FileList?Array.from(i).forEach(t=>e.append(s,t)):null!=i&&e.append(s,"object"==typeof i?JSON.stringify(i):String(i));if(n.onUploadProgress)return await this.xhrFunction({url:s.toString(),headers:a,body:e,controller:i,credentials:r,options:n});o={method:"POST",headers:a,body:e,credentials:r,signal:i.signal}}else o={method:"POST",headers:{...a,"Content-Type":"application/json"},body:JSON.stringify(t),credentials:r,signal:i.signal};const c=await fetch(s.toString(),o);if(401===c.status)throw new Error("Authentication required");if(403===c.status)throw new Error("Permission denied");if(!c.ok){const e=await c.json().catch(()=>null);throw e||415!==c.status?new Error((null==e?void 0:e.error)||`Request failed: ${c.status} ${c.statusText}`):new Error("Server rejected data format (415).")}const l=this.getRedirectUrlFromResponse(c);return l?(await this.redirect(l),{redirected:!0,to:l}):(this.activeAbortController===i&&(this.activeAbortController=null),(c.headers.get("Content-Type")||"").includes("text/event-stream")&&c.body?(n.onStream||console.warn("RPC returned a stream, but no onStream handler provided."),void await this.handleStream(c.body,n)):await c.json())}catch(e){if(this.activeAbortController===i&&(this.activeAbortController=null),e instanceof Error&&"AbortError"===e.name)return console.log("Request was cancelled"),{cancelled:!0};if(n.onStreamError)return void n.onStreamError(e);throw console.error("RPC error:",e),e}}xhrFunction(e){const{url:t,headers:s,body:i,controller:n,credentials:r,options:a}=e;return new Promise((e,o)=>{const c=new XMLHttpRequest;c.open("POST",t,!0),c.withCredentials="include"===r;for(const[e,t]of Object.entries(s))c.setRequestHeader(e,t);const l=()=>{try{c.abort()}catch{}};n.signal.addEventListener("abort",l,{once:!0}),c.upload&&a.onUploadProgress&&(c.upload.onprogress=e=>{var t;const s=e.lengthComputable?e.total:null,i=e.lengthComputable&&e.total>0?Math.min(100,Math.max(0,e.loaded/e.total*100)):null;null==(t=a.onUploadProgress)||t.call(a,{loaded:e.loaded,total:s,percent:i})}),c.onerror=()=>{n.signal.removeEventListener("abort",l),o(new Error("Network error (XHR upload)."))},c.onload=async()=>{var t,s;if(n.signal.removeEventListener("abort",l),401===c.status)return o(new Error("Authentication required"));if(403===c.status)return o(new Error("Permission denied"));if(c.status<200||c.status>=300){let e=`Request failed: ${c.status} ${c.statusText}`;try{const t=JSON.parse(c.responseText||"{}");e=(null==t?void 0:t.error)||(null==t?void 0:t.message)||e}catch{}return o(new Error(e))}const i=c.getResponseHeader("X-PP-Redirect")||(c.status>=300&&c.status<400?c.getResponseHeader("Location"):null);if(i)try{return await this.redirect(i),null==(t=a.onUploadComplete)||t.call(a),e({redirected:!0,to:i})}catch(e){return o(e)}const r=c.responseText??"";let h=r;try{h=JSON.parse(r)}catch{}null==(s=a.onUploadComplete)||s.call(a),e(h)};try{c.send(i)}catch(e){n.signal.removeEventListener("abort",l),o(e)}})}async handleStream(e,t){const s=e.getReader(),i=new TextDecoder;let n="";try{for(;;){const{done:e,value:r}=await s.read();if(e){t.onStreamComplete&&t.onStreamComplete();break}n+=i.decode(r,{stream:!0});const a=n.split("\n");n=a.pop()||"";for(const e of a)if(""!==e.trim()&&e.startsWith("data: ")){const s=e.slice(6);let i=s;try{("true"===s||"false"===s||"null"===s||!isNaN(Number(s))||s.startsWith("{")||s.startsWith("[")||s.startsWith('"'))&&(i=JSON.parse(s))}catch{}t.onStream&&t.onStream(i)}}}catch(e){if(!t.onStreamError)throw e;t.onStreamError(e)}finally{s.releaseLock()}}};m(xe,"instance",null),m(xe,"PUBLIC_METHODS",["createContext","mount","redirect","fetchFunction","enablePerf","disablePerf","getPerfStats","resetPerfStats"]);let nt=xe;function ds(e,t,s=(typeof window<"u"?window:globalThis),i=!0){let n=null;if(Object.defineProperty(s,e,{get(){if(null!==n)return n;if(t&&"object"==typeof t&&!Array.isArray(t)&&"getInstance"in t&&"function"==typeof t.getInstance)return n=t.getInstance(),n;if("function"!=typeof t)return n=t,n;try{return n=t.getInstance(),n}catch{return n=t,n}},set(t){null===t?n=null:console.warn(`Cannot override global ${e}`)},configurable:!0,enumerable:!0}),i)try{s[e]}catch(t){console.error(`Failed to initialize ${e}:`,t)}}ds("pp",{getInstance:()=>nt.getInstance()});export{Et as ComponentInit,nt as PPUtilities};
1
+ var hi=Object.defineProperty,pi=(e,t,s)=>t in e?hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,m=(e,t,s)=>pi(e,"symbol"!=typeof t?t+"":t,s);class fi{constructor(e){m(this,"hooks",[]),m(this,"currentIndex",0),m(this,"onStateChange"),m(this,"pendingLayoutEffects",[]),m(this,"pendingEffects",[]),m(this,"currentEffectPhase",null),m(this,"pendingSynchronousRenderUpdate",!1),m(this,"pendingSynchronousLayoutUpdate",!1),m(this,"pendingUpdate",!1),m(this,"hasScheduledRender",!1),m(this,"batchedUpdates",new Set),m(this,"portalRegistrations",[]),m(this,"disposed",!1),this.onStateChange=e}loadState(e){this.hooks=[...e]}getHooks(){return this.hooks}prepareRender(){this.disposed||(this.currentIndex=0,this.pendingLayoutEffects=[],this.pendingEffects=[],this.currentEffectPhase=null,this.portalRegistrations=[])}startRenderPhase(){this.disposed||(this.currentEffectPhase="render")}finishRenderPhase(){"render"===this.currentEffectPhase&&(this.currentEffectPhase=null);const e=this.pendingSynchronousRenderUpdate;return this.pendingSynchronousRenderUpdate=!1,e&&this.batchedUpdates.clear(),e}runLayoutEffects(){if(this.disposed)return this.pendingLayoutEffects=[],!1;const e=this.pendingLayoutEffects;this.pendingLayoutEffects=[],this.currentEffectPhase="layout",e.forEach(e=>{var t;null==(t=e.previousCleanup)||t.call(e)}),e.forEach(e=>{const t=e.callback();this.hooks[e.hookIndex]={deps:e.deps,cleanup:"function"==typeof t?t:void 0,effectType:"layout"}}),this.currentEffectPhase=null;const t=this.pendingSynchronousLayoutUpdate;return this.pendingSynchronousLayoutUpdate=!1,t&&this.batchedUpdates.clear(),t}runEffects(){if(this.disposed)return void(this.pendingEffects=[]);const e=this.pendingEffects;this.pendingEffects=[],this.currentEffectPhase="effect",e.forEach(e=>{var t;null==(t=e.previousCleanup)||t.call(e)}),e.forEach(e=>{const t=e.callback();this.hooks[e.hookIndex]={deps:e.deps,cleanup:"function"==typeof t?t:void 0,effectType:"effect"}}),this.currentEffectPhase=null}dispose(){if(this.disposed)return;this.disposed=!0,this.pendingLayoutEffects=[],this.pendingEffects=[],this.pendingUpdate=!1,this.hasScheduledRender=!1,this.batchedUpdates.clear(),this.portalRegistrations=[];const e=e=>{const t=e.cleanup;if("function"==typeof t)try{t()}finally{e.cleanup=void 0}};this.hooks.forEach(t=>{!t||"object"!=typeof t||"layout"===t.effectType&&e(t)}),this.hooks.forEach(t=>{!t||"object"!=typeof t||"effect"===t.effectType&&e(t)}),this.hooks.forEach(t=>{!t||"object"!=typeof t||t.effectType||e(t)}),this.hooks=[],this.currentIndex=0}usePortal(e,t){const s=this.currentIndex++;void 0===this.hooks[s]&&(this.hooks[s]={sourceParent:null});const i=this.hooks[s];return this.portalRegistrations.push({ref:e,target:t??null,info:i}),i}getPortalRegistrations(){return this.portalRegistrations}useState(e){const t=this.currentIndex++;if(void 0===this.hooks[t]){const s=this.hooks,i=t,n=this.batchedUpdates,r=()=>this.scheduleUpdate(),a=e=>{const t=s[i];if(this.disposed||void 0===t)return;let a=e;"function"==typeof e&&(a=e(t.__state)),Object.is(t.__state,a)||(t.__state=a,n.add(i),r())};this.hooks[t]={__state:this.resolveInitialState(e),__setter:a}}const s=this.hooks[t];if("object"!=typeof s||null===s||!("__state"in s)){const e=s,i=this.hooks,n=t,r=this.batchedUpdates,a=()=>this.scheduleUpdate(),o=e=>{const t=i[n];if(this.disposed||void 0===t)return;let s=e;"function"==typeof e&&(s=e(t.__state)),Object.is(t.__state,s)||(t.__state=s,r.add(n),a())};this.hooks[t]={__state:e,__setter:o}}return[this.hooks[t].__state,this.hooks[t].__setter]}resolveInitialState(e){return"function"==typeof e?e():e}scheduleUpdate(){if(!this.disposed){if("render"===this.currentEffectPhase)return void(this.pendingSynchronousRenderUpdate=!0);if("layout"===this.currentEffectPhase)return void(this.pendingSynchronousLayoutUpdate=!0);this.hasScheduledRender=!0,this.pendingUpdate||(this.pendingUpdate=!0,queueMicrotask(()=>{if(this.pendingUpdate=!1,this.disposed)return this.hasScheduledRender=!1,void this.batchedUpdates.clear();this.hasScheduledRender&&(this.hasScheduledRender=!1,this.batchedUpdates.clear(),this.onStateChange())}))}}useRef(e=null){const t=this.currentIndex++;return void 0===this.hooks[t]&&(this.hooks[t]={current:e}),this.hooks[t]}useMemo(e,t){const s=this.currentIndex++,i=this.hooks[s];if(!i||this.areDepsDifferent(i.deps,t)){const i=e();return this.hooks[s]={value:i,deps:t},i}return i.value}useCallback(e,t){const s=this.currentIndex++,i=this.hooks[s];return!i||this.areDepsDifferent(i.deps,t)?(this.hooks[s]={callback:e,deps:t},e):i.callback}useReducer(e,t,s){const i=this.currentIndex++;if(void 0===this.hooks[i]){const n={state:s?s(t):t,reducer:e,dispatch:null};n.dispatch=e=>{if(this.disposed)return;const t=n.reducer(n.state,e);Object.is(n.state,t)||(n.state=t,this.scheduleUpdate())},this.hooks[i]=n}const n=this.hooks[i];return n.reducer=e,[n.state,n.dispatch]}useEffect(e,t){const s=this.currentIndex++,i=this.hooks[s];(!i||!t||!i.deps||this.areDepsDifferent(i.deps,t))&&this.pendingEffects.push({hookIndex:s,deps:t,callback:e,previousCleanup:"function"==typeof(null==i?void 0:i.cleanup)?i.cleanup:void 0})}useLayoutEffect(e,t){const s=this.currentIndex++,i=this.hooks[s];(!i||!t||!i.deps||this.areDepsDifferent(i.deps,t))&&this.pendingLayoutEffects.push({hookIndex:s,deps:t,callback:e,previousCleanup:"function"==typeof(null==i?void 0:i.cleanup)?i.cleanup:void 0})}areDepsDifferent(e,t){return e.length!==t.length||t.some((t,s)=>!Object.is(t,e[s]))}}class C{static saveState(e,t){e&&this.states.set(e,t)}static getState(e){return this.states.get(e)}static removeState(e){this.states.delete(e)}static saveScope(e,t){this.scopes.set(e,t)}static getScope(e){return this.scopes.get(e)}static getRootAncestor(e){let t=e;const s=new Set;for(;t&&!s.has(t);){s.add(t);const e=this.parents.get(t);if(!e)return t;t=e}return null}static resolveComponentId(e,t=null){if(!e)return null;if("app"!==e)return e;const s=new Set;let i=t,n=null;for(;i&&!s.has(i);){if(s.add(i),i.startsWith("page_"))return i;const e=this.parents.get(i)??null;if(!e){n=i;break}i=e}if(n)return n;for(const[e,t]of this.parents.entries())if(null===t&&this.scopes.has(e))return e;const r=this.scopes.keys().next().value;return"string"==typeof r?r:null}static getResolvedScope(e,t=null){const s=this.resolveComponentId(e,t);return s?this.scopes.get(s):void 0}static getResolvedScopeWithAncestors(e,t=null){const s=this.resolveComponentId(e,t);if(!s)return;const i=new Set,n=[];let r=s;for(;r&&!i.has(r);){i.add(r);const e=this.scopes.get(r);e&&n.push(e),r=this.parents.get(r)??null}return 0!==n.length?Object.assign({},...n.reverse()):void 0}static removeScope(e){this.scopes.delete(e)}static registerInstance(e,t){var s;const i=this.instances.get(e);i&&i!==t&&(null==(s=i.destroy)||s.call(i)),this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static removeInstance(e){this.instances.delete(e)}static saveParent(e,t){e&&this.parents.set(e,t)}static getParent(e){return this.parents.get(e)}static removeParent(e){if(!this.parents.has(e))return;const t=this.parents.get(e)??null;this.parents.forEach((s,i)=>{s===e&&this.parents.set(i,t)}),this.parents.delete(e)}static saveContextValues(e,t){const s=this.contextValues.get(e)??new Map,i=new Set;return s.forEach((e,s)=>{t.has(s)||i.add(s)}),t.forEach((e,t)=>{s.has(t)&&Object.is(s.get(t),e)||i.add(t)}),t.size>0?this.contextValues.set(e,new Map(t)):this.contextValues.delete(e),Array.from(i)}static resolveContext(e,t){let s=e;for(;s;){const e=this.contextValues.get(s);if(null!=e&&e.has(t))return{providerId:s,value:e.get(t)};s=this.parents.get(s)??null}return{providerId:null,value:t.defaultValue}}static updateContextDependencies(e,t){const s=new Set(t),i=this.consumerContexts.get(e)??new Set;i.forEach(t=>{s.has(t)||this.removeContextConsumer(t,e)}),s.forEach(t=>{i.has(t)||this.addContextConsumer(t,e)}),s.size>0?this.consumerContexts.set(e,s):this.consumerContexts.delete(e)}static getConsumersForContextsInSubtree(e,t){const s=new Set;for(const i of t){const t=this.contextConsumers.get(i);t&&t.forEach(t=>{t!==e&&this.isAncestor(e,t)&&s.add(t)})}return s}static removeContextTracking(e){const t=this.contextValues.get(e),s=t?this.getConsumersForContextsInSubtree(e,t.keys()):new Set;this.contextValues.delete(e);const i=this.consumerContexts.get(e);return i&&(i.forEach(t=>{this.removeContextConsumer(t,e)}),this.consumerContexts.delete(e)),this.removeParent(e),s}static saveTemplate(e,t){this.templates.has(e)||this.templates.set(e,t)}static getTemplate(e){return this.templates.get(e)}static saveOwnedTemplates(e,t){this.ownedTemplateData.has(e)||this.ownedTemplateData.set(e,t)}static getOwnedTemplates(e){return this.ownedTemplateData.get(e)}static clear(){this.states.clear(),this.scopes.clear(),this.instances.clear(),this.parents.clear(),this.templates.clear(),this.ownedTemplateData.clear(),this.contextValues.clear(),this.consumerContexts.clear(),this.contextConsumers.clear()}static destroyAll(){var e;const t=Array.from(this.instances.values()),s=new Set;for(const i of t)if(i&&!s.has(i)){s.add(i);try{null==(e=i.destroy)||e.call(i)}catch(e){console.warn("[PP-WARN] Failed to destroy component instance",e)}}}static getStats(){return{states:this.states.size,scopes:this.scopes.size,instances:this.instances.size,parents:this.parents.size,templates:this.templates.size,ownedData:this.ownedTemplateData.size,contextValues:this.contextValues.size,contextConsumers:this.contextConsumers.size}}static addContextConsumer(e,t){const s=this.contextConsumers.get(e)??new Set;s.add(t),this.contextConsumers.set(e,s)}static removeContextConsumer(e,t){const s=this.contextConsumers.get(e);s&&(s.delete(t),0===s.size&&this.contextConsumers.delete(e))}static isAncestor(e,t){let s=this.parents.get(t)??null;for(;s;){if(s===e)return!0;s=this.parents.get(s)??null}return!1}}m(C,"states",new Map),m(C,"scopes",new Map),m(C,"instances",new Map),m(C,"parents",new Map),m(C,"templates",new Map),m(C,"ownedTemplateData",new Map),m(C,"contextValues",new Map),m(C,"consumerContexts",new Map),m(C,"contextConsumers",new Map);const et=new Set(["class","for","while","if","else","return","function","var","let","const","import","export","this","debugger","delete","typeof","void","new","in","instanceof","do","try","catch","finally","switch","case","default","break","continue","yield","await","with","super","enum","extends","implements","interface","package","private","protected","public","static"]),di=new Set(["Array","Object","String","Number","Boolean","Math","JSON","Date","RegExp","Error","Map","Set","WeakMap","WeakSet","Promise","Symbol","BigInt","parseInt","parseFloat","isNaN","isFinite","encodeURI","decodeURI","encodeURIComponent","decodeURIComponent","console","window","document","undefined","null","NaN","Infinity","pp","true","false","setTimeout","setInterval","clearTimeout","clearInterval","requestAnimationFrame","cancelAnimationFrame","fetch","alert","confirm","prompt"]),wt=new Set(["hidden","disabled","checked","selected","readonly","required","open","autofocus","multiple","ismap","noValidate","defer","async","autoplay","controls","loop","muted","default","reversed","scoped","seamless","sortable","translate","draggable","contenteditable","spellcheck"]);function dt(e){return e.includes("-")?e.replace(/-([a-z])/g,e=>e[1].toUpperCase()):e}const mt=new WeakMap,mi=/^[A-Za-z_$][\w$]*$/;function gi(e){return mi.test(e)&&!et.has(e)}function me(e){const t=mt.get(e);if(t)return t;const s=Object.keys(e).filter(gi),i={keys:s,keySig:s.join("\0")};return mt.set(e,i),i}function ge(e,t){const s=new Array(t.length);for(let i=0;i<t.length;i++)s[i]=e[t[i]];return s}const de=new Map,xi=500;let Ge=null,Ve=null;function vi(e){Ve||(Ve=document.createElement("template")),Ve.innerHTML=e;const t=Array.from(Ve.content.childNodes).filter(e=>e.nodeType===Node.TEXT_NODE?(e.textContent??"").trim().length>0:e.nodeType===Node.ELEMENT_NODE);if(1!==t.length)return null;const s=t[0];return s instanceof HTMLTemplateElement&&s.hasAttribute("pp-owner")?s.innerHTML:null}function yi(e){let t=U(e),s=!1;for(;;){const e=vi(t);if(null===e)break;t=e,s=!0}return s?t:null}function kt(e){if(!e.includes("<textarea"))return e;const t=e.includes("pp-owner"),s=document.createElement("template");s.innerHTML=e;let i=!1;return s.content.querySelectorAll("textarea").forEach(e=>{const s=e;if(t){const e=yi(s.value);if(null!==e)return s.textContent=e,void(i=!0)}s.value.length>0&&0===s.value.trim().length&&(s.textContent="",i=!0)}),i?s.innerHTML:e}function U(e){if(!e.includes("&"))return e;if(de.has(e))return de.get(e);Ge||(Ge=document.createElement("textarea"));const t=Ge;t.innerHTML=e;let s=t.value,i=0;for(;s.includes("&")&&i++<10;){t.innerHTML=s;const e=t.value;if(e===s)break;s=e}if(de.size>=xi){const e=de.keys().next().value;void 0!==e&&de.delete(e)}return de.set(e,s),s}const ee="data-pp-fragment-root";function At(e){const t=String(e??"").trim().toLowerCase();switch(t){case"table":return{prefix:`<table ${ee}="">`,suffix:"</table>",rootSelector:`table[${ee}]`};case"thead":case"tbody":case"tfoot":return{prefix:`<table><${t} ${ee}="">`,suffix:`</${t}></table>`,rootSelector:`${t}[${ee}]`};case"tr":return{prefix:`<table><tbody><tr ${ee}="">`,suffix:"</tr></tbody></table>",rootSelector:`tr[${ee}]`};case"colgroup":return{prefix:`<table><colgroup ${ee}="">`,suffix:"</colgroup></table>",rootSelector:`colgroup[${ee}]`};default:return{prefix:"",suffix:"",rootSelector:null}}}function bi(e){const t=At(e);return{wrap:e=>`${t.prefix}${e}${t.suffix}`,unwrap:e=>{if(!t.prefix&&!t.suffix)return e;const s=document.createElement("template");if(s.innerHTML=e,t.rootSelector){const e=s.content.querySelector(t.rootSelector);if(e)return e.innerHTML}return e}}}function Me(e,t){const s=At(t),i=document.createElement("template");if(i.innerHTML=kt(`${s.prefix}${e}${s.suffix}`),!s.rootSelector)return{root:i.content,toHtml:()=>i.innerHTML};const n=i.content.querySelector(s.rootSelector);return n?(n.removeAttribute(ee),{root:n,toHtml:()=>n.innerHTML}):{root:i.content,toHtml:()=>i.innerHTML}}function _i(e,t){if(e===t)return!0;if(!e||!t||"object"!=typeof e||"object"!=typeof t)return!1;const s=Object.keys(e),i=s.length;let n=0;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&(n++,n>i))return!1;if(n!==i)return!1;for(let n=0;n<i;n++){const i=s[n];if(e[i]!==t[i])return!1}return!0}class Ci{constructor(e,t,s){m(this,"root"),m(this,"getScope"),m(this,"canBindElement"),m(this,"handlerCache",new Map),this.root=e,this.getScope=t,this.canBindElement=s??(e=>this.isRootOwnedElement(e))}clearCache(){this.handlerCache.clear()}resolveEventOwnerScope(e){const t=this.root.getAttribute("pp-component");return C.getResolvedScopeWithAncestors(e,t)}bindEvents(e){(e||this.fallbackCollectEventElements()).forEach(e=>{this.canBindElement(e)&&this.bindElementEvents(e)})}isRootOwnedElement(e){var t;if(e===this.root)return!0;let s=e.closest("[pp-component]");return e===s&&(s=(null==(t=e.parentElement)?void 0:t.closest("[pp-component]"))??null),s===this.root}bindElementEvents(e){const t=e.getAttribute("pp-event-owner");t&&e.removeAttribute("pp-event-owner");const s=[];Array.from(e.attributes).forEach(i=>{if(i.name.startsWith("on")&&!i.name.includes("-")){const n=i.name.slice(2).toLowerCase();let r=i.value.trim();const a=r.match(/^\{([\s\S]*)\}$/);a&&(r=a[1].trim()),s.push(i.name);const o=`__pp_bound_${n}`;if(e[o]===r)return;e[o]=r;const c=e[`__pp_handler_${n}`];c&&e.removeEventListener(n,c);const l=s=>{var i;if(t){const i=this.resolveEventOwnerScope(t);if(i)return void this.executeHandlerWithScope(r,s,i,e)}let n=e.closest("[pp-component]");n===e&&(n=(null==(i=e.parentElement)?void 0:i.closest("[pp-component]"))??null);const a=(null==n?void 0:n.getAttribute("pp-component"))||null;if(a){const t=C.getScope(a);if(t)return void this.executeHandlerWithScope(r,s,t,e)}this.executeHandler(r,s,e)};e[`__pp_handler_${n}`]=l,e.addEventListener(n,l)}}),s.forEach(t=>{e.removeAttribute(t)})}fallbackCollectEventElements(){const e=new Set,t=this.root.attributes;for(let s=0;s<t.length;s++)if(t[s].name.startsWith("on")&&!t[s].name.includes("-")){e.add(this.root);break}const s=this.root.querySelectorAll("*");for(let t=0;t<s.length;t++){const i=s[t],n=i.attributes;for(let t=0;t<n.length;t++)if(n[t].name.startsWith("on")&&!n[t].name.includes("-")){e.add(i);break}}return e}executeHandler(e,t,s){this.executeHandlerWithScope(e,t,this.getScope(),s)}executeHandlerWithScope(e,t,s,i){const n=me(s),r=n.keys,a=ge(s,r);try{const s=this.getCompiledHandler(e,r,n.keySig).call(i??t.currentTarget??null,...a,t);"function"==typeof s&&s(t)}catch(t){console.error("[PP-ERROR] Handler failed:",t),console.error("Code:",e)}}getCompiledHandler(e,t,s){const i=e+"|"+s;if(!this.handlerCache.has(i)){if(this.handlerCache.size>500){const e=this.handlerCache.keys().next().value;e&&this.handlerCache.delete(e)}const s="\n const e = event;\n const $event = event;\n const target = event?.target;\n const currentTarget = event?.currentTarget;\n const el = event?.currentTarget;\n ";let n;try{n=new Function(...t,"event",`"use strict";${s} return (${e})`)}catch{n=new Function(...t,"event",`"use strict";${s} ${e}`)}this.handlerCache.set(i,n)}return this.handlerCache.get(i)}}var Si=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],Pt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Ei="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Tt="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Xe={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Qe="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",wi={5:Qe,"5module":Qe+" export import",6:Qe+" const class extends export import super"},ki=/^in(stanceof)?$/,Ai=new RegExp("["+Tt+"]"),Pi=new RegExp("["+Tt+Ei+"]");function tt(e,t){for(var s=65536,i=0;i<t.length;i+=2){if((s+=t[i])>e)return!1;if((s+=t[i+1])>=e)return!0}return!1}function Z(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&Ai.test(String.fromCharCode(e)):!1!==t&&tt(e,Pt)))}function ae(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&Pi.test(String.fromCharCode(e)):!1!==t&&(tt(e,Pt)||tt(e,Si)))))}var P=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function j(e,t){return new P(e,{beforeExpr:!0,binop:t})}var K={beforeExpr:!0},H={startsExpr:!0},at={};function w(e,t){return void 0===t&&(t={}),t.keyword=e,at[e]=new P(e,t)}var u={num:new P("num",H),regexp:new P("regexp",H),string:new P("string",H),name:new P("name",H),privateId:new P("privateId",H),eof:new P("eof"),bracketL:new P("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new P("]"),braceL:new P("{",{beforeExpr:!0,startsExpr:!0}),braceR:new P("}"),parenL:new P("(",{beforeExpr:!0,startsExpr:!0}),parenR:new P(")"),comma:new P(",",K),semi:new P(";",K),colon:new P(":",K),dot:new P("."),question:new P("?",K),questionDot:new P("?."),arrow:new P("=>",K),template:new P("template"),invalidTemplate:new P("invalidTemplate"),ellipsis:new P("...",K),backQuote:new P("`",H),dollarBraceL:new P("${",{beforeExpr:!0,startsExpr:!0}),eq:new P("=",{beforeExpr:!0,isAssign:!0}),assign:new P("_=",{beforeExpr:!0,isAssign:!0}),incDec:new P("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new P("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:j("||",1),logicalAND:j("&&",2),bitwiseOR:j("|",3),bitwiseXOR:j("^",4),bitwiseAND:j("&",5),equality:j("==/!=/===/!==",6),relational:j("</>/<=/>=",7),bitShift:j("<</>>/>>>",8),plusMin:new P("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:j("%",10),star:j("*",10),slash:j("/",10),starstar:new P("**",{beforeExpr:!0}),coalesce:j("??",1),_break:w("break"),_case:w("case",K),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",K),_do:w("do",{isLoop:!0,beforeExpr:!0}),_else:w("else",K),_finally:w("finally"),_for:w("for",{isLoop:!0}),_function:w("function",H),_if:w("if"),_return:w("return",K),_switch:w("switch"),_throw:w("throw",K),_try:w("try"),_var:w("var"),_const:w("const"),_while:w("while",{isLoop:!0}),_with:w("with"),_new:w("new",{beforeExpr:!0,startsExpr:!0}),_this:w("this",H),_super:w("super",H),_class:w("class",H),_extends:w("extends",K),_export:w("export"),_import:w("import",H),_null:w("null",H),_true:w("true",H),_false:w("false",H),_in:w("in",{beforeExpr:!0,binop:7}),_instanceof:w("instanceof",{beforeExpr:!0,binop:7}),_typeof:w("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:w("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:w("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},q=/\r\n?|\n|\u2028|\u2029/,Ti=new RegExp(q.source,"g");function ye(e){return 10===e||13===e||8232===e||8233===e}function It(e,t,s){void 0===s&&(s=e.length);for(var i=t;i<s;i++){var n=e.charCodeAt(i);if(ye(n))return i<s-1&&13===n&&10===e.charCodeAt(i+1)?i+2:i+1}return-1}var Rt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,D=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Nt=Object.prototype,Ii=Nt.hasOwnProperty,Ri=Nt.toString,be=Object.hasOwn||function(e,t){return Ii.call(e,t)},gt=Array.isArray||function(e){return"[object Array]"===Ri.call(e)},xt=Object.create(null);function ne(e){return xt[e]||(xt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function te(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}var Ni=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Te=function(e,t){this.line=e,this.column=t};Te.prototype.offset=function(e){return new Te(this.line,this.column+e)};var Ue=function(e,t,s){this.start=t,this.end=s,null!==e.sourceFile&&(this.source=e.sourceFile)};function Lt(e,t){for(var s=1,i=0;;){var n=It(e,i,t);if(n<0)return new Te(s,t-i);++s,i=n}}var it={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},vt=!1;function Li(e){var t={};for(var s in it)t[s]=e&&be(e,s)?e[s]:it[s];if("latest"===t.ecmaVersion?t.ecmaVersion=1e8:null==t.ecmaVersion?(!vt&&"object"==typeof console&&console.warn&&(vt=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),(!e||null==e.allowHashBang)&&(t.allowHashBang=t.ecmaVersion>=14),gt(t.onToken)){var i=t.onToken;t.onToken=function(e){return i.push(e)}}return gt(t.onComment)&&(t.onComment=Vi(t,t.onComment)),t}function Vi(e,t){return function(s,i,n,r,a,o){var c={type:s?"Block":"Line",value:i,start:n,end:r};e.locations&&(c.loc=new Ue(this,a,o)),e.ranges&&(c.range=[n,r]),t.push(c)}}var Ie=1,_e=2,ot=4,Vt=8,ut=16,Mt=32,qe=64,Ot=128,he=256,Re=512,$e=Ie|_e|he;function ct(e,t){return _e|(e?ot:0)|(t?Vt:0)}var De=0,lt=1,se=2,Dt=3,Bt=4,Ft=5,L=function(e,t,s){this.options=e=Li(e),this.sourceFile=e.sourceFile,this.keywords=ne(wi[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var i="";!0!==e.allowReserved&&(i=Xe[e.ecmaVersion>=6?6:5===e.ecmaVersion?5:3],"module"===e.sourceType&&(i+=" await")),this.reservedWords=ne(i);var n=(i?i+" ":"")+Xe.strict;this.reservedWordsStrict=ne(n),this.reservedWordsStrictBind=ne(n+" "+Xe.strictBind),this.input=String(t),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf("\n",s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(q).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=u.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Ie),this.regexpState=null,this.privateNameStack=[]},Y={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};L.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Y.inFunction.get=function(){return(this.currentVarScope().flags&_e)>0},Y.inGenerator.get=function(){return(this.currentVarScope().flags&Vt)>0},Y.inAsync.get=function(){return(this.currentVarScope().flags&ot)>0},Y.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(he|Re))return!1;if(t&_e)return(t&ot)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Y.allowSuper.get=function(){return(this.currentThisScope().flags&qe)>0||this.options.allowSuperOutsideMethod},Y.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ot)>0},Y.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Y.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(he|Re)||t&_e&&!(t&ut))return!0}return!1},Y.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&he)>0},L.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var s=this,i=0;i<e.length;i++)s=e[i](s);return s},L.parse=function(e,t){return new this(t,e).parse()},L.parseExpressionAt=function(e,t,s){var i=new this(s,e,t);return i.nextToken(),i.parseExpression()},L.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(L.prototype,Y);var F=L.prototype,Mi=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;F.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){D.lastIndex=e,e+=D.exec(this.input)[0].length;var t=Mi.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){D.lastIndex=e+t[0].length;var s=D.exec(this.input),i=s.index+s[0].length,n=this.input.charAt(i);return";"===n||"}"===n||q.test(s[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||"!"===n&&"="===this.input.charAt(i+1))}e+=t[0].length,D.lastIndex=e,e+=D.exec(this.input)[0].length,";"===this.input[e]&&e++}},F.eat=function(e){return this.type===e&&(this.next(),!0)},F.isContextual=function(e){return this.type===u.name&&this.value===e&&!this.containsEsc},F.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},F.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},F.canInsertSemicolon=function(){return this.type===u.eof||this.type===u.braceR||q.test(this.input.slice(this.lastTokEnd,this.start))},F.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},F.semicolon=function(){!this.eat(u.semi)&&!this.insertSemicolon()&&this.unexpected()},F.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},F.expect=function(e){this.eat(e)||this.unexpected()},F.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var We=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};F.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var s=t?e.parenthesizedAssign:e.parenthesizedBind;s>-1&&this.raiseRecoverable(s,t?"Assigning to rvalue":"Parenthesized pattern")}},F.checkExpressionErrors=function(e,t){if(!e)return!1;var s=e.shorthandAssign,i=e.doubleProto;if(!t)return s>=0||i>=0;s>=0&&this.raise(s,"Shorthand property assignments are valid only in destructuring patterns"),i>=0&&this.raiseRecoverable(i,"Redefinition of __proto__ property")},F.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},F.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var y=L.prototype;y.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==u.eof;){var s=this.parseStatement(null,!0,t);e.body.push(s)}if(this.inModule)for(var i=0,n=Object.keys(this.undefinedExports);i<n.length;i+=1){var r=n[i];this.raiseRecoverable(this.undefinedExports[r].start,"Export '"+r+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var ht={kind:"loop"},Oi={kind:"switch"};y.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;D.lastIndex=this.pos;var t=D.exec(this.input),s=this.pos+t[0].length,i=this.input.charCodeAt(s);if(91===i||92===i)return!0;if(e)return!1;if(123===i||i>55295&&i<56320)return!0;if(Z(i,!0)){for(var n=s+1;ae(i=this.input.charCodeAt(n),!0);)++n;if(92===i||i>55295&&i<56320)return!0;var r=this.input.slice(s,n);if(!ki.test(r))return!0}return!1},y.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;D.lastIndex=this.pos;var e,t=D.exec(this.input),s=this.pos+t[0].length;return!(q.test(this.input.slice(this.pos,s))||"function"!==this.input.slice(s,s+8)||s+8!==this.input.length&&(ae(e=this.input.charCodeAt(s+8))||e>55295&&e<56320))},y.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;D.lastIndex=this.pos;var s=D.exec(this.input),i=this.pos+s[0].length;if(q.test(this.input.slice(this.pos,i)))return!1;if(e){var n,r=i+5;if("using"!==this.input.slice(i,r)||r===this.input.length||ae(n=this.input.charCodeAt(r))||n>55295&&n<56320)return!1;D.lastIndex=r;var a=D.exec(this.input);if(a&&q.test(this.input.slice(r,r+a[0].length)))return!1}if(t){var o,c=i+2;if(!("of"!==this.input.slice(i,c)||c!==this.input.length&&(ae(o=this.input.charCodeAt(c))||o>55295&&o<56320)))return!1}var l=this.input.charCodeAt(i);return Z(l,!0)||92===l},y.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},y.isUsing=function(e){return this.isUsingKeyword(!1,e)},y.parseStatement=function(e,t,s){var i,n=this.type,r=this.startNode();switch(this.isLet(e)&&(n=u._var,i="let"),n){case u._break:case u._continue:return this.parseBreakContinueStatement(r,n.keyword);case u._debugger:return this.parseDebuggerStatement(r);case u._do:return this.parseDoStatement(r);case u._for:return this.parseForStatement(r);case u._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case u._class:return e&&this.unexpected(),this.parseClass(r,!0);case u._if:return this.parseIfStatement(r);case u._return:return this.parseReturnStatement(r);case u._switch:return this.parseSwitchStatement(r);case u._throw:return this.parseThrowStatement(r);case u._try:return this.parseTryStatement(r);case u._const:case u._var:return i=i||this.value,e&&"var"!==i&&this.unexpected(),this.parseVarStatement(r,i);case u._while:return this.parseWhileStatement(r);case u._with:return this.parseWithStatement(r);case u.braceL:return this.parseBlock(!0,r);case u.semi:return this.parseEmptyStatement(r);case u._export:case u._import:if(this.options.ecmaVersion>10&&n===u._import){D.lastIndex=this.pos;var a=D.exec(this.input),o=this.pos+a[0].length,c=this.input.charCodeAt(o);if(40===c||46===c)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===u._import?this.parseImport(r):this.parseExport(r,s);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var l=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(l)return t&&"script"===this.options.sourceType&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),"await using"===l&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,l),this.semicolon(),this.finishNode(r,"VariableDeclaration");var h=this.value,p=this.parseExpression();return n===u.name&&"Identifier"===p.type&&this.eat(u.colon)?this.parseLabeledStatement(r,h,p,e):this.parseExpressionStatement(r,p)}},y.parseBreakContinueStatement=function(e,t){var s="break"===t;this.next(),this.eat(u.semi)||this.insertSemicolon()?e.label=null:this.type!==u.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i<this.labels.length;++i){var n=this.labels[i];if((null==e.label||n.name===e.label.name)&&(null!=n.kind&&(s||"loop"===n.kind)||e.label&&s))break}return i===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,s?"BreakStatement":"ContinueStatement")},y.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},y.parseDoStatement=function(e){return this.next(),this.labels.push(ht),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(u._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(u.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},y.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ht),this.enterScope(0),this.expect(u.parenL),this.type===u.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var s=this.isLet();if(this.type===u._var||this.type===u._const||s){var i=this.startNode(),n=s?"let":this.value;return this.next(),this.parseVar(i,!0,n),this.finishNode(i,"VariableDeclaration"),this.parseForAfterInit(e,i,t)}var r=this.isContextual("let"),a=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var c=this.startNode();return this.next(),"await using"===o&&this.next(),this.parseVar(c,!0,o),this.finishNode(c,"VariableDeclaration"),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,h=new We,p=this.start,d=t>-1?this.parseExprSubscripts(h,"await"):this.parseExpression(!0,h);return this.type===u._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===u._in&&this.unexpected(t),e.await=!0):a&&this.options.ecmaVersion>=8&&(d.start!==p||l||"Identifier"!==d.type||"async"!==d.name?this.options.ecmaVersion>=9&&(e.await=!1):this.unexpected()),r&&a&&this.raise(d.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(d,!1,h),this.checkLValPattern(d),this.parseForIn(e,d)):(this.checkExpressionErrors(h,!0),t>-1&&this.unexpected(t),this.parseFor(e,d))},y.parseForAfterInit=function(e,t,s){return(this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===t.declarations.length?(this.options.ecmaVersion>=9&&(this.type===u._in?s>-1&&this.unexpected(s):e.await=s>-1),this.parseForIn(e,t)):(s>-1&&this.unexpected(s),this.parseFor(e,t))},y.parseFunctionStatement=function(e,t,s){return this.next(),this.parseFunction(e,Pe|(s?0:st),!1,t)},y.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(u._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},y.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(u.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},y.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(u.braceL),this.labels.push(Oi),this.enterScope(0);for(var t,s=!1;this.type!==u.braceR;)if(this.type===u._case||this.type===u._default){var i=this.type===u._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),i?t.test=this.parseExpression():(s&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),s=!0,t.test=null),this.expect(u.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},y.parseThrowStatement=function(e){return this.next(),q.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Di=[];y.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t="Identifier"===e.type;return this.enterScope(t?Mt:0),this.checkLValPattern(e,t?Bt:se),this.expect(u.parenR),e},y.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===u._catch){var t=this.startNode();this.next(),this.eat(u.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(u._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},y.parseVarStatement=function(e,t,s){return this.next(),this.parseVar(e,!1,t,s),this.semicolon(),this.finishNode(e,"VariableDeclaration")},y.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(ht),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},y.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},y.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},y.parseLabeledStatement=function(e,t,s,i){for(var n=0,r=this.labels;n<r.length;n+=1){r[n].name===t&&this.raise(s.start,"Label '"+t+"' is already declared")}for(var a=this.type.isLoop?"loop":this.type===u._switch?"switch":null,o=this.labels.length-1;o>=0;o--){var c=this.labels[o];if(c.statementStart!==e.start)break;c.statementStart=this.start,c.kind=a}return this.labels.push({name:t,kind:a,statementStart:this.start}),e.body=this.parseStatement(i?-1===i.indexOf("label")?i+"label":i:"label"),this.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")},y.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},y.parseBlock=function(e,t,s){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(u.braceL),e&&this.enterScope(0);this.type!==u.braceR;){var i=this.parseStatement(null);t.body.push(i)}return s&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},y.parseFor=function(e,t){return e.init=t,this.expect(u.semi),e.test=this.type===u.semi?null:this.parseExpression(),this.expect(u.semi),e.update=this.type===u.parenR?null:this.parseExpression(),this.expect(u.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},y.parseForIn=function(e,t){var s=this.type===u._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!s||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)&&this.raise(t.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(u.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")},y.parseVar=function(e,t,s,i){for(e.declarations=[],e.kind=s;;){var n=this.startNode();if(this.parseVarId(n,s),this.eat(u.eq)?n.init=this.parseMaybeAssign(t):i||"const"!==s||this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of")?i||"using"!==s&&"await using"!==s||!(this.options.ecmaVersion>=17)||this.type===u._in||this.isContextual("of")?i||"Identifier"===n.id.type||t&&(this.type===u._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+s+" declaration"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(u.comma))break}return e},y.parseVarId=function(e,t){e.id="using"===t||"await using"===t?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,"var"===t?lt:se,!1)};var Pe=1,st=2,Ht=4;function Bi(e,t){var s=t.key.name,i=e[s],n="true";return"MethodDefinition"===t.type&&("get"===t.kind||"set"===t.kind)&&(n=(t.static?"s":"i")+t.kind),"iget"===i&&"iset"===n||"iset"===i&&"iget"===n||"sget"===i&&"sset"===n||"sset"===i&&"sget"===n?(e[s]="true",!1):!!i||(e[s]=n,!1)}function Be(e,t){var s=e.computed,i=e.key;return!s&&("Identifier"===i.type&&i.name===t||"Literal"===i.type&&i.value===t)}y.parseFunction=function(e,t,s,i,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!i)&&(this.type===u.star&&t&st&&this.unexpected(),e.generator=this.eat(u.star)),this.options.ecmaVersion>=8&&(e.async=!!i),t&Pe&&(e.id=t&Ht&&this.type!==u.name?null:this.parseIdent(),e.id&&!(t&st)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?lt:se:Dt));var r=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ct(e.async,e.generator)),t&Pe||(e.id=this.type===u.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,s,!1,n),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&Pe?"FunctionDeclaration":"FunctionExpression")},y.parseFunctionParams=function(e){this.expect(u.parenL),e.params=this.parseBindingList(u.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},y.parseClass=function(e,t){this.next();var s=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var i=this.enterClassBody(),n=this.startNode(),r=!1;for(n.body=[],this.expect(u.braceL);this.type!==u.braceR;){var a=this.parseClassElement(null!==e.superClass);a&&(n.body.push(a),"MethodDefinition"===a.type&&"constructor"===a.kind?(r&&this.raiseRecoverable(a.start,"Duplicate constructor in the same class"),r=!0):a.key&&"PrivateIdentifier"===a.key.type&&Bi(i,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=s,this.next(),e.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},y.parseClassElement=function(e){if(this.eat(u.semi))return null;var t=this.options.ecmaVersion,s=this.startNode(),i="",n=!1,r=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(u.braceL))return this.parseClassStaticBlock(s),s;this.isClassElementNameStart()||this.type===u.star?o=!0:i="static"}if(s.static=o,!i&&t>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==u.star||this.canInsertSemicolon()?i="async":r=!0),!i&&(t>=9||!r)&&this.eat(u.star)&&(n=!0),!i&&!r&&!n){var c=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=c:i=c)}if(i?(s.computed=!1,s.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),s.key.name=i,this.finishNode(s.key,"Identifier")):this.parseClassElementName(s),t<13||this.type===u.parenL||"method"!==a||n||r){var l=!s.static&&Be(s,"constructor"),h=l&&e;l&&"method"!==a&&this.raise(s.key.start,"Constructor can't have get/set modifier"),s.kind=l?"constructor":a,this.parseClassMethod(s,n,r,h)}else this.parseClassField(s);return s},y.isClassElementNameStart=function(){return this.type===u.name||this.type===u.privateId||this.type===u.num||this.type===u.string||this.type===u.bracketL||this.type.keyword},y.parseClassElementName=function(e){this.type===u.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},y.parseClassMethod=function(e,t,s,i){var n=e.key;"constructor"===e.kind?(t&&this.raise(n.start,"Constructor can't be a generator"),s&&this.raise(n.start,"Constructor can't be an async method")):e.static&&Be(e,"prototype")&&this.raise(n.start,"Classes may not have a static property named prototype");var r=e.value=this.parseMethod(t,s,i);return"get"===e.kind&&0!==r.params.length&&this.raiseRecoverable(r.start,"getter should have no params"),"set"===e.kind&&1!==r.params.length&&this.raiseRecoverable(r.start,"setter should have exactly one param"),"set"===e.kind&&"RestElement"===r.params[0].type&&this.raiseRecoverable(r.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")},y.parseClassField=function(e){return Be(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Be(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(u.eq)?(this.enterScope(Re|qe),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")},y.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(he|qe);this.type!==u.braceR;){var s=this.parseStatement(null);e.body.push(s)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")},y.parseClassId=function(e,t){this.type===u.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,se,!1)):(!0===t&&this.unexpected(),e.id=null)},y.parseClassSuper=function(e){e.superClass=this.eat(u._extends)?this.parseExprSubscripts(null,!1):null},y.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},y.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,s=e.used;if(this.options.checkPrivateFields)for(var i=this.privateNameStack.length,n=0===i?null:this.privateNameStack[i-1],r=0;r<s.length;++r){var a=s[r];be(t,a.name)||(n?n.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}},y.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==u.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")},y.parseExport=function(e,t){if(this.next(),this.eat(u.star))return this.parseExportAllDeclaration(e,t);if(this.eat(u._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==u.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var s=0,i=e.specifiers;s<i.length;s+=1){var n=i[s];this.checkUnreserved(n.local),this.checkLocalExport(n.local),"Literal"===n.local.type&&this.raise(n.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},y.parseExportDeclaration=function(e){return this.parseStatement(null)},y.parseExportDefaultDeclaration=function(){var e;if(this.type===u._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Pe|Ht,!1,e)}if(this.type===u._class){var s=this.startNode();return this.parseClass(s,"nullableID")}var i=this.parseMaybeAssign();return this.semicolon(),i},y.checkExport=function(e,t,s){e&&("string"!=typeof t&&(t="Identifier"===t.type?t.name:t.value),be(e,t)&&this.raiseRecoverable(s,"Duplicate export '"+t+"'"),e[t]=!0)},y.checkPatternExport=function(e,t){var s=t.type;if("Identifier"===s)this.checkExport(e,t,t.start);else if("ObjectPattern"===s)for(var i=0,n=t.properties;i<n.length;i+=1){var r=n[i];this.checkPatternExport(e,r)}else if("ArrayPattern"===s)for(var a=0,o=t.elements;a<o.length;a+=1){var c=o[a];c&&this.checkPatternExport(e,c)}else"Property"===s?this.checkPatternExport(e,t.value):"AssignmentPattern"===s?this.checkPatternExport(e,t.left):"RestElement"===s&&this.checkPatternExport(e,t.argument)},y.checkVariableExport=function(e,t){if(e)for(var s=0,i=t;s<i.length;s+=1){var n=i[s];this.checkPatternExport(e,n.id)}},y.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},y.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")},y.parseExportSpecifiers=function(e){var t=[],s=!0;for(this.expect(u.braceL);!this.eat(u.braceR);){if(s)s=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;t.push(this.parseExportSpecifier(e))}return t},y.parseImport=function(e){return this.next(),this.type===u.string?(e.specifiers=Di,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===u.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},y.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,se),this.finishNode(e,"ImportSpecifier")},y.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,se),this.finishNode(e,"ImportDefaultSpecifier")},y.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,se),this.finishNode(e,"ImportNamespaceSpecifier")},y.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===u.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(u.comma)))return e;if(this.type===u.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(u.braceL);!this.eat(u.braceR);){if(t)t=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;e.push(this.parseImportSpecifier())}return e},y.parseWithClause=function(){var e=[];if(!this.eat(u._with))return e;this.expect(u.braceL);for(var t={},s=!0;!this.eat(u.braceR);){if(s)s=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;var i=this.parseImportAttribute(),n="Identifier"===i.key.type?i.key.name:i.key.value;be(t,n)&&this.raiseRecoverable(i.key.start,"Duplicate attribute key '"+n+"'"),t[n]=!0,e.push(i)}return e},y.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===u.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(u.colon),this.type!==u.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")},y.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===u.string){var e=this.parseLiteral(this.value);return Ni.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)},y.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},y.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var G=L.prototype;G.toAssignable=function(e,t,s){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",s&&this.checkPatternErrors(s,!0);for(var i=0,n=e.properties;i<n.length;i+=1){var r=n[i];this.toAssignable(r,t),"RestElement"===r.type&&("ArrayPattern"===r.argument.type||"ObjectPattern"===r.argument.type)&&this.raise(r.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",s&&this.checkPatternErrors(s,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,s);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else s&&this.checkPatternErrors(s,!0);return e},G.toAssignableList=function(e,t){for(var s=e.length,i=0;i<s;i++){var n=e[i];n&&this.toAssignable(n,t)}if(s){var r=e[s-1];6===this.options.ecmaVersion&&t&&r&&"RestElement"===r.type&&"Identifier"!==r.argument.type&&this.unexpected(r.argument.start)}return e},G.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},G.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==u.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},G.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case u.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(u.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case u.braceL:return this.parseObj(!0)}return this.parseIdent()},G.parseBindingList=function(e,t,s,i){for(var n=[],r=!0;!this.eat(e);)if(r?r=!1:this.expect(u.comma),t&&this.type===u.comma)n.push(null);else{if(s&&this.afterTrailingComma(e))break;if(this.type===u.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),n.push(a),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}n.push(this.parseAssignableListItem(i))}return n},G.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},G.parseBindingListItem=function(e){return e},G.parseMaybeDefault=function(e,t,s){if(s=s||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(u.eq))return s;var i=this.startNodeAt(e,t);return i.left=s,i.right=this.parseMaybeAssign(),this.finishNode(i,"AssignmentPattern")},G.checkLValSimple=function(e,t,s){void 0===t&&(t=De);var i=t!==De;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(i?"Binding ":"Assigning to ")+e.name+" in strict mode"),i&&(t===se&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),s&&(be(s,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),s[e.name]=!0),t!==Ft&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":i&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return i&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,s);default:this.raise(e.start,(i?"Binding":"Assigning to")+" rvalue")}},G.checkLValPattern=function(e,t,s){switch(void 0===t&&(t=De),e.type){case"ObjectPattern":for(var i=0,n=e.properties;i<n.length;i+=1){var r=n[i];this.checkLValInnerPattern(r,t,s)}break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var c=o[a];c&&this.checkLValInnerPattern(c,t,s)}break;default:this.checkLValSimple(e,t,s)}},G.checkLValInnerPattern=function(e,t,s){switch(void 0===t&&(t=De),e.type){case"Property":this.checkLValInnerPattern(e.value,t,s);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,s);break;case"RestElement":this.checkLValPattern(e.argument,t,s);break;default:this.checkLValPattern(e,t,s)}};var X=function(e,t,s,i,n){this.token=e,this.isExpr=!!t,this.preserveSpace=!!s,this.override=i,this.generator=!!n},I={b_stat:new X("{",!1),b_expr:new X("{",!0),b_tmpl:new X("${",!1),p_stat:new X("(",!1),p_expr:new X("(",!0),q_tmpl:new X("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new X("function",!1),f_expr:new X("function",!0),f_expr_gen:new X("function",!0,!1,null,!0),f_gen:new X("function",!1,!1,null,!0)},Ce=L.prototype;Ce.initialContext=function(){return[I.b_stat]},Ce.curContext=function(){return this.context[this.context.length-1]},Ce.braceIsBlock=function(e){var t=this.curContext();return t===I.f_expr||t===I.f_stat||(e!==u.colon||t!==I.b_stat&&t!==I.b_expr?e===u._return||e===u.name&&this.exprAllowed?q.test(this.input.slice(this.lastTokEnd,this.start)):e===u._else||e===u.semi||e===u.eof||e===u.parenR||e===u.arrow||(e===u.braceL?t===I.b_stat:e!==u._var&&e!==u._const&&e!==u.name&&!this.exprAllowed):!t.isExpr)},Ce.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},Ce.updateContext=function(e){var t,s=this.type;s.keyword&&e===u.dot?this.exprAllowed=!1:(t=s.updateContext)?t.call(this,e):this.exprAllowed=s.beforeExpr},Ce.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},u.parenR.updateContext=u.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===I.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},u.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?I.b_stat:I.b_expr),this.exprAllowed=!0},u.dollarBraceL.updateContext=function(){this.context.push(I.b_tmpl),this.exprAllowed=!0},u.parenL.updateContext=function(e){var t=e===u._if||e===u._for||e===u._with||e===u._while;this.context.push(t?I.p_stat:I.p_expr),this.exprAllowed=!0},u.incDec.updateContext=function(){},u._function.updateContext=u._class.updateContext=function(e){!e.beforeExpr||e===u._else||e===u.semi&&this.curContext()!==I.p_stat||e===u._return&&q.test(this.input.slice(this.lastTokEnd,this.start))||(e===u.colon||e===u.braceL)&&this.curContext()===I.b_stat?this.context.push(I.f_stat):this.context.push(I.f_expr),this.exprAllowed=!1},u.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},u.backQuote.updateContext=function(){this.curContext()===I.q_tmpl?this.context.pop():this.context.push(I.q_tmpl),this.exprAllowed=!1},u.star.updateContext=function(e){if(e===u._function){var t=this.context.length-1;this.context[t]===I.f_expr?this.context[t]=I.f_expr_gen:this.context[t]=I.f_gen}this.exprAllowed=!0},u.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==u.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var S=L.prototype;function Ut(e){return"Identifier"===e.type||"ParenthesizedExpression"===e.type&&Ut(e.expression)}function rt(e){return"MemberExpression"===e.type&&"PrivateIdentifier"===e.property.type||"ChainExpression"===e.type&&rt(e.expression)||"ParenthesizedExpression"===e.type&&rt(e.expression)}S.checkPropClash=function(e,t,s){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var i,n=e.key;switch(n.type){case"Identifier":i=n.name;break;case"Literal":i=String(n.value);break;default:return}var r=e.kind;if(this.options.ecmaVersion>=6)return void("__proto__"===i&&"init"===r&&(t.proto&&(s?s.doubleProto<0&&(s.doubleProto=n.start):this.raiseRecoverable(n.start,"Redefinition of __proto__ property")),t.proto=!0));var a=t[i="$"+i];if(a)("init"===r?this.strict&&a.init||a.get||a.set:a.init||a[r])&&this.raiseRecoverable(n.start,"Redefinition of property");else a=t[i]={init:!1,get:!1,set:!1};a[r]=!0}},S.parseExpression=function(e,t){var s=this.start,i=this.startLoc,n=this.parseMaybeAssign(e,t);if(this.type===u.comma){var r=this.startNodeAt(s,i);for(r.expressions=[n];this.eat(u.comma);)r.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(r,"SequenceExpression")}return n},S.parseMaybeAssign=function(e,t,s){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var i=!1,n=-1,r=-1,a=-1;t?(n=t.parenthesizedAssign,r=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new We,i=!0);var o=this.start,c=this.startLoc;(this.type===u.parenL||this.type===u.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===e);var l=this.parseMaybeConditional(e,t);if(s&&(l=s.call(this,l,o,c)),this.type.isAssign){var h=this.startNodeAt(o,c);return h.operator=this.value,this.type===u.eq&&(l=this.toAssignable(l,!1,t)),i||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===u.eq?this.checkLValPattern(l):this.checkLValSimple(l),h.left=l,this.next(),h.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(h,"AssignmentExpression")}return i&&this.checkExpressionErrors(t,!0),n>-1&&(t.parenthesizedAssign=n),r>-1&&(t.trailingComma=r),l},S.parseMaybeConditional=function(e,t){var s=this.start,i=this.startLoc,n=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return n;if(this.eat(u.question)){var r=this.startNodeAt(s,i);return r.test=n,r.consequent=this.parseMaybeAssign(),this.expect(u.colon),r.alternate=this.parseMaybeAssign(e),this.finishNode(r,"ConditionalExpression")}return n},S.parseExprOps=function(e,t){var s=this.start,i=this.startLoc,n=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||n.start===s&&"ArrowFunctionExpression"===n.type?n:this.parseExprOp(n,s,i,-1,e)},S.parseExprOp=function(e,t,s,i,n){var r=this.type.binop;if(null!=r&&(!n||this.type!==u._in)&&r>i){var a=this.type===u.logicalOR||this.type===u.logicalAND,o=this.type===u.coalesce;o&&(r=u.logicalAND.binop);var c=this.value;this.next();var l=this.start,h=this.startLoc,p=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,n),l,h,r,n),d=this.buildBinary(t,s,e,p,c,a||o);return(a&&this.type===u.coalesce||o&&(this.type===u.logicalOR||this.type===u.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(d,t,s,i,n)}return e},S.buildBinary=function(e,t,s,i,n,r){"PrivateIdentifier"===i.type&&this.raise(i.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=s,a.operator=n,a.right=i,this.finishNode(a,r?"LogicalExpression":"BinaryExpression")},S.parseMaybeUnary=function(e,t,s,i){var n,r=this.start,a=this.startLoc;if(this.isContextual("await")&&this.canAwait)n=this.parseAwait(i),t=!0;else if(this.type.prefix){var o=this.startNode(),c=this.type===u.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,c,i),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(o.argument):this.strict&&"delete"===o.operator&&Ut(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):"delete"===o.operator&&rt(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,n=this.finishNode(o,c?"UpdateExpression":"UnaryExpression")}else if(t||this.type!==u.privateId){if(n=this.parseExprSubscripts(e,i),this.checkExpressionErrors(e))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(r,a);l.operator=this.value,l.prefix=!1,l.argument=n,this.checkLValSimple(n),this.next(),n=this.finishNode(l,"UpdateExpression")}}else(i||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),n=this.parsePrivateIdent(),this.type!==u._in&&this.unexpected();return s||!this.eat(u.starstar)?n:t?void this.unexpected(this.lastTokStart):this.buildBinary(r,a,n,this.parseMaybeUnary(null,!1,!1,i),"**",!1)},S.parseExprSubscripts=function(e,t){var s=this.start,i=this.startLoc,n=this.parseExprAtom(e,t);if("ArrowFunctionExpression"===n.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return n;var r=this.parseSubscripts(n,s,i,!1,t);return e&&"MemberExpression"===r.type&&(e.parenthesizedAssign>=r.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=r.start&&(e.parenthesizedBind=-1),e.trailingComma>=r.start&&(e.trailingComma=-1)),r},S.parseSubscripts=function(e,t,s,i,n){for(var r=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,s,i,r,a,n);if(o.optional&&(a=!0),o===e||"ArrowFunctionExpression"===o.type){if(a){var c=this.startNodeAt(t,s);c.expression=o,o=this.finishNode(c,"ChainExpression")}return o}e=o}},S.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(u.arrow)},S.parseSubscriptAsyncArrow=function(e,t,s,i){return this.parseArrowExpression(this.startNodeAt(e,t),s,!0,i)},S.parseSubscript=function(e,t,s,i,n,r,a){var o=this.options.ecmaVersion>=11,c=o&&this.eat(u.questionDot);i&&c&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(u.bracketL);if(l||c&&this.type!==u.parenL&&this.type!==u.backQuote||this.eat(u.dot)){var h=this.startNodeAt(t,s);h.object=e,l?(h.property=this.parseExpression(),this.expect(u.bracketR)):this.type===u.privateId&&"Super"!==e.type?h.property=this.parsePrivateIdent():h.property=this.parseIdent("never"!==this.options.allowReserved),h.computed=!!l,o&&(h.optional=c),e=this.finishNode(h,"MemberExpression")}else if(!i&&this.eat(u.parenL)){var p=new We,d=this.yieldPos,f=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var g=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1,p);if(n&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=d,this.awaitPos=f,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,s,g,a);this.checkExpressionErrors(p,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=f||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var v=this.startNodeAt(t,s);v.callee=e,v.arguments=g,o&&(v.optional=c),e=this.finishNode(v,"CallExpression")}else if(this.type===u.backQuote){(c||r)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var y=this.startNodeAt(t,s);y.tag=e,y.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(y,"TaggedTemplateExpression")}return e},S.parseExprAtom=function(e,t,s){this.type===u.slash&&this.readRegexp();var i,n=this.potentialArrowAt===this.start;switch(this.type){case u._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),i=this.startNode(),this.next(),this.type===u.parenL&&!this.allowDirectSuper&&this.raise(i.start,"super() call outside constructor of a subclass"),this.type!==u.dot&&this.type!==u.bracketL&&this.type!==u.parenL&&this.unexpected(),this.finishNode(i,"Super");case u._this:return i=this.startNode(),this.next(),this.finishNode(i,"ThisExpression");case u.name:var r=this.start,a=this.startLoc,o=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&"async"===c.name&&!this.canInsertSemicolon()&&this.eat(u._function))return this.overrideContext(I.f_expr),this.parseFunction(this.startNodeAt(r,a),0,!1,!0,t);if(n&&!this.canInsertSemicolon()){if(this.eat(u.arrow))return this.parseArrowExpression(this.startNodeAt(r,a),[c],!1,t);if(this.options.ecmaVersion>=8&&"async"===c.name&&this.type===u.name&&!o&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(u.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(r,a),[c],!0,t)}return c;case u.regexp:var l=this.value;return(i=this.parseLiteral(l.value)).regex={pattern:l.pattern,flags:l.flags},i;case u.num:case u.string:return this.parseLiteral(this.value);case u._null:case u._true:case u._false:return(i=this.startNode()).value=this.type===u._null?null:this.type===u._true,i.raw=this.type.keyword,this.next(),this.finishNode(i,"Literal");case u.parenL:var h=this.start,p=this.parseParenAndDistinguishExpression(n,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=h),e.parenthesizedBind<0&&(e.parenthesizedBind=h)),p;case u.bracketL:return i=this.startNode(),this.next(),i.elements=this.parseExprList(u.bracketR,!0,!0,e),this.finishNode(i,"ArrayExpression");case u.braceL:return this.overrideContext(I.b_expr),this.parseObj(!1,e);case u._function:return i=this.startNode(),this.next(),this.parseFunction(i,0);case u._class:return this.parseClass(this.startNode(),!1);case u._new:return this.parseNew();case u.backQuote:return this.parseTemplate();case u._import:return this.options.ecmaVersion>=11?this.parseExprImport(s):this.unexpected();default:return this.parseExprAtomDefault()}},S.parseExprAtomDefault=function(){this.unexpected()},S.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===u.parenL&&!e)return this.parseDynamicImport(t);if(this.type===u.dot){var s=this.startNodeAt(t.start,t.loc&&t.loc.start);return s.name="import",t.meta=this.finishNode(s,"Identifier"),this.parseImportMeta(t)}this.unexpected()},S.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(u.parenR)?e.options=null:(this.expect(u.comma),this.afterTrailingComma(u.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(u.parenR)||(this.expect(u.comma),this.afterTrailingComma(u.parenR)||this.unexpected())));else if(!this.eat(u.parenR)){var t=this.start;this.eat(u.comma)&&this.eat(u.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},S.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},S.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=null!=t.value?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},S.parseParenExpression=function(){this.expect(u.parenL);var e=this.parseExpression();return this.expect(u.parenR),e},S.shouldParseArrow=function(e){return!this.canInsertSemicolon()},S.parseParenAndDistinguishExpression=function(e,t){var s,i=this.start,n=this.startLoc,r=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a,o=this.start,c=this.startLoc,l=[],h=!0,p=!1,d=new We,f=this.yieldPos,m=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==u.parenR;){if(h?h=!1:this.expect(u.comma),r&&this.afterTrailingComma(u.parenR,!0)){p=!0;break}if(this.type===u.ellipsis){a=this.start,l.push(this.parseParenItem(this.parseRestBinding())),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}l.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var g=this.lastTokEnd,v=this.lastTokEndLoc;if(this.expect(u.parenR),e&&this.shouldParseArrow(l)&&this.eat(u.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=m,this.parseParenArrowList(i,n,l,t);(!l.length||p)&&this.unexpected(this.lastTokStart),a&&this.unexpected(a),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=m||this.awaitPos,l.length>1?((s=this.startNodeAt(o,c)).expressions=l,this.finishNodeAt(s,"SequenceExpression",g,v)):s=l[0]}else s=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(i,n);return y.expression=s,this.finishNode(y,"ParenthesizedExpression")}return s},S.parseParenItem=function(e){return e},S.parseParenArrowList=function(e,t,s,i){return this.parseArrowExpression(this.startNodeAt(e,t),s,!1,i)};var Fi=[];S.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===u.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var s=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),s&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var i=this.start,n=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),i,n,!0,!1),this.eat(u.parenL)?e.arguments=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Fi,this.finishNode(e,"NewExpression")},S.parseTemplateElement=function(e){var t=e.isTagged,s=this.startNode();return this.type===u.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),s.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),s.tail=this.type===u.backQuote,this.finishNode(s,"TemplateElement")},S.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var s=this.startNode();this.next(),s.expressions=[];var i=this.parseTemplateElement({isTagged:t});for(s.quasis=[i];!i.tail;)this.type===u.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(u.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(u.braceR),s.quasis.push(i=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(s,"TemplateLiteral")},S.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===u.name||this.type===u.num||this.type===u.string||this.type===u.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===u.star)&&!q.test(this.input.slice(this.lastTokEnd,this.start))},S.parseObj=function(e,t){var s=this.startNode(),i=!0,n={};for(s.properties=[],this.next();!this.eat(u.braceR);){if(i)i=!1;else if(this.expect(u.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(u.braceR))break;var r=this.parseProperty(e,t);e||this.checkPropClash(r,n,t),s.properties.push(r)}return this.finishNode(s,e?"ObjectPattern":"ObjectExpression")},S.parseProperty=function(e,t){var s,i,n,r,a=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(u.ellipsis))return e?(a.argument=this.parseIdent(!1),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(a,"RestElement")):(a.argument=this.parseMaybeAssign(!1,t),this.type===u.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(a,"SpreadElement"));this.options.ecmaVersion>=6&&(a.method=!1,a.shorthand=!1,(e||t)&&(n=this.start,r=this.startLoc),e||(s=this.eat(u.star)));var o=this.containsEsc;return this.parsePropertyName(a),!e&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(a)?(i=!0,s=this.options.ecmaVersion>=9&&this.eat(u.star),this.parsePropertyName(a)):i=!1,this.parsePropertyValue(a,e,s,i,n,r,t,o),this.finishNode(a,"Property")},S.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var s="get"===e.kind?0:1;if(e.value.params.length!==s){var i=e.value.start;"get"===e.kind?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")},S.parsePropertyValue=function(e,t,s,i,n,r,a,o){(s||i)&&this.type===u.colon&&this.unexpected(),this.eat(u.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init"):this.options.ecmaVersion>=6&&this.type===u.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(s,i),e.kind="init"):t||o||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===u.comma||this.type===u.braceR||this.type===u.eq?this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((s||i)&&this.unexpected(),this.checkUnreserved(e.key),"await"===e.key.name&&!this.awaitIdentPos&&(this.awaitIdentPos=n),t?e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key)):this.type===u.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(n,r,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected():((s||i)&&this.unexpected(),this.parseGetterSetter(e))},S.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(u.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(u.bracketR),e.key;e.computed=!1}return e.key=this.type===u.num||this.type===u.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},S.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},S.parseMethod=function(e,t,s){var i=this.startNode(),n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(i),this.options.ecmaVersion>=6&&(i.generator=e),this.options.ecmaVersion>=8&&(i.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(ct(t,i.generator)|qe|(s?Ot:0)),this.expect(u.parenL),i.params=this.parseBindingList(u.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(i,!1,!0,!1),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(i,"FunctionExpression")},S.parseArrowExpression=function(e,t,s,i){var n=this.yieldPos,r=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(ct(s,!1)|ut),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!s),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,i),this.yieldPos=n,this.awaitPos=r,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")},S.parseFunctionBody=function(e,t,s,i){var n=t&&this.type!==u.braceL,r=this.strict,a=!1;if(n)e.body=this.parseMaybeAssign(i),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!r||o)&&((a=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var c=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!r&&!a&&!t&&!s&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Ft),e.body=this.parseBlock(!1,void 0,a&&!r),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},S.isSimpleParamList=function(e){for(var t=0,s=e;t<s.length;t+=1){if("Identifier"!==s[t].type)return!1}return!0},S.checkParams=function(e,t){for(var s=Object.create(null),i=0,n=e.params;i<n.length;i+=1){var r=n[i];this.checkLValInnerPattern(r,lt,t?null:s)}},S.parseExprList=function(e,t,s,i){for(var n=[],r=!0;!this.eat(e);){if(r)r=!1;else if(this.expect(u.comma),t&&this.afterTrailingComma(e))break;var a=void 0;s&&this.type===u.comma?a=null:this.type===u.ellipsis?(a=this.parseSpread(i),i&&this.type===u.comma&&i.trailingComma<0&&(i.trailingComma=this.start)):a=this.parseMaybeAssign(!1,i),n.push(a)}return n},S.checkUnreserved=function(e){var t=e.start,s=e.end,i=e.name;(this.inGenerator&&"yield"===i&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===i&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&$e)&&"arguments"===i&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&("arguments"===i||"await"===i)&&this.raise(t,"Cannot use "+i+" in class static initialization block"),this.keywords.test(i)&&this.raise(t,"Unexpected keyword '"+i+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,s).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(i)&&(!this.inAsync&&"await"===i&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+i+"' is reserved"))},S.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),"await"===t.name&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},S.parseIdentNode=function(){var e=this.startNode();return this.type===u.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,("class"===e.name||"function"===e.name)&&(this.lastTokEnd!==this.lastTokStart+1||46!==this.input.charCodeAt(this.lastTokStart))&&this.context.pop(),this.type=u.name):this.unexpected(),e},S.parsePrivateIdent=function(){var e=this.startNode();return this.type===u.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},S.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===u.semi||this.canInsertSemicolon()||this.type!==u.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(u.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},S.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var Fe=L.prototype;Fe.raise=function(e,t){var s=Lt(this.input,e);t+=" ("+s.line+":"+s.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var i=new SyntaxError(t);throw i.pos=e,i.loc=s,i.raisedAt=this.pos,i},Fe.raiseRecoverable=Fe.raise,Fe.curPosition=function(){if(this.options.locations)return new Te(this.curLine,this.pos-this.lineStart)};var oe=L.prototype,Hi=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};oe.enterScope=function(e){this.scopeStack.push(new Hi(e))},oe.exitScope=function(){this.scopeStack.pop()},oe.treatFunctionsAsVarInScope=function(e){return e.flags&_e||!this.inModule&&e.flags&Ie},oe.declareName=function(e,t,s){var i=!1;if(t===se){var n=this.currentScope();i=n.lexical.indexOf(e)>-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&n.flags&Ie&&delete this.undefinedExports[e]}else if(t===Bt){this.currentScope().lexical.push(e)}else if(t===Dt){var r=this.currentScope();i=this.treatFunctionsAsVar?r.lexical.indexOf(e)>-1:r.lexical.indexOf(e)>-1||r.var.indexOf(e)>-1,r.functions.push(e)}else for(var a=this.scopeStack.length-1;a>=0;--a){var o=this.scopeStack[a];if(o.lexical.indexOf(e)>-1&&!(o.flags&Mt&&o.lexical[0]===e)||!this.treatFunctionsAsVarInScope(o)&&o.functions.indexOf(e)>-1){i=!0;break}if(o.var.push(e),this.inModule&&o.flags&Ie&&delete this.undefinedExports[e],o.flags&$e)break}i&&this.raiseRecoverable(s,"Identifier '"+e+"' has already been declared")},oe.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},oe.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},oe.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&($e|Re|he))return t}},oe.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&($e|Re|he)&&!(t.flags&ut))return t}};var je=function(e,t,s){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new Ue(e,s)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Ne=L.prototype;function qt(e,t,s,i){return e.type=t,e.end=s,this.options.locations&&(e.loc.end=i),this.options.ranges&&(e.range[1]=s),e}Ne.startNode=function(){return new je(this,this.start,this.startLoc)},Ne.startNodeAt=function(e,t){return new je(this,e,t)},Ne.finishNode=function(e,t){return qt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Ne.finishNodeAt=function(e,t,s,i){return qt.call(this,e,t,s,i)},Ne.copyNode=function(e){var t=new je(this,e.start,this.startLoc);for(var s in e)t[s]=e[s];return t};var Ui="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",$t="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Wt=$t+" Extended_Pictographic",jt=Wt,Kt=Wt+" EBase EComp EMod EPres ExtPict",zt=Kt,qi=Kt,$i={9:$t,10:Wt,11:Wt,12:Kt,13:Kt,14:qi},Wi="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",ji={9:"",10:"",11:"",12:"",13:"",14:Wi},yt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Gt="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Xt=Gt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Qt=Xt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Zt=Qt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Yt=Zt+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Ki=Yt+" "+Ui,zi={9:Gt,10:Xt,11:Qt,12:Zt,13:Yt,14:Ki},Jt={};function Gi(e){var t=Jt[e]={binary:ne($i[e]+" "+yt),binaryOfStrings:ne(ji[e]),nonBinary:{General_Category:ne(yt),Script:ne(zi[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var Ze=0,bt=[9,10,11,12,13,14];Ze<bt.length;Ze+=1){var Xi=bt[Ze];Gi(Xi)}var v=L.prototype,He=function(e,t){this.parent=e,this.base=t||this};He.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var s=e;s;s=s.parent)if(t.base===s.base&&t!==s)return!0;return!1},He.prototype.sibling=function(){return new He(this.parent,this.base)};var J=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":"")+(e.options.ecmaVersion>=13?"d":"")+(e.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Jt[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function Qi(e){for(var t in e)return!0;return!1}function Zi(e){return 105===e||109===e||115===e}function ei(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Yi(e){return Z(e,!0)||36===e||95===e}function Ji(e){return ae(e,!0)||36===e||95===e||8204===e||8205===e}function ti(e){return e>=65&&e<=90||e>=97&&e<=122}function es(e){return e>=0&&e<=1114111}J.prototype.reset=function(e,t,s){var i=-1!==s.indexOf("v"),n=-1!==s.indexOf("u");this.start=0|e,this.source=t+"",this.flags=s,i&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=n&&this.parser.options.ecmaVersion>=9)},J.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},J.prototype.at=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return-1;var n=s.charCodeAt(e);if(!t&&!this.switchU||n<=55295||n>=57344||e+1>=i)return n;var r=s.charCodeAt(e+1);return r>=56320&&r<=57343?(n<<10)+r-56613888:n},J.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var s=this.source,i=s.length;if(e>=i)return i;var n,r=s.charCodeAt(e);return!t&&!this.switchU||r<=55295||r>=57344||e+1>=i||(n=s.charCodeAt(e+1))<56320||n>57343?e+1:e+2},J.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},J.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},J.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},J.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},J.prototype.eatChars=function(e,t){void 0===t&&(t=!1);for(var s=this.pos,i=0,n=e;i<n.length;i+=1){var r=n[i],a=this.at(s,t);if(-1===a||a!==r)return!1;s=this.nextIndex(s,t)}return this.pos=s,!0},v.validateRegExpFlags=function(e){for(var t=e.validFlags,s=e.flags,i=!1,n=!1,r=0;r<s.length;r++){var a=s.charAt(r);-1===t.indexOf(a)&&this.raise(e.start,"Invalid regular expression flag"),s.indexOf(a,r+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),"u"===a&&(i=!0),"v"===a&&(n=!0)}this.options.ecmaVersion>=15&&i&&n&&this.raise(e.start,"Invalid regular expression flag")},v.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Qi(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},v.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,s=e.backReferenceNames;t<s.length;t+=1){var i=s[t];e.groupNames[i]||e.raise("Invalid named capture referenced")}},v.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new He(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},v.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},v.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!!(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},v.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var s=!1;if(this.options.ecmaVersion>=9&&(s=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!s,!0}return e.pos=t,!1},v.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},v.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},v.regexp_eatBracedQuantifier=function(e,t){var s=e.pos;if(e.eat(123)){var i=0,n=-1;if(this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue),e.eat(125)))return-1!==n&&n<i&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=s}return!1},v.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},v.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},v.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var s=this.regexp_eatModifiers(e),i=e.eat(45);if(s||i){for(var n=0;n<s.length;n++){var r=s.charAt(n);s.indexOf(r,n+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(i){var a=this.regexp_eatModifiers(e);!s&&!a&&58===e.current()&&e.raise("Invalid regular expression modifiers");for(var o=0;o<a.length;o++){var c=a.charAt(o);(a.indexOf(c,o+1)>-1||s.indexOf(c)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1},v.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},v.regexp_eatModifiers=function(e){for(var t="",s=0;-1!==(s=e.current())&&Zi(s);)t+=te(s),e.advance();return t},v.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},v.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},v.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!ei(t)&&(e.lastIntValue=t,e.advance(),!0)},v.regexp_eatPatternCharacters=function(e){for(var t=e.pos,s=0;-1!==(s=e.current())&&!ei(s);)e.advance();return e.pos!==t},v.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},v.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,s=e.groupNames[e.lastStringValue];if(s)if(t)for(var i=0,n=s;i<n.length;i+=1){n[i].separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(s||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},v.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},v.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=te(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=te(e.lastIntValue);return!0}return!1},v.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),Yi(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},v.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,s=this.options.ecmaVersion>=11,i=e.current(s);return e.advance(s),92===i&&this.regexp_eatRegExpUnicodeEscapeSequence(e,s)&&(i=e.lastIntValue),Ji(i)?(e.lastIntValue=i,!0):(e.pos=t,!1)},v.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},v.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var s=e.lastIntValue;if(e.switchU)return s>e.maxBackReference&&(e.maxBackReference=s),!0;if(s<=e.numCapturingParens)return!0;e.pos=t}return!1},v.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},v.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},v.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},v.regexp_eatZero=function(e){return 48===e.current()&&!Ke(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},v.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},v.regexp_eatControlLetter=function(e){var t=e.current();return!!ti(t)&&(e.lastIntValue=t%32,e.advance(),!0)},v.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var s=e.pos,i=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var n=e.lastIntValue;if(i&&n>=55296&&n<=56319){var r=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=1024*(n-55296)+(a-56320)+65536,!0}e.pos=r,e.lastIntValue=n}return!0}if(i&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&es(e.lastIntValue))return!0;i&&e.raise("Invalid unicode escape"),e.pos=s}return!1},v.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},v.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1};var ii=0,ie=1,z=2;function ts(e){return 100===e||68===e||115===e||83===e||119===e||87===e}function si(e){return ti(e)||95===e}function is(e){return si(e)||Ke(e)}function ss(e){return 33===e||e>=35&&e<=38||e>=42&&e<=44||46===e||e>=58&&e<=64||94===e||96===e||126===e}function rs(e){return 40===e||41===e||45===e||47===e||e>=91&&e<=93||e>=123&&e<=125}function ns(e){return 33===e||35===e||37===e||38===e||44===e||45===e||e>=58&&e<=62||64===e||96===e||126===e}function Ke(e){return e>=48&&e<=57}function ri(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function ni(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function ai(e){return e>=48&&e<=55}v.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(ts(t))return e.lastIntValue=-1,e.advance(),ie;var s=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((s=80===t)||112===t)){var i;if(e.lastIntValue=-1,e.advance(),e.eat(123)&&(i=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return s&&i===z&&e.raise("Invalid property name"),i;e.raise("Invalid property name")}return ii},v.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var s=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,s,i),ie}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,n)}return ii},v.regexp_validateUnicodePropertyNameAndValue=function(e,t,s){be(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(s)||e.raise("Invalid property value")},v.regexp_validateUnicodePropertyNameOrValue=function(e,t){return e.unicodeProperties.binary.test(t)?ie:e.switchV&&e.unicodeProperties.binaryOfStrings.test(t)?z:void e.raise("Invalid property name")},v.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";si(t=e.current());)e.lastStringValue+=te(t),e.advance();return""!==e.lastStringValue},v.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";is(t=e.current());)e.lastStringValue+=te(t),e.advance();return""!==e.lastStringValue},v.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},v.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),s=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&s===z&&e.raise("Negated character class may contain strings"),!0}return!1},v.regexp_classContents=function(e){return 93===e.current()?ie:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),ie)},v.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var s=e.lastIntValue;e.switchU&&(-1===t||-1===s)&&e.raise("Invalid character class"),-1!==t&&-1!==s&&t>s&&e.raise("Range out of order in character class")}}},v.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var s=e.current();(99===s||ai(s))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var i=e.current();return 93!==i&&(e.lastIntValue=i,e.advance(),!0)},v.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},v.regexp_classSetExpression=function(e){var t,s=ie;if(!this.regexp_eatClassSetRange(e))if(t=this.regexp_eatClassSetOperand(e)){t===z&&(s=z);for(var i=e.pos;e.eatChars([38,38]);)38!==e.current()&&(t=this.regexp_eatClassSetOperand(e))?t!==z&&(s=ie):e.raise("Invalid character in character class");if(i!==e.pos)return s;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(i!==e.pos)return s}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(!(t=this.regexp_eatClassSetOperand(e)))return s;t===z&&(s=z)}},v.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var s=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;return-1!==s&&-1!==i&&s>i&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1},v.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?ie:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},v.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var s=e.eat(94),i=this.regexp_classContents(e);if(e.eat(93))return s&&i===z&&e.raise("Negated character class may contain strings"),i;e.pos=t}if(e.eat(92)){var n=this.regexp_eatCharacterClassEscape(e);if(n)return n;e.pos=t}return null},v.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var s=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return s}else e.raise("Invalid escape");e.pos=t}return null},v.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===z&&(t=z);return t},v.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return 1===t?ie:z},v.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return!(!this.regexp_eatCharacterEscape(e)&&!this.regexp_eatClassSetReservedPunctuator(e))||(e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1));var s=e.current();return!(s<0||s===e.lookahead()&&ss(s)||rs(s))&&(e.advance(),e.lastIntValue=s,!0)},v.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return!!ns(t)&&(e.lastIntValue=t,e.advance(),!0)},v.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Ke(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},v.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},v.regexp_eatDecimalDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;Ke(s=e.current());)e.lastIntValue=10*e.lastIntValue+(s-48),e.advance();return e.pos!==t},v.regexp_eatHexDigits=function(e){var t=e.pos,s=0;for(e.lastIntValue=0;ri(s=e.current());)e.lastIntValue=16*e.lastIntValue+ni(s),e.advance();return e.pos!==t},v.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var s=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*s+e.lastIntValue:e.lastIntValue=8*t+s}else e.lastIntValue=t;return!0}return!1},v.regexp_eatOctalDigit=function(e){var t=e.current();return ai(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},v.regexp_eatFixedHexDigits=function(e,t){var s=e.pos;e.lastIntValue=0;for(var i=0;i<t;++i){var n=e.current();if(!ri(n))return e.pos=s,!1;e.lastIntValue=16*e.lastIntValue+ni(n),e.advance()}return!0};var pt=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new Ue(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},E=L.prototype;function as(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function oi(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}E.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new pt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},E.getToken=function(){return this.next(),new pt(this)},typeof Symbol<"u"&&(E[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===u.eof,value:t}}}}),E.nextToken=function(){var e=this.curContext();return(!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(u.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},E.readToken=function(e){return Z(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},E.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888},E.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(-1===s&&this.raise(this.pos-2,"Unterminated comment"),this.pos=s+2,this.options.locations)for(var i=void 0,n=t;(i=It(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=i;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,s),t,this.pos,e,this.curPosition())},E.skipLineComment=function(e){for(var t=this.pos,s=this.options.onComment&&this.curPosition(),i=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!ye(i);)i=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,s,this.curPosition())},E.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&Rt.test(String.fromCharCode(e))))break e;++this.pos}}},E.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var s=this.type;this.type=e,this.value=t,this.updateContext(s)},E.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(u.ellipsis)):(++this.pos,this.finishToken(u.dot))},E.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(u.assign,2):this.finishOp(u.slash,1)},E.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),s=1,i=42===e?u.star:u.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++s,i=u.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(u.assign,s+1):this.finishOp(i,s)},E.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(u.assign,3);return this.finishOp(124===e?u.logicalOR:u.logicalAND,2)}return 61===t?this.finishOp(u.assign,2):this.finishOp(124===e?u.bitwiseOR:u.bitwiseAND,1)},E.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(u.assign,2):this.finishOp(u.bitwiseXOR,1)},E.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!q.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(u.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(u.assign,2):this.finishOp(u.plusMin,1)},E.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),s=1;return t===e?(s=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+s)?this.finishOp(u.assign,s+1):this.finishOp(u.bitShift,s)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(s=2),this.finishOp(u.relational,s)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},E.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(u.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(u.arrow)):this.finishOp(61===e?u.eq:u.prefix,1)},E.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var s=this.input.charCodeAt(this.pos+2);if(s<48||s>57)return this.finishOp(u.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(u.assign,3);return this.finishOp(u.coalesce,2)}}return this.finishOp(u.question,1)},E.readToken_numberSign=function(){var e=35;if(this.options.ecmaVersion>=13&&(++this.pos,Z(e=this.fullCharCodeAtPos(),!0)||92===e))return this.finishToken(u.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+te(e)+"'")},E.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(u.parenL);case 41:return++this.pos,this.finishToken(u.parenR);case 59:return++this.pos,this.finishToken(u.semi);case 44:return++this.pos,this.finishToken(u.comma);case 91:return++this.pos,this.finishToken(u.bracketL);case 93:return++this.pos,this.finishToken(u.bracketR);case 123:return++this.pos,this.finishToken(u.braceL);case 125:return++this.pos,this.finishToken(u.braceR);case 58:return++this.pos,this.finishToken(u.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(u.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(u.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+te(e)+"'")},E.finishOp=function(e,t){var s=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,s)},E.readRegexp=function(){for(var e,t,s=this.pos;;){this.pos>=this.input.length&&this.raise(s,"Unterminated regular expression");var i=this.input.charAt(this.pos);if(q.test(i)&&this.raise(s,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++this.pos}var n=this.input.slice(s,this.pos);++this.pos;var r=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(r);var o=this.regexpState||(this.regexpState=new J(this));o.reset(s,n,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var c=null;try{c=new RegExp(n,a)}catch{}return this.finishToken(u.regexp,{pattern:n,flags:a,value:c})},E.readInt=function(e,t,s){for(var i=this.options.ecmaVersion>=12&&void 0===t,n=s&&48===this.input.charCodeAt(this.pos),r=this.pos,a=0,o=0,c=0,l=t??1/0;c<l;++c,++this.pos){var h=this.input.charCodeAt(this.pos),p=void 0;if(i&&95===h)n&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===o&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===c&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=h;else{if((p=h>=97?h-97+10:h>=65?h-65+10:h>=48&&h<=57?h-48:1/0)>=e)break;o=h,a=a*e+p}}return i&&95===o&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===r||null!=t&&this.pos-r!==t?null:a},E.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var s=this.readInt(e);return null==s&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(s=oi(this.input.slice(t,this.pos)),++this.pos):Z(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(u.num,s)},E.readNumber=function(e){var t=this.pos;!e&&null===this.readInt(10,void 0,!0)&&this.raise(t,"Invalid number");var s=this.pos-t>=2&&48===this.input.charCodeAt(t);s&&this.strict&&this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.pos);if(!s&&!e&&this.options.ecmaVersion>=11&&110===i){var n=oi(this.input.slice(t,this.pos));return++this.pos,Z(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(u.num,n)}s&&/[89]/.test(this.input.slice(t,this.pos))&&(s=!1),46===i&&!s&&(++this.pos,this.readInt(10),i=this.input.charCodeAt(this.pos)),(69===i||101===i)&&!s&&((43===(i=this.input.charCodeAt(++this.pos))||45===i)&&++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),Z(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var r=as(this.input.slice(t,this.pos),s);return this.finishToken(u.num,r)},E.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},E.readString=function(e){for(var t="",s=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var i=this.input.charCodeAt(this.pos);if(i===e)break;92===i?(t+=this.input.slice(s,this.pos),t+=this.readEscapedChar(!1),s=this.pos):8232===i||8233===i?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(ye(i)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(s,this.pos++),this.finishToken(u.string,t)};var ui={};E.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==ui)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},E.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ui;this.raise(e,t)},E.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var s=this.input.charCodeAt(this.pos);if(96===s||36===s&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==u.template&&this.type!==u.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(u.template,e)):36===s?(this.pos+=2,this.finishToken(u.dollarBraceL)):(++this.pos,this.finishToken(u.backQuote));if(92===s)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(ye(s)){switch(e+=this.input.slice(t,this.pos),++this.pos,s){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(s)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},E.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(u.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},E.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return te(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var s=this.pos-1;this.invalidStringToken(s,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(i,8);return n>255&&(i=i.slice(0,-1),n=parseInt(i,8)),this.pos+=i.length-1,t=this.input.charCodeAt(this.pos),("0"!==i||56===t||57===t)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-i.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(n)}return ye(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},E.readHexChar=function(e){var t=this.pos,s=this.readInt(16,e);return null===s&&this.invalidStringToken(t,"Bad character escape sequence"),s},E.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,s=this.pos,i=this.options.ecmaVersion>=6;this.pos<this.input.length;){var n=this.fullCharCodeAtPos();if(ae(n,i))this.pos+=n<=65535?1:2;else{if(92!==n)break;this.containsEsc=!0,e+=this.input.slice(s,this.pos);var r=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?Z:ae)(a,i)||this.invalidStringToken(r,"Invalid Unicode escape"),e+=te(a),s=this.pos}t=!1}return e+this.input.slice(s,this.pos)},E.readWord=function(){var e=this.readWord1(),t=u.name;return this.keywords.test(e)&&(t=at[e]),this.finishToken(t,e)};var os="8.15.0";function Ye(e,t){return L.parse(e,t)}function us(e,t,s){return L.parseExpressionAt(e,t,s)}function Je(e,t,s,i,n){var r=[];s||(s=g),function e(i,n,a){var o=a||i.type,c=i!==r[r.length-1];c&&r.push(i),s[o](i,n,e),t[o]&&t[o](i,n||r,r),c&&r.pop()}(e,i,n)}function ft(e,t,s){s(e,t)}function pe(e,t,s){}L.acorn={Parser:L,version:os,defaultOptions:it,Position:Te,SourceLocation:Ue,getLineInfo:Lt,Node:je,TokenType:P,tokTypes:u,keywordTypes:at,TokContext:X,tokContexts:I,isIdentifierChar:ae,isIdentifierStart:Z,Token:pt,isNewLine:ye,lineBreak:q,lineBreakG:Ti,nonASCIIwhitespace:Rt};var g={};g.Program=g.BlockStatement=g.StaticBlock=function(e,t,s){for(var i=0,n=e.body;i<n.length;i+=1){s(n[i],t,"Statement")}},g.Statement=ft,g.EmptyStatement=pe,g.ExpressionStatement=g.ParenthesizedExpression=g.ChainExpression=function(e,t,s){return s(e.expression,t,"Expression")},g.IfStatement=function(e,t,s){s(e.test,t,"Expression"),s(e.consequent,t,"Statement"),e.alternate&&s(e.alternate,t,"Statement")},g.LabeledStatement=function(e,t,s){return s(e.body,t,"Statement")},g.BreakStatement=g.ContinueStatement=pe,g.WithStatement=function(e,t,s){s(e.object,t,"Expression"),s(e.body,t,"Statement")},g.SwitchStatement=function(e,t,s){s(e.discriminant,t,"Expression");for(var i=0,n=e.cases;i<n.length;i+=1){s(n[i],t)}},g.SwitchCase=function(e,t,s){e.test&&s(e.test,t,"Expression");for(var i=0,n=e.consequent;i<n.length;i+=1){s(n[i],t,"Statement")}},g.ReturnStatement=g.YieldExpression=g.AwaitExpression=function(e,t,s){e.argument&&s(e.argument,t,"Expression")},g.ThrowStatement=g.SpreadElement=function(e,t,s){return s(e.argument,t,"Expression")},g.TryStatement=function(e,t,s){s(e.block,t,"Statement"),e.handler&&s(e.handler,t),e.finalizer&&s(e.finalizer,t,"Statement")},g.CatchClause=function(e,t,s){e.param&&s(e.param,t,"Pattern"),s(e.body,t,"Statement")},g.WhileStatement=g.DoWhileStatement=function(e,t,s){s(e.test,t,"Expression"),s(e.body,t,"Statement")},g.ForStatement=function(e,t,s){e.init&&s(e.init,t,"ForInit"),e.test&&s(e.test,t,"Expression"),e.update&&s(e.update,t,"Expression"),s(e.body,t,"Statement")},g.ForInStatement=g.ForOfStatement=function(e,t,s){s(e.left,t,"ForInit"),s(e.right,t,"Expression"),s(e.body,t,"Statement")},g.ForInit=function(e,t,s){"VariableDeclaration"===e.type?s(e,t):s(e,t,"Expression")},g.DebuggerStatement=pe,g.FunctionDeclaration=function(e,t,s){return s(e,t,"Function")},g.VariableDeclaration=function(e,t,s){for(var i=0,n=e.declarations;i<n.length;i+=1){s(n[i],t)}},g.VariableDeclarator=function(e,t,s){s(e.id,t,"Pattern"),e.init&&s(e.init,t,"Expression")},g.Function=function(e,t,s){e.id&&s(e.id,t,"Pattern");for(var i=0,n=e.params;i<n.length;i+=1){s(n[i],t,"Pattern")}s(e.body,t,e.expression?"Expression":"Statement")},g.Pattern=function(e,t,s){"Identifier"===e.type?s(e,t,"VariablePattern"):"MemberExpression"===e.type?s(e,t,"MemberPattern"):s(e,t)},g.VariablePattern=pe,g.MemberPattern=ft,g.RestElement=function(e,t,s){return s(e.argument,t,"Pattern")},g.ArrayPattern=function(e,t,s){for(var i=0,n=e.elements;i<n.length;i+=1){var r=n[i];r&&s(r,t,"Pattern")}},g.ObjectPattern=function(e,t,s){for(var i=0,n=e.properties;i<n.length;i+=1){var r=n[i];"Property"===r.type?(r.computed&&s(r.key,t,"Expression"),s(r.value,t,"Pattern")):"RestElement"===r.type&&s(r.argument,t,"Pattern")}},g.Expression=ft,g.ThisExpression=g.Super=g.MetaProperty=pe,g.ArrayExpression=function(e,t,s){for(var i=0,n=e.elements;i<n.length;i+=1){var r=n[i];r&&s(r,t,"Expression")}},g.ObjectExpression=function(e,t,s){for(var i=0,n=e.properties;i<n.length;i+=1){s(n[i],t)}},g.FunctionExpression=g.ArrowFunctionExpression=g.FunctionDeclaration,g.SequenceExpression=function(e,t,s){for(var i=0,n=e.expressions;i<n.length;i+=1){s(n[i],t,"Expression")}},g.TemplateLiteral=function(e,t,s){for(var i=0,n=e.quasis;i<n.length;i+=1){s(n[i],t)}for(var r=0,a=e.expressions;r<a.length;r+=1){s(a[r],t,"Expression")}},g.TemplateElement=pe,g.UnaryExpression=g.UpdateExpression=function(e,t,s){s(e.argument,t,"Expression")},g.BinaryExpression=g.LogicalExpression=function(e,t,s){s(e.left,t,"Expression"),s(e.right,t,"Expression")},g.AssignmentExpression=g.AssignmentPattern=function(e,t,s){s(e.left,t,"Pattern"),s(e.right,t,"Expression")},g.ConditionalExpression=function(e,t,s){s(e.test,t,"Expression"),s(e.consequent,t,"Expression"),s(e.alternate,t,"Expression")},g.NewExpression=g.CallExpression=function(e,t,s){if(s(e.callee,t,"Expression"),e.arguments)for(var i=0,n=e.arguments;i<n.length;i+=1){s(n[i],t,"Expression")}},g.MemberExpression=function(e,t,s){s(e.object,t,"Expression"),e.computed&&s(e.property,t,"Expression")},g.ExportNamedDeclaration=g.ExportDefaultDeclaration=function(e,t,s){e.declaration&&s(e.declaration,t,"ExportNamedDeclaration"===e.type||e.declaration.id?"Statement":"Expression"),e.source&&s(e.source,t,"Expression")},g.ExportAllDeclaration=function(e,t,s){e.exported&&s(e.exported,t),s(e.source,t,"Expression")},g.ImportDeclaration=function(e,t,s){for(var i=0,n=e.specifiers;i<n.length;i+=1){s(n[i],t)}s(e.source,t,"Expression")},g.ImportExpression=function(e,t,s){s(e.source,t,"Expression")},g.ImportSpecifier=g.ImportDefaultSpecifier=g.ImportNamespaceSpecifier=g.Identifier=g.PrivateIdentifier=g.Literal=pe,g.TaggedTemplateExpression=function(e,t,s){s(e.tag,t,"Expression"),s(e.quasi,t,"Expression")},g.ClassDeclaration=g.ClassExpression=function(e,t,s){return s(e,t,"Class")},g.Class=function(e,t,s){e.id&&s(e.id,t,"Pattern"),e.superClass&&s(e.superClass,t,"Expression"),s(e.body,t)},g.ClassBody=function(e,t,s){for(var i=0,n=e.body;i<n.length;i+=1){s(n[i],t)}},g.MethodDefinition=g.PropertyDefinition=g.Property=function(e,t,s){e.computed&&s(e.key,t,"Expression"),e.value&&s(e.value,t,"Expression")};class W{static pruneCache(e){e.size>this.MAX_CACHE_SIZE&&Array.from(e.keys()).slice(0,e.size-this.MAX_CACHE_SIZE/2).forEach(t=>e.delete(t))}static clearCaches(){this.expressionCache.clear(),this.variableCache.clear(),this.bindingsCache.clear(),this.loopVariableCache.clear()}static extractStateBindings(e){if(this.bindingsCache.has(e))return[...this.bindingsCache.get(e)];const t=new Set;try{Je(Ye(e,{ecmaVersion:2020}),{FunctionDeclaration(e,s){s.length<=2&&e.id&&e.id.name&&t.add(e.id.name)},VariableDeclaration(e,s){s.length>2||e.declarations.forEach(e=>{var s,i,n,r,a;"CallExpression"!==(null==(s=e.init)?void 0:s.type)||"pp"!==(null==(n=null==(i=e.init.callee)?void 0:i.object)?void 0:n.name)||"state"!==(null==(a=null==(r=e.init.callee)?void 0:r.property)?void 0:a.name)?("Identifier"===e.id.type&&t.add(e.id.name),"ObjectPattern"===e.id.type&&e.id.properties.forEach(e=>{var s,i;"Property"===e.type&&"Identifier"===(null==(s=e.value)?void 0:s.type)&&t.add(e.value.name),"RestElement"===e.type&&"Identifier"===(null==(i=e.argument)?void 0:i.type)&&t.add(e.argument.name)})):"ArrayPattern"===e.id.type&&e.id.elements.forEach(e=>{"Identifier"===(null==e?void 0:e.type)&&t.add(e.name)})})}})}catch(e){console.error("[PP-ERROR] AstParser Failed",e)}const s=Array.from(t);return this.pruneCache(this.bindingsCache),this.bindingsCache.set(e,s),s}static extractUsedVariables(e,t){const s=e+"|"+Array.from(t).sort().join(",");if(this.variableCache.has(s))return new Set(this.variableCache.get(s));const i=new Set;try{Je(Ye(`(${e})`,{ecmaVersion:2020}),{Identifier(e,s){if(!t.has(e.name)){if(s.length>1){const t=s[s.length-2];if("MemberExpression"===t.type&&t.property===e&&!t.computed||"Property"===t.type&&t.key===e&&!t.computed&&!t.shorthand)return}i.add(e.name)}}})}catch{}return this.pruneCache(this.variableCache),this.variableCache.set(s,i),new Set(i)}static isValidExpression(e){if(!e.trim())return!1;if(this.expressionCache.has(e))return this.expressionCache.get(e);let t=!1;try{us(`(${e})`,0,{ecmaVersion:2020}),t=!0}catch{t=!1}return this.pruneCache(this.expressionCache),this.expressionCache.set(e,t),t}static analyzeLoopVariableUsage(e,t){const s=e+"|"+t;if(this.loopVariableCache.has(s))return[...this.loopVariableCache.get(s)];const i=[];try{Je(Ye(e,{ecmaVersion:2020}),{Identifier(e,s){if(e.name!==t)return;let n=!1,r=!1,a=e.start,o=e.end;if(s.length>=2){const t=s[s.length-2];if("MemberExpression"===t.type&&t.property===e&&!t.computed||"Property"===t.type&&t.key===e&&!t.computed&&!t.shorthand)return;if("Property"===t.type&&t.shorthand&&(n=!0,s.length>=3)){const e=s[s.length-3];"ObjectExpression"===e.type&&1===e.properties.length&&(r=!0,a=e.start,o=e.end)}}i.push({start:a,end:o,isShorthand:n,isUnwrap:r})}})}catch{}return this.pruneCache(this.loopVariableCache),this.loopVariableCache.set(s,i),[...i]}}m(W,"expressionCache",new Map),m(W,"variableCache",new Map),m(W,"bindingsCache",new Map),m(W,"loopVariableCache",new Map),m(W,"MAX_CACHE_SIZE",1e3);class ve{static escapeTemplateLiteralText(e){return e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}static getRuntimeEscaperSource(){return"\nconst __pp_escape_html = (value) => String(value)\n .split('&').join('&amp;')\n .split('<').join('&lt;')\n .split('>').join('&gt;')\n .split('\"').join('&quot;')\n .split(\"'\").join('&#39;');\nconst __pp_raw_html = (value) => ({ __ppRawHtml: String(value) });\nconst __pp_render_value = (value) => {\n if (typeof value === 'boolean' || value == null) return '';\n if (value && typeof value === 'object' && Object.prototype.hasOwnProperty.call(value, '__ppRawHtml')) return value.__ppRawHtml;\n if (Array.isArray(value)) return value.map(__pp_render_value).join('');\n return __pp_escape_html(value);\n};\n"}static escapeTemplateLiteralTextPreservingInterpolations(e){let t="",s=0,i=0;for(;s<e.length;){if("$"===e[s]&&"{"===e[s+1]){const n=this.findClosingBrace(e,s+1);if(-1!==n){t+=this.escapeTemplateLiteralText(e.slice(i,s)),t+=e.slice(s,n+1),s=n+1,i=s;continue}}s++}return t+=this.escapeTemplateLiteralText(e.slice(i)),t}static clearCache(){this.cache.clear()}static pruneCache(){if(this.cache.size>this.MAX_CACHE_SIZE){const e=this.cache.size-Math.floor(this.MAX_CACHE_SIZE/2);let t=0;for(const s of this.cache.keys()){if(t>=e)break;this.cache.delete(s),t++}}}static transformSpreadAttributes(e){const t=new Map;let s=0;const i=document.createElement("template");i.innerHTML=e;const n=e=>{if(e.nodeType===Node.ELEMENT_NODE){const i=e;if(Array.from(i.childNodes).forEach(n),i.hasAttribute("pp-spread")){const e=i.getAttribute("pp-spread")||"";i.removeAttribute("pp-spread");const n=e.match(/^\s*\{\s*\.\.\.(.+?)\s*\}\s*$/);if(n){const e=U(n[1].trim()),r=`___pp_spread_${s++}___`,a=`\${ (() => {\n const __obj = ${e};\n if (!__obj || typeof __obj !== 'object') return '';\n return Object.entries(__obj)\n .map(([k, v]) => {\n if (v == null) return '';\n const __attrName = String(k);\n if (!/^[^\\s"'<>/=]+$/.test(__attrName) || /^on/i.test(__attrName)) return '';\n const __escapedValue = String(v)\n .split('&').join('&amp;')\n .split('"').join('&quot;')\n .split("'").join('&#39;')\n .split('<').join('&lt;')\n .split('>').join('&gt;');\n return __attrName + '="' + __escapedValue + '"';\n })\n .filter(Boolean)\n .join(' ');\n })() }`;t.set(r,a),i.setAttribute(r,"")}}}};return Array.from(i.content.childNodes).forEach(n),{html:i.innerHTML,spreadReplacements:t}}static expandSpreadPlaceholders(e,t){let s=e;return t.forEach((e,t)=>{s=s.split(`${t}=""`).join(e),s=s.split(t).join(e)}),s}static transformRefAttributes(e){if(!e.includes("pp-ref"))return e;const t=document.createElement("template");t.innerHTML=e;const s=document.createTreeWalker(t.content,NodeFilter.SHOW_ELEMENT);let i=s.nextNode();for(;i;){const e=i;if(e.hasAttribute("pp-ref")){const t=(e.getAttribute("pp-ref")||"").match(/^\s*\{([\s\S]+)\}\s*$/);if(t){const s=U(t[1].trim());e.removeAttribute("pp-ref"),e.setAttribute("data-pp-ref",`{ __pp_ref(${s}) }`)}}i=s.nextNode()}return t.innerHTML}static transformComponentTags(e){const t=document.createElement("template");t.innerHTML=e;const s=e=>{if(e.nodeType!==Node.ELEMENT_NODE)return;const t=e,i=t.tagName.toLowerCase();if(Array.from(t.childNodes).forEach(s),i.includes(".")){const e=document.createDocumentFragment();for(e.appendChild(document.createTextNode(`{${i}}`));t.firstChild;)e.appendChild(t.firstChild);t.replaceWith(e)}};return Array.from(t.content.childNodes).forEach(s),t.innerHTML}static transformContextProviderTags(e){if(!/\.provider\b/i.test(e))return e;let t="",s=0;for(;s<e.length;){const i=e.slice(s).match(/^<([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\.Provider)\b([^>]*)>/i);if(!i){t+=e[s],s+=1;continue}const n=i[1],r=i[2]??"",a=s+i[0].length,o=this.findMatchingContextProviderClose(e,a);if(!o){t+=e[s],s+=1;continue}const c=this.transformContextProviderTags(e.slice(a,o.start));t+=`<pp-context-provider data-pp-context-token="{ __pp_context_token(__pp_context_lookup(${`'${n.replace(/\.Provider$/i,"").replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`})) }" data-pp-context-value="{ __pp_context_value(${this.extractContextProviderValueExpression(r)}) }">`+c+"</pp-context-provider>",s=o.end}return t}static findMatchingContextProviderClose(e,t){this.CONTEXT_PROVIDER_TAG_PATTERN.lastIndex=t;let s,i=1;for(;s=this.CONTEXT_PROVIDER_TAG_PATTERN.exec(e);){const e=s[0];if(i+=e.startsWith("</")?-1:1,0===i)return{start:s.index,end:s.index+e.length}}return null}static extractContextProviderValueExpression(e){const t=e.match(/\bvalue\s*=\s*(?:"([\s\S]*?)"|'([\s\S]*?)'|([^\s>]+))/i);if(!t)return"undefined";const s=t[1]??t[2]??t[3]??"",i=U(s.trim()).match(/^\{([\s\S]*)\}$/);return i?i[1].trim():JSON.stringify(s)}static normalizeTextareaValueAttributes(e){if(!e.includes("<textarea")||!e.includes("value="))return e;const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("textarea").forEach(e=>{const t=e,s=t.getAttribute("value");null!==s&&(t.textContent=s,t.removeAttribute("value"))}),t.innerHTML}static transformStyleAliasAttributes(e){if(!e.includes("pp-style"))return e;const t=document.createElement("template");t.innerHTML=e;const s=document.createTreeWalker(t.content,NodeFilter.SHOW_ELEMENT);let i=s.nextNode();for(;i;){const e=i;if(e.hasAttribute("pp-style")){const t=e.getAttribute("pp-style")??"",s=e.getAttribute("style")??"";e.removeAttribute("pp-style");const i=this.mergeStyleAttributeValues(s,t);i.length>0&&e.setAttribute("style",i)}i=s.nextNode()}return t.innerHTML}static mergeStyleAttributeValues(e,t){const s=e.trim(),i=t.trim().replace(/^;+\s*/,"");return s?i?`${s.endsWith(";")?s:`${s};`} ${i}`:s:i}static transformSelectValueAttributes(e){if(!e.includes("<select")||!e.includes("value="))return e;const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("select").forEach(e=>{const t=e,s=t.getAttribute("value");if(null===s)return;const i=s.match(/^\s*\{([\s\S]+)\}\s*$/);if(!i)return;const n=U(i[1].trim());t.removeAttribute("value"),t.setAttribute("data-pp-select-value",`{ __pp_select_value(${n}) }`)}),t.innerHTML}static transformDefaultValueAttributes(e){if(!e.includes("default"))return e;const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("input, textarea, select").forEach(e=>{const t=e,s=t.getAttribute("defaultvalue");if(null===s)return;const i=s.match(/^\s*\{([\s\S]+)\}\s*$/);if(!i)return;const n=U(i[1].trim());t.removeAttribute("defaultvalue"),t.setAttribute("data-pp-default-value",`{ __pp_default_value(${n}) }`)}),t.innerHTML}static transformDefaultCheckedAttributes(e){if(!e.includes("default"))return e;const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("input").forEach(e=>{const t=e,s=t.getAttribute("defaultchecked");if(null===s)return;const i=s.match(/^\s*\{([\s\S]+)\}\s*$/);if(!i)return;const n=U(i[1].trim());t.removeAttribute("defaultchecked"),t.setAttribute("data-pp-default-checked",`{ __pp_default_checked(${n}) }`)}),t.innerHTML}static compile(e,t){const s=(e||"").replace(/\r\n/g,"\n").replace(/\r/g,"\n"),i=e=>{let t=2166136261;for(let s=0;s<e.length;s++)t^=e.charCodeAt(s),t=t+((t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24))>>>0;return t.toString(16).padStart(8,"0")},n=t.join("\0"),r=`t${i(s)}|k${i(n)}|n${t.length}`;if(this.cache.has(r))return this.cache.get(r);const a=this.transformContextProviderTags(s),{maskedTemplate:o,placeholders:c}=this.maskComplexComponents(a),{maskedHtml:l,placeholders:h}=this.maskLiteralElements(o,"style","STYLE"),{maskedHtml:p,placeholders:u}=this.maskLiteralElements(l,"code","CODE",e=>!this.isPureBindingLiteral(e.innerHTML)),{maskedHtml:d,placeholders:f}=this.maskLiteralElements(p,"script","SCRIPT"),m=this.transformComponentTags(d),g=this.transformStyleAliasAttributes(m),v=this.normalizeTextareaValueAttributes(kt(g)),y=this.transformSelectValueAttributes(v),x=this.transformDefaultValueAttributes(y),_=this.transformDefaultCheckedAttributes(x),{html:b,spreadReplacements:C}=this.transformSpreadAttributes(_),S=this.transformRefAttributes(b),{html:E,loopReplacements:w}=this.processStructuralDirectives(S);let k=this.transformBooleanAttributes(E);(()=>{let e=!0;for(;e;)e=!1,w.forEach((t,s)=>{const i=k;k=k.split("${"+s+"}").join("${"+t+"}"),k=k.split(s).join("{ __pp_raw_html("+t+") }"),k!==i&&(e=!0)})})();const A=new Set;let P=this.getRuntimeEscaperSource()+"return `",T=0,I="";for(;T<k.length;){const e=k[T];if("o"===e||"O"===e){const e=k.slice(T,T+20).toLowerCase().match(/^on\w+\s*=\s*(["'])/);if(e){const t=k.slice(T,T+e[0].length),s=t[t.length-1];let i=T+e[0].length;for(;i<k.length&&(k[i]!==s||"\\"===k[i-1]);)i++;I+=k.slice(T,i+1),T=i+1;continue}}if("{"===e){const e=this.findClosingBrace(k,T);if(-1!==e){const t=k.slice(T+1,e),s=U(t);if(W.isValidExpression(s)){P+=this.escapeTemplateLiteralText(I),I="";const t=W.extractUsedVariables(s,di);for(const e of t)/^___PP_LOOP_\d+___$/.test(e)||A.add(e);const i=s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g," ");P+=`\${ (() => {\n try {\n const __res = (${s});\n return __pp_render_value(__res);\n } catch(e) {\n console.error("[PP-ERROR] Template Expression Failed: \\"${i}\\"", e);\n return '';\n }\n })() }`,T=e+1;continue}t.trim().length>0&&console.warn(`[PP-WARN] Interpolation skipped. Invalid Syntax in: "{${s}}"`)}}I+=e,T++}P+=this.escapeTemplateLiteralText(I),P+="`;",P=this.expandSpreadPlaceholders(P,C);const R=t.slice();try{const e=new Function(...R,P),t=(...t)=>{let s=e(...t);return s=this.restorePlaceholders(s,f),s=this.restorePlaceholders(s,u),s=this.restorePlaceholders(s,h),c.forEach((e,t)=>{s=s.replace(t,e)}),s};return this.pruneCache(),this.cache.set(r,t),t}catch(e){return console.error("[PP-ERROR] Compilation Failed",e),()=>"Error in Template"}}static maskLiteralElements(e,t,s,i=()=>!0){const n=document.createElement("template");n.innerHTML=e;const r=new Map;let a=0;return n.content.querySelectorAll(t).forEach(e=>{if(!i(e))return;const t=`__PP_${s}_${a++}__`;r.set(t,e.outerHTML),e.replaceWith(document.createTextNode(t))}),{maskedHtml:n.innerHTML,placeholders:r}}static isPureBindingLiteral(e){return/^\s*\{[\s\S]*\}\s*$/.test(e)}static restorePlaceholders(e,t){let s=e;return t.forEach((e,t)=>{s=s.replace(t,e)}),s}static transformBooleanAttributes(e){let t="",s=0;for(;s<e.length;){let i=!1;for(const n of wt){const r=`${n}="{`,a=`${n}='{`;if(e.startsWith(r,s)){i=!0;const a=s+r.length-1,o=this.findClosingBrace(e,a);if(-1!==o&&'"'===e[o+1]){const i=U(e.slice(a+1,o)),r=i.replace(/\\/g,"\\\\").replace(/'/g,"\\'");t+=`{ (() => { const __ppAttr = (${i}); if (typeof __ppAttr === 'boolean') return __pp_raw_html(__ppAttr ? '${n}' : ''); if (__ppAttr == null) return ''; if (typeof __ppAttr === 'string' || typeof __ppAttr === 'number' || typeof __ppAttr === 'bigint') return __pp_raw_html('${n}="' + __pp_escape_html(__ppAttr) + '"'); return __pp_raw_html('${n}="{${r}}"'); })() }`,s=o+2;break}}else if(e.startsWith(a,s)){i=!0;const r=s+a.length-1,o=this.findClosingBrace(e,r);if(-1!==o&&"'"===e[o+1]){const i=U(e.slice(r+1,o)),a=i.replace(/\\/g,"\\\\").replace(/'/g,"\\'");t+=`{ (() => { const __ppAttr = (${i}); if (typeof __ppAttr === 'boolean') return __pp_raw_html(__ppAttr ? '${n}' : ''); if (__ppAttr == null) return ''; if (typeof __ppAttr === 'string' || typeof __ppAttr === 'number' || typeof __ppAttr === 'bigint') return __pp_raw_html('${n}="' + __pp_escape_html(__ppAttr) + '"'); return __pp_raw_html('${n}="{${a}}"'); })() }`,s=o+2;break}}}i||(t+=e[s],s++)}return t}static captureLoopVariablesInEventHandlers(e,t,s,i,n=!1,r=[]){let a="",o=0;for(;o<e.length;){const c=e.slice(o,o+40).toLowerCase().match(/^on\w+\s*=\s*(["'])/);if(c){const l=c[0].length,h=e.slice(o,o+l),p=h[h.length-1],u=o+l;let d=u;for(;d<e.length&&(e[d]!==p||"\\"===e[d-1]);)d++;const f=h.slice(0,-2).trim();let m=e.slice(u,d);m=this.rewriteLoopEventHandlerCode(m,t,s,i,n,r),a+=`${f}=${p}${m}${p}`,o=d+1;continue}a+=e[o],o++}return a}static rewriteLoopEventHandlerCode(e,t,s,i,n,r=[]){const a=e.match(/^\{([\s\S]*)\}$/),o=a?a[1]:e;let c=s,l=o;r.forEach(e=>{c=this.applyLoopContextRewrites(c,e),l=this.applyLoopContextRewrites(l,e)});const h={iterator:t,collectionName:c,indexVar:i,userDefinedIndex:n};return l=this.applyLoopContextRewrites(l,h),[...r,h].forEach(e=>{const t=this.getLoopIndexToken(e.indexVar);l=l.split(t).join(`\${${e.indexVar}}`)}),a?`{${l}}`:l}static getLoopIndexToken(e){return`__PP_LOOP_IDX_${e}__`}static applyLoopContextRewrites(e,t){const s=this.getLoopIndexToken(t.indexVar);let i=e;return t.userDefinedIndex&&(i=this.replaceLoopIdentifierUsages(i,t.indexVar,s)),this.replaceLoopIdentifierUsages(i,t.iterator,`(${t.collectionName})[${s}]`)}static replaceLoopIdentifierUsages(e,t,s){const i=W.analyzeLoopVariableUsage(e,t).slice().sort((e,t)=>t.start-e.start);if(0===i.length)return e;let n=e;return i.forEach(e=>{const i=e.isShorthand?this.buildShorthandReplacement(t,s,e.isUnwrap):s;n=n.slice(0,e.start)+i+n.slice(e.end)}),n}static buildShorthandReplacement(e,t,s){return s?`{ ${e}: ${t} }`:`${e}: ${t}`}static processStructuralDirectives(e){if(!e.includes("pp-for"))return{html:e,loopReplacements:new Map};const t=document.createElement("template");t.innerHTML=e;const s=new Map;let i=0,n=0;const r=(e,t=[])=>{const a=Array.from(e.childNodes);for(const e of a){if(e.nodeType!==Node.ELEMENT_NODE)continue;const a=e;if("TEMPLATE"===a.tagName){const e=a,o=e.getAttribute("pp-for")||"";let c=null;if(e.hasAttribute("pp-for")){const e=o.match(/^\s*\(\s*(.+?)\s*,\s*(.+?)\s*\)\s+in\s+(.+?)\s*$/),t=o.match(/^\s*(.+?)\s+in\s+(.+?)\s*$/);let s,i,r,a=!1;if(e)s=e[1].trim(),i=e[2].trim(),r=e[3].trim(),a=!0;else{if(!t)continue;s=t[1].trim(),r=t[2].trim(),i="__pp_idx_"+n++}c={iterator:s,collectionName:r,indexVar:i,userDefinedIndex:a}}if(r(e.content,c?[...t,c]:t),c){const{iterator:n,collectionName:r,indexVar:a,userDefinedIndex:o}=c;let l=e.innerHTML;l=this.transformContextProviderTags(l),l=this.transformComponentTags(l),l=this.transformRefAttributes(l),l=this.transformStyleAliasAttributes(l),l=this.captureLoopVariablesInEventHandlers(l,n,r,a,o,t),l=l.replace(/___PP_LOOP_\d+___/g,e=>"${"+e+"}"),l=l.replace(/\r/g,""),l=this.transformBooleanAttributes(l),l=this.transformInterpolations(l),l=this.escapeTemplateLiteralTextPreservingInterpolations(l);const h=`(Array.isArray(${r}) ? ${r} : []).map(${`(${n}, ${a})`} => \`${l}\`).join('')`,p=`___PP_LOOP_${i++}___`;s.set(p,h),e.replaceWith(document.createTextNode(p));continue}continue}r(a,t)}};return r(t.content),{html:t.innerHTML,loopReplacements:s}}static transformInterpolations(e){let t="",s=0;for(;s<e.length;){if("o"===e[s]||"O"===e[s]){const i=e.slice(s,s+20).toLowerCase().match(/^on\w+\s*=\s*(["'])/);if(i){const n=e.slice(s,s+i[0].length),r=n[n.length-1];let a=s+i[0].length;for(;a<e.length&&(e[a]!==r||"\\"===e[a-1]);)a++;t+=e.slice(s,a+1),s=a+1;continue}}if("{"===e[s]){if(s>0&&"$"===e[s-1]){t+="{",s++;continue}const i=this.findClosingBrace(e,s);if(-1!==i){const n=U(e.slice(s+1,i));if(W.isValidExpression(n)){t+="${__pp_render_value("+n+")}",s=i+1;continue}}}t+=e[s],s++}return t}static maskComplexComponents(e){if(!e.includes("pp-component="))return{maskedTemplate:e,placeholders:new Map};const t=document.createElement("template");t.innerHTML=e;const s=new Map;let i=0;const n=e=>{if(e instanceof Element&&e.hasAttribute("pp-component")){const t=!!e.querySelector("script"),n=!!e.querySelector("template[pp-owner]");if(t||n){const t=`__PP_CHILD_${i++}__`;return s.set(t,e.outerHTML),void e.replaceWith(document.createTextNode(t))}}Array.from(e.children).forEach(e=>n(e))};return n(t.content),{maskedTemplate:t.innerHTML,placeholders:s}}static findClosingBrace(e,t){let s=0,i=null;for(let n=t;n<e.length;n++){const t=e[n];let r=!1;if(n>0&&"\\"===e[n-1]){let t=0,s=n-1;for(;s>=0&&"\\"===e[s];)t++,s--;t%2!=0&&(r=!0)}if(i)t===i&&!r&&(i=null);else if(r||'"'!==t&&"'"!==t&&"`"!==t)if("{"!==t||r){if("}"===t&&!r&&(s--,0===s))return n}else s++;else i=t}return-1}}m(ve,"cache",new Map),m(ve,"MAX_CACHE_SIZE",200),m(ve,"CONTEXT_PROVIDER_TAG_PATTERN",/<\/?([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*\.Provider)\b[^>]*>/gi);const cs=Symbol.for("pp.context");let Oe=null;function ls(e){if(!e||"object"!=typeof e||!("value"in e))throw new Error("Context.Provider expects an object like { value, children? }.");return e}function hs(e,t){const s=Oe;Oe=e;try{return t()}finally{Oe=s}}function ps(e){const t={$$typeof:cs,defaultValue:e,Provider:e=>{const s=ls(e),i=Oe;if(!i)throw new Error("Context.Provider() can only be used while a component is rendering.");return i(t,s.value),s.children??null}};return t}const _t=new Set(["data-state","data-open","style","aria-hidden","hidden","inert"]),Ct=new Set(["alert-dialog-content","alert-dialog-overlay","alert-dialog-portal","dialog-content","dialog-overlay","dialog-portal","popover-content","sheet-content","sheet-overlay","sheet-portal","tooltip-content"]),fs=["script","domDiff","bindEvents","bindRefs","bootstrapNested","portals","restoreFocus","layoutEffects","effects","total"];function St(){return typeof performance<"u"&&"function"==typeof performance.now?performance.now():Date.now()}const V=class e{constructor(e){m(this,"el"),m(this,"id"),m(this,"rawTemplate"),m(this,"renderFunction"),m(this,"templateFn",null),m(this,"hooksSystem"),m(this,"eventManager"),m(this,"latestScope",{}),m(this,"__ppRefStore",new Map),m(this,"__ppRefSeq",0),m(this,"__ppRefCaptureIdsByElement",new WeakMap),m(this,"__ppRefExprsByElement",new WeakMap),m(this,"__ppRefBindingSeq",0),m(this,"activeRefBindings",new Map),m(this,"__ppSelectValueStore",new Map),m(this,"__ppSelectValueSeq",0),m(this,"__ppContextTokenStore",new Map),m(this,"__ppContextTokenSeq",0),m(this,"__ppContextValueStore",new Map),m(this,"__ppContextValueSeq",0),m(this,"__ppDefaultValueStore",new Map),m(this,"__ppDefaultValueSeq",0),m(this,"__ppDefaultCheckedStore",new Map),m(this,"__ppDefaultCheckedSeq",0),m(this,"registeredResetForms",new Set),m(this,"passiveEffectsVersion",0),m(this,"isRendering",!1),m(this,"props",{}),m(this,"ownedChildren",new Map),m(this,"lastRenderedHtml",""),m(this,"renderCount",0),m(this,"trackedPortals",new Map),m(this,"parentId",null),m(this,"initialChildrenHtml",""),m(this,"pendingEventElements",new Set),m(this,"traversalCache",null),m(this,"pendingProvidedContexts",new Map),m(this,"pendingContextTokens",new Set),m(this,"activeContextProviderBoundaryIds",new Set),m(this,"contextRefreshPending",!1),m(this,"_lastRawScopeKeySig",""),m(this,"_lastSortedKeys",[]),m(this,"_lastSortedScopeKeySig",""),m(this,"_cachedHooksAPI",null),m(this,"_propFnCache",new Map),m(this,"_interpolationFnCache",new Map),m(this,"_scopeEvalFnCache",new Map),m(this,"_refEvalFnCache",new Map),this.el=e,this.id=this.el.getAttribute("pp-component")||"",this.id||(this.id="anon_"+Math.random().toString(36).substring(2,9),this.el.setAttribute("pp-component",this.id)),this.props=Array.from(this.el.attributes).reduce((e,t)=>{const s=t.name;if(s.startsWith("on")||"pp-component"===s)return e;const i=dt(s);return et.has(i)||(e[i]=t.value),e},{}),C.registerInstance(this.id,this),this.syncParentId(),this.props=this.computePropsFromAttributes();let t=C.getTemplate(this.id);const s=C.getOwnedTemplates(this.id);t?s&&(this.ownedChildren=s):(this.extractOwnedTemplates(),t=this.el.innerHTML,C.saveTemplate(this.id,t),C.saveOwnedTemplates(this.id,this.ownedChildren)),this.initialChildrenHtml=t,this.props.children=this.initialChildrenHtml,this.hooksSystem=new fi(()=>{this.isRendering||this.render()});const i=C.getState(this.id);i&&this.hooksSystem.loadState(i);const n=Me(this.initialChildrenHtml,this.el.tagName.toLowerCase()),r=this.findOwnScript(n.root),a=(null==r?void 0:r.textContent)||"";r&&r.remove(),this.rawTemplate=n.toHtml(),this.renderFunction=this.createRenderFunction(a),this.eventManager=new Ci(this.el,()=>this.latestScope,e=>this.isManagedEventElement(e)),this.render()}syncParentId(){var e;const t=this.el.__ppRuntimeParentId,s=null==(e=this.el.parentElement)?void 0:e.closest("[pp-component]");this.parentId=void 0!==t?t:s?s.getAttribute("pp-component"):null,C.saveParent(this.id,this.parentId)}static setPerfEnabled(e){this.perfEnabled=e}static getPerfEnabled(){return this.perfEnabled}static resetPerfStats(){this.perfStats.clear()}static getPerfStats(){return Object.fromEntries(this.perfStats.entries())}static createEmptyPerfEntry(){const e={};return fs.forEach(t=>{e[t]={count:0,totalMs:0,maxMs:0}}),{renderCount:0,phases:e}}recordPerfPhase(t,s){if(!e.perfEnabled)return;let i=e.perfStats.get(this.id);i||(i=e.createEmptyPerfEntry(),e.perfStats.set(this.id,i));const n=i.phases[t];n.count++,n.totalMs+=s,n.maxMs=Math.max(n.maxMs,s)}startPerfTimer(){return e.perfEnabled?St():0}endPerfTimer(t,s){e.perfEnabled&&this.recordPerfPhase(t,St()-s)}findOwnScript(e){const t=Array.from(e.children);for(const e of t){if("script"===e.tagName.toLowerCase()&&"text/pp"===e.getAttribute("type"))return e;if(e.hasAttribute("pp-component"))continue;const t=this.findOwnScript(e);if(t)return t}return null}interpolateAttrString(e,t){const s=me(t),i=s.keys,n=ge(t,i),r=s.keySig;return e.replace(/\{([\s\S]*?)\}/g,(e,t)=>{const s=U(String(t).trim());try{const e=this.getCachedFunction(this._interpolationFnCache,s,i,r,300)(...n);return"boolean"==typeof e||null==e?"":Array.isArray(e)?e.join(""):String(e)}catch(e){return console.warn(`[PP-WARN] Failed attribute interpolation for {${s}}`,e),""}})}applyAttributeInterpolations(e,t){const s=me(t),i=s.keys,n=ge(t,i),r=s.keySig;for(const s of Array.from(e.attributes)){const a=s.name;if("pp-component"===a||a.startsWith("on"))continue;const o=s.value;if(!o.includes("{"))continue;if(!/^\s*\{[\s\S]*\}\s*$/.test(o)){const s=this.interpolateAttrString(o,t);s!==o&&e.setAttribute(a,s);continue}const c=o.match(/^\s*\{([\s\S]*)\}\s*$/);if(!c)continue;const l=U(c[1].trim());if(!W.isValidExpression(l))continue;let h;try{h=this.getCachedFunction(this._scopeEvalFnCache,l,i,r,300)(...n)}catch(e){console.error(`[PP-ERROR] Failed to eval "${l}"`,e);continue}if(wt.has(a.toLowerCase())&&"boolean"==typeof h){h?e.setAttribute(a,""):e.removeAttribute(a);continue}const p=typeof h;null==h?e.removeAttribute(a):("string"===p||"number"===p||"boolean"===p||"bigint"===p)&&e.setAttribute(a,String(h))}}computePropsFromAttributes(){const e=this.parentId?C.getResolvedScopeWithAncestors(this.parentId,this.id):void 0,t=e?me(e):null,s=(null==t?void 0:t.keys)??[],i=e?ge(e,s):[],n=this.el.__ppRawBindings,r=new Set([...Array.from(this.el.attributes).map(e=>e.name),...n?Object.keys(n):[]]),a=(null==t?void 0:t.keySig)??"",o=t=>{if(e)try{const e=t+"|"+a;let n=this._propFnCache.get(e);if(!n){if(n=new Function(...s,`"use strict"; return (${t});`),this._propFnCache.size>200){const e=this._propFnCache.keys().next().value;void 0!==e&&this._propFnCache.delete(e)}this._propFnCache.set(e,n)}return n(...i)}catch(e){return void console.warn(`[PP-WARN] Failed to evaluate prop expression "{${t}}" for component "${this.id}"`,e)}};return Array.from(r).reduce((t,s)=>{if(s.startsWith("on")&&!s.includes("-")||"pp-component"===s)return t;const i=dt(s);if(et.has(i))return t;const r=this.el.attributes.getNamedItem(s),a=(null==n?void 0:n[s])??(null==r?void 0:r.value);if(void 0===a)return t;if(""===a)return t[i]=!0,t;if(e){const s=a.match(/^\s*\{([\s\S]*)\}\s*$/);if(s){const e=U(s[1].trim());if(W.isValidExpression(e))return t[i]=o(e),t}if(a.includes("{"))return t[i]=this.interpolateAttrString(a,e),t}return t[i]=a,t},{})}refreshPropsFromParent(e=!1){const t=this.computePropsFromAttributes();t.children=this.initialChildrenHtml,e||!_i(this.props,t)||0!==this.ownedChildren.size?(this.props=t,this.isRendering||this.render()):this.bootstrapNestedComponents()}extractOwnedTemplates(){const e=this.el.querySelectorAll("template[pp-owner]");let t=0;e.forEach(e=>{var s,i;if((null==(s=e.parentElement)?void 0:s.closest("[pp-component]"))!==this.el)return;const n=e.getAttribute("pp-owner");if(n){const s=`__PP_OWNED_${this.id}_${t++}__`;this.ownedChildren.set(s,{ownerId:n,content:e.innerHTML,contextTag:(null==(i=e.parentElement)?void 0:i.tagName.toLowerCase())??null});const r=document.createComment(s);e.replaceWith(r)}})}replaceOwnedPlaceholder(e,t,s){const i=`\x3c!--${t}--\x3e`;return e.includes(i)?e.replace(i,s):e.replace(t,s)}maskNestedOwnedTemplates(e,t=null){const s=new Map,i=Me(e,t);let n=0;const r=i.root.querySelectorAll("[pp-component] > template[pp-owner]");for(const e of Array.from(r)){const t=`__PP_NESTED_TPL_${n++}__`;s.set(t,e.outerHTML),e.replaceWith(document.createComment(t))}return{content:i.toHtml(),placeholders:s}}restoreMaskedOwnedTemplates(e,t){if(0===t.size)return;const s=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),i=[];let n=s.nextNode();for(;n;){const e=n,r=t.get(e.data||"");if(r){const t=document.createElement("template");t.innerHTML=r;const s=t.content.firstChild;s&&i.push({node:e,replacement:s})}n=s.nextNode()}i.forEach(({node:e,replacement:t})=>{e.replaceWith(t)})}materializeTemplateComponentBoundaries(e){const t=[];e instanceof HTMLTemplateElement&&e.hasAttribute("pp-component")&&t.push(e),e.querySelectorAll("template[pp-component]").forEach(e=>t.push(e)),t.forEach(e=>{const t=e.content.cloneNode(!0),s=t.firstElementChild;s?(Array.from(e.attributes).forEach(e=>{"pp-owner"!==e.name&&s.setAttribute(e.name,e.value)}),e.replaceWith(t)):e.replaceWith(document.createComment("pp-empty-template-component"))})}renderOwnedContent(e,t,s){const{content:i,placeholders:n}=this.maskNestedOwnedTemplates(e.content,e.contextTag),r=me(s).keys,a=ge(s,r),o=bi(e.contextTag),c=ve.compile(o.wrap(i),r);let l=o.unwrap(c(...a));for(const[e,t]of n)l=this.replaceOwnedPlaceholder(l,e,t);return this.markOwnedBindings(l,t,e.contextTag)}resolveOwnedTemplateOwner(e,t=this.id){const s=C.resolveComponentId(e,t);if(!s)return null;const i=C.getResolvedScopeWithAncestors(e,t);return i?{ownerId:s,scope:i}:null}resolveOwnedChildren(e){if(!e.includes("__PP_OWNED_"))return e;this.ownedChildren.forEach((t,s)=>{const i=this.resolveOwnedTemplateOwner(t.ownerId);if(i){const n=this.renderOwnedContent(t,i.ownerId,i.scope);e=this.replaceOwnedPlaceholder(e,s,n)}else e=this.replaceOwnedPlaceholder(e,s,t.content)});const t=/__PP_OWNED_([^_]+(?:_[^_]+)*)_(\d+)__/g;let s;for(;null!==(s=t.exec(e));){const i=s[0],n=s[1],r=C.getOwnedTemplates(n);if(r&&r.has(i)){const s=r.get(i),a=this.resolveOwnedTemplateOwner(s.ownerId,n);if(a){const t=this.renderOwnedContent(s,a.ownerId,a.scope);e=this.replaceOwnedPlaceholder(e,i,t)}else e=this.replaceOwnedPlaceholder(e,i,s.content);t.lastIndex=0}}return e}markOwnedBindings(e,t,s=null){const i=Me(e,s),n=document.createTreeWalker(i.root,NodeFilter.SHOW_ELEMENT);let r=n.nextNode();for(;r;){const e=r;Array.from(e.attributes).some(e=>e.name.startsWith("on"))&&e.setAttribute("pp-event-owner",t),e.hasAttribute("data-pp-ref")&&e.setAttribute("pp-ref-owner",t),r=n.nextNode()}return i.toHtml()}getCachedFunction(e,t,s,i,n){const r=t+"|"+i;let a=e.get(r);if(!a){if(a=new Function(...s,`"use strict"; return (${t});`),e.size>n){const t=e.keys().next().value;void 0!==t&&e.delete(t)}e.set(r,a)}return a}createRenderFunction(e){const t=W.extractStateBindings(e);return new Function("pp",`\n "use strict";\n ${e}\n return { ${t.join(", ")} };\n `)}updateRefValue(e,t,s){try{"function"==typeof e?e(t):e&&"object"==typeof e&&"current"in e&&(e.current=t)}catch(e){console.warn(s,e)}}clearRefValue(e,t){this.updateRefValue(e,null,t)}attachRefValue(e,t,s){this.updateRefValue(e,t,s)}ensureRefBindingId(e,t){const s="captured"===t?"__ppCapturedRefBindingId":"__ppPlainRefBindingId";return e[s]||(e[s]=`pprefbind_${this.id}_${t}_${++this.__ppRefBindingSeq}`),e[s]}resolveCapturedRefValue(e,t){if(this.__ppRefStore.has(e))return this.__ppRefStore.get(e);if(!t||t===this.id)return;const s=C.getInstance(t);return s&&s.__ppRefStore.has(e)?s.__ppRefStore.get(e):void 0}resolvePlainRefValue(e,t,s,i){const n=this.latestScope[e];if("function"==typeof n||n&&"object"==typeof n&&"current"in n)return n;try{return this.getCachedFunction(this._refEvalFnCache,e,t,i,200)(...s)}catch{return}}commitRefBindings(e){for(const[t,s]of this.activeRefBindings.entries()){const i=e.get(t);i?(s.value!==i.value||s.element!==i.element)&&this.clearRefValue(s.value,"[PP-WARN] Ref cleanup failed"):this.clearRefValue(s.value,"[PP-WARN] Ref cleanup failed")}for(const[t,s]of e.entries()){const e=this.activeRefBindings.get(t);e&&e.value===s.value&&e.element===s.element||this.attachRefValue(s.value,s.element,"[PP-WARN] Ref attachment failed")}this.activeRefBindings=e}clearAllRefBindings(){for(const e of this.activeRefBindings.values())this.clearRefValue(e.value,"[PP-WARN] Ref cleanup failed");this.activeRefBindings.clear()}createRefCaptureFunction(){return this.__ppRefStore=new Map,this.__ppRefSeq=0,e=>{const t=`ppref_${this.id}_${++this.__ppRefSeq}`;return this.__ppRefStore.set(t,e),t}}createSelectValueCaptureFunction(){return this.__ppSelectValueStore=new Map,this.__ppSelectValueSeq=0,e=>{const t=`ppselect_${this.id}_${++this.__ppSelectValueSeq}`;return this.__ppSelectValueStore.set(t,e),t}}createContextTokenCaptureFunction(){return this.__ppContextTokenStore=new Map,this.__ppContextTokenSeq=0,e=>{const t=`ppcontexttoken_${this.id}_${++this.__ppContextTokenSeq}`;return this.__ppContextTokenStore.set(t,e),t}}createContextValueCaptureFunction(){return this.__ppContextValueStore=new Map,this.__ppContextValueSeq=0,e=>{const t=`ppcontextvalue_${this.id}_${++this.__ppContextValueSeq}`;return this.__ppContextValueStore.set(t,e),t}}createContextLookupFunction(){const e=(e,t)=>{if(null==e)return;if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const s=Object.keys(Object(e)).find(e=>e.toLowerCase()===t.toLowerCase());return s?e[s]:void 0};return t=>{const s=String(t).split(".").map(e=>e.trim()).filter(Boolean);if(0===s.length)return;const[i,...n]=s;let r;"globalthis"===i.toLowerCase()?r=globalThis:"window"===i.toLowerCase()?r=typeof window<"u"?window:globalThis:(r=e(this.latestScope,i),void 0===r&&(r=e(globalThis,i)));for(const t of n)r=e(r,t);return r}}createDefaultValueCaptureFunction(){return this.__ppDefaultValueStore=new Map,this.__ppDefaultValueSeq=0,e=>{const t=`ppdefaultvalue_${this.id}_${++this.__ppDefaultValueSeq}`;return this.__ppDefaultValueStore.set(t,e),t}}createDefaultCheckedCaptureFunction(){return this.__ppDefaultCheckedStore=new Map,this.__ppDefaultCheckedSeq=0,e=>{const t=`ppdefaultchecked_${this.id}_${++this.__ppDefaultCheckedSeq}`;return this.__ppDefaultCheckedStore.set(t,e),t}}consumeContext(e){return this.pendingContextTokens.add(e),C.resolveContext(this.parentId,e).value}registerProvidedContext(e,t){this.pendingProvidedContexts.set(e,t)}requestContextRefresh(){this.contextRefreshPending||(this.contextRefreshPending=!0,queueMicrotask(()=>{if(this.contextRefreshPending=!1,C.getInstance(this.id)===this){if(this.isRendering)return void this.requestContextRefresh();this.forceUpdate()}}))}refreshContextConsumers(e){var t;for(const s of e){const e=C.getInstance(s);null==(t=null==e?void 0:e.requestContextRefresh)||t.call(e)}}makeHooksAPI(){return this._cachedHooksAPI?this._cachedHooksAPI.props=this.props:this._cachedHooksAPI={state:e=>this.hooksSystem.useState(e),effect:(e,t)=>this.hooksSystem.useEffect(e,t),layoutEffect:(e,t)=>this.hooksSystem.useLayoutEffect(e,t),ref:(e=null)=>this.hooksSystem.useRef(e),memo:(e,t)=>this.hooksSystem.useMemo(e,t),callback:(e,t)=>this.hooksSystem.useCallback(e,t),reducer:(e,t,s)=>s?this.hooksSystem.useReducer(e,t,s):this.hooksSystem.useReducer(e,t),context:e=>this.consumeContext(e),portal:(e,t)=>this.hooksSystem.usePortal(e,t),props:this.props},this._cachedHooksAPI}syncTrackedPortals(e){if(0===this.trackedPortals.size)return;const t=this.hooksSystem.getPortalRegistrations();if(0===t.length)return;const s=new Map,i=new Map;e.querySelectorAll("*").forEach(e=>{const t=e,n=t.getAttribute("data-pp-ref");if(n){const e=s.get(n);e?e.push(t):s.set(n,[t])}const r=t.getAttribute("pp-ref");if(r){const e=i.get(r);e?e.push(t):i.set(r,[t])}});const n=new Map;for(const[e,t]of this.__ppRefStore.entries()){if(!t||"object"!=typeof t||!("current"in t))continue;const s=t,i=n.get(s);i?i.push(e):n.set(s,[e])}const r=new Map;for(const[e,t]of Object.entries(this.latestScope)){if(!t||"object"!=typeof t||!("current"in t))continue;const s=t,i=r.get(s);i?i.push(e):r.set(s,[e])}const a=(e,t)=>{for(const s of t){const t=e.get(s);if(!t||0===t.length)continue;const i=t.shift()??null;if(0===t.length&&e.delete(s),i)return i}return null},o=[];for(const e of t){const t=e.ref.current;if(!t||!this.trackedPortals.has(t))continue;const c=n.get(e.ref)??[];let l=a(s,c);if(!l){const t=r.get(e.ref)??[];l=a(i,t)}if(!l)continue;const h=this.trackedPortals.get(t);o.push({liveElement:t,sourceElement:l,placeholderText:h.placeholder.data||`pp-portal:${this.id}`})}0!==o.length&&(o.forEach(({sourceElement:e,placeholderText:t})=>{e.replaceWith(document.createComment(t))}),o.forEach(({liveElement:e,sourceElement:t})=>{this.morphTrackedPortalRoot(e,t)}))}morphTrackedPortalRoot(e,t){if(e.tagName!==t.tagName){const s=e.parentNode;if(!s)return;const i=t.cloneNode(!0),n=this.trackedPortals.get(e);return s.replaceChild(i,e),this.collectEventElements(i),void(n&&(this.trackedPortals.delete(e),this.trackedPortals.set(i,{...n,element:i})))}this.syncAttributes(e,t,!0),this.hasEventAttributes(e)&&this.pendingEventElements.add(e),this.morphChildren(e,t)}applyPortals(){const e=this.hooksSystem.getPortalRegistrations(),t=new Set;let s=!1;for(const i of e){const e=i.ref.current;if(!e)continue;const n=i.target??document.body;t.add(e);const r=this.trackedPortals.get(e);if(null!=r&&r.placeholder.parentNode){r.target!==n&&(n.appendChild(e),r.target=n,s=!0);continue}null===i.info.sourceParent&&e.parentNode instanceof Element&&(i.info.sourceParent=e.parentNode);const a=document.createComment(`pp-portal:${this.id}`);e.parentNode&&e.parentNode.insertBefore(a,e),n.appendChild(e),s=!0,this.trackedPortals.set(e,{element:e,placeholder:a,target:n})}for(const[e,i]of this.trackedPortals)t.has(e)||(i.placeholder.parentNode?(i.placeholder.parentNode.insertBefore(e,i.placeholder),i.placeholder.remove()):e.parentNode&&e.remove(),this.trackedPortals.delete(e),s=!0);s&&this.invalidateTraversalCache()}render(){var t;if(this.isRendering)return;this.isRendering=!0,this.renderCount++;const s=this.startPerfTimer();if(e.perfEnabled){let t=e.perfStats.get(this.id);t||(t=e.createEmptyPerfEntry(),e.perfStats.set(this.id,t)),t.renderCount++}try{this.pendingProvidedContexts=new Map,this.pendingContextTokens=new Set;const e=this.saveFocusState();this.hooksSystem.prepareRender();const s=this.makeHooksAPI(),i=globalThis.pp,n=(null==(t=null==i?void 0:i.createComponentRuntime)?void 0:t.call(i,s))??s,r=this.startPerfTimer();this.hooksSystem.startRenderPhase();let a,o=!1;try{a=hs((e,t)=>this.registerProvidedContext(e,t),()=>this.renderFunction(n))}finally{o=this.hooksSystem.finishRenderPhase()}if(this.endPerfTimer("script",r),o)return this.isRendering=!1,void this.render();C.saveState(this.id,this.hooksSystem.getHooks()),this.latestScope={...this.props,...a},this.latestScope.__pp_ref=this.createRefCaptureFunction(),this.latestScope.__pp_select_value=this.createSelectValueCaptureFunction(),this.latestScope.__pp_context_token=this.createContextTokenCaptureFunction(),this.latestScope.__pp_context_value=this.createContextValueCaptureFunction(),this.latestScope.__pp_context_lookup=this.createContextLookupFunction(),this.latestScope.__pp_default_value=this.createDefaultValueCaptureFunction(),this.latestScope.__pp_default_checked=this.createDefaultCheckedCaptureFunction(),C.saveScope(this.id,this.latestScope);const c=me(this.latestScope),l=c.keys,h=c.keySig;let p,u;h===this._lastRawScopeKeySig?(p=this._lastSortedKeys,u=this._lastSortedScopeKeySig):(p=l.length>1?[...l].sort():l.slice(),u=p.join("\0"),this._lastRawScopeKeySig=h,this._lastSortedKeys=p,this._lastSortedScopeKeySig=u);const d=ge(this.latestScope,p);this.templateFn||(this.templateFn=ve.compile(this.rawTemplate,p));let f=this.templateFn(...d);if(f=this.resolveOwnedChildren(f),this.lastRenderedHtml!==f){const e=this.startPerfTimer();this.applyDomDiff(f),this.endPerfTimer("domDiff",e),this.lastRenderedHtml=f}if(this.hasEventAttributes(this.el)&&this.pendingEventElements.add(this.el),this.pendingEventElements.size>0){const e=this.pendingEventElements;this.pendingEventElements=new Set;const t=this.startPerfTimer();this.eventManager.bindEvents(e),this.endPerfTimer("bindEvents",t)}const m=this.startPerfTimer();this.bindRefs(p,d,u),this.endPerfTimer("bindRefs",m);const g=C.saveContextValues(this.id,this.pendingProvidedContexts);C.updateContextDependencies(this.id,this.pendingContextTokens);const v=g.length>0?C.getConsumersForContextsInSubtree(this.id,g):null,y=this.startPerfTimer();this.bootstrapNestedComponents(),this.endPerfTimer("bootstrapNested",y);const x=this.startPerfTimer();this.applyPortals(),this.endPerfTimer("portals",x),this.bindUncontrolledInputDefaults(),this.bindUncontrolledFormResets(),this.bindControlledSelectValues();const _=this.startPerfTimer();this.restoreFocusState(e),this.endPerfTimer("restoreFocus",_);const b=this.startPerfTimer(),S=this.hooksSystem.runLayoutEffects();if(this.endPerfTimer("layoutEffects",b),S)return this.isRendering=!1,void this.render();this.schedulePassiveEffects(),null!=v&&v.size&&this.refreshContextConsumers(v)}catch(e){console.error("[PP-ERROR] Render Cycle Failed",e)}finally{this.endPerfTimer("total",s),this.isRendering=!1}}schedulePassiveEffects(){const e=++this.passiveEffectsVersion;queueMicrotask(()=>{if(this.passiveEffectsVersion!==e||C.getInstance(this.id)!==this)return;const t=this.startPerfTimer();this.hooksSystem.runEffects(),this.endPerfTimer("effects",t)})}applyDomDiff(e){if(typeof SVGElement<"u"&&this.el instanceof SVGElement){const t=(new DOMParser).parseFromString(`<svg xmlns="http://www.w3.org/2000/svg">${e}</svg>`,"image/svg+xml").documentElement,s=document.createDocumentFragment();return Array.from(t.childNodes).forEach(e=>{s.appendChild(document.importNode(e,!0))}),this.morphChildren(this.el,s),void this.invalidateTraversalCache()}const{content:t,placeholders:s}=this.maskNestedOwnedTemplates(e,this.el.tagName.toLowerCase()),i=Me(t,this.el.tagName.toLowerCase()).root;this.restoreMaskedOwnedTemplates(i,s),this.materializeTemplateComponentBoundaries(i),this.syncTrackedPortals(i),this.morphChildren(this.el,i),this.invalidateTraversalCache()}isInsideTrackedPortal(e){for(const[t]of this.trackedPortals)if(t===e||t.contains(e))return!0;return!1}isEffectManagedSurfaceElement(e,t){const s=e.getAttribute("data-slot");if(s&&Ct.has(s))return!0;const i=null==t?void 0:t.getAttribute("data-slot");return!!i&&Ct.has(i)}createNestedBoundaryId(t){return e.nestedBoundarySequence+=1,`${t}__pp${e.nestedBoundarySequence.toString(36)}`}getBoundaryBaseId(e){const t=e,s=e.getAttribute("pp-component");return!t.__ppBaseComponentId&&s&&(t.__ppBaseComponentId=s),t.__ppBaseComponentId??s}ensureBoundaryIdentity(e){var t;const s=e,i=e.getAttribute("pp-component")||"";if(s.__ppRuntimeComponentId)return i!==s.__ppRuntimeComponentId&&e.setAttribute("pp-component",s.__ppRuntimeComponentId),s.__ppBaseComponentId||(s.__ppBaseComponentId=i||s.__ppRuntimeComponentId),s.__ppRuntimeComponentId;if(!i)return"";s.__ppBaseComponentId=i;const n=C.getInstance(i);if(n&&n.el&&n.el!==e){if(n.el.isConnected){const t=this.createNestedBoundaryId(i);return s.__ppRuntimeComponentId=t,e.setAttribute("pp-component",t),t}null==(t=n.destroy)||t.call(n)}return s.__ppRuntimeComponentId=i,i}syncNestedBoundaryAttributes(e,t){const s=t.getAttribute("pp-component"),i=this.getBoundaryBaseId(e);if(!s||i&&s!==i)return!1;this.syncAttributes(e,t,!1,!0);const n=e;return n.__ppRuntimeComponentId&&e.getAttribute("pp-component")!==n.__ppRuntimeComponentId&&e.setAttribute("pp-component",n.__ppRuntimeComponentId),!0}morphChildren(e,t){if(this.hasKeyedDirectChildren(e)||this.hasKeyedDirectChildren(t))return void this.morphKeyedChildren(e,t);let s=e.firstChild,i=t.firstChild;for(;s||i;){const t=(null==s?void 0:s.nextSibling)??null,n=(null==i?void 0:i.nextSibling)??null;if(i){if(!s){const t=i.cloneNode(!0);e.appendChild(t),t.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(t),i=n;continue}if(s.nodeType!==i.nodeType){const r=i.cloneNode(!0);e.replaceChild(r,s),r.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(r),s=t,i=n;continue}if(s.nodeType!==Node.TEXT_NODE){if(s.nodeType===Node.ELEMENT_NODE){const r=s,a=i;if(r.tagName!==a.tagName){const r=i.cloneNode(!0);e.replaceChild(r,s),r.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(r),s=t,i=n;continue}if(r.hasAttribute("pp-component")&&r!==this.el){if(!this.syncNestedBoundaryAttributes(r,a)){const r=i.cloneNode(!0);e.replaceChild(r,s),r.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(r),s=t,i=n;continue}this.hasEventAttributes(r)&&this.pendingEventElements.add(r),s=t,i=n;continue}const o=this.isInsideTrackedPortal(r);if(this.syncAttributes(r,a,o),this.hasEventAttributes(r)&&this.pendingEventElements.add(r),r instanceof HTMLTextAreaElement){s=t,i=n;continue}this.morphChildren(r,a)}s=t,i=n}else s.textContent!==i.textContent&&(s.textContent=i.textContent),s=t,i=n}else s&&e.removeChild(s),s=t}}hasKeyedDirectChildren(e){const t=e.childNodes;for(let e=0;e<t.length;e++){const s=t[e];if(null!==this.getNodeKey(s))return!0}return!1}getNodeKey(e){if(e.nodeType!==Node.ELEMENT_NODE)return null;const t=e.getAttribute("key");return t&&t.length>0?t:null}areNodesCompatible(e,t){if(e.nodeType!==t.nodeType)return!1;if(e.nodeType!==Node.ELEMENT_NODE)return!0;const s=t;if(e.tagName!==s.tagName)return!1;const i=this.getNodeKey(e),n=this.getNodeKey(t);return null===i&&null===n||null!==i&&i===n}morphKeyedChildren(e,t){const s=Array.from(e.childNodes),i=Array.from(t.childNodes),n=this.collectDuplicateKeys(i),r=new Map,a=[];n.length>0&&console.warn(`[PP-WARN] Duplicate key values detected: ${n.join(", ")}`),s.forEach(e=>{const t=this.getNodeKey(e);if(null===t)return void a.push(e);const s=r.get(t);s?s.push(e):r.set(t,[e])});let o=e.firstChild;i.forEach(t=>{const s=this.getNodeKey(t);let i;if(null!==s){const e=r.get(s);for(;e&&e.length>0;){const s=e.shift();if(this.areNodesCompatible(s,t)){i=s;break}a.push(s)}}else{const e=a.findIndex(e=>this.areNodesCompatible(e,t));-1!==e&&(i=a.splice(e,1)[0])}if(i)i!==o&&e.insertBefore(i,o);else{const s=t.cloneNode(!0);e.insertBefore(s,o),s.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(s),i=s}this.morphNode(i,t),o=i.nextSibling}),a.forEach(t=>{t.parentNode===e&&e.removeChild(t)}),r.forEach(t=>{t.forEach(t=>{t.parentNode===e&&e.removeChild(t)})})}collectDuplicateKeys(e){const t=new Set,s=new Set;return e.forEach(e=>{const i=this.getNodeKey(e);if(null!==i){if(t.has(i))return void s.add(i);t.add(i)}}),Array.from(s.values())}morphNode(e,t){if(e.nodeType!==t.nodeType){const s=e.parentNode;if(!s)return;const i=t.cloneNode(!0);return s.replaceChild(i,e),void(i.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(i))}if(e.nodeType===Node.TEXT_NODE)return void(e.textContent!==t.textContent&&(e.textContent=t.textContent));if(e.nodeType!==Node.ELEMENT_NODE)return;const s=e,i=t;if(s.tagName!==i.tagName){const e=s.parentNode;if(!e)return;const i=t.cloneNode(!0);return e.replaceChild(i,s),void(i.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(i))}if(s.hasAttribute("pp-component")&&s!==this.el){if(!this.syncNestedBoundaryAttributes(s,i)){const e=s.parentNode;if(!e)return;const i=t.cloneNode(!0);return e.replaceChild(i,s),void(i.nodeType===Node.ELEMENT_NODE&&this.collectEventElements(i))}return void(this.hasEventAttributes(s)&&this.pendingEventElements.add(s))}const n=this.isInsideTrackedPortal(s);this.syncAttributes(s,i,n),this.hasEventAttributes(s)&&this.pendingEventElements.add(s),!(s instanceof HTMLTextAreaElement)&&this.morphChildren(s,i)}collectEventElements(e){this.hasEventAttributes(e)&&this.pendingEventElements.add(e);for(let t=0;t<e.children.length;t++)this.collectEventElements(e.children[t])}hasEventAttributes(e){const t=e.attributes;for(let e=0;e<t.length;e++)if(t[e].name.startsWith("on")&&!t[e].name.includes("-"))return!0;return!1}isManagedEventElement(e){if(this.isElementOwnedByTree(e,this.el))return!0;for(const[t]of this.trackedPortals)if(this.isElementOwnedByTree(e,t))return!0;return!1}isElementOwnedByTree(e,t){if(e===t)return!0;if(!t.contains(e))return!1;let s=e,i=!0;for(;s&&s!==t;){if(!i&&s.hasAttribute("pp-component"))return!1;s=s.parentElement,i=!1}return s===t}invalidateTraversalCache(){this.traversalCache=null}getTraversalCache(){if(this.traversalCache)return this.traversalCache;const e=[],t=[],s=[],i=[],n=new Set,r=[],a=(e,t)=>{r.push(e)};a(this.el);for(const[e]of this.trackedPortals)a(e);for(;r.length>0;){const a=r.pop();if(n.has(a))continue;n.add(a);const o=a,c=a!==this.el&&a.hasAttribute("pp-component");if(e.push(o),(a.hasAttribute("data-pp-ref")||a.hasAttribute("pp-ref")||this.__ppRefCaptureIdsByElement.has(o)||this.__ppRefExprsByElement.has(o))&&i.push(o),(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement)&&s.push(o),c)t.push(o);else for(let e=a.children.length-1;e>=0;e--)r.push(a.children[e])}return this.traversalCache={ownedElements:e,childBoundaries:t,managedInputs:s,refElements:i},this.traversalCache}collectManagedInputs(){return this.getTraversalCache().managedInputs}syncAttributes(e,t,s=!1,i=!1){const n=s||this.isEffectManagedSurfaceElement(e,t),r=e,a=e.attributes;for(let s=a.length-1;s>=0;s--){const o=a[s].name;if(!(i&&"pp-component"===o||t.hasAttribute(o))){if(n&&_t.has(o)||"value"===o&&e instanceof HTMLInputElement&&r.__ppHasUncontrolledDefaultValue||"checked"===o&&e instanceof HTMLInputElement&&r.__ppHasUncontrolledDefaultChecked||"selected"===o&&e instanceof HTMLOptionElement&&r.__ppHasUncontrolledDefaultSelected)continue;e.removeAttribute(o),"data-pp-ref"===o&&this.__ppRefCaptureIdsByElement.delete(e),"pp-ref"===o&&this.__ppRefExprsByElement.delete(e)}}const o=t.attributes;for(let t=0;t<o.length;t++){const s=o[t];n&&_t.has(s.name)||i&&"pp-component"===s.name||(e.getAttribute(s.name)!==s.value&&e.setAttribute(s.name,s.value),"value"===s.name&&(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement)&&e.value!=s.value&&(e.value=s.value))}if(e instanceof HTMLTextAreaElement&&t instanceof HTMLTextAreaElement&&!r.__ppHasUncontrolledDefaultValue){const s=t.getAttribute("value"),i=s??t.value,n=s??t.defaultValue;e.value!==i&&(e.value=i),e.defaultValue!==n&&(e.defaultValue=n)}}bindRefs(e,t,s){const i=this.getTraversalCache(),n=new Map;for(let r=0;r<i.refElements.length;r++){const a=i.refElements[r],o=a,c=a!==this.el&&a.hasAttribute("pp-component"),l=a.getAttribute("data-pp-ref"),h=a.getAttribute("pp-ref-owner");let p=null;if(l)this.__ppRefStore.has(l)?(a.removeAttribute("data-pp-ref"),this.__ppRefCaptureIdsByElement.set(a,l),p=l):c||(a.removeAttribute("data-pp-ref"),this.__ppRefCaptureIdsByElement.set(a,l),p=l);else{const e=this.__ppRefCaptureIdsByElement.get(a);e&&this.__ppRefStore.has(e)?p=e:e&&this.__ppRefCaptureIdsByElement.delete(a)}if(p){const e=this.resolveCapturedRefValue(p,h);if("function"==typeof e||e&&"object"==typeof e&&"current"in e){const t=this.ensureRefBindingId(o,"captured");n.set(t,{element:a,value:e})}else l&&p.startsWith(`ppref_${this.id}_`)&&console.warn(`[PP-WARN] Missing captured ref for id="${p}"`)}const u=a.getAttribute("pp-ref");let d=u;if(d=u||(this.__ppRefExprsByElement.get(a)||null),!d)continue;const f=this.resolvePlainRefValue(d,e,t,s);if("function"==typeof f||f&&"object"==typeof f&&"current"in f){u&&a.removeAttribute("pp-ref"),this.__ppRefExprsByElement.set(a,d);const e=this.ensureRefBindingId(o,"plain");n.set(e,{element:a,value:f});continue}u&&c||(u&&(a.removeAttribute("pp-ref"),this.__ppRefExprsByElement.set(a,d)),Object.prototype.hasOwnProperty.call(this.latestScope,d)||console.warn(`[PP-WARN] Could not resolve pp-ref="${d}"`))}this.commitRefBindings(n)}bindControlledSelectValues(){const e=this.collectManagedInputs();for(let t=0;t<e.length;t++){const s=e[t];if(!(s instanceof HTMLSelectElement))continue;const i=s,n=s.getAttribute("data-pp-select-value");let r=null;n?(s.removeAttribute("data-pp-select-value"),i.__ppSelectValueCaptureId=n,r=n):i.__ppSelectValueCaptureId&&this.__ppSelectValueStore.has(i.__ppSelectValueCaptureId)?r=i.__ppSelectValueCaptureId:i.__ppSelectValueCaptureId&&delete i.__ppSelectValueCaptureId,r&&this.applyControlledSelectValue(s,this.__ppSelectValueStore.get(r))}}bindUncontrolledInputDefaults(){const e=this.collectManagedInputs();for(let t=0;t<e.length;t++){const s=e[t];if(s.__ppManagedInputMounted)this.resolveDefaultValueBinding(s),s instanceof HTMLInputElement&&this.resolveDefaultCheckedBinding(s);else{const e=this.resolveDefaultValueBinding(s);if(void 0!==e&&this.applyUncontrolledDefaultValue(s,e),s instanceof HTMLInputElement){const e=this.resolveDefaultCheckedBinding(s);void 0!==e&&this.applyUncontrolledDefaultChecked(s,e)}}s.__ppManagedInputMounted=!0}}bindUncontrolledFormResets(){const e=this.collectManagedInputs(),t=new Set;for(let s=0;s<e.length;s++){const i=e[s],n=i.closest("form");n instanceof HTMLFormElement&&this.isUncontrolledResetManagedElement(i)&&(t.add(n),this.registerResetHandler(n))}for(const e of this.registeredResetForms)t.has(e)||this.unregisterResetHandler(e);this.registeredResetForms=t}registerResetHandler(e){const t=e;if(t.__ppResetCallbacks||(t.__ppResetCallbacks=new Map),t.__ppResetCallbacks.set(this.id,()=>{this.restoreUncontrolledFormDefaults(e)}),t.__ppOriginalReset)return;t.__ppOriginalReset=e.reset;const s=this.id;e.reset=function(){var e,i;null==(e=t.__ppOriginalReset)||e.call(this),null==(i=t.__ppResetCallbacks)||i.forEach((e,i)=>{var n;C.getInstance(i)||i===s?e():null==(n=t.__ppResetCallbacks)||n.delete(i)})}}unregisterResetHandler(e){var t;const s=e;null==(t=s.__ppResetCallbacks)||t.delete(this.id),!(s.__ppResetCallbacks&&s.__ppResetCallbacks.size>0)&&(s.__ppOriginalReset&&(e.reset=s.__ppOriginalReset,delete s.__ppOriginalReset),delete s.__ppResetCallbacks)}restoreUncontrolledFormDefaults(e){const t=this.collectManagedInputs();for(let s=0;s<t.length;s++){const i=t[s],n=i;if(i.closest("form")===e){if(i instanceof HTMLSelectElement){this.restoreUncontrolledSelectState(i);continue}(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)&&n.__ppHasUncontrolledDefaultValue&&(i.value=i.defaultValue),i instanceof HTMLInputElement&&n.__ppHasUncontrolledDefaultChecked&&(i.checked=i.defaultChecked)}}}restoreUncontrolledSelectState(e){const t=Array.from(e.options);if(e.multiple)return void t.forEach(e=>{e.selected=e.defaultSelected});const s=t.find(e=>e.defaultSelected);s?e.value=s.value:t.length>0&&(e.selectedIndex=0)}isUncontrolledResetManagedElement(e){const t=e;return!(!t.__ppHasUncontrolledDefaultValue&&!t.__ppHasUncontrolledDefaultChecked)||e instanceof HTMLSelectElement&&Array.from(e.options).some(e=>e.defaultSelected)}resolveDefaultValueBinding(e){const t=e.getAttribute("data-pp-default-value");if(t){if(e.removeAttribute("data-pp-default-value"),e.__ppDefaultValueCaptureId=t,this.__ppDefaultValueStore.has(t))return this.__ppDefaultValueStore.get(t)}else if(e.__ppDefaultValueCaptureId){if(this.__ppDefaultValueStore.has(e.__ppDefaultValueCaptureId))return this.__ppDefaultValueStore.get(e.__ppDefaultValueCaptureId);delete e.__ppDefaultValueCaptureId}if(e.hasAttribute("defaultvalue"))return e.getAttribute("defaultvalue")}resolveDefaultCheckedBinding(e){const t=e.getAttribute("data-pp-default-checked");if(t){if(e.removeAttribute("data-pp-default-checked"),e.__ppDefaultCheckedCaptureId=t,this.__ppDefaultCheckedStore.has(t))return this.__ppDefaultCheckedStore.get(t)}else if(e.__ppDefaultCheckedCaptureId){if(this.__ppDefaultCheckedStore.has(e.__ppDefaultCheckedCaptureId))return this.__ppDefaultCheckedStore.get(e.__ppDefaultCheckedCaptureId);delete e.__ppDefaultCheckedCaptureId}if(e.hasAttribute("defaultchecked"))return e.getAttribute("defaultchecked")}applyUncontrolledDefaultValue(e,t){if(e instanceof HTMLSelectElement)return void this.applyUncontrolledDefaultSelectValue(e,t);const s=null==t?"":String(t);e.defaultValue!==s&&(e.defaultValue=s),e.value!==s&&(e.value=s),e.__ppHasUncontrolledDefaultValue=!0}applyUncontrolledDefaultSelectValue(e,t){const s=this.normalizeControlledSelectValues(t),i=e.multiple?new Set(s):new Set(s.length>0?[s[0]]:[]);for(let t=0;t<e.options.length;t++){const s=e.options[t],n=s,r=i.has(s.value);s.defaultSelected!==r&&(s.defaultSelected=r),s.selected!==r&&(s.selected=r),r?n.__ppHasUncontrolledDefaultSelected=!0:delete n.__ppHasUncontrolledDefaultSelected}if(!e.multiple){const t=s.length>0?s[0]:"";e.value!==t&&(e.value=t)}}applyUncontrolledDefaultChecked(e,t){const s=this.normalizeDefaultCheckedValue(t);e.defaultChecked!==s&&(e.defaultChecked=s),e.checked!==s&&(e.checked=s),e.__ppHasUncontrolledDefaultChecked=!0}normalizeDefaultCheckedValue(e){if("string"==typeof e){const t=e.trim().toLowerCase();if(""===t||"true"===t)return!0;if("false"===t||"0"===t||"off"===t||"no"===t)return!1}return!!e}applyControlledSelectValue(e,t){if(e.multiple){const s=new Set(this.normalizeControlledSelectValues(t));for(let t=0;t<e.options.length;t++){const i=e.options[t],n=s.has(i.value);i.selected!==n&&(i.selected=n)}return}const s=null==t?"":String(t);e.value!==s&&(e.value=s)}normalizeControlledSelectValues(e){return null==e?[]:Array.isArray(e)?e.filter(e=>null!=e).map(e=>String(e)):[String(e)]}bootstrapNestedComponents(){const e=new Set,t=new Set,s=(i,n)=>{Array.from(i.children).forEach(i=>{const r=i;if(r.hasAttribute("pp-component"))return void this.bootstrapNestedComponentBoundary(r,n);const a=this.syncContextProviderBoundary(r,n,e,t);s(r,a??n)})};s(this.el,this.id),this.trackedPortals.forEach(({element:e})=>{s(e,this.id)}),this.activeContextProviderBoundaryIds.forEach(s=>{e.has(s)||C.removeContextTracking(s).forEach(e=>t.add(e))}),this.activeContextProviderBoundaryIds=e,t.size>0&&this.refreshContextConsumers(t)}bootstrapNestedComponentBoundary(t,s){const i=this.ensureBoundaryIdentity(t);if(!i)return;if(t.__ppRawBindings){const e=t.__ppRawBindings;for(const[s,i]of Object.entries(e))t.setAttribute(s,i)}else{const e={};for(const s of Array.from(t.attributes))s.value.includes("{")&&"pp-component"!==s.name&&!s.name.startsWith("on")&&(e[s.name]=s.value);t.__ppRawBindings=e}const n=C.getResolvedScopeWithAncestors(s,this.id)??this.latestScope;this.applyAttributeInterpolations(t,n);const r=C.getInstance(i);if(null!=r&&r.refreshPropsFromParent){const e=r.parentId!==s;return r.parentId=s,C.saveParent(i,s),r.el!==t&&(!t.__ppRawBindings&&r.el.__ppRawBindings&&(t.__ppRawBindings=r.el.__ppRawBindings),r.el=t),void r.refreshPropsFromParent(e)}if(!C.getState(i)){t.__ppRuntimeParentId=s;try{new e(t)}finally{delete t.__ppRuntimeParentId}}}syncContextProviderBoundary(e,t,s,i){if("pp-context-provider"!==e.tagName.toLowerCase())return null;const n=this.resolveContextProviderBoundary(e);if(!n)return null;s.add(n.boundaryId),C.saveParent(n.boundaryId,t);const r=C.saveContextValues(n.boundaryId,new Map([[n.context,n.value]]));return r.length>0&&C.getConsumersForContextsInSubtree(n.boundaryId,r).forEach(e=>i.add(e)),n.boundaryId}resolveContextProviderBoundary(e){const t=e,s=e.getAttribute("data-pp-context-token")??t.__ppContextTokenCaptureId??null,i=e.getAttribute("data-pp-context-value")??t.__ppContextValueCaptureId??null;if(!s||!i)return null;t.__ppContextTokenCaptureId=s,t.__ppContextValueCaptureId=i,e.removeAttribute("data-pp-context-token"),e.removeAttribute("data-pp-context-value");const n=this.__ppContextTokenStore.get(s);return n?{boundaryId:this.ensureContextProviderBoundaryId(t),context:n,value:this.__ppContextValueStore.get(i)}:null}ensureContextProviderBoundaryId(e){return e.__ppContextBoundaryId||(e.__ppContextBoundaryId=`ppctx_${this.id}_${Math.random().toString(36).slice(2,10)}`),e.__ppContextBoundaryId}saveFocusState(){const e=document.activeElement;if(!e)return null;const t=this.el.contains(e),s=!t&&Array.from(this.trackedPortals.values()).some(t=>t.element.contains(e));if(!t&&!s)return null;const i=this.collectManagedInputs().indexOf(e);if(-1===i)return null;const n=this.getTextSelectionState(e);return{element:e,index:i,selectionStart:n.selectionStart,selectionEnd:n.selectionEnd}}isTextSelectionControl(e){return e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&["text","search","url","tel","password"].includes(e.type)}getTextSelectionState(e){if(!this.isTextSelectionControl(e))return{selectionStart:null,selectionEnd:null};try{return{selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}}catch{return{selectionStart:null,selectionEnd:null}}}restoreFocusState(e){if(!e)return;const t=e.element,s=t&&t.isConnected&&(this.el.contains(t)||Array.from(this.trackedPortals.values()).some(e=>e.element.contains(t)))?t:this.collectManagedInputs()[e.index];if(s&&(s.focus(),null!==e.selectionStart&&null!==e.selectionEnd&&this.isTextSelectionControl(s)))try{s.setSelectionRange(e.selectionStart,e.selectionEnd)}catch(e){console.warn("Could not restore cursor position",e)}}forceUpdate(){this.lastRenderedHtml="",this.render()}destroy(){for(const e of this.registeredResetForms)this.unregisterResetHandler(e);this.registeredResetForms.clear(),this.hooksSystem.dispose(),this.clearAllRefBindings();for(const[,e]of this.trackedPortals)e.element.parentNode&&e.element.remove(),e.placeholder.parentNode&&e.placeholder.remove();this.trackedPortals.clear(),this.activeContextProviderBoundaryIds.forEach(e=>{C.removeContextTracking(e)}),this.activeContextProviderBoundaryIds.clear();const e=C.removeContextTracking(this.id);this.eventManager.clearCache(),C.removeState(this.id),C.removeScope(this.id),C.removeInstance(this.id),e.forEach(e=>{var t;const s=C.getInstance(e);null==(t=null==s?void 0:s.requestContextRefresh)||t.call(s)})}};m(V,"nestedBoundarySequence",0),m(V,"perfEnabled",!1),m(V,"perfStats",new Map);let le=V;const Et={bootstrap:()=>{Array.from(document.querySelectorAll("[pp-component]")).filter(e=>{var t;return!(null!=(t=e.parentElement)&&t.closest("[pp-component]"))}).forEach(e=>{new le(e)})}},xe=class e{constructor(){m(this,"activeAbortController",null),m(this,"navigationEnabled",!1),m(this,"boundHandleLinkClick",null),m(this,"boundHandlePopState",null),m(this,"isNavigating",!1),m(this,"loadedDynamicScripts",new Set),m(this,"RESET_SCROLL_ATTR","pp-reset-scroll"),m(this,"mounted",!1)}mount(){this.mounted||(this.mounted=!0,this.disableTransitions(),Et.bootstrap(),this.restoreBodyAccessibility(),this.enableTransitions(),this.enableSPANavigation())}createComponentRuntime(t){const s={};for(const t of e.PUBLIC_METHODS){const e=this[t];"function"==typeof e?s[t]=e.bind(this):void 0!==e&&(s[t]=e)}return Object.assign({},s,t)}createContext(e){return ps(e)}enablePerf(){le.setPerfEnabled(!0)}disablePerf(){le.setPerfEnabled(!1)}getPerfStats(){return le.getPerfStats()}resetPerfStats(){le.resetPerfStats()}getCsrfToken(){const e=document.cookie.match(/(?:^|;\s*)prisma_php_csrf=([^;]*)/);return e?decodeURIComponent(e[1]):""}resolveRpcUrl(e){const t=window.location.pathname.replace(/\/+$/,"")||"/";return new URL(e??t,window.location.origin)}resolveRpcCredentials(e,t){return t||(e.origin===window.location.origin?"same-origin":"include")}async ensureCsrfToken(e,t,s){let i=this.getCsrfToken();if(""!==i||"omit"===t)return i;const n=new URL(s??e.toString(),window.location.origin);return await fetch(n.toString(),{method:"GET",credentials:t,cache:"no-store",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/html, application/json, */*"}}),i=this.getCsrfToken(),i}disableTransitions(){const e=document.createElement("style");e.id="pp-disable-transitions",e.textContent="\n *, *::before, *::after {\n transition: none !important;\n animation: none !important;\n }\n ",document.head.insertBefore(e,document.head.firstChild)}enableTransitions(){const e=document.getElementById("pp-disable-transitions");e&&e.remove()}restoreBodyAccessibility(){document.body.style.transition="",document.body.style.opacity="1",document.body.style.pointerEvents="auto",document.body.style.userSelect="auto",document.body.removeAttribute("inert"),document.body.setAttribute("aria-busy","false")}static resetInstance(){this.instance&&(this.instance.navigationEnabled&&this.instance.disableSPANavigation(),this.instance.activeAbortController&&(this.instance.activeAbortController.abort(),this.instance.activeAbortController=null),this.instance=null)}static getInstance(){return this.instance||(this.instance=new e),this.instance}enableSPANavigation(){this.navigationEnabled||"true"!==document.body.getAttribute("pp-spa")||(this.navigationEnabled=!0,this.boundHandleLinkClick=this.handleLinkClick.bind(this),this.boundHandlePopState=this.handlePopState.bind(this),document.addEventListener("click",this.boundHandleLinkClick),window.addEventListener("popstate",this.boundHandlePopState))}disableSPANavigation(){this.navigationEnabled=!1,this.boundHandleLinkClick&&(document.removeEventListener("click",this.boundHandleLinkClick),this.boundHandleLinkClick=null),this.boundHandlePopState&&(window.removeEventListener("popstate",this.boundHandlePopState),this.boundHandlePopState=null)}handleLinkClick(e){if(!this.navigationEnabled)return;const t=this.getNavigationTarget(e.target);if(!t)return;const s=t.closest("a");if(s&&s.href)try{const t=new URL(s.href),i=t.origin!==window.location.origin,n=t.pathname===window.location.pathname&&t.search===window.location.search,r="false"===s.getAttribute("pp-spa");if(i||"_blank"===s.target||s.hasAttribute("download")||r||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;if(e.preventDefault(),n){const s=t.hash;if(s){e.preventDefault(),history.pushState(null,"",t.pathname+t.search+s);const i=document.querySelector(s);return void(i&&i.scrollIntoView({behavior:"smooth"}))}}this.navigateTo(t.pathname+t.search+t.hash)}catch(e){console.error("Link click navigation error:",e)}}getNavigationTarget(e){return e instanceof Element?e:e instanceof Node?e.parentElement:null}async handlePopState(){const e=window.location.pathname+window.location.search+window.location.hash;await this.navigateTo(e,!1)}async navigateTo(e,t=!0){this.isNavigating=!0;const s=this.saveScrollPositions();try{this.dispatchNavigationEvent("start",e),await this.showLoadingTransition();const i=await this.fetchPageContent(e);if("hardReload"in i)return void(window.location.href=i.hardReload);if("redirect"in i)return void await this.navigateTo(i.redirect,t);const n=i;this.updateBrowserHistory(e,t);const r=document.getElementById("loading-file-1B87E"),a="startViewTransition"in document,o=this.getResetScrollConfig(n);!r&&a?await this.updatePageContentWithViewTransition(n):await this.updatePageContent(n),this.resetGlobalCaches(),Et.bootstrap(),this.handleScrollRestoration(s,o),await this.handleNavigationCompletion(),this.dispatchNavigationEvent("complete",e)}catch(t){this.handleNavigationError(e,t)}finally{this.isNavigating=!1}}resetGlobalCaches(){C.clear(),W.clearCaches(),ve.clearCache()}getResetScrollConfig(e){if("true"===e.body.getAttribute(this.RESET_SCROLL_ATTR))return{mode:"global",resetElementKeys:new Set,resetWindow:!1};const t=e.querySelectorAll(`[${this.RESET_SCROLL_ATTR}]`),s=new Set;let i=!1;if(t.length>0)for(const e of Array.from(t))if("true"===e.getAttribute(this.RESET_SCROLL_ATTR)){const t=this.getElementKeyFromElement(e);s.add(t),i=!0}return i||s.size>0?{mode:"none",resetElementKeys:s,resetWindow:i}:{mode:"none",resetElementKeys:new Set,resetWindow:!1}}getElementKeyFromElement(e){return e.id?e.id:e.className?e.className:e.tagName}handleScrollRestoration(e,t){requestAnimationFrame(()=>{if("global"===t.mode)return window.scrollTo(0,0),document.documentElement.scrollTop=0,document.documentElement.scrollLeft=0,void document.querySelectorAll("*").forEach(e=>{(e.scrollTop||e.scrollLeft)&&(e.scrollTop=0,e.scrollLeft=0)});if(t.resetWindow)window.scrollTo(0,0),document.documentElement.scrollTop=0,document.documentElement.scrollLeft=0;else{const t=e.window;t&&window.scrollTo(t.scrollLeft,t.scrollTop)}document.querySelectorAll("*").forEach(s=>{const i=s.tagName.toLowerCase();if(t.resetWindow&&("html"===i||"body"===i))return;const n=this.getElementKey(s);t.resetElementKeys.has(n)?(s.scrollTop=0,s.scrollLeft=0):e[n]&&(s.scrollTop=e[n].scrollTop,s.scrollLeft=e[n].scrollLeft)})})}saveScrollPositions(){const e={window:{scrollTop:window.scrollY||document.documentElement.scrollTop,scrollLeft:window.scrollX||document.documentElement.scrollLeft}};return document.querySelectorAll("*").forEach(t=>{(t.scrollTop||t.scrollLeft)&&(e[this.getElementKey(t)]={scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})}),e}getElementKey(e){return e.id||e.className||e.tagName}teardownCurrentPageComponents(){C.destroyAll()}async updatePageContentWithViewTransition(e){e.title&&(document.title=e.title),await this.reconcileHead(e);const t=e.body.innerHTML;if(this.syncBodyAttributes(e.body),this.teardownCurrentPageComponents(),this.isNavigating||!document.startViewTransition)return void(document.body.innerHTML=t);const s=document.startViewTransition(()=>{document.body.innerHTML=t});try{await s.finished}catch(e){console.warn("View transition failed, continuing anyway:",e)}}dispatchNavigationEvent(e,t,s){const i=`pp:navigation:${e}`,n=s?{url:t,error:s}:{url:t};document.dispatchEvent(new CustomEvent(i,{detail:n}))}async showLoadingTransition(){const e=document.getElementById("loading-file-1B87E");if(e){const t=this.findLoadingElement(e,window.location.pathname);if(t)return void await this.updateContentWithTransition(t)}const t=document.querySelector("[pp-loading-content='true']")||document.body;t&&!("startViewTransition"in document)&&await this.fadeOut(t,250)}async fetchPageContent(e){const t=new URL(e,window.location.origin).hash,s=await fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest","X-PP-Navigation":"true",Accept:"text/html"}});if(!s.ok)throw new Error(`Navigation failed: ${s.status} ${s.statusText}`);const i=s.headers.get("X-PP-Root-Layout"),n=document.querySelector('meta[name="pp-root-layout"]'),r=n?n.getAttribute("content"):null;if(i&&r&&i!==r)return{hardReload:e};if(s.redirected){const e=new URL(s.url);if(t&&e.searchParams.has("next")){const s=e.searchParams.get("next");s&&!s.includes("#")&&e.searchParams.set("next",s+t)}return{redirect:e.pathname+e.search+e.hash}}const a=this.getRedirectUrlFromResponse(s);if(a)return{redirect:a};const o=await s.text();return(new DOMParser).parseFromString(o,"text/html")}getRedirectUrlFromResponse(e){const t=e.headers.get("X-PP-Redirect");if(t)return t;const s=e.headers.get("Location"),i=e.status;return s&&i>=300&&i<400?s:null}updateBrowserHistory(e,t){t&&history.pushState(null,"",e)}async updatePageContent(e){e.title&&(document.title=e.title),await this.reconcileHead(e);const t=e.body;this.syncBodyAttributes(t),this.teardownCurrentPageComponents(),document.body.innerHTML=t.innerHTML}syncBodyAttributes(e){e&&(Array.from(document.body.attributes).forEach(e=>{"style"!==e.name&&document.body.removeAttribute(e.name)}),Array.from(e.attributes).forEach(e=>{"style"!==e.name&&document.body.setAttribute(e.name,e.value)}))}async handleNavigationCompletion(){const e=document.querySelector("[pp-loading-content='true']")||document.body;this.fadeIn(e,150),setTimeout(()=>{this.restoreBodyAccessibility()},50);const t=window.location.hash;t&&requestAnimationFrame(()=>{const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})})}handleNavigationError(e,t){console.error("Navigation error:",t),this.restoreBodyAccessibility(),this.dispatchNavigationEvent("error",e,t),window.location.href=e}findLoadingElement(e,t){let s=t;for(;;){const t=e.querySelector(`div[pp-loading-url='${s}']`);if(t)return t;if("/"===s)break;const i=s.lastIndexOf("/");s=i<=0?"/":s.substring(0,i)}return e.querySelector("div[pp-loading-url='/' ]")}async updateContentWithTransition(e){const t=document.querySelector("[pp-loading-content='true']")||document.body;if(!t)return;const{fadeIn:s,fadeOut:i}=this.parseTransition(e);await this.fadeOut(t,i),t.innerHTML=e.innerHTML,this.fadeIn(t,s)}parseTransition(e){let t=250,s=250;const i=e.querySelector("[pp-loading-transition]"),n=null==i?void 0:i.getAttribute("pp-loading-transition");if(n){let e=JSON.parse(n);e&&"object"==typeof e?(t=this.parseTime(e.fadeIn??t),s=this.parseTime(e.fadeOut??s)):console.warn("pp-loading-transition is not valid JSON → default values (250 ms) will be used. String:",n)}return{fadeIn:t,fadeOut:s}}fadeOut(e,t){return new Promise(s=>{e.style.transition=`opacity ${t}ms ease-out`,setTimeout(()=>{e.style.transition="",s()},t)})}fadeIn(e,t){e.style.transition=`opacity ${t}ms ease-in`,setTimeout(()=>{e.style.transition=""},t)}parseTime(e){if("number"==typeof e)return e;const t=e.match(/^(\d+)(ms|s|m)?$/);if(t){const e=parseInt(t[1],10);switch(t[2]||"ms"){case"ms":default:return e;case"s":return 1e3*e;case"m":return 60*e*1e3}}return 0}async reconcileHead(e){const t="pp-dynamic-script",s="pp-dynamic-link";document.head.querySelectorAll("[pp-dynamic-meta]").forEach(e=>e.remove()),document.head.querySelectorAll(`[${s}]`).forEach(e=>e.remove()),document.head.querySelectorAll(`[${t}]`).forEach(e=>e.remove());const i=[];Array.from(e.head.children).forEach(e=>{var n;switch(e.tagName){case"SCRIPT":{if(!e.hasAttribute(t))break;const s=e.src;if(s&&this.loadedDynamicScripts.has(s))break;const n=document.createElement("script");if(Array.from(e.attributes).forEach(e=>{e.name!==t&&n.setAttribute(e.name,e.value)}),s){const e=new Promise((e,t)=>{n.addEventListener("load",()=>{this.loadedDynamicScripts.add(s),e()}),n.addEventListener("error",()=>{console.error("Failed to load dynamic script:",s),t(new Error(`Failed to load dynamic script: ${s}`))})});i.push(e)}else n.textContent=e.textContent;n.setAttribute(t,"true"),document.head.appendChild(n);break}case"META":{const t=e;if(t.getAttribute("charset")||"viewport"===t.name)break;const s=t.name?`meta[name="${t.name}"]`:`meta[property="${t.getAttribute("property")}"]`,i=t.cloneNode(!0),r=document.head.querySelector(s);r?document.head.replaceChild(i,r):document.head.insertBefore(i,(null==(n=document.head.querySelector("title"))?void 0:n.nextSibling)||null);break}case"TITLE":{const t=e.cloneNode(!0),s=document.head.querySelector("title");s?document.head.replaceChild(t,s):document.head.appendChild(t);break}case"LINK":{const t=e;if("icon"===t.rel){const e=t.cloneNode(!0),s=document.head.querySelector('link[rel="icon"]');s?document.head.replaceChild(e,s):document.head.appendChild(e)}else t.hasAttribute(s)&&document.head.appendChild(t.cloneNode(!0));break}}}),i.length&&await Promise.allSettled(i)}async redirect(e){if(e)try{const t=new URL(e,window.location.origin);t.origin!==window.location.origin?window.location.href=e:this.navigationEnabled?await this.navigateTo(t.pathname+t.search+t.hash):window.location.href=e}catch(e){console.error("Redirect error:",e)}}async fetchFunction(e,t={},s=!1){let i=null;const n="boolean"==typeof s?{abortPrevious:s}:s;try{n.abortPrevious&&this.activeAbortController&&(this.activeAbortController.abort(),this.activeAbortController=null),i=new AbortController,n.abortPrevious&&(this.activeAbortController=i);const s=this.resolveRpcUrl(n.url),r=this.resolveRpcCredentials(s,n.credentials),a={"X-CSRF-Token":await this.ensureCsrfToken(s,r,n.csrfUrl),"X-PP-Function":e,"PP-Wire-Request":"true","X-Requested-With":"XMLHttpRequest",Accept:"application/json, text/event-stream"};let o;if(Object.values(t).some(e=>e instanceof File||e instanceof FileList&&e.length>0)){const e=new FormData;for(const[s,i]of Object.entries(t))i instanceof File?e.append(s,i):i instanceof FileList?Array.from(i).forEach(t=>e.append(s,t)):null!=i&&e.append(s,"object"==typeof i?JSON.stringify(i):String(i));if(n.onUploadProgress)return await this.xhrFunction({url:s.toString(),headers:a,body:e,controller:i,credentials:r,options:n});o={method:"POST",headers:a,body:e,credentials:r,signal:i.signal}}else o={method:"POST",headers:{...a,"Content-Type":"application/json"},body:JSON.stringify(t),credentials:r,signal:i.signal};const c=await fetch(s.toString(),o);if(401===c.status)throw new Error("Authentication required");if(403===c.status)throw new Error("Permission denied");if(!c.ok){const e=await c.json().catch(()=>null);throw e||415!==c.status?new Error((null==e?void 0:e.error)||`Request failed: ${c.status} ${c.statusText}`):new Error("Server rejected data format (415).")}const l=this.getRedirectUrlFromResponse(c);return l?(await this.redirect(l),{redirected:!0,to:l}):(this.activeAbortController===i&&(this.activeAbortController=null),(c.headers.get("Content-Type")||"").includes("text/event-stream")&&c.body?(n.onStream||console.warn("RPC returned a stream, but no onStream handler provided."),void await this.handleStream(c.body,n)):await c.json())}catch(e){if(this.activeAbortController===i&&(this.activeAbortController=null),e instanceof Error&&"AbortError"===e.name)return console.log("Request was cancelled"),{cancelled:!0};if(n.onStreamError)return void n.onStreamError(e);throw console.error("RPC error:",e),e}}xhrFunction(e){const{url:t,headers:s,body:i,controller:n,credentials:r,options:a}=e;return new Promise((e,o)=>{const c=new XMLHttpRequest;c.open("POST",t,!0),c.withCredentials="include"===r;for(const[e,t]of Object.entries(s))c.setRequestHeader(e,t);const l=()=>{try{c.abort()}catch{}};n.signal.addEventListener("abort",l,{once:!0}),c.upload&&a.onUploadProgress&&(c.upload.onprogress=e=>{var t;const s=e.lengthComputable?e.total:null,i=e.lengthComputable&&e.total>0?Math.min(100,Math.max(0,e.loaded/e.total*100)):null;null==(t=a.onUploadProgress)||t.call(a,{loaded:e.loaded,total:s,percent:i})}),c.onerror=()=>{n.signal.removeEventListener("abort",l),o(new Error("Network error (XHR upload)."))},c.onload=async()=>{var t,s;if(n.signal.removeEventListener("abort",l),401===c.status)return o(new Error("Authentication required"));if(403===c.status)return o(new Error("Permission denied"));if(c.status<200||c.status>=300){let e=`Request failed: ${c.status} ${c.statusText}`;try{const t=JSON.parse(c.responseText||"{}");e=(null==t?void 0:t.error)||(null==t?void 0:t.message)||e}catch{}return o(new Error(e))}const i=c.getResponseHeader("X-PP-Redirect")||(c.status>=300&&c.status<400?c.getResponseHeader("Location"):null);if(i)try{return await this.redirect(i),null==(t=a.onUploadComplete)||t.call(a),e({redirected:!0,to:i})}catch(e){return o(e)}const r=c.responseText??"";let h=r;try{h=JSON.parse(r)}catch{}null==(s=a.onUploadComplete)||s.call(a),e(h)};try{c.send(i)}catch(e){n.signal.removeEventListener("abort",l),o(e)}})}async handleStream(e,t){const s=e.getReader(),i=new TextDecoder;let n="";try{for(;;){const{done:e,value:r}=await s.read();if(e){t.onStreamComplete&&t.onStreamComplete();break}n+=i.decode(r,{stream:!0});const a=n.split("\n");n=a.pop()||"";for(const e of a)if(""!==e.trim()&&e.startsWith("data: ")){const s=e.slice(6);let i=s;try{("true"===s||"false"===s||"null"===s||!isNaN(Number(s))||s.startsWith("{")||s.startsWith("[")||s.startsWith('"'))&&(i=JSON.parse(s))}catch{}t.onStream&&t.onStream(i)}}}catch(e){if(!t.onStreamError)throw e;t.onStreamError(e)}finally{s.releaseLock()}}};m(xe,"instance",null),m(xe,"PUBLIC_METHODS",["createContext","mount","redirect","fetchFunction","enablePerf","disablePerf","getPerfStats","resetPerfStats"]);let nt=xe;function ds(e,t,s=(typeof window<"u"?window:globalThis),i=!0){let n=null;if(Object.defineProperty(s,e,{get(){if(null!==n)return n;if(t&&"object"==typeof t&&!Array.isArray(t)&&"getInstance"in t&&"function"==typeof t.getInstance)return n=t.getInstance(),n;if("function"!=typeof t)return n=t,n;try{return n=t.getInstance(),n}catch{return n=t,n}},set(t){null===t?n=null:console.warn(`Cannot override global ${e}`)},configurable:!0,enumerable:!0}),i)try{s[e]}catch(t){console.error(`Failed to initialize ${e}:`,t)}}ds("pp",{getInstance:()=>nt.getInstance()});export{Et as ComponentInit,nt as PPUtilities};