taggedjs 2.7.7 → 2.7.9
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.
- package/bundle.js +1 -1
- package/bundle.js.map +1 -1
- package/js/interpolations/attributes/isSpecialAttribute.function.d.ts +1 -1
- package/js/interpolations/attributes/isSpecialAttribute.function.js +3 -0
- package/js/interpolations/attributes/isSpecialAttribute.function.js.map +1 -1
- package/js/interpolations/attributes/processAttribute.function.d.ts +8 -6
- package/js/interpolations/attributes/processAttribute.function.js +27 -25
- package/js/interpolations/attributes/processAttribute.function.js.map +1 -1
- package/js/interpolations/attributes/processNameValueAttribute.function.d.ts +3 -2
- package/js/interpolations/attributes/processNameValueAttribute.function.js +7 -6
- package/js/interpolations/attributes/processNameValueAttribute.function.js.map +1 -1
- package/js/interpolations/attributes/specialAttribute.d.ts +3 -1
- package/js/interpolations/attributes/specialAttribute.js +25 -6
- package/js/interpolations/attributes/specialAttribute.js.map +1 -1
- package/js/interpolations/index.d.ts +1 -0
- package/js/interpolations/index.js.map +1 -1
- package/js/interpolations/interpolateTemplate.d.ts +0 -3
- package/js/interpolations/optimizers/attachDomElements.function.js +5 -6
- package/js/interpolations/optimizers/attachDomElements.function.js.map +1 -1
- package/js/state/callbackStateUpdate.function.js +0 -1
- package/js/state/callbackStateUpdate.function.js.map +1 -1
- package/js/state/handleProviderChanges.function.d.ts +1 -2
- package/js/state/handleProviderChanges.function.js.map +1 -1
- package/js/subject/index.d.ts +1 -0
- package/js/subject/index.js +1 -0
- package/js/subject/index.js.map +1 -1
- package/js/subject/signal.function.d.ts +9 -0
- package/js/subject/signal.function.js +26 -0
- package/js/subject/signal.function.js.map +1 -0
- package/js/tag/BaseSupport.type.d.ts +0 -4
- package/js/tag/Support.class.d.ts +11 -6
- package/js/tag/Support.class.js +10 -11
- package/js/tag/Support.class.js.map +1 -1
- package/js/tag/TemplaterResult.class.d.ts +1 -0
- package/js/tag/TemplaterResult.class.js.map +1 -1
- package/js/tag/buildBeforeElement.function.d.ts +2 -2
- package/js/tag/buildBeforeElement.function.js +4 -6
- package/js/tag/buildBeforeElement.function.js.map +1 -1
- package/js/tag/checkDestroyPrevious.function.js +2 -2
- package/js/tag/checkDestroyPrevious.function.js.map +1 -1
- package/js/tag/destroySupport.function.d.ts +1 -1
- package/js/tag/destroySupport.function.js +4 -9
- package/js/tag/destroySupport.function.js.map +1 -1
- package/js/tag/elementDestroyCheck.function.d.ts +5 -3
- package/js/tag/elementDestroyCheck.function.js +1 -1
- package/js/tag/elementDestroyCheck.function.js.map +1 -1
- package/js/tag/getSupport.function.d.ts +6 -0
- package/js/tag/getSupport.function.js +8 -0
- package/js/tag/getSupport.function.js.map +1 -0
- package/js/tag/getTagWrap.function.js +1 -1
- package/js/tag/getTagWrap.function.js.map +1 -1
- package/js/tag/processUpdateAttrContext.function.js +4 -2
- package/js/tag/processUpdateAttrContext.function.js.map +1 -1
- package/js/tag/render/renderExistingTag.function.js +2 -1
- package/js/tag/render/renderExistingTag.function.js.map +1 -1
- package/js/tag/render/renderTagOnly.function.js +1 -1
- package/js/tag/render/renderTagOnly.function.js.map +1 -1
- package/js/tag/render/softDestroySupport.function.js +2 -2
- package/js/tag/render/softDestroySupport.function.js.map +1 -1
- package/js/tag/runElementDestroyCall.function.d.ts +5 -0
- package/js/tag/runElementDestroyCall.function.js +14 -0
- package/js/tag/runElementDestroyCall.function.js.map +1 -0
- package/js/tag/smartRemoveKids.function.d.ts +1 -1
- package/js/tag/smartRemoveKids.function.js +50 -41
- package/js/tag/smartRemoveKids.function.js.map +1 -1
- package/js/tag/tagElement.js +6 -4
- package/js/tag/tagElement.js.map +1 -1
- package/js/tag/tagRunner.js +3 -0
- package/js/tag/tagRunner.js.map +1 -1
- package/js/tag/update/processFirstSubjectComponent.function.js +1 -1
- package/js/tag/update/processFirstSubjectComponent.function.js.map +1 -1
- package/js/tag/update/processFirstSubjectValue.function.js +5 -5
- package/js/tag/update/processFirstSubjectValue.function.js.map +1 -1
- package/js/tag/update/processNewSubjectTag.function.d.ts +2 -1
- package/js/tag/update/processNewSubjectTag.function.js +2 -2
- package/js/tag/update/processNewSubjectTag.function.js.map +1 -1
- package/js/tag/update/processNewValue.function.js +1 -1
- package/js/tag/update/processNewValue.function.js.map +1 -1
- package/js/tag/update/processTag.function.d.ts +3 -1
- package/js/tag/update/processTag.function.js +3 -2
- package/js/tag/update/processTag.function.js.map +1 -1
- package/js/tag/update/processTagArray.js +1 -1
- package/js/tag/update/processTagArray.js.map +1 -1
- package/js/tag/update/processTagResult.function.js +3 -4
- package/js/tag/update/processTagResult.function.js.map +1 -1
- package/js/tag/update/updateExistingTagComponent.function.js +1 -1
- package/js/tag/update/updateExistingTagComponent.function.js.map +1 -1
- package/js/tag/update/updateExistingValue.function.js +4 -3
- package/js/tag/update/updateExistingValue.function.js.map +1 -1
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function n(t){return t.renderCount=0,t.global={}}t.d(e,{W9:()=>q,cg:()=>c,m0:()=>s,rS:()=>yt,Y2:()=>r,ei:()=>Q,B7:()=>v,TU:()=>w,XF:()=>Y,PC:()=>X,Ot:()=>S,Mj:()=>j,tD:()=>a,j8:()=>ue,um:()=>ae,E2:()=>Ye,OH:()=>tn,TB:()=>Ee,Ii:()=>Pe,yV:()=>Ve,zV:()=>b,ze:()=>Ke,WJ:()=>C,aZ:()=>Oe,O:()=>Ce,Ie:()=>o,B4:()=>at,Az:()=>Wn,Xi:()=>ln,pc:()=>it,Ah:()=>n,ck:()=>un,k6:()=>ut,Gk:()=>rt,cF:()=>Ln,PB:()=>Mt,qy:()=>Nn,cy:()=>h,Tn:()=>g,Gv:()=>d,yL:()=>f,D8:()=>u,Ze:()=>i,_4:()=>p,mn:()=>l,Eb:()=>bt,z:()=>G,bc:()=>z,sA:()=>rn,MG:()=>nn,PL:()=>Je,nI:()=>Rt,PZ:()=>Me,N_:()=>De,r5:()=>Z,uc:()=>Xe,pG:()=>Ie,QB:()=>ze,R6:()=>Mn,Ll:()=>D,wk:()=>O,xP:()=>on,uz:()=>F,ag:()=>en,Tc:()=>vt,Hf:()=>In,_A:()=>ot,NU:()=>cn,hW:()=>an,wB:()=>$,id:()=>k,MC:()=>T,zC:()=>A});class r{get(t){return"todo"}}const o="";var s,c;!function(t){t.string="string",t.number="number",t.boolean="boolean",t[void 0]="undefined"}(s||(s={})),function(t){t.function="function",t.date="date",t.unknown="unknown",t.object="object"}(c||(c={}));const a={tag:["html"],dom:["dom"],templater:["templater"],tagComponent:["tagComponent"],tagArray:["tagArray"],subject:["subject"],tagJsSubject:["tagJsSubject"],renderOnce:["renderOnce"],stateRender:["stateRender"],version:Date.now()};function u(t){switch(t){case s.string:case s.number:case s.boolean:return!0}return!1}function i(t){switch(t?.tagJsType){case a.dom:case a.tag:case a.templater:return!0}return!1}function l(t){const e=t?.tagJsType;return e===a.tagComponent||e===a.stateRender}function p(t){return d(t)&&typeof t.subscribe===c.function}function f(t){return t&&g(t.then)}function g(t){return typeof t===c.function}function d(t){return typeof t===c.object&&null!==t}function h(t){return Array.isArray(t)}function b(t){const e=new v;return e.subscribeWith=e=>{const n=[],r=[],o=(o,s)=>{n[s]=!0,r[s]=o;if(n.length===t.length){for(const t of n)if(!t)return;e(r,c)}},s=[...t],c=s.shift().subscribe((t=>o(t,0))),a=s.map(((t,e)=>t.subscribe((t=>o(t,e+1)))));return c.subscriptions=a,c},e}function m(t,e,n){const r=v.globalSubCount$;v.globalSubCount$.next(r.value+1);const o=function(){o.unsubscribe()};return o.callback=e,o.subscriptions=[],o.unsubscribe=function(){return function(t,e,n){!function(t,e){const n=t.findIndex((t=>t.callback===e));-1!==n&&t.splice(n,1)}(e,n);const r=v.globalSubCount$;v.globalSubCount$.next(r.value-1),t.unsubscribe=()=>t;const o=t.subscriptions;for(const t of o)t.unsubscribe();return t}(o,n,e)},o.add=t=>(o.subscriptions.push(t),o),o.next=t=>{e(t,o)},o}function y(t,e,n){const r=[...e],o=r.shift(),s=t=>{if(r.length)return y(t,r,n);n(t)};let c=s;const a=o(t,{setHandler:t=>c=t,next:s});c(a)}class v{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=m(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{y(t,this.methods,(t=>n(t,e)))}}return n(t)}return this.subscribers.push(e),this.onSubscription&&this.onSubscription(e),e}next(t){this.value=t,this.emit()}set=this.next.bind(this);emit(){const t=this.value,e=this.subscribers;for(const n of e)n.callback(t,n)}toPromise(){return new Promise((t=>{this.subscribe(((e,n)=>{n.unsubscribe(),t(e)}))}))}toCallback(t){const e=this.subscribe(((n,r)=>{const o=r?.unsubscribe;o?o():setTimeout((()=>e.unsubscribe()),0),t(n)}));return this}pipe(...t){const e=new v(this.value);return e.setMethods(t),e.subscribeWith=t=>this.subscribe(t),e.next=t=>this.next(t),e}setMethods(t){this.methods=t}static all(t){return b(t.map((t=>{if(p(t))return t;return new v(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new v(0)}class w extends v{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,C(this)}next(t){this._value=t,this.emit()}emit(){const t=this._value,e=this.subscribers;for(const n of e)n.callback(t,n)}}function C(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}class S extends v{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class j extends v{value;constructor(t){super(t),this.value=t,this._value=t,C(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function k(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function T(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const A=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function x(){const t=D.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function E(t){const e=D.stateConfig;let n=t;if(typeof t===c.function&&(n=t()),typeof n===c.function){const t=n;n=function(...e){return t(...e)},n.original=t}const r={get:function(){return R(r)},defaultValue:n};return e.stateArray.push(r),n}function O(t){return D.stateConfig.handlers.handler(t)}function P(t){const e=D.stateConfig;e.states[e.statesIndex]=t;return e.support.states[e.statesIndex]=t,++e.statesIndex,t(O)}function V(t){const e=D.stateConfig,n=e.support,r=e.statesIndex,o=e.prevSupport,s=o?.states[r],c=[];s((t=>(c.push(t),t)));let a=0;return n.states[e.statesIndex]=t,++e.statesIndex,t((t=>{e.stateArray.push({get:()=>t,defaultValue:t});const n=c[a];return++a,n}))}function J(t,e){e.handlers.handler=E,e.handlers.letHandler=I,e.handlers.statesHandler=P,e.rearray=[],e.stateArray=[],e.states=[],e.statesIndex=0,e.support=t}function W(t,e,n,r){e.rearray=n,e.stateArray=[],e.states=r,e.statesIndex=0,e.handlers.handler=x,e.handlers.letHandler=_,e.handlers.statesHandler=V,e.support=t}class N{}function R(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const e=t(N),[n]=e,[r]=t(n);return[n,r]}(e);return n}function I(t){const e=D.stateConfig,n=typeof t===c.function?t():t,r={get:function(){return R(r)},defaultValue:n};return e.stateArray.push(r),M(n,r)}function _(){const t=D.stateConfig,e=t.rearray[t.stateArray.length],n=R(e),r={get:function(){return R(r)},defaultValue:e.defaultValue};return t.stateArray.push(r),M(n,r)}function M(t,e){return function(n){return e.callback=n,t}}const D={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:E,letHandler:I,statesHandler:P}}};function L(t,e,n,r){for(let n=t.length-1;n>=0;--n){const r=t[n].get(),o=e[n].callback;o&&o(r)}for(let t=r.length-1;t>=0;--t){const e=[],o=t=>(e.push(t),t);r[t](o);let s=0;const c=t=>e[s++];n[t](c)}}const $=(t,e)=>B(t,e),H=t=>t;const B=(t,e,{init:n,before:r,final:o=H}={})=>{const s=O({pastResult:void 0,values:void 0}),c=s.values;if(void 0===c){if(r&&!r(t))return s.values=t,s.pastResult;const a=(n||e)(t,c);return s.pastResult=o(a),s.values=t,s.pastResult}if(t.every(((t,e)=>t===c[e])))return s.pastResult;if(r&&!r(t))return s.values=t,s.pastResult;const a=e(t,c);return s.pastResult=o(a),c.length=0,c.push(...t),s.pastResult};function U(t,e){return Object.defineProperty(e,"noInit",{get(){const e=t();return e.setup.init=()=>{},e}}),Object.defineProperty(e,"asSubject",{get(){const e=t(),n=O((()=>sn())),r=O((()=>new S(void 0))),o=O((()=>({stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}))),s=(t,s)=>(B(t,((t,e)=>{const c=sn(),a=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;L(t,e.state,o.states,e.states)}r.next(a)}),e.setup),r);return s.setup=e.setup,U((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function F(t,e){const n=O((function(){return{stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}})),r=sn();return O((function(){return new v(t,e).pipe((t=>(L(r.state,n.stateArray,r.states,n.states),t)))}))}function z(t){return D.stateConfig.handlers.letHandler(t)}function G(t){return e=>{let n=z(t)(e);return $([t],(()=>e(n=t))),e(n),n}}U((()=>function(t){const e=(e,n)=>B(e,n,t);return e.setup=t,U((()=>e),e),e}({})),$),F._value=t=>{const e=O((function(){return{stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}})),n=sn();return O((function(){return new S(t).pipe((t=>(L(n.state,e.stateArray,n.states,e.states),t)))}))},F.all=function(t){const e=O((()=>({stateArray:D.stateConfig.stateArray,states:D.stateConfig.states}))),n=sn();return v.all(t).pipe((t=>(L(n.state,e.stateArray,n.states,e.states),t)))};const Z={create:t=>{const e=O((()=>({stateDiff:0,provider:void 0})));if(e.stateDiff){let t=e.stateDiff;for(;t--;)O(void 0);return O(void 0)}const n=O((()=>{const n=D.stateConfig,r=n.stateArray.length,o=t.prototype?new t:t(),s=n.support,c=n.stateArray.length-r,a={constructMethod:t,instance:o,stateDiff:c,owner:s,children:[]};e.provider=a;const u=s.subject.global;return(u.providers=u.providers||[]).push(a),e.stateDiff=c,o})),r=t,o=r.compareTo=r.toString();return e.provider.constructMethod.compareTo=o,n},inject:t=>O((()=>{const e=t,n=e.compareTo=e.compareTo||t.toString(),r=sn(),o=[];let s={ownerSupport:r.ownerSupport};for(;s.ownerSupport;){const t=s.ownerSupport.subject.global.providers;if(!t){s=s.ownerSupport;continue}const e=t.find((t=>{o.push(t);if(t.constructMethod.compareTo===n)return!0}));if(e){const t=r.subject.global;return(t.providers=t.providers||[]).push(e),e.children.push(r),e.instance}s=s.ownerSupport}const c=`Could not inject provider: ${t.name} ${t}`;throw console.warn(`${c}. Available providers`,o),new Error(c)}))};class X extends Error{details;constructor(t,e,n={}){super(t),this.name=X.name,this.details={...n,errorCode:e}}}class q extends X{constructor(t,e){super(t,"array-no-key-error",e),this.name=q.name}}class Q extends X{constructor(t,e){super(t,"state-mismatch-error",e),this.name=Q.name}}class Y extends X{constructor(t,e){super(t,"sync-callback-error",e),this.name=Y.name}}function K(t,e){return tt(t,e)}function tt(t,e){if(null===t||typeof t!==c.object)return t;if(e<0)return t;if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);const n=h(t)?[]:Object.create(Object.getPrototypeOf(t));if(h(t))for(let r=0;r<t.length;r++)n[r]=tt(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=tt(t[r],e-1));return n}function et(t,e,n){return nt(t,e,n)}function nt(t,e,n){return!(t!==e&&(r=t,o=e,!g(r)||!g(o)||r.toString()!==o.toString()))||(n<0||typeof t===c.object&&typeof e===c.object&&(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():h(t)&&h(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!nt(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!h(t)&&!h(e)&&function(t,e,n){const r=Object.keys(t),o=Object.keys(e);if(0===r.length&&0===o.length)return!0;if(r.length!==o.length)return!1;for(const s of r){if(!o.includes(s)||!nt(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function rt(t,e){const n={propWatch:t,props:e,tagJsType:a.templater,key:function(t){return n.arrayValue=t,n}};return n}const ot=[];function st(t){return t.map(ct)}function ct(t,e){const n=t,r=t?.tagJsType;if(r)switch(r){case a.stateRender:return;case a.dom:case a.tag:case a.templater:return st(n.values)}return h(t)?st(n):K(t,e)}function at(t,e,n){const r={templater:t,subject:e,castedProps:n,state:[],states:[],appSupport:void 0};r.appSupport=r;const o=e.global;o.blocked=[],o.destroy$=new v;const s=t.props;return s&&(r.propsConfig=function(t,e,n){const r=t.templater;if(r.tagJsType!==a.stateRender){switch(r.propWatch){case yt.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case yt.SHALLOW:return t.propsConfig={latest:e.map((t=>ct(t,kt))),castProps:n}}return t.propsConfig={latest:e.map((t=>ct(t,Tt))),castProps:n}}}(r,s,n)),r}function ut(t,e,n,r,o){const s=at(t,r,o);return s.ownerSupport=e,s.appSupport=n,s}function it(t,e,n,r,o){const s={templater:t,subject:r,castedProps:o,appSupport:void 0};return s.ownerSupport=e,s.appSupport=n,s}function lt(t,e,n){return t.map((t=>function(t,e,n,r){if(i(t)||!t)return t;if(!e)return t;return pt(t,e,n,r)}(t,e.ownerSupport,e,n)))}function pt(t,e,n,r){if(!t)return t;if(t.tagJsType)return t;if(typeof t===c.function)return function(t,e){const n=t.mem;if(n)return t;const r=function(...t){return r.toCall(...t)};return r.original=t,r.mem=t,r.toCall=function(...t){return function(t,e,n){const r=n.subject.global,o=r?.newest||n,s=void 0===sn(),c=t(...e),a=function(){const t=o.subject.global;if(!1===s){if(!0===t.locked)return c}return function(t,e){const n=t.subject,r=Ze(t.templater);if(r){return qe(e,t)}const o=n.global;o.locked=!0,Ge(o.newest,t,e,n),delete o.locked}(o,n),c};if(s)return a();return D.tagClosed$.toCallback(a),c}(r.mem,t,e)},Object.assign(r,t),r}(t,e);if(r===Tt)return t;return gt(t)?t:h(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=pt(s,n,e,r+1),typeof s===c.function){if(s.mem)continue;ft(r+1,o,s,t,e)}}return t}(t,n,e,r):function(t,e,n,r){const o=Object.keys(t);for(const s of o){const o=t[s],a=pt(o,n,e,r+1);if(t[s]===a)continue;const u=Object.getOwnPropertyDescriptor(t,s);if(!(u?.get||u?.set)&&(t[s]=a,typeof a===c.function)){if(o.mem)continue;ft(r+1,s,o,t,e)}}return t}(t,n,e,r)}function ft(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function gt(t){return typeof t!==c.object||!t||t.tagJsType}function dt(t,e,n,r){const o=e.original;let s;t.tagJsType===a.stateRender?s=t():(s=o(...r),typeof s===c.function&&(s=s())),s.templater=t,t.tag=s;const u=D.stateConfig;return n.state=u.stateArray,n.states=u.states,n}function ht(t,e,n){const r=t.propWatch===yt.DEEP?Tt:kt,o=t.props,s=e.propsConfig;let c=s.castProps;const a=n?.propsConfig,u=a?.castProps;u&&(s.castProps=u,c=He(e,n,n.ownerSupport,o,r));return c||lt(o,e,0)}function bt(t){return{set html(e){e.arrayValue=t}}}let mt=0;var yt;function vt(t,e=yt.SHALLOW){const n=function(...r){const o=rt(e,r);o.tagJsType=a.tagComponent;const s=function(t,e){return function(n,r,o){const s=ht(t,n,o),c=n.ownerSupport,a=ut(t,c,n.appSupport,r,s);return dt(t,e,a,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=ot,r.setUse=D,r.ValueTypes=a,r.tagIndex=mt++,ot.push(n),n}function wt(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")}function Ct(t,e){const n=function(t,e,n){const r=Qe(t,e);if(r)return 11;switch(n){case yt.NONE:return 1;case yt.SHALLOW:return jt(t,e);case yt.IMMUTABLE:return St(t,e)}return function(t,e){let n=t,r=e;n=[...t],r=[...e||[]];if(!n.every(((t,e)=>function(t,e,n,r){const o=r[e];if(typeof t===c.object){const e={...t},n={...o||{}},r=Object.entries(e).every((([t,r])=>At(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return At(t,o,(()=>{n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}(e.props,t.propsConfig.latest,t.templater.propWatch);return n}function St(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function jt(t,e){const n=t.length;for(let r=0;r<n;++r){const n=t[r],o=e[r];if(h(n)&&h(o)){if(n===o)continue;return 3}if(typeof n!==c.function||typeof o!==c.function)if(typeof n!==c.object){if(n!==o)return 3.3}else if(typeof e===c.object){const t=Object.entries(n);for(const e of t){if(!xt(e,o))return 3.1}}}return!1}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(yt||(yt={})),vt.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},vt.state=wt,vt.use=wt,vt.route=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},vt.key=bt,vt.app=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},vt.deepPropWatch=vt,vt.immutableProps=function(t){return vt(t,yt.IMMUTABLE)},vt.watchProps=function(t){return vt(t,yt.SHALLOW)},Object.defineProperty(vt,"renderOnce",{set(t){t.tagJsType=a.renderOnce}}),Object.defineProperty(vt,"state",{set(t){t.original={setUse:D,tags:ot},t.tagJsType=a.stateRender}}),Object.defineProperty(vt,"use",{set(t){t.original={setUse:D,tags:ot},t.tagJsType=a.stateRender}});const kt=3,Tt=10;function At(t,e,n){if(typeof t!==c.function)return!!et(t,e,Tt)&&4;if(typeof e!==c.function)return!1;const r=e?.original;r&&(e=r);t.original&&(t=t.original);return t.toString()===e.toString()?(n(),5):(n(),6)}function xt([t,e],n){const r=n[t];return typeof e===c.function&&typeof r===c.function||r===e}let Et=[],Ot=[],Pt=[],Vt=[],Jt=[],Wt=[];const Nt={locks:0};function Rt(){if(!(Nt.locks>0)){++Nt.locks;for(const t of Et){t.parentNode.removeChild(t)}for(const t of Ot)t();for(const[t,e]of Pt)e.textContent=t;for(const t of Vt)t.relative.appendChild(t.element);for(const{element:t,relative:e}of Jt)e.parentNode.insertBefore(t,e);for(const t of Wt)t();Et=[],Ot=[],Vt=[],Jt=[],Wt=[],Pt=[],--Nt.locks}}function It(t,e){const n=document.createTextNode(t);return Jt.push({element:n,relative:e}),n}function _t(t){switch(t){case void 0:case!1:case null:return o}return t}function Mt(t,e,n){Ot.push((()=>{void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}))}function Dt(t,e,n,r){switch(r){case"oninit":case"init":return void Wt.push((()=>{e({target:n,stagger:0})}));case"autofocus":return void Wt.push((()=>n.focus()));case"autoselect":return void Wt.push((()=>n.select()));case"style":{const r=t.split(".");return void Ot.push((()=>n.style[r[1]]=e))}case"class":return void function(t,e,n){const r=t.split(".");if(r.shift(),e){for(const t of r)Ot.push((()=>n.classList.add(t)));return}for(const t of r)Ot.push((()=>n.classList.remove(t)))}(t,e,n)}throw new Error(`Invalid special attribute of ${r}. ${t}`)}function Lt(t,e){const n=function(t,e,n=[]){const r=t.subject;n.push({support:t,renderCount:r.renderCount,provider:e});const o=e.children;for(let t=o.length-1;t>=0;--t){const r=o[t],s=r.subject;n.push({support:r,renderCount:s.renderCount,provider:e})}return n}(t,e);return n}function $t(t,e=[]){const n=t.subject.global,r=Ze(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return $t(o,e);const s=t,c=l(s.templater),u=t.templater.tagJsType,i=o&&u!==a.stateRender&&(!c||function(t,e,n){const r=function(t,e){const n=t.props,r=e.propsConfig,o=r.latest;if(Qe(n,o))return!0;switch(t.propWatch){case yt.IMMUTABLE:return St(n,o);case yt.SHALLOW:return jt(n,o)}return!et(n,o,Tt)}(e,n);if(t&&r)return!0;return!1}(o,s.templater,s)),p=function(t){const e=t.subject.global.providers;if(!e)return[];const n=[];for(const t of e){const e=Lt(t.owner,t);n.push(...e.map((t=>t.support)))}return n}(s);return e.push(...p),i?($t(o,e),c&&e.push(s),e):(e.push(s),e)}function Ht(t){++Nt.locks,t.forEach(Bt),--Nt.locks,Rt()}function Bt(t){const e=t.subject.global;e&&Xe(e.newest)}const Ut="no-data-ever",Ft="promise-no-data-ever";function zt(t,e){const n=e.subject.global,r=function(t,e){if(!0!==n.deleted)return function(t,e,n,r){let o=e;for(;o.ownerSupport&&!l(o.templater);)o=o.ownerSupport;const s=o.subject.global;s.locked=!0;const c=t.apply(n,r);return function(t,e){const n=e.subject.global;return delete n.locked,function(t,e,n){return Ht($t(t)),function(t,e,n){if(f(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return Ft;delete e.subject.global.locked;return Ht($t(e)),Ft}))}return Ut}(e,t,n)}(e,t,n)}(c,o)}(r.tagFunction,r.support,t,e)};return r.tagFunction=t,r.support=e,r}function Gt(t,e,n,r,o){if(o)return Dt(t,e,n,o);r(n,t,e)}function Zt(t,e,n,r){const o=t.appElement;"blur"===e&&(e="focusout");const s="_"+e,c=t.subject.global.events;if(!c[e]){const t=function(t){t.originalStopPropagation=t.stopPropagation,Xt(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function Xt(t,e,n){const r=n[e];if(r){let e=!1;if(t.stopPropagation=function(){e=!0,t.originalStopPropagation.call(t)},r(t),t.defaultPrevented||e)return}const o=n.parentNode;o&&Xt(t,e,o)}function qt(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,Zt(n.appSupport,r,t,o)}function Qt(t){if(t.startsWith("class."))return"class";const e=function(t){switch(t){case"autoselect":return"autoselect";case"autofocus":return"autofocus";case"oninit":case"init":return"oninit"}return!1}(t);return!1!==e||!!t.startsWith("style.")&&"style"}function Yt(t,e,n,r,o,s,a,u){const i=re(e);if(i>=0){const e=t[i],c=ue(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,void Kt(t,e,n,r,o,s)}const l=re(a);if(l>=0){const a=t[l],i={isAttr:!0,element:n,attrName:e,checkValueChange:Pe,withinOwnerElement:!0};s.push(i);return p(i.value)?function(t,e,n,r,o,s){s&&Ot.push((function(){n.removeAttribute(t)}));const c=e.value;if(p(c)){const a=function(c){te(c,t,e,n,r,o,s)},u=c.subscribe(a),i=e.global;(i.subscriptions=i.subscriptions||[]).push(u)}return void te(e.value,t,e,n,r,o,s)}(e,i,n,r,o,u):(function(t,e,n,r,o,s,a){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?a&&"init"===t?Dt(t,e,r,t):ne(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=a,Gt(t,e,r,o,a))}(e,a,i,n,o,r,u),void(i.value=a))}return Gt(e,a,n,o,u)}function Kt(t,e,n,r,s,a){if(!oe(e))if(typeof e!==c.object)0!==e.length&&s(n,e,o);else for(const o in e){Yt(t,o,n,r,s,a,e[o],Qt(o))}}function te(t,e,n,r,o,s,c){return g(t)?function(t,e,n,r,o,s,c){const u=t.templater.wrapper;if((u?.tagJsType||u?.original?.tagJsType)!==a.renderOnce)return ne(c,e,t,r,n);return ee(e,n,r,o,s,t)}(o,t,r,e,c,s,n):ee(t,r,e,c,s,o)}function ee(t,e,n,r,o,s){if(g(t))return qt(e,t,s,n);if(r)Dt(n,t,e,r);else{switch(t){case void 0:case!1:case null:return void Ot.push((function(){e.removeAttribute(n)}))}o(e,n,t)}}function ne(t,e,n,r,o){const s=t.value;return s&&s.tagFunction&&s.support?(s.tagFunction=e,s.support=n,s):qt(o,e=zt(e,n),n,r)}function re(t){return d(t)&&"tagJsVar"in t?t.tagJsVar:-1}function oe(t){return null==t||!1===t}function se(t,e,n,r,o,s,c,a,u=[]){const i=document.createElement("div"),l=[];for(const p of t){const t={};l.push(t);const f=p.v;if(!isNaN(f)){ce(e,o,c,n,u,r,s);continue}if("text"===p.nn){const n=t,r=n.tc=p.tc;i.innerHTML=r;const s=n.domElement=document.createTextNode(i.innerText);s.id=`tp_${o.length}_${e.length}`,c?Vt.push({element:s,relative:c}):Jt.push({element:s,relative:a});continue}const g=t.domElement=document.createElement(p.nn);p.at&&p.at.map((t=>{const r=t[0],s=t[1],c=t[2];Yt(e,r,g,n,Mt,o,s,c)})),c?Vt.push({element:g,relative:c}):Jt.push({element:g,relative:a}),p.ch&&(t.ch=se(p.ch,e,n,r,o,s+1,g,a,u).dom)}return{subs:u,dom:l,context:o}}function ce(t,e,n,r,s,c,a){const u=t[e.length],i=document.createTextNode(o);i.id=`dvp_${e.length}_${t.length}`;const l=ue(u,e,a>0);if(l.placeholder=i,n?Vt.push({relative:n,element:i}):Jt.push({element:i,relative:r.subject.placeholder}),p(u))return void s.push({insertBefore:i,appendTo:n,subject:u,support:r,counts:c,contextItem:l});r.subject.global.locked=!0,Me(u,l,r,c,`rvp_${e.length}_${t.length}`,n);delete r.subject.global.locked,l.value=u}function ae(t,e,n,r){const o=t.subject.global;o.oldest=t,o.newest=t,++Nt.locks;const s=function(t,e={counts:{added:0,removed:0}},n,r){const o=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===a.dom)return n.dom;return Wn(n.strings,n.values)}(t),s=t.templater.tag,c=s.values,u=[],i=t.subject.global;i.context=u;const l=se(o,c,t,e.counts,u,0,n,r);return l}(t,r,e,n);return o.htmlDomMeta=s.dom,--Nt.locks,s}function ue(t,e,n){const r={value:t,checkValueChange:Pe,withinOwnerElement:n};return e.push(r),r}function ie(t,e){const n=e.global.newest;n.ownerSupport=t,e.checkValueChange=Ve;const r=ae(n,void 0,e.placeholder,{counts:{added:0,removed:0}});for(const t of r.subs)Le(t);return n}function le(){return{tagJsType:a.templater}}function pe(t,e,n){const r=it(t,e,e.appSupport,n);return n.global.context=[],r}function fe(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,a){if(n){if(oe(e))return void r.removeAttribute(n);if(typeof n===c.object)if(typeof e===c.object)for(const t in n)t in e||Ot.push((function(){r.removeAttribute(t)}));else for(const t in n)Ot.push((function(){r.removeAttribute(t)}))}Kt(t,e,r,o,s,a)}(t,e,n.value,n.element,r,n.howToSet,[]),void(n.value=e);const o=n.element;te(e,n.attrName,n,o,r,n.howToSet,n.isSpecial),n.value=e}function ge(t,e,n,r){const o=t[e],s=n[e];if(!p(o)){if(s.isAttr){if(o===s.value)return;fe(t,o,s,r),s.value=o}he(s,o,r),s.value=o}}function de(t,e){const n=t.subject.global.context;!function(t,e){const n=e.templater.tag||e.templater,r=e.templater.values||n.values,o=t.templater.tag;o.values=r}(t,e),++Nt.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length;for(;r<o;)ge(n,r,e,t),++r}(t,n),--Nt.locks,Rt()}function he(t,e,r){if(e===t.value)return;const o=t.checkValueChange(e,t);if(-1===o)return;const s=e&&e.tagJsType;if(s){if(s===a.renderOnce)return;if(l(e))return t.global||n(t),void function(t,e,r){const o=e.global;if(!o.newest)return void $e(t,e,r,{added:0,removed:0});const s=ut(t,r,r.appSupport,e);!function(t,e,r){const o=r.global,s=o.newest,c=s.templater.wrapper,u=e.templater.wrapper;let i=!1;const l=e.templater.tagJsType,p=a.stateRender===l||a.renderOnce===l;if(p)i=e.templater.tagJsType===a.renderOnce||xe(s,e);else if(c&&u){i=c.original===u.original}const f=e.templater;if(!i)return void function(t,e,r){const o=t.global,s=o.oldest;Ce(s,0),n(t);const c=$e(e,t,r,{added:0,removed:0})}(r,f,t);const g=p||Ct(s,f);if(!g){return void function(t,e,n,r,o){const s=t.props,c=He(e,n,r,s,o),a=e.propsConfig;a.castProps=c;const u=n.propsConfig;u.latest=a.latest}(f,e,s,t,f.propWatch===yt.DEEP?Tt:kt)}if(o.locked)return void o.blocked.push(e);Xe(e)}(r,s,e)}(e,t,r)}const u=t.global;if(u){const n=u.newest;if(n)return void function(t,e,n,r){if(typeof n===c.function)return;!function(t,e,n,r){const o=n.templater||n,s=ut(o,r,r.appSupport,e),c=t.subject.global;de(c.oldest,s)}(t,e,n,r)}(n,t,e,r)}if(s)switch(s){case a.templater:return void ie(r,t);case a.tag:case a.dom:{const o=e;let s=o.templater;s||(s=le(),o.templater=s,s.tag=o);return(t.global?t.global:n(t)).newest=pe(s,r,t),void ie(r,t)}}h(e)?Se(t,e,r,{added:0,removed:0}):typeof e!==c.function?o&&function(t,e){e.checkValueChange=Pe;const n=e.placeholder,r=_t(t);e.simpleValueElm=It(r,n)}(e,t):t.value=e}function be(t,e,r){r.checkValueChange=Ve;const o=t;let s=o.templater;s||(s=rt(yt.DEEP),s.tag=o,o.templater=s);const c=r.global=n(r),a=c.newest=ut(s,e,e.appSupport,r);return c.oldest=a,r}function me(t){const e=t.subject.global,n=e.providers;if(n)for(const t of n)for(let n=t.children.length-1;n>=0;--n){t.children[n].subject.global===e&&t.children.splice(n,1)}t.subject.renderCount=0}function ye(t){for(const e of t){const t=e.lastArray;if(t){ye(t);continue}const n=e.global;if(!n)continue;const r=n.newest,o=n.subscriptions;o&&o.forEach((t=>t.unsubscribe())),l(r.templater)&&me(r);ye(n.context)}}function ve(t,e=[],n=[]){for(const r of t){const t=r.global;if(!t)continue;const o=t.newest;if(o){e.push(o);const r=t.subscriptions;r&&n.push(...r)}const s=t.context;s&&ve(s,e,n)}return{tags:e,subs:n}}function we(t,e,n){const r=n,o=t.subject.global,s=o.htmlDomMeta,c=o.context;o.deleted=!0;for(const t of c){if(t.withinOwnerElement)continue;const r=t.lastArray;if(r){Oe(t,r);continue}const o=t.simpleValueElm;if(o){delete t.simpleValueElm,Et.push(o);continue}const s=t.global;if(void 0===s)continue;if(!0===s.deleted)continue;s.deleted=!0;const c=s.oldest;c&&(n+=we(c,e,n))}return function(t,e,n){const r=t.map((t=>{const n=t.marker;n&&Et.push(n);const r=t.domElement;if(r)return function(t,e){const n=t;if(n.ondestroy){const r=function(t,e){const n=t.ondestroy.tagFunction;if(!n)return;return(0,n.tagFunction)({target:t,stagger:e})}(n,e);if(f(r))return r.then((()=>{Et.push(t),Rt()}))}Et.push(t)}(r,e)})).filter((t=>t));if(r.length)return n.push(Promise.all(r)),e}(s,r,e),n}function Ce(t,e){const n=t.subject.global;n.deleted=!0,t.subject.renderCount=0;ye(n.context),n.destroy$&&(n.destroy$.next(),me(t));const r=[];return e=we(t,r,e),r.length?Promise.all(r).then((()=>e)):e}function Se(t,e,n,r,o){t.lastArray||(t.lastArray=[]);const s=t.lastArray;let c=t.placeholder,a=0;const u=[];for(let t=0;t<s.length;++t){const n=s[t],o=Ae(n,e,t,s,a,r);0!==o?(a+=o,2===o&&(t-=1)):u.push(n)}t.lastArray=u;const i=o,l=e.length;for(let t=0;t<l;++t){c=je(e,t,u,n,c,r,i).placeholder}}function je(t,e,n,r,o,s,c){const a=t[e],u=n[e];return u?function(t,e,n,r,o,s,c,a){const u=n.length>o;if(u)return he(e,t,r),e;const i=ke(t,s,r,c,n,a);return i}(a,u,n,r,e,o,s,c):ke(a,o,r,s,n,c)}function ke(t,e,n,r,o,s){const c={value:t,checkValueChange:Pe,withinOwnerElement:!1};r.added=r.added+1;const u=document.createTextNode("");return c.placeholder=u,s||Jt.push({element:u,relative:e}),function(t,e,n){const r=t.tagJsType;if(r)switch(r){case a.templater:be(t.tag,e,n);break;case a.tag:case a.dom:be(t,e,n)}}(t,n,c),Me(t,c,n,r,`rvp_${o.length}_array`,s),c.value=t,o.push(c),s&&Vt.push({element:u,relative:s}),c}function Te(t,e){const n=t.global;if(n){const t=n.oldest;n.deleted=!0,Ce(t,e.removed),n.deleted=!0}else{const e=t.simpleValueElm;delete t.simpleValueElm,Et.push(e)}++e.removed}function Ae(t,e,n,r,o,s){const c=e.length-1,a=n-o,u=a<0||c<a,i=r[n];return u?(Te(i,s),++o,1):r[n].value.arrayValue!==e[n].arrayValue?(Te(i,s),r.splice(n,1),++o,2):0}function xe(t,e){const n=t.templater,r=e.templater,o=n?.tag||t,s=r.tag;if(n?.tagJsType===a.stateRender)return n.dom===r.dom;switch(o.tagJsType){case a.dom:return s?.tagJsType===a.dom&&function(t,e){const n=t.dom,r=e.dom;return n===r}(o,s);case a.tag:{const n=function(t,e,n,r){const o=t.strings,s=e.strings;if(o.length!==s.length)return!1;if(!o.every(((t,e)=>s[e].length===t.length)))return!1;const a=n.templater.values||t.values,u=r.templater.values||e.values;return function(t,e){const n=t.length===e.length;if(!n)return!1;const r=e.every(((e,n)=>{const r=t[n];if(typeof e===c.function&&typeof r===c.function){return!!(e.toString()===r.toString())}return!0}));if(r)return!0;return!1}(a,u)}(o,s,t,e);return n}}throw new Error(`unknown tagJsType of ${o.tagJsType}`)}function Ee(t,e){if(!h(t)){return Oe(e,e.lastArray),9}return!1}function Oe(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)Te(e[t],n);delete t.lastArray}function Pe(t,e){if(null==t||typeof t!==c.object)return function(t,e){const n=_t(t),r=e.simpleValueElm;Pt.push([n,r])}(t,e),-1;const n=e.simpleValueElm;return delete e.simpleValueElm,Et.push(n),6}function Ve(t,e){const r=e.global,o=r?.newest;if(i(t)){return!xe(t,o)&&(Ce(o,0),n(e),7)}const s=t?.tagJsType;return!s&&(Ce(o,0),delete e.global,e.renderCount=0,8)}function Je(t,e,n){const r=rt(yt.DEEP);r.tagJsType=t.tagJsType;const o=pe(r,n,e);function s(){return r.tag=t(),o}return r.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,o}function We(t,e){const n=t.rearray;n.length&&n.length!==t.stateArray.length&&function(t,e,n){const r=`Saved states between renders are inconsistent. Expected ${t.length} states got ${n.stateArray.length}.`,o=e.templater?.wrapper;let s=o;(o?.original||o?.original)&&(s=o.original);const c={oldStates:n.stateArray,newStates:n.rearray,tagFunction:s,templater:e.templater},a=new Q(r,c);throw console.error(Ne,c),a}(n,e,t)}D.tagClosed$=new v(void 0,(function(t){sn()||t.next()}));const Ne="State tracking requires same number of state calls on every render. This error typically occurs when a state call is only reachable behind a condition. Also, wrapping tags that have state, with tag(), often helps when tag is only reachable by a condition.";function Re(t,e){const n=t.subject;++n.renderCount;const r=D.stateConfig;delete r.support,t.state=r.stateArray,D.tagClosed$.next(e),We(r,t),n.global.newest=t}function Ie(t,e,n,r){const o=n.global,s=n.renderCount,c=e?.state,u=D.stateConfig;if(c){const n=e.states;u.prevSupport=e,W(t,D.stateConfig,c,n)}else J(t,u);const i=t.templater;let l;if(i.tagJsType===a.stateRender){l=dt(i,i,ut(i,r,t.appSupport,n)),l.states=t.states}else{l=(0,i.wrapper)(t,n,e),l.states=t.states}return Re(l,r),n.renderCount>s+1?o.newest:l}function _e(t,e,n,r){n.checkValueChange=Ve;const o=pe(t,e,n);o.ownerSupport=e;const s=ae(o,r,void 0,{counts:{added:0,removed:0}});for(const t of s.dom)t.marker&&Vt.push({element:t.marker,relative:r}),t.domElement&&Vt.push({element:t.domElement,relative:r});let c=-1;const a=s.subs.length-1;for(;c++<a;){Le(s.subs[c])}return o}function Me(t,e,r,o,s,c){const u=t?.tagJsType;if(u)switch(u){case a.templater:return e.checkValueChange=Ve,c?_e(t,r,e,c):ie(r,e);case a.dom:case a.tag:{e.checkValueChange=Ve;const o=t;let s=o.templater;s||(s=function(t){const e=le();return e.tag=t,t.templater=e,e}(o));const a=n(e);return c?_e(s,r,e,c):(a.newest=pe(s,r,e),e.checkValueChange=Ve,ie(r,e))}case a.stateRender:case a.tagComponent:if(n(e),e.checkValueChange=Ve,c){const n=function(t,e,n,r,o){const s=ut(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==a.tagComponent?[]:ht(t,s);c.castProps=e}const u=e.global,{support:i}=ze(s,u.newest,e,n);return function(t,e,n){let r=Vt.length;const o=ae(t,n,void 0,{counts:e});for(const t of o.dom)t.domElement&&Vt.splice(r++,0,{element:t.domElement,relative:n}),t.marker&&Vt.splice(r++,0,{element:t.marker,relative:n});const s=o.subs;for(const t of s)Le(t)}(i,r,o),i}(t,e,r,o,c);return n}return $e(t,e,r,o);case a.renderOnce:{n(e);const o=Je(t,e,r);Ie(o,void 0,e,r);const s=_e(o.templater,r,e,c);return e.checkValueChange=Ve,s}}if(h(t))return Se(e,t,r,o,c),void(e.checkValueChange=Ee);p(t)||function(t,e,n,r){const o=_t(t),s=It(o,n);s.id=r,e.simpleValueElm=s,e.checkValueChange=Pe}(t,e,e.placeholder,s)}function De(t,e,n){t!==e.value&&(he(e,t,n),D.stateConfig.support||Rt())}function Le({subject:t,support:e,counts:n,contextItem:r,appendTo:o}){let s=function(t){Me(t,r,e,{...n},`rvp_-1_${e.templater.tag?.values.length}`,c?o:void 0),c||D.stateConfig.support||Rt(),s=function(t){De(t,r,e)}};let c=!0;const a=t.subscribe((function(t){s(t)}));r.subject=t,c=!1;const u=e.subject.global;(u.subscriptions=u.subscriptions||[]).push(a)}function $e(t,e,n,r){const o=ut(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==a.tagComponent?[]:ht(t,o);s.castProps=e}const c=e.global,{support:u}=ze(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=Ve;const r=ae(t,void 0,n.placeholder,{counts:e}).subs;for(const t of r)Le(t)}(u,r,e),u}function He(t,e,n,r,o,s=-1){const c=e.subject.global.newest;if(!c){const e=lt(r,t,s);r.push(...e);return t.propsConfig.castProps=e,r}const a=(e=c||e).propsConfig.castProps,u=[];for(let e=0;e<r.length;++e){const c=r[e],i=Be(a[e],c,t,n,s+1,o);u.push(i)}return t.propsConfig.castProps=u,u}function Be(t,e,n,r,o,s){return typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):s===o||gt(e)?e:h(e)?function(t,e,n,r,o){for(let s=t.length-1;s>=0;--s){const c=t[s];t[s]=Be(e[s],c,n,r,o+1,s)}return t}(e,t,n,r,s):void 0===t?e:function(t,e,n,r,o,s){const c=Object.keys(t);for(const a of c){const c=t[a],u=Be(e[a],c,n,r,s,o+1);if(t[a]===u)continue;const i=Object.getOwnPropertyDescriptor(t,a)?.set;i||(t[a]=u)}return t}(e,t,n,r,s,o)}function Ue(t){const e=t.subject.global,{subs:r,tags:o}=ve(e.context);Fe(t);for(const t of o)Fe(t);e.subscriptions&&r.forEach((t=>t.unsubscribe())),n(t.subject)}function Fe(t){const e=t.subject,n=e.global;!0!==n.deleted&&(n.deleted=!0,e.renderCount=0,we(t,[],0))}function ze(t,e,n,r){const o=e?.templater,s=o?.tag,c=Ie(t,e,n,r),u=!e||xe(e,c);if(u){if(e){const t=e.templater.tag;t&&n.renderCount>0&&function(t,e,n){if(t.tagJsType===a.dom){const r=n?.dom;return void(r!==t.dom&&Ue(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&Ue(e)}}}(t,e,s)}}else{!function(t,e){const n=t.subject.global;let r=-1;const o=n.providers=n.providers||[],s=o.length-1;for(;r++<s;){const t=o[r];let s=-1;const c=t.children.length-1;for(;s++<c;)if(n===t.children[s].subject.global)return t.children.splice(s,1),void t.children.push(e)}}(e,c),Ue(e);const t=c.subject.global;t.oldest=c,t.newest=c}const i=e?.ownerSupport;return c.ownerSupport=r||i,{support:c,wasLikeTags:u}}function Ge(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=ze(e,t,r,n);return c?(de(o.oldest,s),s):(ie(n,r),s)}function Ze(t){return a.templater===t.tagJsType}function Xe(t){const e=t.subject.global,n=Ze(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n)return qe(r,t);e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]),delete e.locked;return Ge(e.newest,t,r,o)}function qe(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return Xe(n.newest||t)}function Qe(t,e){return t.length!==e.length}function Ye(t){const e=sn();if(!e)throw en;return Ke(e,D.stateConfig,t)}function Ke(t,e,n){const r=e.stateArray,o=e.states;return function(...e){return t.subject.renderCount>0?function(t,e,n,...r){const o=t.subject.global,s=(t=o.newest).state;L(s,n.stateArray,t.states,n.states);const c=e(...r);return L(n.stateArray,s,n.states,t.states),Xe(t),f(c)&&c.finally((()=>{L(n.stateArray,s,n.states,t.states),Xe(t)})),c}(t,n,{stateArray:r,states:o},...e):n(...e)}}const tn=()=>{const t=sn();if(!t)throw en;const e=D.stateConfig;return function(n){return Ke(t,e,n)}},en=new Y("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function nn(t){O(t)}function rn(t){O((function(){sn().subject.global.destroy$.toCallback(t)}))}function on(t){return D.stateConfig.handlers.statesHandler(t)}function sn(){return D.stateConfig.support}const cn=":tagvar",an=":";function un(t,e){const n={values:e,ownerSupport:sn(),tagJsType:a.tag,strings:t,key:t=>(n.arrayValue=t,n),html:function(t,e){return n.children={strings:t,values:e},n}};return n}function ln(t,e){const n={values:e,ownerSupport:sn(),dom:t,tagJsType:a.dom,key:function(t){return n.arrayValue=t,n},html:{dom:function(t,e){return n.children={dom:t,values:e},n}}};return n}const pn="ondoubleclick",fn=/(:tagvar\d+:)/,gn=/(^:tagvar\d+:|:tagvar\d+:$)/g,dn="__safeTagVar",hn=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,bn=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function mn(t,e){yn(t,e);const n=function(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(bn,"g");t=function(t){return t.replace(Cn,(function(t){return t.replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);for(;c<t.length;){const u=a.exec(t);if(!u)break;const[i,l,p]=u,f=i.startsWith("</"),g=i.endsWith("/>");if(c<u.index){const e=t.slice(c,u.index);if(e.trim()){vn(e).forEach((t=>{t.startsWith(cn)&&(t=cn+ ++s+an),wn(o,n,t)}))}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const d=[];let h;for(;null!==(h=hn.exec(p));){const t=h[1]||h[3]||h[5];let n=h[2]||h[4]||h[6];if(void 0===t)continue;const r=""!==h[2],o=void 0===n&&r,c=t.toLowerCase(),a=c.startsWith("on")?jn(c):c;if(o){if(t.slice(0,cn.length)===cn){const t=cn+ ++s+an;e.push(["at",t]),d.push([t]);continue}if(h[0].startsWith(t)&&h[0].slice(t.length,h[0].length).search(/\s+$/)>=0){d.push([a]);continue}n=cn+ ++s+an}r||(n=h[2]);const u=[a,n],i=Qt(c);i&&u.push(i),d.push(u)}const b={nn:l};d.length&&(b.at=d),o?(o.ch||(o.ch=[]),o.ch.push(b)):n.push(b),g||(r.push(o),o=b)}if(c<t.length){const e=t.slice(c);if(e.trim()){vn(e).forEach((t=>(t.startsWith(cn)&&++s,wn(o,n,t))))}}return n}(yn(t,e).join(""));return n}function yn(t,e){return function(t,e){const n=t.map(((t,n)=>n<e.length?t+cn+n+an:t));return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(cn+(e.length+n-1)+an)}(n,t,e),n}(t.map((t=>t.replace(gn,((t,e)=>dn+e)))),e)}function vn(t){return t.split(fn).filter((t=>""!==t))}function wn(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:Sn(n)})}const Cn=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function Sn(t){return t.replace(/(\[l t\]!--[\s\S]*?--\[g t\])/g,(function(t){return t.replace(/\[l t\]/g,"<").replace(/\[g t\]/g,">").replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]")}))}function jn(t){if(t.startsWith("on")){return t.length===pn.length&&t===pn?"dblclick":t.slice(2,t.length)}return t}const kn=new RegExp(cn+"(\\d+)"+an,"g"),Tn="ch";function An(t,e,n=[],r=[]){const o=t;for(let t=0;t<o.length;t++){const s=[...r,t],c=o[t];if(c.at){const t=c.at;c.at=En(t,e)}if(c.ch){const t=c.ch,r=[...s,Tn];c.ch=An(t,e,n,r)}t=xn(c,e,o,t)}return o}function xn(t,e,n,r){if("text"!==t.nn)return r;const o=t;let c,a=o.tc;if(typeof a!==s.string)return r;for(;null!==(c=kn.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=cn+o+an,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,kn.lastIndex=0}}return o.tc=a,r}function En(t,e){return t.map((t=>{const[n,r,o]=t;if(n.startsWith(cn)){const t=parseInt(n.replace(cn,""),10);if(!isNaN(t)&&t<e)return[{tagJsVar:t}]}if(typeof r===s.string&&r.startsWith(cn)){const t=parseInt(r.replace(cn,""),10);if(!isNaN(t)&&t<e)return[n,{tagJsVar:t},o]}return t}))}const On="__safeTagVar";const Pn=/__safeTagVar(\d+)/g;function Vn(t){if(t.at&&(t.at=t.at?t.at.map((t=>{if(1===t.length)return t;const[,e]=t;if(typeof e===s.string&&e.startsWith(On)){const n=parseInt(e.replace(On,""),10);t[1]=cn+n+an}return t})):[]),t.ch){const e=t.ch;for(let t=0;t<e.length;t++){const n=e[t];if("text"===n.nn){if(typeof n.tc!==s.string)return;n.tc=n.tc.replace(Pn,((t,e)=>cn+e+an))}Vn(n)}0===e.length&&delete t.ch}}const Jn={};function Wn(t,e){const n=function(t){const e=t.map((t=>t.length));return e.push(t.length),Number(e.join(""))}(t),r=Jn[n],o=r&&function(t,e,n){if(n&&n.strings.length===t.length&&n.strings.every(((e,n)=>e===t[n]))&&n.values.length===e.length)return!0;return!1}(t,e,r);if(o)return r.domMetaMap;const s=An(mn(t,e),e.length);s.forEach(Vn);const c={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return Jn[n]=c,s}function Nn(t,...e){const n=un(t,e),r=rt(yt.NONE);return r.tag=n,n.templater=r,n}Nn.dom=function(t,...e){return ln(t,e)};const Rn=[];function In(t,e,r){const o=Rn.findIndex((t=>t.element===e));o>=0&&(Ce(Rn[o].support,0),Rn.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e}));let s=()=>p(r);s.propWatch=yt.NONE,s.tagJsType=a.stateRender,s.props=[r],s.isApp=!0;const u=function(t,e){const r={value:t,checkValueChange:Ve,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},_n(t,r,e),r}(s,e),i=u.global;J(i.newest,D.stateConfig);let p=t(r);const f=typeof p==c.function;f||(l(p)?(i.newest.propsConfig={latest:[r],castProps:[r]},s.propWatch=p.propWatch,s.tagJsType=p.tagJsType,s.wrapper=p.wrapper,s=p):(s.tag=p,p=t));const g=document.createTextNode("");ot.push(s.wrapper||{original:s});const d=Mn(s,g,e,u,f);i.isApp=!0,f&&(p.tag=d.templater.tag),e.destroy=function(){const t=i.events;for(const n in t){const r=t[n];e.removeEventListener(n,r)}i.events={},Ce(d,0),Rt()},++Nt.locks;const h=ae(d,e);i.oldest=d,i.newest=d;let b=s.setUse;if(s.tagJsType!==a.stateRender){const e=t.original;b=e.setUse,e.isApp=!0}e.setUse=b,e.ValueTypes=a,Rn.push({element:e,support:d});const m=document.createDocumentFragment();m.appendChild(g);for(const t of h.dom)Dn(t,m);for(const t of h.subs)Le(t);return--Nt.locks,Rt(),e.appendChild(m),{support:d,tags:ot,ValueTypes:a}}function _n(t,e,n){const r=e.global,o=at(t,e);return o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function Mn(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.newest,u=s.oldest;if(c===u||W(c,D.stateConfig,u.state,u.states),t.tagJsType===a.stateRender){const e=t.wrapper||{original:t};if(!o){const e=_n(t,r,n);return Re(e),e}const s=dt(t,e,c);return Re(s),s}const i=(0,t.wrapper)(c,r);return Re(i),i}function Dn(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}const Ln={tagElement:In,renderWithSupport:ze,renderSupport:Xe,renderTagOnly:Ie,paint:Rt};var $n=e.W9,Hn=e.cg,Bn=e.m0,Un=e.rS,Fn=e.Y2,zn=e.ei,Gn=e.B7,Zn=e.TU,Xn=e.XF,qn=e.PC,Qn=e.Ot,Yn=e.Mj,Kn=e.tD,tr=e.j8,er=e.um,nr=e.E2,rr=e.OH,or=e.TB,sr=e.Ii,cr=e.yV,ar=e.zV,ur=e.ze,ir=e.WJ,lr=e.aZ,pr=e.O,fr=e.Ie,gr=e.B4,dr=e.Az,hr=e.Xi,br=e.pc,mr=e.Ah,yr=e.ck,vr=e.k6,wr=e.Gk,Cr=e.cF,Sr=e.PB,jr=e.qy,kr=e.cy,Tr=e.Tn,Ar=e.Gv,xr=e.yL,Er=e.D8,Or=e.Ze,Pr=e._4,Vr=e.mn,Jr=e.Eb,Wr=e.z,Nr=e.bc,Rr=e.sA,Ir=e.MG,_r=e.PL,Mr=e.nI,Dr=e.PZ,Lr=e.N_,$r=e.r5,Hr=e.uc,Br=e.pG,Ur=e.QB,Fr=e.R6,zr=e.Ll,Gr=e.wk,Zr=e.xP,Xr=e.uz,qr=e.ag,Qr=e.Tc,Yr=e.Hf,Kr=e._A,to=e.NU,eo=e.hW,no=e.wB,ro=e.id,oo=e.MC,so=e.zC;export{$n as ArrayNoKeyError,Hn as BasicTypes,Bn as ImmutableTypes,Un as PropWatches,Fn as RouteQuery,zn as StateMismatchError,Gn as Subject,Zn as Subjective,Xn as SyncCallbackError,qn as TagError,Qn as ValueSubject,Yn as ValueSubjective,Kn as ValueTypes,tr as addOneContext,er as buildBeforeElement,nr as callback,rr as callbackMaker,or as checkArrayValueChange,sr as checkSimpleValueChange,cr as checkTagValueChange,ar as combineLatest,ur as createTrigger,ir as defineValueOn,lr as destroyArray,pr as destroySupport,fr as empty,gr as getBaseSupport,dr as getDomMeta,hr as getDomTag,br as getHtmlSupport,mr as getNewGlobal,yr as getStringTag,vr as getSupport,wr as getTemplaterResult,Cr as hmr,Sr as howToSetInputValue,jr as html,kr as isArray,Tr as isFunction,Ar as isObject,xr as isPromise,Er as isSimpleType,Or as isStaticTag,Pr as isSubjectInstance,Vr as isTagComponent,Jr as key,Wr as letProp,Nr as letState,Rr as onDestroy,Ir as onInit,_r as oneRenderToSupport,Mr as paint,Dr as processFirstSubjectValue,Lr as processSubUpdate,$r as providers,Hr as renderSupport,Br as renderTagOnly,Ur as renderWithSupport,Fr as runWrapper,zr as setUseMemory,Gr as state,Zr as states,Xr as subject,qr as syncError,Qr as tag,Yr as tagElement,Kr as tags,to as variablePrefix,eo as variableSuffix,no as watch,ro as willCallback,oo as willPromise,so as willSubscribe};
|
|
1
|
+
var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function n(t){return t.renderCount=0,t.global={}}t.d(e,{W9:()=>Q,cg:()=>c,m0:()=>s,rS:()=>wt,Y2:()=>r,ei:()=>Y,B7:()=>w,TU:()=>C,XF:()=>K,PC:()=>q,Ot:()=>S,Mj:()=>k,tD:()=>a,j8:()=>fe,um:()=>pe,E2:()=>an,OH:()=>ln,TB:()=>Ie,Ii:()=>Me,yV:()=>De,zV:()=>m,ze:()=>un,WJ:()=>j,aZ:()=>_e,O:()=>Oe,Ie:()=>o,B4:()=>dt,Az:()=>Hn,Xi:()=>vn,pc:()=>ht,Ah:()=>n,ck:()=>yn,Gk:()=>ot,cF:()=>Xn,PB:()=>Lt,qy:()=>Bn,cy:()=>b,Tn:()=>g,Gv:()=>h,yL:()=>d,D8:()=>i,Ze:()=>l,_4:()=>f,mn:()=>p,Eb:()=>yt,z:()=>Z,bc:()=>G,sA:()=>dn,MG:()=>fn,PL:()=>Le,nI:()=>_t,PZ:()=>Fe,N_:()=>Ge,r5:()=>X,uc:()=>on,pG:()=>Ue,QB:()=>tn,R6:()=>Gn,Ll:()=>L,vP:()=>u,wk:()=>P,xP:()=>gn,uz:()=>F,ag:()=>pn,Tc:()=>Ct,Hf:()=>zn,_A:()=>st,Ag:()=>gt,NU:()=>bn,hW:()=>mn,wB:()=>H,id:()=>T,MC:()=>A,zC:()=>E});class r{get(t){return"todo"}}const o="";var s,c;!function(t){t.string="string",t.number="number",t.boolean="boolean",t[void 0]="undefined"}(s||(s={})),function(t){t.function="function",t.date="date",t.unknown="unknown",t.object="object"}(c||(c={}));const a={tag:["html"],dom:["dom"],templater:["templater"],tagComponent:["tagComponent"],tagArray:["tagArray"],subject:["subject"],tagJsSubject:["tagJsSubject"],renderOnce:["renderOnce"],stateRender:["stateRender"],version:Date.now()};function u(t){let e=t;const n=new Set;return{get value(){return e},set value(t){e!==t&&(e=t,n.forEach((e=>e(t))))},subscribe(t){t(e),n.add(t);const r=()=>n.delete(t);return r.unsubscribe=r,r}}}function i(t){switch(t){case s.string:case s.number:case s.boolean:return!0}return!1}function l(t){switch(t?.tagJsType){case a.dom:case a.tag:case a.templater:return!0}return!1}function p(t){const e=t?.tagJsType;return e===a.tagComponent||e===a.stateRender}function f(t){return h(t)&&typeof t.subscribe===c.function}function d(t){return t&&g(t.then)}function g(t){return typeof t===c.function}function h(t){return typeof t===c.object&&null!==t}function b(t){return Array.isArray(t)}function m(t){const e=new w;return e.subscribeWith=e=>{const n=[],r=[],o=(o,s)=>{n[s]=!0,r[s]=o;if(n.length===t.length){for(const t of n)if(!t)return;e(r,c)}},s=[...t],c=s.shift().subscribe((t=>o(t,0))),a=s.map(((t,e)=>t.subscribe((t=>o(t,e+1)))));return c.subscriptions=a,c},e}function y(t,e,n){const r=w.globalSubCount$;w.globalSubCount$.next(r.value+1);const o=function(){o.unsubscribe()};return o.callback=e,o.subscriptions=[],o.unsubscribe=function(){return function(t,e,n){!function(t,e){const n=t.findIndex((t=>t.callback===e));-1!==n&&t.splice(n,1)}(e,n);const r=w.globalSubCount$;w.globalSubCount$.next(r.value-1),t.unsubscribe=()=>t;const o=t.subscriptions;for(const t of o)t.unsubscribe();return t}(o,n,e)},o.add=t=>(o.subscriptions.push(t),o),o.next=t=>{e(t,o)},o}function v(t,e,n){const r=[...e],o=r.shift(),s=t=>{if(r.length)return v(t,r,n);n(t)};let c=s;const a=o(t,{setHandler:t=>c=t,next:s});c(a)}class w{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=y(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{v(t,this.methods,(t=>n(t,e)))}}return n(t)}return this.subscribers.push(e),this.onSubscription&&this.onSubscription(e),e}next(t){this.value=t,this.emit()}set=this.next.bind(this);emit(){const t=this.value,e=this.subscribers;for(const n of e)n.callback(t,n)}toPromise(){return new Promise((t=>{this.subscribe(((e,n)=>{n.unsubscribe(),t(e)}))}))}toCallback(t){const e=this.subscribe(((n,r)=>{const o=r?.unsubscribe;o?o():setTimeout((()=>e.unsubscribe()),0),t(n)}));return this}pipe(...t){const e=new w(this.value);return e.setMethods(t),e.subscribeWith=t=>this.subscribe(t),e.next=t=>this.next(t),e}setMethods(t){this.methods=t}static all(t){return m(t.map((t=>{if(f(t))return t;return new w(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new w(0)}class C extends w{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,j(this)}next(t){this._value=t,this.emit()}emit(){const t=this._value,e=this.subscribers;for(const n of e)n.callback(t,n)}}function j(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}class S extends w{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class k extends w{value;constructor(t){super(t),this.value=t,this._value=t,j(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function T(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function A(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const E=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function x(){const t=L.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function O(t){const e=L.stateConfig;let n=t;if(typeof t===c.function&&(n=t()),typeof n===c.function){const t=n;n=function(...e){return t(...e)},n.original=t}const r={get:function(){return I(r)},defaultValue:n};return e.stateArray.push(r),n}function P(t){return L.stateConfig.handlers.handler(t)}function V(t){const e=L.stateConfig;e.states[e.statesIndex]=t;return e.support.states[e.statesIndex]=t,++e.statesIndex,t(P)}function J(t){const e=L.stateConfig,n=e.support,r=e.statesIndex,o=e.prevSupport,s=o?.states[r],c=[];s((t=>(c.push(t),t)));let a=0;return n.states[e.statesIndex]=t,++e.statesIndex,t((t=>{e.stateArray.push({get:()=>t,defaultValue:t});const n=c[a];return++a,n}))}function W(t,e){e.handlers.handler=O,e.handlers.letHandler=_,e.handlers.statesHandler=V,e.rearray=[],e.stateArray=[],e.states=[],e.statesIndex=0,e.support=t}function N(t,e,n,r){e.rearray=n,e.stateArray=[],e.states=r,e.statesIndex=0,e.handlers.handler=x,e.handlers.letHandler=M,e.handlers.statesHandler=J,e.support=t}class R{}function I(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const e=t(R),[n]=e,[r]=t(n);return[n,r]}(e);return n}function _(t){const e=L.stateConfig,n=typeof t===c.function?t():t,r={get:function(){return I(r)},defaultValue:n};return e.stateArray.push(r),D(n,r)}function M(){const t=L.stateConfig,e=t.rearray[t.stateArray.length],n=I(e),r={get:function(){return I(r)},defaultValue:e.defaultValue};return t.stateArray.push(r),D(n,r)}function D(t,e){return function(n){return e.callback=n,t}}const L={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:O,letHandler:_,statesHandler:V}}};function $(t,e,n,r){for(let n=t.length-1;n>=0;--n){const r=t[n].get(),o=e[n].callback;o&&o(r)}for(let t=r.length-1;t>=0;--t){const e=[],o=t=>(e.push(t),t);r[t](o);let s=0;const c=t=>e[s++];n[t](c)}}const H=(t,e)=>U(t,e),B=t=>t;const U=(t,e,{init:n,before:r,final:o=B}={})=>{const s=P({pastResult:void 0,values:void 0}),c=s.values;if(void 0===c){if(r&&!r(t))return s.values=t,s.pastResult;const a=(n||e)(t,c);return s.pastResult=o(a),s.values=t,s.pastResult}if(t.every(((t,e)=>t===c[e])))return s.pastResult;if(r&&!r(t))return s.values=t,s.pastResult;const a=e(t,c);return s.pastResult=o(a),c.length=0,c.push(...t),s.pastResult};function z(t,e){return Object.defineProperty(e,"noInit",{get(){const e=t();return e.setup.init=()=>{},e}}),Object.defineProperty(e,"asSubject",{get(){const e=t(),n=P((()=>hn())),r=P((()=>new S(void 0))),o=P((()=>({stateArray:L.stateConfig.stateArray,states:L.stateConfig.states}))),s=(t,s)=>(U(t,((t,e)=>{const c=hn(),a=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;$(t,e.state,o.states,e.states)}r.next(a)}),e.setup),r);return s.setup=e.setup,z((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function F(t,e){const n=P((function(){return{stateArray:L.stateConfig.stateArray,states:L.stateConfig.states}})),r=hn();return P((function(){return new w(t,e).pipe((t=>($(r.state,n.stateArray,r.states,n.states),t)))}))}function G(t){return L.stateConfig.handlers.letHandler(t)}function Z(t){return e=>{let n=G(t)(e);return H([t],(()=>e(n=t))),e(n),n}}z((()=>function(t){const e=(e,n)=>U(e,n,t);return e.setup=t,z((()=>e),e),e}({})),H),F._value=t=>{const e=P((function(){return{stateArray:L.stateConfig.stateArray,states:L.stateConfig.states}})),n=hn();return P((function(){return new S(t).pipe((t=>($(n.state,e.stateArray,n.states,e.states),t)))}))},F.all=function(t){const e=P((()=>({stateArray:L.stateConfig.stateArray,states:L.stateConfig.states}))),n=hn();return w.all(t).pipe((t=>($(n.state,e.stateArray,n.states,e.states),t)))};const X={create:t=>{const e=P((()=>({stateDiff:0,provider:void 0})));if(e.stateDiff){let t=e.stateDiff;for(;t--;)P(void 0);return P(void 0)}const n=P((()=>{const n=L.stateConfig,r=n.stateArray.length,o=t.prototype?new t:t(),s=n.support,c=n.stateArray.length-r,a={constructMethod:t,instance:o,stateDiff:c,owner:s,children:[]};e.provider=a;const u=s.subject.global;return(u.providers=u.providers||[]).push(a),e.stateDiff=c,o})),r=t,o=r.compareTo=r.toString();return e.provider.constructMethod.compareTo=o,n},inject:t=>P((()=>{const e=t,n=e.compareTo=e.compareTo||t.toString(),r=hn(),o=[];let s={ownerSupport:r.ownerSupport};for(;s.ownerSupport;){const t=s.ownerSupport.subject.global.providers;if(!t){s=s.ownerSupport;continue}const e=t.find((t=>{o.push(t);if(t.constructMethod.compareTo===n)return!0}));if(e){const t=r.subject.global;return(t.providers=t.providers||[]).push(e),e.children.push(r),e.instance}s=s.ownerSupport}const c=`Could not inject provider: ${t.name} ${t}`;throw console.warn(`${c}. Available providers`,o),new Error(c)}))};class q extends Error{details;constructor(t,e,n={}){super(t),this.name=q.name,this.details={...n,errorCode:e}}}class Q extends q{constructor(t,e){super(t,"array-no-key-error",e),this.name=Q.name}}class Y extends q{constructor(t,e){super(t,"state-mismatch-error",e),this.name=Y.name}}class K extends q{constructor(t,e){super(t,"sync-callback-error",e),this.name=K.name}}function tt(t,e){return et(t,e)}function et(t,e){if(null===t||typeof t!==c.object)return t;if(e<0)return t;if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);const n=b(t)?[]:Object.create(Object.getPrototypeOf(t));if(b(t))for(let r=0;r<t.length;r++)n[r]=et(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=et(t[r],e-1));return n}function nt(t,e,n){return rt(t,e,n)}function rt(t,e,n){return!(t!==e&&(r=t,o=e,!g(r)||!g(o)||r.toString()!==o.toString()))||(n<0||typeof t===c.object&&typeof e===c.object&&(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():b(t)&&b(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!rt(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!b(t)&&!b(e)&&function(t,e,n){const r=Object.keys(t),o=Object.keys(e);if(0===r.length&&0===o.length)return!0;if(r.length!==o.length)return!1;for(const s of r){if(!o.includes(s)||!rt(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function ot(t,e){const n={propWatch:t,props:e,tagJsType:a.templater,key:function(t){return n.arrayValue=t,n}};return n}const st=[];function ct(t,e,n){return t.map((t=>function(t,e,n,r){if(l(t)||!t)return t;if(!e)return t;return at(t,e,n,r)}(t,e.ownerSupport,e,n)))}function at(t,e,n,r){if(!t)return t;if(t.tagJsType)return t;if(typeof t===c.function)return function(t,e){const n=t.mem;if(n)return t;const r=function(...t){return r.toCall(...t)};return r.original=t,r.mem=t,r.toCall=function(...t){return function(t,e,n){const r=n.subject.global,o=r?.newest||n,s=void 0===hn(),c=t(...e),a=function(){const t=o.subject.global;if(!1===s){if(!0===t.locked)return c}return function(t,e){const n=t.subject,r=rn(t.templater);if(r){return sn(e,t)}const o=n.global;o.locked=!0,nn(o.newest,t,e,n),delete o.locked}(o,n),c};if(s)return a();return L.tagClosed$.toCallback(a),c}(r.mem,t,e)},Object.assign(r,t),r}(t,e);if(r===Et)return t;return it(t)?t:b(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=at(s,n,e,r+1),typeof s===c.function){if(s.mem)continue;ut(r+1,o,s,t,e)}}return t}(t,n,e,r):function(t,e,n,r){const o=Object.keys(t);for(const s of o){const o=t[s],a=at(o,n,e,r+1);if(t[s]===a)continue;const u=Object.getOwnPropertyDescriptor(t,s);if(!(u?.get||u?.set)&&(t[s]=a,typeof a===c.function)){if(o.mem)continue;ut(r+1,s,o,t,e)}}return t}(t,n,e,r)}function ut(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function it(t){return typeof t!==c.object||!t||t.tagJsType}function lt(t,e,n,r){const o=e.original;let s;t.tagJsType===a.stateRender?s=t():(s=o(...r),typeof s===c.function&&(s=s())),s.templater=t,t.tag=s;const u=L.stateConfig;return n.state=u.stateArray,n.states=u.states,n}function pt(t){return t.map(ft)}function ft(t,e){const n=t,r=t?.tagJsType;if(r)switch(r){case a.stateRender:return;case a.dom:case a.tag:case a.templater:return pt(n.values)}return b(t)?pt(n):tt(t,e)}function dt(t,e,n){const r={templater:t,subject:e,castedProps:n,appSupport:void 0},o=e.global;return o.blocked=[],o.destroy$=new w,r}function gt(t,e,n,r){e.state=[],e.states=[],e.appSupport=n;const o=t.props;return o&&(e.propsConfig=function(t,e,n){const r=t.templater;if(r.tagJsType!==a.stateRender){switch(r.propWatch){case wt.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case wt.SHALLOW:return t.propsConfig={latest:e.map((t=>ft(t,At))),castProps:n}}return t.propsConfig={latest:e.map((t=>ft(t,Et))),castProps:n}}}(e,o,r)),e}function ht(t,e,n,r,o){const s={templater:t,subject:r,castedProps:o,appSupport:void 0};return s.ownerSupport=e,s.appSupport=n,s}function bt(t,e,n,r,o){const s=dt(t,r,o);return s.ownerSupport=e,gt(t,s,n,o)}function mt(t,e,n){const r=t.propWatch===wt.DEEP?Et:At,o=t.props,s=e.propsConfig;let c=s.castProps;const a=n?.propsConfig,u=a?.castProps;u&&(s.castProps=u,c=qe(e,n,n.ownerSupport,o,r));return c||ct(o,e,0)}function yt(t){return{set html(e){e.arrayValue=t}}}let vt=0;var wt;function Ct(t,e=wt.SHALLOW){const n=function(...r){const o=ot(e,r);o.tagJsType=a.tagComponent;const s=function(t,e){return function(n,r,o){const s=mt(t,n,o),c=n.ownerSupport,a=bt(t,c,n.appSupport,r,s);return lt(t,e,a,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=st,r.setUse=L,r.ValueTypes=a,r.tagIndex=vt++,st.push(n),n}function jt(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")}function St(t,e){const n=function(t,e,n){const r=cn(t,e);if(r)return 11;switch(n){case wt.NONE:return 1;case wt.SHALLOW:return Tt(t,e);case wt.IMMUTABLE:return kt(t,e)}return function(t,e){let n=t,r=e;n=[...t],r=[...e||[]];if(!n.every(((t,e)=>function(t,e,n,r){const o=r[e];if(typeof t===c.object){const e={...t},n={...o||{}},r=Object.entries(e).every((([t,r])=>xt(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return xt(t,o,(()=>{n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}(e.props,t.propsConfig.latest,t.templater.propWatch);return n}function kt(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function Tt(t,e){const n=t.length;for(let r=0;r<n;++r){const n=t[r],o=e[r];if(b(n)&&b(o)){if(n===o)continue;return 3}if(typeof n!==c.function||typeof o!==c.function)if(typeof n!==c.object){if(n!==o)return 3.3}else if(typeof e===c.object){const t=Object.entries(n);for(const e of t){if(!Ot(e,o))return 3.1}}}return!1}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(wt||(wt={})),Ct.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},Ct.state=jt,Ct.use=jt,Ct.route=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},Ct.key=yt,Ct.app=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},Ct.deepPropWatch=Ct,Ct.immutableProps=function(t){return Ct(t,wt.IMMUTABLE)},Ct.watchProps=function(t){return Ct(t,wt.SHALLOW)},Object.defineProperty(Ct,"renderOnce",{set(t){t.tagJsType=a.renderOnce}}),Object.defineProperty(Ct,"state",{set(t){t.original={setUse:L,tags:st},t.tagJsType=a.stateRender}}),Object.defineProperty(Ct,"use",{set(t){t.original={setUse:L,tags:st},t.tagJsType=a.stateRender}});const At=3,Et=10;function xt(t,e,n){if(typeof t!==c.function)return!!nt(t,e,Et)&&4;if(typeof e!==c.function)return!1;const r=e?.original;r&&(e=r);t.original&&(t=t.original);return t.toString()===e.toString()?(n(),5):(n(),6)}function Ot([t,e],n){const r=n[t];return typeof e===c.function&&typeof r===c.function||r===e}let Pt=[],Vt=[],Jt=[],Wt=[],Nt=[],Rt=[];const It={locks:0};function _t(){if(!(It.locks>0)){++It.locks;for(const t of Pt){t.parentNode.removeChild(t)}for(const t of Vt)t();for(const[t,e]of Jt)e.textContent=t;for(const t of Wt)t.relative.appendChild(t.element);for(const{element:t,relative:e}of Nt)e.parentNode.insertBefore(t,e);for(const t of Rt)t();Pt=[],Vt=[],Wt=[],Nt=[],Rt=[],Jt=[],--It.locks}}function Mt(t,e){const n=document.createTextNode(t);return Nt.push({element:n,relative:e}),n}function Dt(t){switch(t){case void 0:case!1:case null:return o}return t}function Lt(t,e,n){Vt.push((()=>{void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}))}function $t(t,e,n,r,o,s){switch(r){case"init":{const t=s.added;return void Rt.push((()=>{e({target:n,stagger:t})}))}case"destroy":{const t=++s.removed,r=o.subject.global;return r.destroys=r.destroys||[],void r.destroys.push((()=>e({target:n,stagger:t})))}case"autofocus":return void Rt.push((()=>n.focus()));case"autoselect":return void Rt.push((()=>n.select()));case"style":{const r=t.split(".");return void Vt.push((()=>n.style[r[1]]=e))}case"class":return void function(t,e,n){const r=t.split(".");if(r.shift(),e){for(const t of r)Vt.push((()=>n.classList.add(t)));return}for(const t of r)Vt.push((()=>n.classList.remove(t)))}(t,e,n)}throw new Error(`Invalid special attribute of ${r}. ${t}`)}function Ht(t,e){const n=function(t,e,n=[]){const r=t.subject;n.push({support:t,renderCount:r.renderCount,provider:e});const o=e.children;for(let t=o.length-1;t>=0;--t){const r=o[t],s=r.subject;n.push({support:r,renderCount:s.renderCount,provider:e})}return n}(t,e);return n}function Bt(t,e=[]){const n=t.subject.global,r=rn(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return Bt(o,e);const s=t,c=p(s.templater),u=t.templater.tagJsType,i=o&&u!==a.stateRender&&(!c||function(t,e,n){const r=function(t,e){const n=t.props,r=e.propsConfig,o=r.latest;if(cn(n,o))return!0;switch(t.propWatch){case wt.IMMUTABLE:return kt(n,o);case wt.SHALLOW:return Tt(n,o)}return!nt(n,o,Et)}(e,n);if(t&&r)return!0;return!1}(o,s.templater,s)),l=function(t){const e=t.subject.global.providers;if(!e)return[];const n=[];for(const t of e){const e=Ht(t.owner,t);n.push(...e.map((t=>t.support)))}return n}(s);return e.push(...l),i?(Bt(o,e),c&&e.push(s),e):(e.push(s),e)}function Ut(t){++It.locks,t.forEach(zt),--It.locks,_t()}function zt(t){const e=t.subject.global;e&&on(e.newest)}const Ft="no-data-ever",Gt="promise-no-data-ever";function Zt(t,e){const n=e.subject.global,r=function(t,e){if(!0!==n.deleted)return function(t,e,n,r){let o=e;for(;o.ownerSupport&&!p(o.templater);)o=o.ownerSupport;const s=o.subject.global;s.locked=!0;const c=t.apply(n,r);return function(t,e){const n=e.subject.global;return delete n.locked,function(t,e,n){return Ut(Bt(t)),function(t,e,n){if(d(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return Gt;delete e.subject.global.locked;return Ut(Bt(e)),Gt}))}return Ft}(e,t,n)}(e,t,n)}(c,o)}(r.tagFunction,r.support,t,e)};return r.tagFunction=t,r.support=e,r}const Xt=["init","destroy"];function qt(t,e,n,r,o,s,c){if(c)return $t(t,e,n,c,s,o);r(n,t,e)}function Qt(t,e,n,r){const o=t.appElement;"blur"===e&&(e="focusout");const s="_"+e,c=t.subject.global.events;if(!c[e]){const t=function(t){t.originalStopPropagation=t.stopPropagation,Yt(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function Yt(t,e,n){const r=n[e];if(r){let e=!1;if(t.stopPropagation=function(){e=!0,t.originalStopPropagation.call(t)},r(t),t.defaultPrevented||e)return}const o=n.parentNode;o&&Yt(t,e,o)}function Kt(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,Qt(n.appSupport,r,t,o)}function te(t){if(t.startsWith("class."))return"class";const e=function(t){switch(t){case"autoselect":return"autoselect";case"autofocus":return"autofocus";case"oninit":case"init":return"oninit";case"ondestroy":case"destroy":return"destroy"}return!1}(t);return!1!==e||!!t.startsWith("style.")&&"style"}function ee(t,e,n,r,o,s,a,u,i){const l=ce(e);if(l>=0){const e=t[l],c=fe(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,void ne(t,e,n,r,o,s,u)}const p=ce(i);if(p>=0){const i=t[p],l={isAttr:!0,element:n,attrName:e,checkValueChange:Me,withinOwnerElement:!0};s.push(l);return f(l.value)?function(t,e,n,r,o,s,c){s&&Vt.push((function(){n.removeAttribute(t)}));const a=e.value;if(f(a)){const u=function(a){re(a,t,e,n,r,o,s,c)},i=a.subscribe(u),l=e.global;(l.subscriptions=l.subscriptions||[]).push(i)}return void re(e.value,t,e,n,r,o,s,c)}(e,l,n,r,o,a,u):(function(t,e,n,r,o,s,a,u){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?u&&Xt.includes(t)?$t(t,e,r,t,s,a):se(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=u,qt(t,e,r,o,a,s,u))}(e,i,l,n,o,r,u,a),void(l.value=i))}return qt(e,i,n,o,u,r,a)}function ne(t,e,n,r,s,a,u){if(!ae(e))if(typeof e!==c.object)0!==e.length&&s(n,e,o);else for(const o in e){const c=e[o];ee(t,o,n,r,s,a,te(o),u,c)}}function re(t,e,n,r,o,s,c,u){return g(t)?function(t,e,n,r,o,s,c,u){const i=t.templater.wrapper;if((i?.tagJsType||i?.original?.tagJsType)!==a.renderOnce)return se(c,e,t,r,n);return oe(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u):oe(t,r,e,c,s,o,u)}function oe(t,e,n,r,o,s,c){switch(t){case void 0:case!1:case null:return void Vt.push((function(){e.removeAttribute(n)}))}if(!1===r)return g(t)?Kt(e,t,s,n):void o(e,n,t);$t(n,t,e,r,s,c)}function se(t,e,n,r,o){const s=t.value;return s&&s.tagFunction&&s.support?(s.tagFunction=e,s.support=n,s):Kt(o,e=Zt(e,n),n,r)}function ce(t){return h(t)&&"tagJsVar"in t?t.tagJsVar:-1}function ae(t){return null==t||!1===t}const ue="object"==typeof document&&document.createElement("div");function ie(t,e,n,r,o,s,c,a,u=[]){const i=[];for(const l of t){const t={};i.push(t);const p=l.v;if(!isNaN(p)){le(e,o,c,n,u,r,s);continue}if("text"===l.nn){const n=t,r=n.tc=l.tc;ue.innerHTML=r;const s=n.domElement=document.createTextNode(ue.innerText);s.id=`tp_${o.length}_${e.length}`,c?Wt.push({element:s,relative:c}):Nt.push({element:s,relative:a});continue}const f=t.domElement=document.createElement(l.nn);l.at&&l.at.map((t=>{const s=t[0],c=t[1],a=t[2]||!1;ee(e,s,f,n,Lt,o,a,r,c)})),c?Wt.push({element:f,relative:c}):Nt.push({element:f,relative:a}),l.ch&&(t.ch=ie(l.ch,e,n,r,o,s+1,f,a,u).dom)}return{subs:u,dom:i,context:o}}function le(t,e,n,r,s,c,a){const u=t[e.length],i=document.createTextNode(o);i.id=`dvp_${e.length}_${t.length}`;const l=fe(u,e,a>0);if(l.placeholder=i,n?Wt.push({relative:n,element:i}):Nt.push({element:i,relative:r.subject.placeholder}),f(u))return void s.push({insertBefore:i,appendTo:n,subject:u,support:r,counts:c,contextItem:l});r.subject.global.locked=!0,Fe(u,l,r,c,`rvp_${e.length}_${t.length}`,n);delete r.subject.global.locked,l.value=u}function pe(t,e,n,r){const o=t.subject.global;o.oldest=t,o.newest=t,++It.locks;const s=function(t,e,n,r){const o=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===a.dom)return n.dom;return Hn(n.strings,n.values)}(t),s=t.templater.tag,c=s.values,u=[],i=t.subject.global;i.context=u;const l=ie(o,c,t,e,u,0,n,r);return l}(t,e,n,r);return o.htmlDomMeta=s.dom,--It.locks,s}function fe(t,e,n){const r={value:t,checkValueChange:Me,withinOwnerElement:n};return e.push(r),r}function de(t,e,n){const r=e.global.newest;r.ownerSupport=t,e.checkValueChange=De;const o=pe(r,n,void 0,e.placeholder);for(const t of o.subs)Ze(t);return r}function ge(){return{tagJsType:a.templater}}function he(t,e,n){const r=ht(t,e,e.appSupport,n);return n.global.context=[],r}const be={added:0,removed:0};function me(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,a,u){if(n){if(ae(e))return void r.removeAttribute(n);if(typeof n===c.object)if(typeof e===c.object)for(const t in n)t in e||Vt.push((function(){r.removeAttribute(t)}));else for(const t in n)Vt.push((function(){r.removeAttribute(t)}))}ne(t,e,r,o,s,a,u)}(t,e,n.value,n.element,r,n.howToSet,[],be),void(n.value=e);const o=n.element;re(e,n.attrName,n,o,r,n.howToSet,n.isSpecial,be),n.value=e}function ye(t,e,n,r){const o=t[e],s=n[e];if(!f(o)){if(s.isAttr){if(o===s.value)return;me(t,o,s,r),s.value=o}Ce(s,o,r),s.value=o}}function ve(t,e){const n=t.subject.global.context;!function(t,e){const n=e.templater.tag||e.templater,r=e.templater.values||n.values,o=t.templater.tag;o.values=r}(t,e),++It.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length;for(;r<o;)ye(n,r,e,t),++r}(t,n),--It.locks,_t()}const we={added:0,removed:0};function Ce(t,e,r){if(e===t.value)return;const o=t.checkValueChange(e,t);if(-1===o)return;const s=e&&e.tagJsType;if(s){if(s===a.renderOnce)return;if(p(e))return t.global||n(t),void function(t,e,r){const o=e.global;if(!o.newest)return void Xe(t,e,r,{added:0,removed:0});const s=bt(t,r,r.appSupport,e);!function(t,e,r){const o=r.global,s=o.newest,c=s.templater.wrapper,u=e.templater.wrapper;let i=!1;const l=e.templater.tagJsType,p=a.stateRender===l||a.renderOnce===l;if(p)i=e.templater.tagJsType===a.renderOnce||Re(s,e);else if(c&&u){i=c.original===u.original}const f=e.templater;if(!i)return void function(t,e,r){const o=t.global,s=o.oldest;Oe(s),n(t);const c=Xe(e,t,r,{added:0,removed:0})}(r,f,t);const d=p||St(s,f);if(!d){return void function(t,e,n,r,o){const s=t.props,c=qe(e,n,r,s,o),a=e.propsConfig;a.castProps=c;const u=n.propsConfig;u.latest=a.latest}(f,e,s,t,f.propWatch===wt.DEEP?Et:At)}if(o.locked)return void o.blocked.push(e);on(e)}(r,s,e)}(e,t,r)}const u=t.global;if(u){const n=u.newest;if(n)return void function(t,e,n,r){if(typeof n===c.function)return;!function(t,e,n,r){const o=n.templater||n,s=bt(o,r,r.appSupport,e),c=t.subject.global;ve(c.oldest,s)}(t,e,n,r)}(n,t,e,r)}if(s)switch(s){case a.templater:return void de(r,t,we);case a.tag:case a.dom:{const o=e;let s=o.templater;s||(s=ge(),o.templater=s,s.tag=o);return(t.global?t.global:n(t)).newest=he(s,r,t),void de(r,t,we)}}b(e)?Pe(t,e,r,{added:0,removed:0}):typeof e!==c.function?o&&function(t,e){e.checkValueChange=Me;const n=e.placeholder,r=Dt(t);e.simpleValueElm=Mt(r,n)}(e,t):t.value=e}function je(t,e,r){r.checkValueChange=De;const o=t;let s=o.templater;s||(s=ot(wt.DEEP),s.tag=o,o.templater=s);const c=r.global=n(r),a=c.newest=bt(s,e,e.appSupport,r);return c.oldest=a,r}function Se(t){const e=t.subject.global,n=e.providers;if(n)for(const t of n)for(let n=t.children.length-1;n>=0;--n){t.children[n].subject.global===e&&t.children.splice(n,1)}e.destroy$&&e.destroy$.next(),t.subject.renderCount=0}function ke(t){for(const e of t){const t=e.lastArray;if(t){ke(t);continue}const n=e.global;if(!n)continue;const r=n.newest,o=n.subscriptions;o&&o.forEach((t=>t.unsubscribe())),p(r.templater)&&Se(r);ke(n.context)}}function Te(t,e=[],n=[]){for(const r of t){const t=r.global;if(!t)continue;const o=t.newest;if(o){e.push(o);const r=t.subscriptions;r&&n.push(...r)}const s=t.context;s&&Te(s,e,n)}return{tags:e,subs:n}}function Ae(t,e){const n=t.subject.global,r=n.htmlDomMeta,o=n.context;n.deleted=!0;const s=n.destroys;if(s)return function(t,e,n,r){const o=[];if(t.forEach((t=>{const e=t();e instanceof Promise&&o.push(e)})),o.length){const t=Promise.all(o).then((()=>{Ee(e,n),xe(r),_t()}));return void n.push(t)}Ee(e,n),xe(r),_t()}(s,o,e,r);Ee(o,e),xe(r)}function Ee(t,e){for(const n of t){if(n.withinOwnerElement)continue;const t=n.lastArray;if(t){_e(n,t);continue}const r=n.simpleValueElm;if(r){delete n.simpleValueElm,Pt.push(r);continue}const o=n.global;if(void 0===o)continue;if(!0===o.deleted)continue;o.deleted=!0;const s=o.oldest;s&&Ae(s,e)}}function xe(t){t.forEach((t=>{const e=t.marker;e&&Pt.push(e);const n=t.domElement;n&&Pt.push(n)}))}function Oe(t){const e=t.subject.global;e.deleted=!0,t.subject.renderCount=0;const n=[];return ke(e.context),e.destroy$&&Se(t),Ae(t,n),n}function Pe(t,e,n,r,o){t.lastArray||(t.lastArray=[]);const s=t.lastArray;let c=t.placeholder,a=0;const u=[];for(let t=0;t<s.length;++t){const n=s[t],o=Ne(n,e,t,s,a,r);0!==o?(a+=o,2===o&&(t-=1)):u.push(n)}t.lastArray=u;const i=o,l=e.length;for(let t=0;t<l;++t){c=Ve(e,t,u,n,c,r,i).placeholder}}function Ve(t,e,n,r,o,s,c){const a=t[e],u=n[e];return u?function(t,e,n,r,o,s,c,a){const u=n.length>o;if(u)return Ce(e,t,r),e;const i=Je(t,s,r,c,n,a);return i}(a,u,n,r,e,o,s,c):Je(a,o,r,s,n,c)}function Je(t,e,n,r,o,s){const c={value:t,checkValueChange:Me,withinOwnerElement:!1};r.added=r.added+1;const u=document.createTextNode("");return c.placeholder=u,s||Nt.push({element:u,relative:e}),function(t,e,n){const r=t.tagJsType;if(r)switch(r){case a.templater:je(t.tag,e,n);break;case a.tag:case a.dom:je(t,e,n)}}(t,n,c),Fe(t,c,n,r,`rvp_${o.length}_array`,s),c.value=t,o.push(c),s&&Wt.push({element:u,relative:s}),c}function We(t,e){const n=t.global;if(n){const t=n.oldest;n.deleted=!0,Oe(t),n.deleted=!0}else{const e=t.simpleValueElm;delete t.simpleValueElm,Pt.push(e)}++e.removed}function Ne(t,e,n,r,o,s){const c=e.length-1,a=n-o,u=a<0||c<a,i=r[n];return u?(We(i,s),++o,1):r[n].value.arrayValue!==e[n].arrayValue?(We(i,s),r.splice(n,1),++o,2):0}function Re(t,e){const n=t.templater,r=e.templater,o=n?.tag||t,s=r.tag;if(n?.tagJsType===a.stateRender)return n.dom===r.dom;switch(o.tagJsType){case a.dom:return s?.tagJsType===a.dom&&function(t,e){const n=t.dom,r=e.dom;return n===r}(o,s);case a.tag:{const n=function(t,e,n,r){const o=t.strings,s=e.strings;if(o.length!==s.length)return!1;if(!o.every(((t,e)=>s[e].length===t.length)))return!1;const a=n.templater.values||t.values,u=r.templater.values||e.values;return function(t,e){const n=t.length===e.length;if(!n)return!1;const r=e.every(((e,n)=>{const r=t[n];if(typeof e===c.function&&typeof r===c.function){return!!(e.toString()===r.toString())}return!0}));if(r)return!0;return!1}(a,u)}(o,s,t,e);return n}}throw new Error(`unknown tagJsType of ${o.tagJsType}`)}function Ie(t,e){if(!b(t)){return _e(e,e.lastArray),9}return!1}function _e(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)We(e[t],n);delete t.lastArray}function Me(t,e){if(null==t||typeof t!==c.object)return function(t,e){const n=Dt(t),r=e.simpleValueElm;Jt.push([n,r])}(t,e),-1;const n=e.simpleValueElm;return delete e.simpleValueElm,Pt.push(n),6}function De(t,e){const r=e.global,o=r?.newest;if(l(t)){return!Re(t,o)&&(Oe(o),n(e),7)}const s=t?.tagJsType;return!s&&(Oe(o),delete e.global,e.renderCount=0,8)}function Le(t,e,n){const r=ot(wt.DEEP);r.tagJsType=t.tagJsType;const o=he(r,n,e);function s(){return r.tag=t(),o}return r.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,o}function $e(t,e){const n=t.rearray;n.length&&n.length!==t.stateArray.length&&function(t,e,n){const r=`Saved states between renders are inconsistent. Expected ${t.length} states got ${n.stateArray.length}.`,o=e.templater?.wrapper;let s=o;(o?.original||o?.original)&&(s=o.original);const c={oldStates:n.stateArray,newStates:n.rearray,tagFunction:s,templater:e.templater},a=new Y(r,c);throw console.error(He,c),a}(n,e,t)}L.tagClosed$=new w(void 0,(function(t){hn()||t.next()}));const He="State tracking requires same number of state calls on every render. This error typically occurs when a state call is only reachable behind a condition. Also, wrapping tags that have state, with tag(), often helps when tag is only reachable by a condition.";function Be(t,e){const n=t.subject;++n.renderCount;const r=L.stateConfig;delete r.support,t.state=r.stateArray,L.tagClosed$.next(e),$e(r,t),n.global.newest=t}function Ue(t,e,n,r){const o=n.global,s=n.renderCount,c=e?.state,u=L.stateConfig;if(c){const n=e.states;u.prevSupport=e,N(t,L.stateConfig,c,n)}else W(t,u);const i=t.templater;let l;if(i.tagJsType===a.stateRender){l=lt(i,i,bt(i,r,t.appSupport,n)),l.states=t.states}else{l=(0,i.wrapper)(t,n,e),l.states=t.states}return Be(l,r),n.renderCount>s+1?o.newest:l}function ze(t,e,n,r,o){n.checkValueChange=De;const s=he(t,e,n);s.ownerSupport=e;const c=pe(s,o,r,void 0);for(const t of c.dom)t.marker&&Wt.push({element:t.marker,relative:r}),t.domElement&&Wt.push({element:t.domElement,relative:r});let a=-1;const u=c.subs.length-1;for(;a++<u;){Ze(c.subs[a])}return s}function Fe(t,e,r,o,s,c){const u=t?.tagJsType;if(u)switch(u){case a.templater:return e.checkValueChange=De,c?ze(t,r,e,c,o):de(r,e,o);case a.dom:case a.tag:{e.checkValueChange=De;const s=t;let a=s.templater;a||(a=function(t){const e=ge();return e.tag=t,t.templater=e,e}(s));const u=n(e);return c?ze(a,r,e,c,o):(u.newest=he(a,r,e),e.checkValueChange=De,de(r,e,o))}case a.stateRender:case a.tagComponent:if(n(e),e.checkValueChange=De,c){const n=function(t,e,n,r,o){const s=bt(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==a.tagComponent?[]:mt(t,s);c.castProps=e}const u=e.global,{support:i}=tn(s,u.newest,e,n);return function(t,e,n){let r=Wt.length;const o=pe(t,e,n,void 0);for(const t of o.dom)t.domElement&&Wt.splice(r++,0,{element:t.domElement,relative:n}),t.marker&&Wt.splice(r++,0,{element:t.marker,relative:n});const s=o.subs;for(const t of s)Ze(t)}(i,r,o),i}(t,e,r,o,c);return n}return Xe(t,e,r,o);case a.renderOnce:{n(e);const s=Le(t,e,r);Ue(s,void 0,e,r);const a=ze(s.templater,r,e,c,o);return e.checkValueChange=De,a}}if(b(t))return Pe(e,t,r,o,c),void(e.checkValueChange=Ie);f(t)||function(t,e,n,r){const o=Dt(t),s=Mt(o,n);s.id=r,e.simpleValueElm=s,e.checkValueChange=Me}(t,e,e.placeholder,s)}function Ge(t,e,n){t!==e.value&&(Ce(e,t,n),L.stateConfig.support||_t())}function Ze({subject:t,support:e,counts:n,contextItem:r,appendTo:o}){let s=function(t){Fe(t,r,e,{...n},`rvp_-1_${e.templater.tag?.values.length}`,c?o:void 0),c||L.stateConfig.support||_t(),s=function(t){Ge(t,r,e)}};let c=!0;const a=t.subscribe((function(t){s(t)}));r.subject=t,c=!1;const u=e.subject.global;(u.subscriptions=u.subscriptions||[]).push(a)}function Xe(t,e,n,r){const o=bt(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==a.tagComponent?[]:mt(t,o);s.castProps=e}const c=e.global,{support:u}=tn(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=De;const r=pe(t,e,void 0,n.placeholder).subs;for(const t of r)Ze(t)}(u,r,e),u}function qe(t,e,n,r,o,s=-1){const c=e.subject.global.newest;if(!c){const e=ct(r,t,s);r.push(...e);return t.propsConfig.castProps=e,r}const a=(e=c||e).propsConfig.castProps,u=[];for(let e=0;e<r.length;++e){const c=r[e],i=Qe(a[e],c,t,n,s+1,o);u.push(i)}return t.propsConfig.castProps=u,u}function Qe(t,e,n,r,o,s){return typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):s===o||it(e)?e:b(e)?function(t,e,n,r,o){for(let s=t.length-1;s>=0;--s){const c=t[s];t[s]=Qe(e[s],c,n,r,o+1,s)}return t}(e,t,n,r,s):void 0===t?e:function(t,e,n,r,o,s){const c=Object.keys(t);for(const a of c){const c=t[a],u=Qe(e[a],c,n,r,s,o+1);if(t[a]===u)continue;const i=Object.getOwnPropertyDescriptor(t,a)?.set;i||(t[a]=u)}return t}(e,t,n,r,s,o)}function Ye(t){const e=t.subject.global,{subs:r,tags:o}=Te(e.context);Ke(t);for(const t of o)Ke(t);e.subscriptions&&r.forEach((t=>t.unsubscribe())),n(t.subject)}function Ke(t){const e=t.subject,n=e.global;!0!==n.deleted&&(n.deleted=!0,e.renderCount=0,Ae(t,[]))}function tn(t,e,n,r){const o=e?.templater,s=o?.tag,c=Ue(t,e,n,r),u=!e||Re(e,c);if(u){if(e){const t=e.templater.tag;t&&n.renderCount>0&&function(t,e,n){if(t.tagJsType===a.dom){const r=n?.dom;return void(r!==t.dom&&Ye(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&Ye(e)}}}(t,e,s)}}else{!function(t,e){const n=t.subject.global;let r=-1;const o=n.providers=n.providers||[],s=o.length-1;for(;r++<s;){const t=o[r];let s=-1;const c=t.children.length-1;for(;s++<c;)if(n===t.children[s].subject.global)return t.children.splice(s,1),void t.children.push(e)}}(e,c),Ye(e);const t=c.subject.global;t.oldest=c,t.newest=c}const i=e?.ownerSupport;return c.ownerSupport=r||i,{support:c,wasLikeTags:u}}const en={added:0,removed:0};function nn(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=tn(e,t,r,n);return c?(ve(o.oldest,s),s):(de(n,r,en),s)}function rn(t){return a.templater===t.tagJsType}function on(t){const e=t.subject.global,n=rn(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n)return sn(r,t);e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]),delete e.locked;return nn(e.newest,t,r,o)}function sn(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return on(n.newest||t)}function cn(t,e){return t.length!==e.length}function an(t){const e=hn();if(!e)throw pn;return un(e,L.stateConfig,t)}function un(t,e,n){const r=e.stateArray,o=e.states;return function(...e){return t.subject.renderCount>0?function(t,e,n,...r){const o=t.subject.global,s=(t=o.newest).state;$(s,n.stateArray,t.states,n.states);const c=e(...r);return $(n.stateArray,s,n.states,t.states),on(t),d(c)&&c.finally((()=>{$(n.stateArray,s,n.states,t.states),on(t)})),c}(t,n,{stateArray:r,states:o},...e):n(...e)}}const ln=()=>{const t=hn();if(!t)throw pn;const e=L.stateConfig;return function(n){return un(t,e,n)}},pn=new K("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function fn(t){P(t)}function dn(t){P((function(){hn().subject.global.destroy$.toCallback(t)}))}function gn(t){return L.stateConfig.handlers.statesHandler(t)}function hn(){return L.stateConfig.support}const bn=":tagvar",mn=":";function yn(t,e){const n={values:e,ownerSupport:hn(),tagJsType:a.tag,strings:t,key:t=>(n.arrayValue=t,n),html:function(t,e){return n.children={strings:t,values:e},n}};return n}function vn(t,e){const n={values:e,ownerSupport:hn(),dom:t,tagJsType:a.dom,key:function(t){return n.arrayValue=t,n},html:{dom:function(t,e){return n.children={dom:t,values:e},n}}};return n}const wn="ondoubleclick",Cn=/(:tagvar\d+:)/,jn=/(^:tagvar\d+:|:tagvar\d+:$)/g,Sn="__safeTagVar",kn=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,Tn=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function An(t,e){En(t,e);const n=function(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(Tn,"g");t=function(t){return t.replace(Pn,(function(t){return t.replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);for(;c<t.length;){const u=a.exec(t);if(!u)break;const[i,l,p]=u,f=i.startsWith("</"),d=i.endsWith("/>");if(c<u.index){const e=t.slice(c,u.index);if(e.trim()){xn(e).forEach((t=>{t.startsWith(bn)&&(t=bn+ ++s+mn),On(o,n,t)}))}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const g=[];let h;for(;null!==(h=kn.exec(p));){const t=h[1]||h[3]||h[5];let n=h[2]||h[4]||h[6];if(void 0===t)continue;const r=""!==h[2],o=void 0===n&&r,c=t.toLowerCase(),a=c.startsWith("on")?Jn(c):c;if(o){if(t.slice(0,bn.length)===bn){const t=bn+ ++s+mn;e.push(["at",t]),g.push([t]);continue}if(h[0].startsWith(t)&&h[0].slice(t.length,h[0].length).search(/\s+$/)>=0){g.push([a]);continue}n=bn+ ++s+mn}r||(n=h[2]);const u=[a,n],i=te(c);i&&u.push(i),g.push(u)}const b={nn:l};g.length&&(b.at=g),o?(o.ch||(o.ch=[]),o.ch.push(b)):n.push(b),d||(r.push(o),o=b)}if(c<t.length){const e=t.slice(c);if(e.trim()){xn(e).forEach((t=>(t.startsWith(bn)&&++s,On(o,n,t))))}}return n}(En(t,e).join(""));return n}function En(t,e){return function(t,e){const n=t.map(((t,n)=>n<e.length?t+bn+n+mn:t));return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(bn+(e.length+n-1)+mn)}(n,t,e),n}(t.map((t=>t.replace(jn,((t,e)=>Sn+e)))),e)}function xn(t){return t.split(Cn).filter((t=>""!==t))}function On(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:Vn(n)})}const Pn=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function Vn(t){return t.replace(/(\[l t\]!--[\s\S]*?--\[g t\])/g,(function(t){return t.replace(/\[l t\]/g,"<").replace(/\[g t\]/g,">").replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]")}))}function Jn(t){if(t.startsWith("on")){return t.length===wn.length&&t===wn?"dblclick":t.slice(2,t.length)}return t}const Wn=new RegExp(bn+"(\\d+)"+mn,"g"),Nn="ch";function Rn(t,e,n=[],r=[]){const o=t;for(let t=0;t<o.length;t++){const s=[...r,t],c=o[t];if(c.at){const t=c.at;c.at=_n(t,e)}if(c.ch){const t=c.ch,r=[...s,Nn];c.ch=Rn(t,e,n,r)}t=In(c,e,o,t)}return o}function In(t,e,n,r){if("text"!==t.nn)return r;const o=t;let c,a=o.tc;if(typeof a!==s.string)return r;for(;null!==(c=Wn.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=bn+o+mn,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,Wn.lastIndex=0}}return o.tc=a,r}function _n(t,e){return t.map((t=>{const[n,r,o]=t;if(n.startsWith(bn)){const t=parseInt(n.replace(bn,""),10);if(!isNaN(t)&&t<e)return[{tagJsVar:t}]}if(typeof r===s.string&&r.startsWith(bn)){const t=parseInt(r.replace(bn,""),10);if(!isNaN(t)&&t<e)return[n,{tagJsVar:t},o]}return t}))}const Mn="__safeTagVar";const Dn=/__safeTagVar(\d+)/g;function Ln(t){if(t.at&&(t.at=t.at?t.at.map((t=>{if(1===t.length)return t;const[,e]=t;if(typeof e===s.string&&e.startsWith(Mn)){const n=parseInt(e.replace(Mn,""),10);t[1]=bn+n+mn}return t})):[]),t.ch){const e=t.ch;for(let t=0;t<e.length;t++){const n=e[t];if("text"===n.nn){if(typeof n.tc!==s.string)return;n.tc=n.tc.replace(Dn,((t,e)=>bn+e+mn))}Ln(n)}0===e.length&&delete t.ch}}const $n={};function Hn(t,e){const n=function(t){const e=t.map((t=>t.length));return e.push(t.length),Number(e.join(""))}(t),r=$n[n],o=r&&function(t,e,n){if(n&&n.strings.length===t.length&&n.strings.every(((e,n)=>e===t[n]))&&n.values.length===e.length)return!0;return!1}(t,e,r);if(o)return r.domMetaMap;const s=Rn(An(t,e),e.length);s.forEach(Ln);const c={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return $n[n]=c,s}function Bn(t,...e){const n=yn(t,e),r=ot(wt.NONE);return r.tag=n,n.templater=r,n}Bn.dom=function(t,...e){return vn(t,e)};const Un=[];function zn(t,e,r){const o=Un.findIndex((t=>t.element===e));o>=0&&(Oe(Un[o].support),Un.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e}));let s=()=>l(r);s.propWatch=wt.NONE,s.tagJsType=a.stateRender,s.props=[r],s.isApp=!0;const u=function(t,e){const r={value:t,checkValueChange:De,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},Fn(t,r,e),r}(s,e),i=u.global;W(i.newest,L.stateConfig);let l=t(r);const f=typeof l==c.function;f||(p(l)?(i.newest.propsConfig={latest:[r],castProps:[r]},s.propWatch=l.propWatch,s.tagJsType=l.tagJsType,s.wrapper=l.wrapper,s=l):(s.tag=l,l=t));const d=document.createTextNode("");st.push(s.wrapper||{original:s});const g=Gn(s,d,e,u,f);i.isApp=!0,f&&(l.tag=g.templater.tag),e.destroy=function(){const t=i.events;for(const n in t){const r=t[n];e.removeEventListener(n,r)}i.events={};const n=Oe(g);return _t(),n},++It.locks;const h=pe(g,{added:0,removed:0},e,void 0);i.oldest=g,i.newest=g;let b=s.setUse;if(s.tagJsType!==a.stateRender){const e=t.original;b=e.setUse,e.isApp=!0}e.setUse=b,e.ValueTypes=a,Un.push({element:e,support:g});const m=document.createDocumentFragment();m.appendChild(d);for(const t of h.dom)Zn(t,m);for(const t of h.subs)Ze(t);return--It.locks,_t(),e.appendChild(m),{support:g,tags:st,ValueTypes:a}}function Fn(t,e,n){const r=e.global,o=dt(t,e);return gt(t,o,o),o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function Gn(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.newest,u=s.oldest;if(c===u||N(c,L.stateConfig,u.state,u.states),t.tagJsType===a.stateRender){const e=t.wrapper||{original:t};if(!o){const e=Fn(t,r,n);return Be(e),e}const s=lt(t,e,c);return Be(s),s}const i=(0,t.wrapper)(c,r);return Be(i),i}function Zn(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}const Xn={tagElement:zn,renderWithSupport:tn,renderSupport:on,renderTagOnly:Ue,paint:_t};var qn=e.W9,Qn=e.cg,Yn=e.m0,Kn=e.rS,tr=e.Y2,er=e.ei,nr=e.B7,rr=e.TU,or=e.XF,sr=e.PC,cr=e.Ot,ar=e.Mj,ur=e.tD,ir=e.j8,lr=e.um,pr=e.E2,fr=e.OH,dr=e.TB,gr=e.Ii,hr=e.yV,br=e.zV,mr=e.ze,yr=e.WJ,vr=e.aZ,wr=e.O,Cr=e.Ie,jr=e.B4,Sr=e.Az,kr=e.Xi,Tr=e.pc,Ar=e.Ah,Er=e.ck,xr=e.Gk,Or=e.cF,Pr=e.PB,Vr=e.qy,Jr=e.cy,Wr=e.Tn,Nr=e.Gv,Rr=e.yL,Ir=e.D8,_r=e.Ze,Mr=e._4,Dr=e.mn,Lr=e.Eb,$r=e.z,Hr=e.bc,Br=e.sA,Ur=e.MG,zr=e.PL,Fr=e.nI,Gr=e.PZ,Zr=e.N_,Xr=e.r5,qr=e.uc,Qr=e.pG,Yr=e.QB,Kr=e.R6,to=e.Ll,eo=e.vP,no=e.wk,ro=e.xP,oo=e.uz,so=e.ag,co=e.Tc,ao=e.Hf,uo=e._A,io=e.Ag,lo=e.NU,po=e.hW,fo=e.wB,go=e.id,ho=e.MC,bo=e.zC;export{qn as ArrayNoKeyError,Qn as BasicTypes,Yn as ImmutableTypes,Kn as PropWatches,tr as RouteQuery,er as StateMismatchError,nr as Subject,rr as Subjective,or as SyncCallbackError,sr as TagError,cr as ValueSubject,ar as ValueSubjective,ur as ValueTypes,ir as addOneContext,lr as buildBeforeElement,pr as callback,fr as callbackMaker,dr as checkArrayValueChange,gr as checkSimpleValueChange,hr as checkTagValueChange,br as combineLatest,mr as createTrigger,yr as defineValueOn,vr as destroyArray,wr as destroySupport,Cr as empty,jr as getBaseSupport,Sr as getDomMeta,kr as getDomTag,Tr as getHtmlSupport,Ar as getNewGlobal,Er as getStringTag,xr as getTemplaterResult,Or as hmr,Pr as howToSetInputValue,Vr as html,Jr as isArray,Wr as isFunction,Nr as isObject,Rr as isPromise,Ir as isSimpleType,_r as isStaticTag,Mr as isSubjectInstance,Dr as isTagComponent,Lr as key,$r as letProp,Hr as letState,Br as onDestroy,Ur as onInit,zr as oneRenderToSupport,Fr as paint,Gr as processFirstSubjectValue,Zr as processSubUpdate,Xr as providers,qr as renderSupport,Qr as renderTagOnly,Yr as renderWithSupport,Kr as runWrapper,to as setUseMemory,eo as signal,no as state,ro as states,oo as subject,so as syncError,co as tag,ao as tagElement,uo as tags,io as upgradeBaseToSupport,lo as variablePrefix,po as variableSuffix,fo as watch,go as willCallback,ho as willPromise,bo as willSubscribe};
|
|
2
2
|
//# sourceMappingURL=bundle.js.map
|