@plitzi/plitzi-sdk 0.36.2 → 0.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-CxhCXM28.js";import{Component as t,Fragment as r,Profiler as n,Suspense as i,createContext as a,createElement as s,isValidElement as o,lazy as l,use as u,useCallback as c,useContext as d,useEffect as h,useId as f,useLayoutEffect as p,useMemo as m,useRef as y,useState as g,useSyncExternalStore as b}from"react";import{jsx as w}from"react/jsx-runtime";var v=a(void 0);v.displayName="ElementContext";var x=a(void 0);x.displayName="ElementParentContext";var k=e=>!1!==e&&"false"!==e,S=(e,t)=>{let r=new Set(t),n={};for(let i in e)!r.has(i)&&Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},M=()=>{},A=class{items=[];notifying=0;dead=0;get length(){return this.items.length-this.dead}add(e){return this.items.push(e),()=>this.remove(e)}remove(e){let t=this.items.indexOf(e);if(-1===t)return;if(this.notifying>0)return this.items[t]=M,void this.dead++;let r=this.items.pop();t<this.items.length&&(this.items[t]=r)}begin(){this.notifying++}end(){0===--this.notifying&&this.dead>0&&this.compact()}forEach(e,t){this.begin();try{let r,{items:n}=this,i=n.length,a=0,s=!1;for(;a<i;)try{for(;a<i;a++)e(n[a])}catch(e){s||(s=!0,r=e),a++}if(s){if(!t)throw r;t(r)}}finally{this.end()}}clear(){if(this.notifying>0){let{items:e}=this;for(let t=0,r=e.length;t<r;t++)e[t]=M;return void(this.dead=e.length)}this.items.length=0,this.dead=0}compact(){let{items:e}=this,t=0;for(let r=0;r<e.length;r++)e[r]!==M&&(e[t++]=e[r]);e.length=t,this.dead=0}},T=(e,t)=>"function"==typeof e?!e(t):!1===e,P=e=>"object"==typeof e&&!!e&&!Array.isArray(e),N=(e,t)=>{if(!P(e)||!P(t))return t;let r={...e};for(let n of Object.keys(t))"__proto__"!==n&&(r[n]=n in e?N(e[n],t[n]):t[n]);return r},D=/* @__PURE__ */new Map,_=e=>{let t=D.get(e);return void 0===t&&(t=e.split("."),D.size>=512&&D.delete(D.keys().next().value),D.set(e,t)),t},j=/* @__PURE__ */new Map;function C(e,t){let r=Array.isArray(t);if("string"!=typeof t&&!r||r&&!t.length||"string"==typeof t&&!t)return e;if("string"==typeof t&&-1===t.indexOf("."))return"object"==typeof e&&e&&t in e?e[t]:void 0;if("string"==typeof t)return(e=>{let t=j.get(e);if(!t){if(t=(e=>{if(1===e.length){let t=e[0];return e=>"object"==typeof e&&e&&t in e?e[t]:void 0}return t=>{let r=t;for(let n=0;n<e.length;n++){if("object"!=typeof r||!r)return;r=r[e[n]]}return r}})(_(e)),j.size>=512){let e=j.keys().next().value;j.delete(e)}j.set(e,t)}return t})(t)(e);let n=e;for(let i of t){if("object"!=typeof n||!n||!(i in n))return;n=n[i]}return n}var O,W=Symbol("unchanged"),E=e=>/^\d+$/.test(e),$=e=>Array.isArray(e)?e.slice():{...e},F=(e,t,r,n,i)=>{let a=t[r],s="object"==typeof e&&e?e:{};if(r===t.length-1){let e=s[a],t=i?n(e):n;if(e===t)return W;let r=$(s);return r[a]=t,r}let o=F(s[a],t,r+1,n,i);if(o===W)return W;let l=$(s);return l[a]=o,l},z=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,I=e=>z.test(e)?`.${e}`:`[${JSON.stringify(e)}]`,Y=e=>z.test(e)?e:JSON.stringify(e),H=e=>{let t=e.length,r="";for(let a=0;a<t-1;a++){let t=0===a?"o":"_"+(a-1);r+=`var _${a}=${t}==null?void 0:${t}${I(e[a])};\n`}let n=t>1?"_"+(t-2):"o";r+=`var _p=${n}==null?void 0:${n}${I(e[t-1])};\n`,r+="var _v=f?v(_p):v;\nif(_p===_v)return null;\n";let i="_v";for(let a=t-1;a>=0;a--)i=`{...${0===a?"o":`(_${a-1}||{})`},${Y(e[a])}:${i}}`;return r+=`return ${i};`,Function("o","v","f",r)},q=/* @__PURE__ */new Map,L=(e,t,r)=>{if("object"!=typeof e||!e)return W;let n=e,i=t[r];if(!Object.hasOwn(n,i))return W;if(r===t.length-1){let e=$(n);return Array.isArray(e)?e.splice(Number(i),1):delete e[i],e}let a=L(n[i],t,r+1);if(a===W)return W;let s=$(n);return s[i]=a,s},U=(e,t,r,n,i)=>{let a=((e,t)=>{if(!(()=>{if(typeof window>"u")return!1;if(void 0===O)try{H(["x","y"])({x:{}},1,!1),O=!0}catch{O=!1}return O})())return;let r=q.get(e);if(r)return r;if(t.some(E))return;let n=H(t);return q.size>=256&&q.delete(q.keys().next().value),q.set(e,n),n})(t,r);if(a){let t=a(e,n,i);return null===t?W:t}return F(e,r,0,n,i)},B=Symbol("@plitzi/nexus/cancel"),R=(()=>{try{return"production"}catch{}return"production"})(),V="production"===R,X=!V,Z="test"===R;var Q=e=>"number"==typeof e||""===e||isNaN(Number(e))?e:Number(e),G=e=>Array.isArray(e)?e.slice():{...e},J=(e,t,r,n)=>{let i=Q(t[r]),a=G(e);return a[i]=r===t.length-1?n:J(e[i]??{},t,r+1,n),a},K=Symbol("no-error"),ee=(e,t,r)=>{let n=0,i=K;for(;n<r;)try{for(;n<r;n++)e[n](t)}catch(e){i===K&&(i=e),n++}return i},te="__proto__";var re=(e,t)=>e===t||e.startsWith(`${t}.`),ne=class{reportError;records=/* @__PURE__ */new Map;listeners=/* @__PURE__ */new Set;announced=/* @__PURE__ */new Set;timer;snapshot;constructor(e){this.reportError=e}get size(){return this.records.size}getRecords(){return this.snapshot??=Object.fromEntries(this.records),this.snapshot}subscribe(e){return this.listeners.add(e),this.schedule(),()=>{this.listeners.delete(e),this.schedule()}}record(e,t,r,n){this.drop(e,n,!1);let i=Math.max(0,t),a={updatedAt:r,expiresAt:r+i,ttl:i};this.records.set(e,a),this.announced.delete(e),this.changed(),n||this.emit({path:e,type:"recorded",freshness:a})}drop(e,t,r=!0){if(0!==this.records.size)for(let n of[...this.records.keys()])(n===e?r:n.startsWith(`${e}.`))&&this.forget(n,t)}dropChanged(e,t,r){for(let n of[...this.records.keys()])C(e,n)!==C(t,n)&&this.forget(n,r)}get(e){if(0===this.records.size)return;let t=e;for(;;){let e=this.records.get(t);if(e)return e;let r=t.lastIndexOf(".");if(-1===r)return;t=t.slice(0,r)}}expire(e,t){let r=[];if(this.records.forEach((n,i)=>{(void 0===e||re(i,e)||re(e,i))&&(n.expiresAt>t&&this.records.set(i,{...n,expiresAt:t}),this.announced.add(i),r.push(i))}),r.length>0){this.changed();for(let e of r)this.emit({path:e,type:"expired",freshness:this.records.get(e)})}return r}forget(e,t){let r=this.records.get(e);this.records.delete(e),this.announced.delete(e),this.changed(),t||this.emit({path:e,type:"dropped",freshness:r})}changed(){this.snapshot=void 0,this.schedule()}emit(e){for(let t of[...this.listeners])try{t(e)}catch(Fs){this.reportError(Fs,e.path)}}schedule(){if(clearTimeout(this.timer),this.timer=void 0,0===this.listeners.size)return;let e=1/0;this.records.forEach((t,r)=>{!this.announced.has(r)&&t.expiresAt<e&&(e=t.expiresAt)}),e!==1/0&&(this.timer=setTimeout(()=>this.elapse(),Math.min(2147483647,Math.max(0,e-Date.now()))))}elapse(){let e=Date.now(),t=[];this.records.forEach((r,n)=>{!this.announced.has(n)&&r.expiresAt<=e&&(this.announced.add(n),t.push(n))});for(let r of t)this.emit({path:r,type:"elapsed",freshness:this.records.get(r)});this.schedule()}},ie=class{subscribers=null;children=null},ae=class{direct=/* @__PURE__ */new Map;descendants=/* @__PURE__ */new Map;root=new ie;size=0;add(e,t){let r=_(e),n=this.direct.get(e);if(!n){n=new A,this.direct.set(e,n);let t=this.root;for(let e of r){t.children||(t.children=/* @__PURE__ */new Map);let r=t.children.get(e);r||(r=new ie,t.children.set(e,r)),t=r}t.subscribers=n,this.size++;let i="";for(let n=0;n<r.length-1;n++){i=i?`${i}.${r[n]}`:r[n];let t=this.descendants.get(i);t||(t=/* @__PURE__ */new Set,this.descendants.set(i,t)),t.add(e)}}return n.add(t),()=>this.remove(e,n,t,r)}remove(e,t,r,n){if(this.direct.get(e)!==t||(t.remove(r),t.length>0))return;this.direct.delete(e),this.size--;let i=this.root;for(let s of n){if(!i.children)return;let e=i.children.get(s);if(!e)return;i=e}i.subscribers===t&&(i.subscribers=null);let a="";for(let s=0;s<n.length-1;s++){a=a?`${a}.${n[s]}`:n[s];let t=this.descendants.get(a);t&&(t.delete(e),0===t.size&&this.descendants.delete(a))}}walkAncestors(e,t){let r=this.root;for(let n of e){if(!r.children)return;let e=r.children.get(n);if(!e)return;r=e,r.subscribers&&t(r.subscribers)}}getDescendants(e){return this.descendants.get(e)}forEachAffected(e,t,r){let n=e=>{e&&e.forEach(t,r)};if("string"!=typeof e)return void this.direct.forEach(n);let i=_(e);this.walkAncestors(i,n),this.descendants.get(e)?.forEach(e=>n(this.direct.get(e)))}clear(){this.direct.clear(),this.descendants.clear(),this.root.children=null,this.root.subscribers=null,this.size=0}},se=0;function oe(e,t){let r,n,i,a={},s=new A,o=new A,l=new ae,u=new A,c=()=>{0!==u.length&&u.forEach(e=>e())},d=[],h=[],f=[],p=t?.parent,m=++se,y=(e,t,r)=>{if(0===h.length)throw e;let n={error:e,phase:t,path:r};for(let i=0,a=h.length;i<a;i++)h[i](n)},g=new ne((e,t)=>y(e,"notify",t)),b=()=>a,w=()=>r??={...a},{getState:v,getPath:x,invalidate:k,resetCache:S,getMergeCount:M}=function(e,t,r,n){if(!r)return{getState:t,getPath:t=>C(e(),t),invalidate:()=>{},resetCache:()=>{},getMergeCount:()=>0};let i,a=r,s=n&&n.length>0?new Set(n):void 0,o=!0,l=!1,u=0,c=/* @__PURE__ */new Map,d=/* @__PURE__ */new Map;return{getState:()=>((o||void 0===i)&&(i=(()=>{u++;let e=t(),r=N(a.getState(),e);if(s)for(let t of s)void 0!==e[t]&&(r[t]=e[t]);return r})(),o=!1),i),getPath:t=>{if(l)c.clear(),l=!1;else if(c.has(t))return c.get(t);let r=(t=>{if(s){let r=t.indexOf("."),n=-1===r?t:t.slice(0,r);if(s.has(n)&&void 0!==e()[n])return C(e(),t)}let r=C(e(),t);if(void 0===r)return a.getPath(t);let n=a.getPath(t);if(void 0===n||!P(r)||!P(n))return r;let i=d.get(t);if(i&&i.own===r&&i.parent===n)return i.value;u++;let o=N(n,r);return d.set(t,{own:r,parent:n,value:o}),o})(t);return c.set(t,r),r},invalidate:()=>{o=!0,l=!0},resetCache:()=>{c.clear(),d.clear(),i=void 0,o=!0,l=!1},getMergeCount:()=>u}}(b,w,p,t?.exclusive),T=()=>{k(),c()},D=!1;p&&(S(),i=p.subscribeInvalidate?.(T));let{setState:j,batch:O}=function(e){let{getOwnState:t,getOwnSnapshot:r,setOwnState:n,mutateOwnKey:i,deleteOwnKey:a,parent:s,listeners:o,pathListeners:l,changeListeners:u,interceptors:c,readOnly:d,freshness:h,reportError:f,invalidateDescendants:p,onDelegateToParent:m}=e,y=e=>{if(0===d.length||!(e=>{for(let t=0,r=d.length;t<r;t++){let r=d[t];if(e===r||e.startsWith(`${r}.`)||r.startsWith(`${e}.`))return!0}return!1})(e))return!1;if(X)throw Error(`@plitzi/nexus: refused to write to read-only path "${e}"`);return!0},g=(e,t,r)=>{let n=t;for(let i=0,a=c.length;i<a;i++){let a;try{a=c[i]({path:e,value:n,prev:r})}catch(t){return f(t,"beforeChange",e),B}if(a===B)return B;void 0!==a&&(n=a)}return n},b=(e,t,r)=>{void 0===t?h.size>0&&h.drop(e,r):h.record(e,t,Date.now(),r)},w=0,v=/* @__PURE__ */new Set,x=(e,t)=>{let{items:r}=e;if(w>0)for(let n=0,i=r.length;n<i;n++)v.add(r[n]);else if(0!==r.length){e.begin();try{let e=ee(r,t,r.length);e!==K&&f(e,"notify",t)}finally{e.end()}}},k=(e,t,r)=>{let n={path:e,prev:t,next:r,prevValue:void 0===e?t:C(t,e),nextValue:void 0===e?r:C(r,e)},{items:i}=u;u.begin();try{let t=ee(i,n,i.length);t!==K&&f(t,"onChange",e)}finally{u.end()}},S=(e,t,r,n)=>{let i=l.getDescendants(e);if(i)for(let a of i){let i=l.direct.get(a);if(!i)continue;let s=_(a).slice(n);C(t,s)!==C(r,s)&&x(i,e)}},M=(e,t,r,i,a)=>{let s=e?C(r,e):void 0,f=e?a?t(s):t:void 0;if(e&&c.length>0){let t=g(e,f,s);if(t===B)return;f=t}if(e&&s===f)return;let m=e?((e,t,r)=>{if("string"==typeof t){if(!t)return r;let n=_(t);if(1===n.length){let t=G(e);return t[Q(n[0])]=r,t}return J(e,n,0,r)}return Array.isArray(t)&&t.length?J(e,t,0,r):r})(r,e,f):a?t(r):{...r,...t};if(!e&&c.length>0){let e=g(void 0,m,r);if(e===B)return;m=e}if(m!==r){if(d.length>0)for(let e=0,t=d.length;e<t;e++){let t=d[e];if(C(r,t)!==C(m,t)){if(X)throw Error(`@plitzi/nexus: refused to write to read-only path "${d[e]}"`);return}}h.size>0&&h.dropChanged(r,m,!i),n(m),u.length>0&&k(e,r,m),p(),i&&(x(o,e),l.size>0&&l.direct.forEach((t,n)=>{C(r,n)!==C(m,n)&&x(t,e)}))}};return{setState:(e,d,f={})=>{let{canPropagate:w=!0,unmount:v=!1,raw:A=!1,ttl:T}=f,P=t(),N=!A&&"function"==typeof d;if("string"==typeof e&&-1!==e.indexOf(te)&&-1!==_(e).indexOf(te))throw Error(`@plitzi/nexus: refused to write to unsafe path "${e}" (\`__proto__\` segment)`);if("string"==typeof e&&y(e))return;if(s&&"string"==typeof e&&!(-1===e.indexOf(".")?Object.hasOwn(P,e):((e,t)=>{let r=e;for(let n=0,i=t.length;n<i;n++){if("object"!=typeof r||!r||!Object.hasOwn(r,t[n]))return!1;r=r[t[n]]}return!0})(P,_(e))))return m?.(e),void s.setState(e,d,{canPropagate:w,unmount:v,raw:A,ttl:T});if("string"!=typeof e)return void M(e,d,P,w,N);if(-1===e.indexOf(".")){if(v){if(!Object.hasOwn(P,e))return;let t=P[e];if(c.length>0&&g(e,void 0,t)===B)return;h.drop(e,!w);let n=u.length>0?r():void 0;if(a(e),void 0!==n&&k(e,n,r()),w&&(x(o,e),l.size>0)){let r=l.direct.get(e);r&&x(r,e),S(e,t,void 0,1)}return void p()}let t=P[e],n=N?d(t):d,s=n;if(c.length>0){let r=g(e,n,t);if(r===B)return;s=r}if(b(e,T,!w),t===s)return;let f=u.length>0?r():void 0;if(i(e,s),void 0!==f&&k(e,f,r()),w&&(x(o,e),l.size>0)){let r=l.direct.get(e);r&&x(r,e),S(e,t,s,1)}return void p()}let D,j=_(e);if(v){if(c.length>0&&g(e,void 0,C(P,e))===B)return;h.drop(e,!w),D=((e,t)=>L(e,t,0))(P,j)}else if(c.length>0){let t=C(P,e),r=N?d(t):d,n=g(e,r,t);if(n===B)return;D=U(P,e,j,n,!1)}else D=U(P,e,j,d,N);if(v||b(e,T,!w),D===W)return;let O=D;n(O),u.length>0&&k(e,P,O),w&&(x(o,e),l.size>0&&(((e,t)=>{l.walkAncestors(t,t=>x(t,e))})(e,j),S(e,P,O,0))),p()},batch:e=>{w++;try{return e()}finally{if(w--,0===w&&v.size>0){let e=[...v];v.clear();let t=ee(e,void 0,e.length);t!==K&&f(t,"notify",void 0)}}}}}({getOwnState:b,getOwnSnapshot:w,setOwnState:e=>{a=e,r=void 0,k()},mutateOwnKey:(e,t)=>{a[e]=t,k(),r=void 0},deleteOwnKey:e=>{delete a[e],k(),r=void 0},parent:p,listeners:s,pathListeners:l,changeListeners:o,interceptors:d,readOnly:t?.readOnly??[],freshness:g,reportError:y,invalidateDescendants:c,onDelegateToParent:X&&p?e=>p.scopeClaims?.claimDelegatedWrite(e,m):void 0}),E=()=>{n&&(n.unsubscribe(),n=void 0,S())},$=()=>{p&&(!D&&(s.length>0||l.size>0||o.length>0)?!n&&p&&(k(),S(),n=function(e,t,r,n,i,a,s){let o;return{unsubscribe:e.subscribe(e=>{s();let l=e;if(t.forEach(t=>t(e),e=>a(e,"notify",l)),r.size>0&&r.forEachAffected(e,t=>t(e),e=>a(e,"notify",l)),n.length>0){let e=i(),t=o??e,r={path:l,prev:t,next:e,prevValue:void 0===l?t:C(t,l),nextValue:void 0===l?e:C(e,l)};o=e,n.forEach(e=>e(r),e=>a(e,"onChange",l))}}),seedBaseline:()=>{o??=i()}}}(p,s,l,o,v,y,k),o.length>0&&n.seedBaseline()):E())},F=e=>($(),()=>{e(),$()}),z=e=>F(s.add(e)),I=(e,t)=>F(l.add(e,t)),Y=e=>{let t=F(o.add(e));return n?.seedBaseline(),t};a="function"==typeof e?e(j,v):e;let H=e=>g.get(e)??p?.getFreshness(e),q={id:t?.id,scopePath:t?.scopePath,getState:v,getOwnState:w,getPath:x,setState:j,get:e=>void 0===e?v():x(e),set:j,watch:(e,t)=>"function"==typeof e?z(e):I(e,t),withBase:e=>{let t=(t,r,n)=>j(void 0===t?e:`${e}.${t}`,r,n);return{getState:t=>{let r=x(e);return void 0===r&&void 0!==t?t:r},getPath:(t,r)=>{let n=x(`${e}.${t}`);return void 0===n&&void 0!==r?r:n},setState:t,subscribe:t=>I(e,t),subscribePath:(t,r)=>I(`${e}.${t}`,r),get:t=>x(void 0===t?e:`${e}.${t}`),set:t,watch:(t,r)=>"function"==typeof t?I(e,t):I(`${e}.${t}`,r)}},batch:O,subscribe:z,subscribePath:I,subscribeChange:Y,getFreshness:H,isStale:e=>{let t=H(e);return!t||Date.now()>=t.expiresAt},expire:e=>{let t=g.expire(e,Date.now()),r=p?p.expire(e):[];return 0===r.length?t:[...t,...r]},watchFreshness:(e,t)=>{let r="function"==typeof e?void 0:e,n="function"==typeof e?e:t,i=void 0===r?n:e=>{let t=e.path;(t===r||t.startsWith(`${r}.`)||r.startsWith(`${t}.`))&&n(e)},a=g.subscribe(i),s=p?.watchFreshness(i);return()=>{a(),s?.()}},getFreshnessRecords:()=>g.getRecords(),destroy:()=>{D=!0,E(),s.clear(),l.clear(),o.clear(),u.clear(),i?.(),X&&p&&p.scopeClaims?.releaseScope(m)},reconnect:()=>{D=!1,p&&(i?.(),i=p.subscribeInvalidate?.(T)),$()},subscribeInvalidate:e=>u.add(e),hydrate:()=>{for(let e of f)e()}};if(t?.middlewares)for(let A of t.middlewares){let e=A(q);e?.beforeChange&&d.push(e.beforeChange),e?.onChange&&Y(e.onChange),e?.onError&&h.push(e.onError);let r=e?.hydrate;r&&(t.deferHydrate?f.push(()=>r(q)):r(q))}return X&&(q.scopeClaims=(()=>{let e=/* @__PURE__ */new Map,t=/* @__PURE__ */new Map;return{claimDelegatedWrite(r,n){let i=e.get(r);if(void 0!==i){if(i===n)return;if(Z)throw Error((e=>`@plitzi/nexus: scope collision — two sibling scopes under the same parent both delegate a write to "${e}", clobbering each other through the shared parent. Write to a path each scope owns, or move the shared value into the parent and update it there.`)(r));return}e.set(r,n);let a=t.get(n);a?a.add(r):t.set(n,/* @__PURE__ */new Set([r]))},releaseScope(r){let n=t.get(r);if(n){for(let t of n)e.delete(t);t.delete(r)}}}})()),Z&&(q.listeners=s,q.pathListeners=l,q.changeListeners=o,q.interceptors=d,q.errorHandlers=h,q.invalidateListeners=u,q.getMergeCount=M),q}var le=a(void 0);le.displayName="StoreContext";var ue=a(void 0);ue.displayName="StoreRegistryContext";var ce=(e,t)=>{for(let r=e;r;r=r.parent)if(r.id===t)return r.store},de=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Object.is(e[r],t[r]))return!1;return!0};function he(e,t,r){let n=d(le),i=d(ue);if(e)return e;if(void 0!==r){let e=ce(i,r);if(!e)throw Error(`${t}: no store registered with id "${r}" in any ancestor StoreProvider`);return e}if(!n)throw Error(`${t} must be used inside a StoreProvider`);return n}function fe(e,t,r){let n=t.current.length;return m(()=>Array.from({length:n},(r,n)=>(r,i)=>{let a=t.current[n],s="function"==typeof a?a(e.getState()):a;e.setState(s,r,i)}),[e,r])}var pe=typeof window<"u"?p:h,me=(e,t)=>{if(Object.is(e,t))return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i of r)if(!Object.is(e[i],t[i]))return!1;return!0};function ye(e,t,r={}){let n=r,i=he(n.store,"useStoreSync",n.storeId);Array.isArray(e)?function(e,t,r,n){let{mode:i="sync",enabled:a=!0,syncStrategy:s="afterRender",raw:o=!1,ttl:l}=n,u=t.map((e,t)=>"function"==typeof e?`fn_${t}`:e).join("|"),c=y(!1),d=!c.current;c.current=!0;let h=y(void 0),f=a&&(d||"sync"===i&&r.some((e,t)=>!Object.is(h.current?.[t],e))),p=(n=!0)=>{h.current=r,e.batch(()=>{t.forEach((t,i)=>{let a="function"==typeof t?t(e.getState()):t;e.setState(a,r[i],{canPropagate:n,raw:o,ttl:l})})})};"render"===s?f&&p():(f&&d&&p(!1),pe(()=>{f&&!d&&p()},[f,r,u]))}(i,e,t,r):function(e,t,r,n){let i=void 0===t,a="function"==typeof t,s=i?me:Object.is,{mode:o="sync",enabled:l=!0,equalityFn:u=s,syncStrategy:c="afterRender",raw:d=!1,ttl:h}=n,f=y(void 0),p=y(!1),m=!p.current;p.current=!0;let g=f.current,b=l&&(m||"sync"===o&&(void 0===g||!u(g,r))),w=(n=!0)=>{if(f.current=r,i)e.setState(void 0,e=>({...e,...r}),{canPropagate:n});else if(a){let i=t(e.getState());e.setState(i,r,{canPropagate:n,raw:d,ttl:h})}else e.setState(t,r,{canPropagate:n,raw:d,ttl:h})};"render"===c?b&&w():(b&&m&&w(!1),pe(()=>{b&&!m&&w()},[b,r,t]))}(i,e,t,r)}var ge=[];var be=()=>({useStore:function(e,t){return function(e,t={}){let r=he(t.store,"useStore",t.storeId),n=Array.isArray(e),i=function(e,t,r){let n=r.mode??"sync",i=r.enabled??!0,a=void 0===t,s=r.equalityFn??(a?me:Object.is),o=r.transformer,l=y(o);l.current=o;let u=m(()=>function(e,t){return()=>{if("string"==typeof t)return e.getPath(t);if("function"==typeof t){let r=e.getState();return C(r,t(r))}return e.getState()}}(e,t),[e,t]),d=y(u()),h=m(()=>r=>i&&"mount"!==n?"string"==typeof t?e.subscribePath(t,r):e.subscribe(r):()=>{},[i,n,t,e]),f=()=>{if(!i)return d.current;if("mount"===n)return u();let e=u();return s(d.current,e)?d.current:(d.current=e,e)},p=b(h,f,f);return[m(()=>l.current?l.current(p):p,[p]),c((r,n)=>{a?e.setState(void 0,r,n):"function"==typeof t?e.setState(t(e.getState()),r,n):e.setState(t,r,n)},[e,t])]}(r,n?void 0:e,n?{...t,enabled:!1,transformer:void 0}:t),a=function(e,t,r){let n=r.mode??"sync",i=r.enabled??!0,a=r.equalityFn??de,s=r.transformer,o=y(s);o.current=s;let l=y(t);l.current=t;let u=t.map((e,t)=>"function"==typeof e?`fn_${t}`:e).join("|"),d=y(null),h=m(()=>function(e,t,r,n={}){let{equalityFn:i=de}=n;return()=>{let n=t.current,a=n.some(e=>"function"==typeof e)?e.getState():void 0,s=n.map(t=>"function"==typeof t?C(a,t(a)):e.getPath(t)),o=r.current;return null!==o&&i(o,s)?o:(r.current=s,s)}}(e,l,d,{equalityFn:a}),[e,u,a]),f=function(e,t,r,n,i){return m(()=>r=>{if(!n||"mount"===i)return()=>{};let a=t.current;if(a.some(e=>"function"==typeof e))return e.subscribe(r);let s=a.map(t=>e.subscribePath(t,r));return()=>s.forEach(e=>e())},[e,r,n,i])}(e,l,u,i,n),p=function(e,t,r,n){let i=c(()=>{if(!r){let e=n.current??t();return n.current=e,e}return t()},[r,t,n]);return b(e,i,i)}(f,h,i,d);return[m(()=>o.current?o.current(p):p,[p]),...fe(e,l,u)]}(r,n?e:ge,n?t:{...t,enabled:!1,transformer:void 0});return n?a:i}(e,t)},useStoreSync:function(e,t,r){ye(e,t,r)},useStoreGetter:function(e,t){return function(e,t){let r="string"==typeof e?e:void 0,n=Array.isArray(e)?e:void 0,i="object"!=typeof e||Array.isArray(e)?t:e,a=he(i?.store,"useStoreGetter",i?.storeId),s=n?.map(e=>"function"==typeof e?e.toString():e).join("|");return m(()=>{if(n)return n.map(e=>(t,r)=>{let n="function"==typeof e?e(a.getState()):C(a.getState(),e);if(void 0!==t){let e=C(n,t);return void 0===e&&void 0!==r?r:e}return void 0===n&&void 0!==r?r:n});if(void 0!==r){let e=a.withBase(r);return(t,r)=>void 0===t?void 0===r?e.getState():e.getState(r):void 0===r?e.getPath(t):e.getPath(t,r)}return(e,t)=>{let r=a.getState();if(void 0!==e){let n=C(r,e);return void 0===n&&void 0!==t?t:n}return r}},[a,r,s])}(e,t)},useStoreSetter:function(e,t){return function(e,t){let r="string"==typeof e?e:void 0,n="object"==typeof e?e:t,i=he(n?.store,"useStoreSetter",n?.storeId);return m(()=>void 0===r?i.setState:i.withBase(r).setState,[i,r])}(e,t)},useFreshness:function(e,t){return function(e,t={}){let{enabled:r=!0}=t,n=he(t.store,"useFreshness",t.storeId),i=y(void 0),a=c(t=>r?n.watchFreshness(e,t):()=>{},[n,e,r]),s=c(()=>{let t=(e=>({isStale:!e||Date.now()>=e.expiresAt,updatedAt:e?.updatedAt,expiresAt:e?.expiresAt}))(n.getFreshness(e));return i.current&&((e,t)=>e.isStale===t.isStale&&e.updatedAt===t.updatedAt&&e.expiresAt===t.expiresAt)(i.current,t)?i.current:(i.current=t,t)},[n,e]);return b(a,s,s)}(e,t)},useOnStale:function(e,t,r){!function(e,t,r={}){let{enabled:n=!0}=r,i=he(r.store,"useOnStale",r.storeId),a=y(t);h(()=>{a.current=t},[t]),h(()=>{if(n)return i.watchFreshness(e,e=>{("expired"===e.type||"elapsed"===e.type)&&a.current(e)})},[i,e,n])}(e,t,r)}});function we(e){return he(void 0,"useStoreById",e)}var{useStore:ve,useStoreSync:xe,useStoreGetter:ke,useStoreSetter:Se}=be(),{useStore:Me,useStoreSync:Ae,useStoreGetter:Te,useStoreSetter:Pe}=be(),{useStore:Ne,useStoreSync:De,useStoreGetter:_e,useStoreSetter:je}=be(),Ce=Symbol("twigArrowParams"),Oe=(e,t)=>e===t?0:null==e?-1:null==t?1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t)),We=e=>null==e?"":String(e),Ee=e=>"object"==typeof e&&!!e&&"__PLITZI_RAW__"===e.__marker,$e=e=>Ee(e)?e.__raw:e,Fe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ze=/* @__PURE__ */new Map,Ie={raw:e=>(e=>({__raw:e,__marker:"__PLITZI_RAW__"}))(e),to_json:e=>"object"==typeof e&&e?JSON.stringify(e):We(e),json_encode:e=>"object"==typeof e&&e?JSON.stringify(e):We(e),object_as_json:e=>"object"==typeof e&&e?JSON.stringify(e):e,default:(e,t)=>(e=>null==e||""===e)(e)?t[0]:e,upper:e=>"string"==typeof e?e.toUpperCase():e,lower:e=>"string"==typeof e?e.toLowerCase():e,trim:e=>"string"==typeof e?e.trim():e,capitalize:e=>"string"==typeof e&&e.length>0?e[0].toUpperCase()+e.slice(1).toLowerCase():e,title:e=>"string"==typeof e?e.replace(/\b\w/g,e=>e.toUpperCase()):e,camelize:e=>"string"==typeof e?e.replace(/[-_]+(.)?/g,(e,t)=>t?t.toUpperCase():""):e,kebab:e=>"string"==typeof e?e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():e,snake:e=>"string"==typeof e?e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase():e,ltrim:e=>"string"==typeof e?e.trimStart():e,rtrim:e=>"string"==typeof e?e.trimEnd():e,pad:(e,t)=>{if("string"!=typeof e)return e;let r=Number(t[0])||0,n=t.length>1?We(t[1]):" ";if(""===n)return e;let i=r-e.length;if(i<=0)return e;let a=Math.ceil(i/n.length);return n.repeat(a).slice(0,i)+e},padRight:(e,t)=>{if("string"!=typeof e)return e;let r=Number(t[0])||0,n=t.length>1?We(t[1]):" ";if(""===n)return e;let i=r-e.length;if(i<=0)return e;let a=Math.ceil(i/n.length);return e+n.repeat(a).slice(0,i)},number:(e,t)=>{if("number"==typeof e){let r=Number(t[0])||0;return e.toFixed(r)}if("string"!=typeof e)return e;let r=e.match(/-?\d+(?:\.\d+)?/);return r?Number(r[0]):0},replace:(e,t)=>"string"!=typeof e||0===t.length?e:e.split(We(t[0])).join(We(t[1])),slice:(e,t)=>{if(0===t.length)return e;let r=Number(t[0])||0,n=t.length>1&&Number.isFinite(Number(t[1]))?r+Number(t[1]):void 0;return"string"==typeof e||Array.isArray(e)?e.slice(r,n):e},split:(e,t)=>"string"==typeof e&&t.length>0?e.split(We(t[0])):e,join:(e,t)=>Array.isArray(e)?e.join(0===t.length?"":We(t[0])):e,reverse:e=>"string"==typeof e?e.split("").reverse().join(""):Array.isArray(e)?[...e].reverse():e,length:e=>"string"==typeof e||Array.isArray(e)?e.length:"number"==typeof e?We(e).length:"object"==typeof e&&e?Object.keys(e).length:0,first:e=>"string"==typeof e?e.length>0?e[0]:"":Array.isArray(e)?e.length>0?e[0]:void 0:e,last:e=>"string"==typeof e?e.length>0?e[e.length-1]:"":Array.isArray(e)?e.length>0?e[e.length-1]:void 0:e,contains:(e,t)=>{if(0===t.length)return!1;let r=t[0];return"string"==typeof e?e.includes(We(r)):!!Array.isArray(e)&&e.includes(r)},startswith:(e,t)=>"string"==typeof e&&t.length>0&&e.startsWith(We(t[0])),endswith:(e,t)=>"string"==typeof e&&t.length>0&&e.endsWith(We(t[0])),number_format:(e,t)=>{if("number"!=typeof e)return e;let r=Number(t[0])||0,n=null==t[1]?".":We(t[1]),i=null==t[2]?"":We(t[2]),a=e.toFixed(r);if(""===i)return a.replace(".",n);let s=a.split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,i),s.join(n)},sort:(e,t)=>{if(!Array.isArray(e))return e;let r=[...e],n=t[0];if("function"==typeof n){let e=n;return(e[Ce]??1)>=2?r.sort((t,r)=>Number(e(t,r))):r.sort((t,r)=>Oe(e(t),e(r)))}return r.sort(Oe)},batch:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=Number(t[0]);if(r<=0)return e;let n=[];for(let i=0;i<e.length;i+=r)n.push(e.slice(i,i+r));return n},map:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=t[0];return"function"==typeof r?e.map((e,t)=>r(e,t)):e},reduce:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=t[0];if("function"!=typeof r)return e;let n=t[1],i=+(void 0===n),a=void 0===n?e[0]:n;for(let s=i;s<e.length;s++)a=r(a,e[s],s);return a},merge:(e,t)=>{if(0===t.length)return e;let r=t[0];return Array.isArray(e)&&Array.isArray(r)?[...e,...r]:"object"==typeof e&&e&&"object"==typeof r&&r&&!Array.isArray(r)?{...e,...r}:e},keys:e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.keys(e):e,values:e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.values(e):e,filter:(e,t)=>{if(!Array.isArray(e))return e;if(0===t.length)return e.filter(Boolean);let r=t[0];if("function"==typeof r)return e.filter((e,t)=>r(e,t));let n=We(r);return e.filter(e=>{if("object"==typeof e&&e){let t=e[n];return null!=t&&!1!==t&&""!==t}return!!e})},column:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=We(t[0]);return e.map(e=>"object"==typeof e&&e?e[r]:void 0)},url_encode:e=>"string"==typeof e?encodeURIComponent(e):"object"==typeof e&&e&&!Array.isArray(e)?new URLSearchParams(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,We(t)]))).toString():e,nl2br:e=>"string"==typeof e?e.replace(/\n/g,"<br>"):e,striptags:(e,t)=>{if("string"!=typeof e)return e;let r=t.length>0?We(t[0]).trim():"";if(r){let t=r.split(/(?:\s*>\s*<\s*|<\s*|>\s*)/).filter(Boolean).map(e=>e.replace(/[/>]/g,"").trim());if(t.length>0){let r=RegExp(`<(?!/?(?:${t.join("|")})\\b)[^>]+>`,"gi");return e.replace(r,"").replace(/\s+/g," ").trim()}}return e.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()},abs:e=>"number"==typeof e?Math.abs(e):e,round:(e,t)=>{if("number"!=typeof e)return e;let r=Number(t[0])||0,n=null==t[1]?"common":We(t[1]),i=10**r;return"ceil"===n?Math.ceil(e*i)/i:"floor"===n?Math.floor(e*i)/i:Math.round(e*i)/i},format:(e,t)=>{if("string"!=typeof e)return e;let r=0;return e.replace(/%s|%d|%f|%%/g,e=>{if("%%"===e)return"%";let n=t[r];return r++,void 0===n?e:"%d"===e?String(Math.floor(Number(n))):"%f"===e?String(Number(n)):We(n)})},spaceless:e=>"string"==typeof e?e.replace(/>\s+</g,"><").trim():e,random:e=>Array.isArray(e)?e.length>0?e[Math.floor(Math.random()*e.length)]:void 0:"string"==typeof e?e.length>0?e[Math.floor(Math.random()*e.length)]:"":"number"==typeof e?Math.floor(Math.random()*e):e,date:(e,t)=>{if(0===t.length)return e;let r=We(t[0]),n=e instanceof Date?e:new Date(String(e));if(Number.isNaN(n.getTime()))return"";let i=((e,t)=>{if(!t)return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),weekday:e.getDay()};let r=(e=>{if(!ze.has(e))try{ze.set(e,new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",weekday:"short"}))}catch{ze.set(e,null)}return ze.get(e)??null})(t);if(!r)return;let n=r.formatToParts(e),i=e=>n.find(t=>t.type===e)?.value??"";return{year:Number(i("year")),month:Number(i("month")),day:Number(i("day")),hours:Number(i("hour")),minutes:Number(i("minute")),seconds:Number(i("second")),weekday:Fe.indexOf(i("weekday"))}})(n,t.length>1?We(t[1]):"");if(!i)return"";let a=e=>String(e).padStart(2,"0"),s={Y:String(i.year),m:a(i.month),n:String(i.month),d:a(i.day),j:String(i.day),H:a(i.hours),G:String(i.hours),i:a(i.minutes),s:a(i.seconds),w:String(i.weekday),N:String(0===i.weekday?7:i.weekday),U:String(Math.floor(n.getTime()/1e3)),l:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][i.weekday],F:["January","February","March","April","May","June","July","August","September","October","November","December"][i.month-1],M:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][i.month-1]},o="";for(let l of r)o+=Object.prototype.hasOwnProperty.call(s,l)?s[l]:l;return o},base64_encode:e=>"string"==typeof e?(e=>{let t=(new TextEncoder).encode(e),r="";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return btoa(r)})(e):e,base64_decode:e=>"string"==typeof e?(e=>{let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return(new TextDecoder).decode(r)})(e):e,md5:e=>"string"==typeof e?(e=>{let t=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],r=/* @__PURE__ */new Uint32Array(64);for(let p=0;p<64;p++)r[p]=Math.floor(4294967296*Math.abs(Math.sin(p+1)));let n=(new TextEncoder).encode(e),i=8*n.length,a=1+(n.length+8>>6)<<6,s=new Uint8Array(a);s.set(n),s[n.length]=128;let o=new DataView(s.buffer);o.setUint32(a-8,i>>>0,!0),o.setUint32(a-4,Math.floor(i/4294967296)>>>0,!0);let l=1732584193,u=4023233417,c=2562383102,d=271733878,h=(e,t)=>e<<t|e>>>32-t;for(let p=0;p<a;p+=64){let e=/* @__PURE__ */new Uint32Array(16);for(let t=0;t<16;t++)e[t]=o.getUint32(p+4*t,!0);let n=l,i=u,a=c,s=d;for(let o=0;o<64;o++){let l,u;o<16?(l=i&a|~i&s,u=o):o<32?(l=s&i|~s&a,u=(5*o+1)%16):o<48?(l=i^a^s,u=(3*o+5)%16):(l=a^(i|~s),u=7*o%16),l=l+n+r[o]+e[u]|0,n=s,s=a,a=i,i=i+h(l,t[o])|0}l=l+n|0,u=u+i|0,c=c+a|0,d=d+s|0}let f=e=>{let t="";for(let r=0;r<4;r++)t+=(e>>>8*r&255).toString(16).padStart(2,"0");return t};return f(l)+f(u)+f(c)+f(d)})(e):e,without:(e,t)=>{if("object"!=typeof e||!e||Array.isArray(e))return e;let r=t.map(We),n={};for(let[i,a]of Object.entries(e))r.includes(i)||(n[i]=a);return n},only:(e,t)=>{if("object"!=typeof e||!e||Array.isArray(e))return e;let r=t.map(We),n={};for(let[i,a]of Object.entries(e))r.includes(i)&&(n[i]=a);return n},find:(e,t)=>{if(!Array.isArray(e)||0===t.length)return;let r=t[0];if("function"==typeof r)return e.find((e,t)=>r(e,t));if(t.length<2)return;let n=We(r),i=t[1];return e.find(e=>"object"==typeof e&&e?e[n]===i:e===i)},pluck:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=We(t[0]);return e.map(e=>"object"==typeof e&&e?e[r]:void 0)},unique:e=>Array.isArray(e)?[...new Set(e)]:e,flatten:e=>Array.isArray(e)?e.flat():e,sum:e=>Array.isArray(e)?e.reduce((e,t)=>e+("number"==typeof t?t:0),0):e,chunk:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=Number(t[0]);if(r<=0)return e;let n=[];for(let i=0;i<e.length;i+=r)n.push(e.slice(i,i+r));return n},index_by:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=We(t[0]),n={};for(let i of e)"object"==typeof i&&i&&(n[String(i[r]??"")]=i);return n},group_by:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=We(t[0]),n={};for(let i of e)if("object"==typeof i&&i){let e=String(i[r]??"");n[e]=n[e]??[],n[e].push(i)}return n}},Ye=e=>!(null==e||!1===e||""===e||0===e||Array.isArray(e)&&0===e.length),He=(e,t)=>"string"==typeof t?t.includes(String(e)):Array.isArray(t)?t.includes(e):!("object"!=typeof t||!t)&&String(e)in t,qe=[],Le=class e{variables;keepEmptyTokens;breakFlag=!1;continueFlag=!1;hasSet=!1;constructor(e,t=!1){this.variables={...e},this.keepEmptyTokens=t}evalNodes(e){let t=e.length;if(0===t)return"";if(1===t)return this.evalNode(e[0]);let r="";for(let n=0;n<t&&(r+=this.evalNode(e[n]),!this.breakFlag&&!this.continueFlag);n++);return r}evalNode(e){switch(e.type){case"text":return e.value;case"variable":return this.evalVariable(e);case"if":return this.evalIf(e);case"for":return this.evalFor(e);case"set":return this.evalSet(e);case"apply":return this.evalApply(e);case"break":return this.breakFlag=!0,"";case"continue":return this.continueFlag=!0,""}}evalVariable(e){let t=this.evalExpression(e.expression);return!this.keepEmptyTokens||null!=t&&""!==t?Ee(t)?String($e(t)):"function"==typeof t?"":null!=t&&"object"!=typeof t?String(t):e.raw?null==t?"":String(t):"object"==typeof t&&t?JSON.stringify(t):"":e.source}evalIf(e){if(Ye(this.evalExpression(e.condition)))return this.evalNodes(e.body);for(let t of e.elseifClauses)if(Ye(this.evalExpression(t.condition)))return this.evalNodes(t.body);return e.elseBody?this.evalNodes(e.elseBody):""}evalFor(e){let t=this.evalExpression(e.collection);if(void 0!==e.source&&void 0===t)return e.source;let r,n=null;if(null!==e.keyVar){let i=(e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.entries(e):null)(t);if(!i||0===i.length)return e.elseBody?this.evalNodes(e.elseBody):"";let a=i.length;n=Array(a),r=Array(a);for(let e=0;e<a;e++)n[e]=i[e][0],r[e]=i[e][1]}else{let n=(e=>Array.isArray(e)?e:"object"==typeof e&&e?Object.values(e):null)(t);if(!n||0===n.length)return e.elseBody?this.evalNodes(e.elseBody):"";r=n}return this.runLoop(e,r,n)}runLoop(e,t,r){let{valueVar:n,keyVar:i,body:a}=e,s=t.length,o=this.variables.loop,l={index:0,index0:0,first:!1,last:!1,length:s,revindex:0};this.variables.loop=l;let u="";for(let c=0;c<s;c++){if(l.index=c+1,l.index0=c,l.first=0===c,l.last=c===s-1,l.revindex=s-c,null!==r&&null!==i&&(this.variables[i]=r[c]),this.variables[n]=t[c],u+=this.evalNodes(a),this.breakFlag){this.breakFlag=!1;break}this.continueFlag&&=!1}return void 0===o?delete this.variables.loop:this.variables.loop=o,u}evalSet(e){return this.hasSet=!0,this.variables[e.name]=Array.isArray(e.value)?this.evalNodes(e.value):this.evalExpression(e.value),""}evalApply(e){let t=this.applyFilters(this.evalNodes(e.body),e.filters);return Ee(t)?String($e(t)):"object"==typeof t&&t?JSON.stringify(t):null==t?"":String(t)}applyFilters(e,t){let r=e;for(let n of t){let e=Ie[n.name];void 0!==e&&(r=e(r,0===n.args.length?qe:this.evalArgs(n.args)))}return r}evalArgs(e){let t=e.length,r=Array(t);for(let n=0;n<t;n++)r[n]=this.evalExpression(e[n]);return r}evalExpression(e){switch(e.type){case"literal":return e.value;case"array":{let t=e.elements,r=Array(t.length);for(let e=0;e<t.length;e++)r[e]=this.evalExpression(t[e]);return r}case"object":{let t={};for(let r of e.entries){let e=this.evalExpression(r.key);t["string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):""]=this.evalExpression(r.value)}return t}case"range":return this.evalRange(e.start,e.end);case"path":return this.resolvePath(e.segments);case"index":return this.resolveIndex(e.object,e.index);case"function":return this.evalFunction(e.name,e.args);case"filter":return this.applyFilters(this.evalExpression(e.subject),e.filters);case"concat":{let t=e.parts,r=t.length,n="";for(let e=0;e<r;e++){let r=this.evalExpression(t[e]);n+=null==r?"":String(r)}return n}case"unary":return"-"===e.operator?-Number(this.evalExpression(e.operand)):!Ye(this.evalExpression(e.operand));case"binary":return this.evalBinary(e.operator,e.left,e.right);case"default":return this.evalExpression(e.value)??this.evalExpression(e.defaultExpr);case"ternary":return Ye(this.evalExpression(e.condition))?this.evalExpression(e.trueExpr):this.evalExpression(e.falseExpr);case"arrow":return this.createArrowFunction(e.params,e.body)}}createArrowFunction(t,r){let n={...this.variables},i=this.keepEmptyTokens,a=(...a)=>{let s=new e(n,i);for(let e=0;e<t.length;e++)s.variables[t[e]]=a[e];return s.evalExpression(r)};return a[Ce]=t.length,a}resolvePath(e){let t=e.length;if(0===t)return;let r=this.variables[e[0]];for(let n=1;n<t;n++){if(null==r)return;r=r[e[n]]}return r}resolveIndex(e,t){let r=this.evalExpression(e);if(null==r)return;let n=this.evalExpression(t);return null!=n?r[String(n)]:void 0}evalRange(e,t){let r=Number(this.evalExpression(e)),n=Number(this.evalExpression(t)),i=r<=n,a=1+(i?n-r:r-n),s=Array(a);for(let o=0;o<a;o++)s[o]=i?r+o:r-o;return s}evalFunction(e,t){let r=this.evalArgs(t);switch(e){case"cycle":{let e=r[0],t=r[1];return Array.isArray(e)&&"number"==typeof t?e[t%e.length]:""}case"max":return this.minMax(r,Math.max);case"min":return this.minMax(r,Math.min);case"range":return this.rangeFunction(r);default:return""}}minMax(e,t){return 0===e.length?void 0:t(...1===e.length&&Array.isArray(e[0])?e[0]:e)}rangeFunction(e){if(0===e.length)return[];if(1===e.length){let t=Number(e[0]),r=Array(t+1);for(let e=0;e<=t;e++)r[e]=e;return r}let t=Number(e[0]),r=Number(e[1]),n=e.length>2?Number(e[2]):t<=r?1:-1;if(0===n)return[];let i=Math.floor((n>0?r-t:t-r)/Math.abs(n))+1;if(i<=0)return[];let a=Array(i);for(let s=0;s<i;s++)a[s]=t+s*n;return a}evalBinary(e,t,r){if("or"===e)return Ye(this.evalExpression(t))||Ye(this.evalExpression(r));if("and"===e)return Ye(this.evalExpression(t))&&Ye(this.evalExpression(r));let n=this.evalExpression(t),i=this.evalExpression(r),a="number"==typeof n&&"number"==typeof i;switch(e){case"+":return a?n+i:Number(n)+Number(i);case"-":return a?n-i:Number(n)-Number(i);case"*":return a?n*i:Number(n)*Number(i);case"/":return a?n/i:Number(n)/Number(i);case"%":return a?n%i:Number(n)%Number(i);case"==":return n===i||String(n)===String(i);case"!=":return n!==i&&String(n)!==String(i);case">":return a?n>i:Number(n)>Number(i);case"<":return a?n<i:Number(n)<Number(i);case">=":return a?n>=i:Number(n)>=Number(i);case"<=":return a?n<=i:Number(n)<=Number(i);case"in":return He(n,i);case"not in":return!He(n,i);case"is":return n===i;case"is not":return n!==i;default:return!1}}},Ue=(e,t)=>e[t],Be=(e,t)=>{let r=t.indexOf(".");if(-1===r)return e[t];let n=e[t.slice(0,r)],i=r+1,a=t.length;for(;i<a;){if(null==n)return;let e=t.indexOf(".",i);if(-1===e)return n[t.slice(i)];n=n[t.slice(i,e)],i=e+1}return n},Re=e=>null==e?"":"object"==typeof e?JSON.stringify(e):String(e),Ve=e=>{try{return JSON.parse(e)||e}catch{return e}},Xe=41,Ze=e=>e>=97&&e<=122||e>=65&&e<=90||95===e,Qe=e=>Ze(e)||e>=48&&e<=57,Ge=e=>Qe(e)||45===e,Je=e=>e>=48&&e<=57,Ke=e=>32===e||9===e||10===e||13===e,et=e=>{let t=e.length;if(0===t||!Ze(e.charCodeAt(0)))return!1;for(let r=1;r<t;r++)if(!Qe(e.charCodeAt(r)))return!1;return!0},tt=e=>{let t=e.length;if(0===t||!Ze(e.charCodeAt(0)))return!1;let r=!1,n=!1;for(let i=1;i<t;i++){let t=e.charCodeAt(i);if(46!==t){if(r){if(n=Je(t),!n&&!Ze(t))return!1;r=!1}else if(n?!Je(t):!Qe(t))return!1}else{if(r)return!1;r=!0,n=!1}}return!r},rt=e=>et(e),nt=(e,t)=>t?`{{{${e}}}}`:`{{${e}}}`,it=e=>{switch(e.type){case"text":return e.value;case"variable":return nt(e.content,e.raw);case"tag":return`{%${e.content}%}`}},at=class{src;pos=0;constructor(e){this.src=e}eof(){return this.pos>=this.src.length}peek(){return this.pos<this.src.length?this.src.charCodeAt(this.pos):-1}at(e){let t=this.pos+e;return t<this.src.length?this.src.charCodeAt(t):-1}skipWs(){for(;this.pos<this.src.length&&Ke(this.src.charCodeAt(this.pos));)this.pos++}scanName(){let e=this.pos;if(!this.eof()&&Ze(this.src.charCodeAt(this.pos)))for(this.pos++;!this.eof()&&Ge(this.src.charCodeAt(this.pos));)this.pos++;return this.src.slice(e,this.pos)}scanIndex(){let e=this.pos;for(;!this.eof()&&Je(this.src.charCodeAt(this.pos));)this.pos++;return this.src.slice(e,this.pos)}scanStringLiteral(){let e=this.src.charCodeAt(this.pos);this.pos++;let t="";for(;this.pos<this.src.length&&this.src.charCodeAt(this.pos)!==e;)if(92===this.src.charCodeAt(this.pos)&&this.pos+1<this.src.length){this.pos++;let r=this.src.charCodeAt(this.pos);t+=110===r?"\n":116===r?"\t":114===r?"\r":92===r?"\\":r===e?String.fromCharCode(r):String.fromCharCode(92)+String.fromCharCode(r),this.pos++}else t+=this.src[this.pos],this.pos++;return this.pos<this.src.length&&this.pos++,t}scanNumber(){let e=this.pos;for(45===this.src.charCodeAt(this.pos)&&this.pos++;this.pos<this.src.length&&Je(this.src.charCodeAt(this.pos));)this.pos++;if(46===this.src.charCodeAt(this.pos))for(this.pos++;this.pos<this.src.length&&Je(this.src.charCodeAt(this.pos));)this.pos++;return Number(this.src.slice(e,this.pos))}matchKeyword(e){let t=this.pos+e.length;if(t>this.src.length)return!1;for(let r=0;r<e.length;r++)if(this.src.charCodeAt(this.pos+r)!==e.charCodeAt(r))return!1;return!(t<this.src.length&&Qe(this.src.charCodeAt(t))||(this.pos=t,this.skipWs(),0))}matchBinaryOp(){this.skipWs();let e=this.peek();if(61===this.at(1)){if(61===e)return this.pos+=2,"==";if(33===e)return this.pos+=2,"!=";if(62===e)return this.pos+=2,">=";if(60===e)return this.pos+=2,"<="}return 62===e?(this.pos++,">"):60===e?(this.pos++,"<"):null}},st=e=>new ot(e).parseTernary(),ot=class extends at{parseTernary(){let e=this.parseOr();if(this.skipWs(),63===this.peek()){this.pos++,this.skipWs();let t=this.parseOr();if(this.skipWs(),58===this.peek())return this.pos++,this.skipWs(),{type:"ternary",condition:e,trueExpr:t,falseExpr:this.parseTernary()}}return e}parseOr(){let e=this.parseAnd();for(this.skipWs();this.matchKeyword("or");)e={type:"binary",operator:"or",left:e,right:this.parseAnd()},this.skipWs();return e}parseAnd(){let e=this.parseNot();for(this.skipWs();this.matchKeyword("and");)e={type:"binary",operator:"and",left:e,right:this.parseNot()},this.skipWs();return e}parseNot(){return this.skipWs(),this.matchKeyword("not")?{type:"unary",operator:"not",operand:this.parseComparison()}:this.parseComparison()}parseComparison(){let e=this.parseConcat();for(this.skipWs();!this.eof();){if(this.matchKeyword("is")){this.skipWs(),e={type:"binary",operator:this.matchKeyword("not")?"is not":"is",left:e,right:this.parseConcat()},this.skipWs();continue}if(this.matchKeyword("not")){if(this.skipWs(),this.matchKeyword("in")){e={type:"binary",operator:"not in",left:e,right:this.parseConcat()},this.skipWs();continue}let t=this.src.slice(this.pos-4);return this.pos=this.src.length,{type:"unary",operator:"not",operand:st(t)}}if(this.matchKeyword("in")){e={type:"binary",operator:"in",left:e,right:this.parseConcat()},this.skipWs();continue}let t=this.matchBinaryOp();if(!t)break;e={type:"binary",operator:t,left:e,right:this.parseConcat()},this.skipWs()}return e}parseConcat(){let e=this.parseAdditive();for(this.skipWs();126===this.peek();){this.pos++;let t=this.parseAdditive();e="concat"===e.type?{type:"concat",parts:[...e.parts,t]}:{type:"concat",parts:[e,t]},this.skipWs()}return e}parseAdditive(){let e=this.parseMultiplicative();this.skipWs();for(let t=this.peek();43===t||45===t;t=this.peek())this.pos++,e={type:"binary",operator:43===t?"+":"-",left:e,right:this.parseMultiplicative()},this.skipWs();return e}parseMultiplicative(){let e=this.parseDefault();this.skipWs();for(let t=this.peek();42===t||47===t||37===t;t=this.peek())this.pos++,e={type:"binary",operator:42===t?"*":47===t?"/":"%",left:e,right:this.parseDefault()},this.skipWs();return e}parseDefault(){if(this.skipWs(),45===this.peek()&&Je(this.at(1)))return this.maybeTrailingFilters({type:"literal",value:this.scanNumber()});if(45===this.peek())return this.pos++,{type:"unary",operator:"-",operand:this.parseDefault()};let e=this.parseAtom();for(this.skipWs();63===this.peek()&&63===this.at(1);)this.pos+=2,this.skipWs(),e={type:"default",value:e,defaultExpr:this.parseAtom()},this.skipWs();return e}parseAtom(){this.skipWs();let e=this.peek();if(40===e){this.pos++,this.skipWs();let e=this.pos,t=this.tryParseArrowParams();if(null!==t)return this.maybeTrailingFilters({type:"arrow",params:t,body:this.parseTernary()});this.pos=e;let r=this.parseTernary();return this.skipWs(),this.peek()===Xe&&this.pos++,this.maybeTrailingFilters(r)}return 39===e||34===e?this.maybeTrailingFilters({type:"literal",value:this.scanStringLiteral()}):Je(e)?this.maybeTrailingFilters({type:"literal",value:this.scanNumber()}):91===e?(this.pos++,this.maybeTrailingFilters({type:"array",elements:this.parseArgList(93)})):123===e?(this.pos++,this.maybeTrailingFilters(this.parseObjectLiteral())):this.parsePathOrFunctionOrArrow()}tryParseArrowParams(){let e=this.pos,t=[];for(this.skipWs();this.peek()!==Xe;){let r=this.scanName();if(!r)return this.pos=e,null;if(t.push(r),this.skipWs(),44!==this.peek())break;this.pos++,this.skipWs()}return this.skipWs(),this.peek()===Xe&&(this.pos++,this.skipWs(),61===this.peek()&&62===this.at(1))?(this.pos+=2,t):(this.pos=e,null)}parsePathOrFunctionOrArrow(){let e=this.scanName();if(!e)return this.pos++,{type:"literal",value:""};if("true"===e||"false"===e)return this.maybeTrailingFilters({type:"literal",value:"true"===e});if(this.skipWs(),61===this.peek()&&62===this.at(1))return this.pos+=2,this.maybeTrailingFilters({type:"arrow",params:[e],body:this.parseTernary()});if(40===this.peek()){this.pos++;let t=this.parseArgList(Xe);return this.maybeTrailingFilters(this.parseAccessChain({type:"function",name:e,args:t},null))}let t=[e];return this.maybeTrailingFilters(this.parseAccessChain({type:"path",segments:t},t))}parseAccessChain(e,t){let r=e,n=t;for(;;){let e=this.peek();if(46===e){let e=this.pos;this.pos++;let t=this.scanName()||this.scanIndex();if(!t){this.pos=e;break}n?n.push(t):r={type:"index",object:r,index:{type:"literal",value:t}};continue}if(91!==e)break;this.pos++;let t=this.parseTernary();this.skipWs(),93===this.peek()&&this.pos++,n&&"literal"===t.type&&"boolean"!=typeof t.value?n.push(String(t.value)):(n&&=(r={type:"path",segments:n},null),r={type:"index",object:r,index:t})}return n?{type:"path",segments:n}:r}maybeTrailingFilters(e){return this.skipWs(),124===this.peek()?{type:"filter",subject:e,filters:this.parseTrailingFilters()}:e}parseObjectLiteral(){let e=[];for(this.skipWs();!this.eof()&&125!==this.peek();){let t=this.parseObjectKey();this.skipWs(),58===this.peek()&&this.pos++,this.skipWs(),e.push({key:t,value:this.parseTernary()}),this.skipWs(),44===this.peek()&&(this.pos++,this.skipWs())}return 125===this.peek()&&this.pos++,{type:"object",entries:e}}parseObjectKey(){let e=this.peek();if(39===e||34===e)return{type:"literal",value:this.scanStringLiteral()};if(Je(e))return{type:"literal",value:this.scanNumber()};if(40===e){this.pos++,this.skipWs();let e=this.parseTernary();return this.skipWs(),this.peek()===Xe&&this.pos++,e}return{type:"literal",value:this.scanName()}}parseArgList(e){let t=[];for(this.skipWs();!this.eof()&&this.peek()!==e;)t.push(this.parseTernary()),this.skipWs(),44===this.peek()&&(this.pos++,this.skipWs());return this.peek()===e&&this.pos++,t}parseTrailingFilters(){let e=[];for(;124===this.peek();)this.pos++,this.skipWs(),e.push(this.readFilter()),this.skipWs();return e}parseApplyChain(){this.skipWs();let e=[this.readFilter()];for(this.skipWs();124===this.peek();)this.pos++,this.skipWs(),e.push(this.readFilter()),this.skipWs();return e}readFilter(){let e=this.scanName();return this.skipWs(),40===this.peek()?(this.pos++,{name:e,args:this.parseArgList(Xe)}):{name:e,args:[]}}},lt=e=>{let t=0;for(;t<e.length&&!Ke(e.charCodeAt(t));)t++;return e.slice(0,t)},ut=(e,t=!1)=>{let r=new dt(e,t),n=r.parseBody();if(!r.error){let e=r.peek();if(e&&"tag"===e.type){let t=lt(e.content.trim());ct.has(t)&&(r.error=`Orphan closing tag: {% ${t} %} without matching opening tag`)}}return{nodes:n,error:r.error}},ct=/* @__PURE__ */new Set(["endif","endfor","endset","endapply","else","elseif"]),dt=class{tokens;keepEmptyTokens;pos=0;error=null;constructor(e,t=!1){this.tokens=e,this.keepEmptyTokens=t}peek(){return this.tokens[this.pos]}advance(){let e=this.tokens[this.pos];return e&&this.pos++,e}isTag(e){let t=this.peek();if(!t||"tag"!==t.type)return!1;let r=t.content.trim();return r===e||r.startsWith(e+" ")||r.startsWith(e+"\t")}parseBody(){let e=[];for(;this.pos<this.tokens.length;){let t=this.peek();if(!t||"tag"===t.type&&ct.has(lt(t.content.trim())))break;let r=this.parseNode();r&&e.push(r)}return e}parseNode(){let e=this.peek();return e?"text"===e.type?(this.advance(),{type:"text",value:e.value}):"variable"===e.type?this.parseVariable():this.parseTag():null}parseVariable(){let e=this.advance();if(!e||"variable"!==e.type)return{type:"variable",raw:!1,expression:{type:"literal",value:""},source:""};let t=e.content.trim(),r=this.keepEmptyTokens?nt(e.content,e.raw):"";if(et(t))return{type:"variable",raw:e.raw,expression:{type:"path",segments:[t]},source:r};let n=st(t);return{type:"variable",raw:e.raw,expression:n,source:r}}parseTag(){let e=this.peek();if(!e||"tag"!==e.type)return null;let t=e.content.trim();switch(lt(t)){case"if":return this.parseIf();case"for":return this.parseFor();case"set":return this.parseSet();case"apply":return this.parseApply();case"break":return this.advance(),{type:"break"};case"continue":return this.advance(),{type:"continue"};default:return this.advance(),null}}parseIf(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return this.error="Malformed {% if %} tag",{type:"if",condition:{type:"literal",value:!1},body:[],elseifClauses:[],elseBody:null};let t=e.content.trim(),r=-1===t.indexOf(" ")?"":t.slice(t.indexOf(" ")+1).trim();if(!r)return this.error="Malformed {% if %} tag: missing condition",{type:"if",condition:{type:"literal",value:!1},body:[],elseifClauses:[],elseBody:null};let n=st(r),i=this.parseBody(),a=[],s=null,o=!1;for(;this.peek();){let e=this.peek();if(!e||"tag"!==e.type)break;let t=lt(e.content.trim());if("elseif"===t){this.advance();let t=e.content.trim(),r=t.slice(t.indexOf(" ")+1).trim(),n=st(r),i=this.parseBody();a.push({condition:n,body:i})}else{if("else"!==t){if("endif"===t){this.advance(),o=!0;break}break}this.advance(),s=this.parseBody()}}return o||(this.error="Malformed {% if %} block: missing {% endif %}"),{type:"if",condition:n,body:i,elseifClauses:a,elseBody:s}}parseFor(){let e=this.pos;this.advance();let t=this.tokens[this.pos-1];if("tag"!==t.type)return{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let r=t.content.trim(),n=r.slice(r.indexOf(" ")+1).trim(),i=/\sin\s/.exec(n);if(!i)return this.error="Invalid {% for %} syntax: missing the `in` keyword",{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let a=n.slice(0,i.index).trim(),s=n.slice(i.index+i[0].length).trim(),o=(e=>{let t=0;for(let r=0;r+1<e.length;r++){let n=e.charCodeAt(r);if(0!==t)n===t&&(t=0);else if(39===n||34===n)t=n;else if(46===n&&46===e.charCodeAt(r+1))return[e.slice(0,r).trim(),e.slice(r+2).trim()]}return null})(s),l=o?{type:"range",start:st(o[0]),end:st(o[1])}:st(s),u=a.indexOf(","),c=-1===u?null:a.slice(0,u).trim(),d=-1===u?a:a.slice(u+1).trim();if(!rt(d))return this.error=`Invalid {% for %} variable name: "${d}"`,{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};if(null!==c&&!rt(c))return this.error=`Invalid {% for %} key variable name: "${c}"`,{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let h=this.parseBody(),f=null;if(this.peek()){let e=this.peek();e&&"tag"===e.type&&"else"===lt(e.content.trim())&&(this.advance(),f=this.parseBody())}let p=this.peek();return p&&"tag"===p.type&&"endfor"===lt(p.content.trim())?this.advance():this.error="Malformed {% for %} block: missing {% endfor %}",{type:"for",valueVar:d,keyVar:c,collection:l,body:h,elseBody:f,source:this.keepEmptyTokens?this.reconstructRange(e,this.pos):void 0}}reconstructRange(e,t){let r="";for(let n=e;n<t;n++)r+=it(this.tokens[n]);return r}parseSet(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return{type:"set",name:"_unknown",value:{type:"literal",value:""}};let t=e.content.trim(),r=t.slice(t.indexOf(" ")+1).trim(),n=r.indexOf("=");if(-1===n){let e=r.trim(),t=this.parseBody(),n=this.peek();return n&&"tag"===n.type&&this.advance(),{type:"set",name:e,value:t}}let i=r.slice(0,n).trim(),a=r.slice(n+1).trim();return{type:"set",name:i,value:st(a)}}parseApply(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return{type:"apply",filters:[],body:[]};let t=e.content.trim(),r=(e=>new ot(e).parseApplyChain())(t.slice(t.indexOf(" ")+1).trim()),n=this.parseBody(),i=this.peek();return i&&"tag"===i.type&&this.advance(),{type:"apply",filters:r,body:n}}},ht=/* @__PURE__ */new Map,ft={hits:0,misses:0},pt=e=>{let t=ht.get(e);if(t)return ft.hits++,t;ft.misses++;let r=(e=>{let t=(e=>{let t=[],r=0;for(;r<e.length;){let n,i,a=e.indexOf("{{",r),s=e.indexOf("{%",r);if(-1===a&&-1===s)break;if(-1===a?(n=s,i=!0):-1===s||a<s?(n=a,i=!1):(n=s,i=!0),n>r&&t.push({type:"text",value:e.slice(r,n)}),i||123!==e.charCodeAt(n+2))if(i){let i=e.indexOf("%}",n+2);if(-1===i)return{tokens:t,error:"Unclosed tag"};t.push({type:"tag",content:e.slice(n+2,i)}),r=i+2}else{let i=e.indexOf("}}",n+2);if(-1===i)return{tokens:t,error:"Unclosed double-brace token"};t.push({type:"variable",content:e.slice(n+2,i),raw:!1}),r=i+2}else{let i=e.indexOf("}}}",n+3);if(-1===i)return{tokens:t,error:"Unclosed triple-brace token"};t.push({type:"variable",content:e.slice(n+3,i),raw:!0}),r=i+3}}return r<e.length&&t.push({type:"text",value:e.slice(r)}),{tokens:t,error:null}})(e);if(t.error)return null;let r=t.tokens,{hasTags:n,allSimpleOrDotted:i}=(e=>{let t=!1,r=!0;for(let n=0;n<e.length;n++){let i=e[n];if("tag"===i.type){t=!0;break}if("variable"===i.type&&!tt(i.content.trim())){r=!1;break}}return{hasTags:t,allSimpleOrDotted:r}})(r),a=null,s=null;if(n||!i){let e=ut(r,!1);if(e.error)return null;a=e.nodes;let t=ut(r,!0);t.error||(s=t.nodes)}else{let e=ut(r,!0);e.error||(s=e.nodes)}return{tokens:r,hasTags:n,allSimpleOrDotted:i,nodes:a,nodesWithSource:s}})(e);return r?((()=>{if(ht.size>=256){let e=ht.keys().next().value;void 0!==e&&ht.delete(e)}})(),ht.set(e,r),r):null},mt=(e,t={},r=!1,n=!1)=>{if("string"!=typeof e)return e;try{if(-1===e.indexOf("{%")&&-1===e.indexOf("{{"))return e;let i="variables"in t?(e=>{let t={},r=e.variables;for(let n in r)t[n]=r[n];for(let n in e)t[n]=e[n];return t})(t):t,a=pt(e);if(!a)return e;if(!r&&!a.hasTags&&a.allSimpleOrDotted){let e=((e,t)=>{let r="";for(let n of e.tokens)if("text"===n.type)r+=n.value;else if("variable"===n.type){let e=n.content.trim(),i=-1===n.content.indexOf(".")?Ue(t,e):Be(t,e);r+=n.raw?null==i?"":String(i):Re(i)}return r})(a,i);return n?Ve(e):e}let s=((e,t)=>t?e.nodesWithSource:e.nodes)(a,r);if(!s)return e;let{output:o,variables:l,hasSet:u}=((e,t,r=!1)=>{let n=new Le(t,r);return{output:n.evalNodes(e),variables:n.variables,hasSet:n.hasSet}})(s,i,r);return u&&Object.assign(t,l),r&&o===e?e:n?Ve(o):o}catch{return e}},yt="[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*",gt=`(?:${yt}|\\d+)`,bt=`\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${yt}(?:\\.${gt})*)\\s*\\]`,wt=`${yt}(?:${bt})*(?:\\??\\.${gt}(?:${bt})*)*(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`,vt=`(?:\\{\\{\\{\\s*${wt}\\s*\\}\\}\\}|\\{\\{\\s*${wt}\\s*\\}\\})`,xt=new RegExp(vt,"g"),kt=RegExp(`^${vt}$`),St=(e,t=!1)=>{if("string"!=typeof e)return!1;let r=t?kt:xt;return r.lastIndex=0,r.test(e.trim())},Mt=(e,t)=>{if(Array.isArray(e))for(let r of e)Mt(r,t);else if("object"==typeof e&&e){if("type"in e&&"path"===e.type&&"segments"in e&&Array.isArray(e.segments)){let r=e.segments[0];return void("string"==typeof r&&t.add(r))}for(let r of Object.values(e))Mt(r,t)}},At=e=>{let t=pt(e);if(!t)return[];let r=/* @__PURE__ */new Set;return Mt(t.nodes??t.nodesWithSource,r),[...r]},Tt=({source:e,transformers:t})=>{let r=[];if(e){let t=e.indexOf(".");r.push(t>-1?e.substring(0,t):e)}for(let{action:n,params:i}of t??[])"twigTemplate"===n&&i.template&&r.push(...At(i.template));return r};function Pt(e){if("string"==typeof e||"number"==typeof e){let t=String(e);return""===t?null:/^[a-zA-Z0-9_-]+$/.test(t)||/^\d+$/.test(t)?t:null}return null}function Nt(e,t=!0){return e?"string"==typeof e?function(e,t){if(!e||e.startsWith(".")||e.endsWith(".")||/[^a-zA-Z0-9_.[\]-]/.test(e)||t&&(/\.\.|(\[\])/g.test(e)||(e.match(/\[/g)||[]).length!==(e.match(/\]/g)||[]).length||/\][^.[]/.test(e)))return[];let r,n=[],i=/([^.[\]]+)|\[(\d+)\]/g;for(;r=i.exec(e);)if(r[1]){if(!t&&""===r[1])continue;let e=Pt(r[1]);if(null!==e)n.push(e);else if(t)return[]}else if(r[2]){let e=Pt(r[2]);if(null!==e)n.push(e);else if(t)return[]}return n.length?n:[]}(e,t):Array.isArray(e)?function(e,t){if(!Array.isArray(e))return[];let r=[];for(let n of e){let e=Pt(n);if(null!==e)r.push(e);else if(t)return[]}return r}(e,t):[]:[]}function Dt(e,t,r){if(null==e||!t)return r;let n=Nt(t);if(!n.length)return r;let i=e;for(let a of n){if("object"!=typeof i||!i)return r;i=Array.isArray(i)?i[Number(a)]:i[a]}return void 0===i?r:i}function _t(e,t,r){let n=Nt(t);if(!n.length)return e;let i=e;for(let s=0;s<n.length-1;s++){let t=n[s],r=n[s+1];if("object"!=typeof i||!i)return e;let a=i;(null==a[t]||"object"!=typeof a[t])&&(a[t]=/^\d+$/.test(r)?[]:{}),i=a[t]}let a=n[n.length-1];return"object"==typeof i&&i&&(i[a]=r),e}function jt(e,t=/* @__PURE__ */new WeakMap){if("object"!=typeof e||!e)return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let r=/* @__PURE__ */new Map;return t.set(e,r),e.forEach((e,n)=>r.set(n,jt(e,t))),r}if(e instanceof Set){let r=/* @__PURE__ */new Set;return t.set(e,r),e.forEach(e=>r.add(jt(e,t))),r}if(ArrayBuffer.isView(e)){if(e instanceof DataView){let r=new DataView(jt(e.buffer,t),e.byteOffset,e.byteLength);return t.set(e,r),r}let r=new(0,e.constructor)(e.buffer.slice(0),e.byteOffset,e.length);return t.set(e,r),r}if(e instanceof ArrayBuffer){let r=e.slice(0);return t.set(e,r),r}if(Array.isArray(e)){let r=[];return t.set(e,r),e.forEach((e,n)=>r[n]=jt(e,t)),r}let r=Object.getPrototypeOf(e),n=Object.create(r);t.set(e,n);for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=jt(e[i],t));return n}var Ct=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),e);function Ot(e,t){let r=Nt(t),n=Array.isArray(e)?[...e]:Ct(e);if(!r.length)return n;let i=e,a=n;for(let s=0;s<r.length;s++){let e=r[s],t=i?.[e];if(!t||"object"!=typeof t){a[e]=t;break}let n=Array.isArray(t)?[...t]:Ct(t);a[e]=n,i=t,a=n}return n}function Wt(e,t){if(null===e)return!1;let r=Nt(t),n=e;for(let i of r){if(null==n||!(i in n))return!1;n=n[i]}return!0}function Et(e,t){let r=Array.isArray(t)?t:t?[t]:[];if(0===r.length)return{...e};let n=[],i=[];for(let s of r){let e=Nt(s);0!==e.length&&(1===e.length?n.push(e[0]):i.push(s))}let a=e;if(n.length){let e;for(let t of n)Object.prototype.hasOwnProperty.call(a,t)&&(e??=Ct(a),delete e[t]);e&&(a=e)}for(let s of i){let e=Nt(s);if(!Wt(a,s))continue;let t=Ot(a,s),r=t;for(let n=0;n<e.length-1&&r&&"object"==typeof r;n++)r=r[e[n]];if(r&&"object"==typeof r){let t=e[e.length-1];Object.prototype.hasOwnProperty.call(r,t)&&delete r[t]}a=t}return a}Math.pow(10,8);var $t=6048e5,Ft=6e4,zt=36e5,It=Symbol.for("constructDateFrom");function Yt(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&It in e?e[It](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ht(e,t){return Yt(t||e,e)}function qt(e,t,r){const n=Ht(e,r?.in);return isNaN(t)?Yt(r?.in||e,NaN):t?(n.setDate(n.getDate()+t),n):n}var Lt={};function Ut(){return Lt}function Bt(e,t){const r=Ut(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=Ht(e,t?.in),a=i.getDay(),s=(a<n?7:0)+a-n;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function Rt(e,t){return Bt(e,{...t,weekStartsOn:1})}function Vt(e,t){const r=Ht(e,t?.in),n=r.getFullYear(),i=Yt(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const a=Rt(i),s=Yt(r,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const o=Rt(s);return r.getTime()>=a.getTime()?n+1:r.getTime()>=o.getTime()?n:n-1}function Xt(e){const t=Ht(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Zt(e,...t){const r=Yt.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}function Qt(e,t){const r=Ht(e,t?.in);return r.setHours(0,0,0,0),r}function Gt(e,t){const r=+Ht(e)-+Ht(t);return r<0?-1:r>0?1:r}function Jt(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+Ht(e)));var t}function Kt(e,t){return+Ht(e)-+Ht(t)}function er(e,t,r){const[n,i,a]=Zt(r?.in,e,e,t),s=Gt(i,a),o=Math.abs(function(e,t){const[r,n]=Zt(void 0,e,t);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}(i,a));if(o<1)return 0;1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-s*o);let l=Gt(i,a)===-s;(function(e,t){const r=Ht(e,t?.in);return+function(e,t){const r=Ht(e,t?.in);return r.setHours(23,59,59,999),r}(r,t)===+function(e,t){const r=Ht(e,t?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}(r,t)})(n)&&1===o&&1===Gt(n,a)&&(l=!1);const u=s*(o-+l);return 0===u?0:u}var tr={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function rr(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var nr={date:rr({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:rr({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:rr({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ir={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ar(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,i=r?.width?String(r.width):t;n=e.formattingValues[i]||e.formattingValues[t]}else{const t=e.defaultWidth,i=r?.width?String(r.width):e.defaultWidth;n=e.values[i]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function sr(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const s=a[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}(o,e=>e.test(s)):function(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(o,e=>e.test(s));let u;return u=e.valueCallback?e.valueCallback(l):l,u=r.valueCallback?r.valueCallback(u):u,{value:u,rest:t.slice(s.length)}}}function or(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];return s=r.valueCallback?r.valueCallback(s):s,{value:s,rest:t.slice(i.length)}}}var lr={code:"en-US",formatDistance:(e,t,r)=>{let n;const i=tr[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:nr,formatRelative:(e,t,r,n)=>ir[e],localize:{ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:ar({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ar({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:ar({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:ar({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:ar({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:or({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:sr({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:sr({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:sr({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:sr({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:sr({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ur(e,t){const r=Ht(e,t?.in),n=+Rt(r)-+function(e,t){const r=Vt(e,t),n=Yt(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Rt(n)}(r);return Math.round(n/$t)+1}function cr(e,t){const r=Ht(e,t?.in),n=r.getFullYear(),i=Ut(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=Yt(t?.in||e,0);s.setFullYear(n+1,0,a),s.setHours(0,0,0,0);const o=Bt(s,t),l=Yt(t?.in||e,0);l.setFullYear(n,0,a),l.setHours(0,0,0,0);const u=Bt(l,t);return+r>=+o?n+1:+r>=+u?n:n-1}function dr(e,t){const r=Ht(e,t?.in),n=+Bt(r,t)-+function(e,t){const r=Ut(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=cr(e,t),a=Yt(t?.in||e,0);return a.setFullYear(i,0,n),a.setHours(0,0,0,0),Bt(a,t)}(r,t);return Math.round(n/$t)+1}function hr(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}var fr={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return hr("yy"===t?n%100:n,t.length)},M(e,t){const r=e.getMonth();return"M"===t?String(r+1):hr(r+1,2)},d:(e,t)=>hr(e.getDate(),t.length),a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>hr(e.getHours()%12||12,t.length),H:(e,t)=>hr(e.getHours(),t.length),m:(e,t)=>hr(e.getMinutes(),t.length),s:(e,t)=>hr(e.getSeconds(),t.length),S(e,t){const r=t.length,n=e.getMilliseconds();return hr(Math.trunc(n*Math.pow(10,r-3)),t.length)}},pr={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){const t=e.getFullYear(),n=t>0?t:1-t;return r.ordinalNumber(n,{unit:"year"})}return fr.y(e,t)},Y:function(e,t,r,n){const i=cr(e,n),a=i>0?i:1-i;return"YY"===t?hr(a%100,2):"Yo"===t?r.ordinalNumber(a,{unit:"year"}):hr(a,t.length)},R:function(e,t){return hr(Vt(e),t.length)},u:function(e,t){return hr(e.getFullYear(),t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return hr(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return hr(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return fr.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return hr(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=dr(e,n);return"wo"===t?r.ordinalNumber(i,{unit:"week"}):hr(i,t.length)},I:function(e,t,r){const n=ur(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):hr(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):fr.d(e,t)},D:function(e,t,r){const n=function(e,t){const r=Ht(e,t?.in);return function(e,t){const[r,n]=Zt(void 0,e,t),i=Qt(r),a=Qt(n),s=+i-Xt(i),o=+a-Xt(a);return Math.round((s-o)/864e5)}(r,function(e){const t=Ht(e,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}(r))+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):hr(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return hr(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return hr(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return hr(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(i=12===n?"noon":0===n?"midnight":n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(i=n>=17?"evening":n>=12?"afternoon":n>=4?"morning":"night",t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return fr.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):fr.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):hr(n,t.length)},k:function(e,t,r){let n=e.getHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):hr(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):fr.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):fr.s(e,t)},S:function(e,t){return fr.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return yr(n);case"XXXX":case"XX":return gr(n);default:return gr(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return yr(n);case"xxxx":case"xx":return gr(n);default:return gr(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+mr(n,":");default:return"GMT"+gr(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+mr(n,":");default:return"GMT"+gr(n,":")}},t:function(e,t,r){return hr(Math.trunc(+e/1e3),t.length)},T:function(e,t,r){return hr(+e,t.length)}};function mr(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),a=n%60;return 0===a?r+String(i):r+String(i)+t+hr(a,2)}function yr(e,t){return e%60==0?(e>0?"-":"+")+hr(Math.abs(e)/60,2):gr(e,t)}function gr(e,t=""){const r=e>0?"-":"+",n=Math.abs(e);return r+hr(Math.trunc(n/60),2)+t+hr(n%60,2)}var br=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},wr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},vr={p:wr,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return br(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",br(n,t)).replace("{{time}}",wr(i,t))}},xr=/^D+$/,kr=/^Y+$/,Sr=["D","DD","YY","YYYY"];function Mr(e){return xr.test(e)}function Ar(e){return kr.test(e)}function Tr(e,t,r){const n=function(e,t,r){const n="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,r);if(Sr.includes(e))throw new RangeError(n)}var Pr=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Nr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dr=/^'([^]*?)'?$/,_r=/''/g,jr=/[a-zA-Z]/;function Cr(e,t,r){const n=Ut(),i=r?.locale??n.locale??lr,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Ht(e,r?.in);if(!Jt(o))throw new RangeError("Invalid time value");let l=t.match(Nr).map(e=>{const t=e[0];return"p"===t||"P"===t?(0,vr[t])(e,i.formatLong):e}).join("").match(Pr).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Or(e)};if(pr[t])return{isToken:!0,value:e};if(t.match(jr))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const u={firstWeekContainsDate:a,weekStartsOn:s,locale:i};return l.map(n=>{if(!n.isToken)return n.value;const a=n.value;return(!r?.useAdditionalWeekYearTokens&&Ar(a)||!r?.useAdditionalDayOfYearTokens&&Mr(a))&&Tr(a,t,String(e)),(0,pr[a[0]])(o,a,i.localize,u)}).join("")}function Or(e){const t=e.match(Dr);return t?t[1].replace(_r,"'"):e}function Wr(e,t){return function(e,t,r){const n=Ut(),i=r?.locale??n.locale??lr,a=Gt(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const s=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:a}),[o,l]=Zt(r?.in,...a>0?[t,e]:[e,t]),u=function(e,t,r){const n=Kt(e,t)/1e3;return(i=r?.roundingMethod,e=>{const t=(i?Math[i]:Math.trunc)(e);return 0===t?0:t})(n);var i}(l,o),c=(Xt(l)-Xt(o))/1e3,d=Math.round((u-c)/60);let h;if(d<2)return r?.includeSeconds?u<5?i.formatDistance("lessThanXSeconds",5,s):u<10?i.formatDistance("lessThanXSeconds",10,s):u<20?i.formatDistance("lessThanXSeconds",20,s):u<40?i.formatDistance("halfAMinute",0,s):u<60?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",1,s):0===d?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",d,s);if(d<45)return i.formatDistance("xMinutes",d,s);if(d<90)return i.formatDistance("aboutXHours",1,s);if(d<1440){const e=Math.round(d/60);return i.formatDistance("aboutXHours",e,s)}if(d<2520)return i.formatDistance("xDays",1,s);if(d<43200){const e=Math.round(d/1440);return i.formatDistance("xDays",e,s)}if(d<86400)return h=Math.round(d/43200),i.formatDistance("aboutXMonths",h,s);if(h=er(l,o),h<12){const e=Math.round(d/43200);return i.formatDistance("xMonths",e,s)}{const e=h%12,t=Math.trunc(h/12);return e<3?i.formatDistance("aboutXYears",t,s):e<9?i.formatDistance("overXYears",t,s):i.formatDistance("almostXYears",t+1,s)}}(e,function(e){return Yt(e,Date.now())}(e),t)}var Er=class{subPriority=0;validate(e,t){return!0}},$r=class extends Er{constructor(e,t,r,n,i){super(),this.value=e,this.validateValue=t,this.setValue=r,this.priority=n,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,r){return this.setValue(e,t,this.value,r)}},Fr=class extends Er{priority=10;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>Yt(t,e))}set(e,t){return t.timestampIsSet?e:Yt(e,function(e,t){const r=function(e){return"function"==typeof e&&e.prototype?.constructor===e}(t)?new t(0):Yt(t,0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r}(e,this.context))}},zr=class{run(e,t,r,n){const i=this.parse(e,t,r,n);return i?{setter:new $r(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,r){return!0}},Ir=/^(1[0-2]|0?\d)/,Yr=/^(3[0-1]|[0-2]?\d)/,Hr=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,qr=/^(5[0-3]|[0-4]?\d)/,Lr=/^(2[0-3]|[0-1]?\d)/,Ur=/^(2[0-4]|[0-1]?\d)/,Br=/^(1[0-1]|0?\d)/,Rr=/^(1[0-2]|0?\d)/,Vr=/^[0-5]?\d/,Xr=/^[0-5]?\d/,Zr=/^\d/,Qr=/^\d{1,2}/,Gr=/^\d{1,3}/,Jr=/^\d{1,4}/,Kr=/^-?\d+/,en=/^-?\d/,tn=/^-?\d{1,2}/,rn=/^-?\d{1,3}/,nn=/^-?\d{1,4}/,an=/^([+-])(\d{2})(\d{2})?|Z/,sn=/^([+-])(\d{2})(\d{2})|Z/,on=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ln=/^([+-])(\d{2}):(\d{2})|Z/,un=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function cn(e,t){return e?{value:t(e.value),rest:e.rest}:e}function dn(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function hn(e,t){const r=t.match(e);if(!r)return null;if("Z"===r[0])return{value:0,rest:t.slice(1)};const n="+"===r[1]?1:-1,i=r[2]?parseInt(r[2],10):0,a=r[3]?parseInt(r[3],10):0,s=r[5]?parseInt(r[5],10):0;return{value:n*(i*zt+a*Ft+1e3*s),rest:t.slice(r[0].length)}}function fn(e){return dn(Kr,e)}function pn(e,t){switch(e){case 1:return dn(Zr,t);case 2:return dn(Qr,t);case 3:return dn(Gr,t);case 4:return dn(Jr,t);default:return dn(new RegExp("^\\d{1,"+e+"}"),t)}}function mn(e,t){switch(e){case 1:return dn(en,t);case 2:return dn(tn,t);case 3:return dn(rn,t);case 4:return dn(nn,t);default:return dn(new RegExp("^-?\\d{1,"+e+"}"),t)}}function yn(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function gn(e,t){const r=t>0,n=r?t:1-t;let i;if(n<=50)i=e||100;else{const t=n+50;i=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return r?i:1-i}function bn(e){return e%400==0||e%4==0&&e%100!=0}var wn=[31,28,31,30,31,30,31,31,30,31,30,31],vn=[31,29,31,30,31,30,31,31,30,31,30,31];function xn(e,t,r){const n=Ut(),i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Ht(e,r?.in),s=a.getDay(),o=7-i;return qt(a,t<0||t>6?t-(s+o)%7:((t%7+7)%7+o)%7-(s+o)%7,r)}var kn={G:new class extends zr{priority=140;parse(e,t,r){switch(t){case"G":case"GG":case"GGG":return r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"});case"GGGGG":return r.era(e,{width:"narrow"});default:return r.era(e,{width:"wide"})||r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"})}}set(e,t,r){return t.era=r,e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]},y:new class extends zr{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,r){const n=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return cn(pn(4,e),n);case"yo":return cn(r.ordinalNumber(e,{unit:"year"}),n);default:return cn(pn(t.length,e),n)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r){const n=e.getFullYear();if(r.isTwoDigitYear){const t=gn(r.year,n);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const i="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}},Y:new class extends zr{priority=130;parse(e,t,r){const n=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return cn(pn(4,e),n);case"Yo":return cn(r.ordinalNumber(e,{unit:"year"}),n);default:return cn(pn(t.length,e),n)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r,n){const i=cr(e,n);if(r.isTwoDigitYear){const t=gn(r.year,i);return e.setFullYear(t,0,n.firstWeekContainsDate),e.setHours(0,0,0,0),Bt(e,n)}const a="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(a,0,n.firstWeekContainsDate),e.setHours(0,0,0,0),Bt(e,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends zr{priority=130;parse(e,t){return mn("R"===t?4:t.length,e)}set(e,t,r){const n=Yt(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Rt(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends zr{priority=130;parse(e,t){return mn("u"===t?4:t.length,e)}set(e,t,r){return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends zr{priority=120;parse(e,t,r){switch(t){case"Q":case"QQ":return pn(t.length,e);case"Qo":return r.ordinalNumber(e,{unit:"quarter"});case"QQQ":return r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(e,{width:"narrow",context:"formatting"});default:return r.quarter(e,{width:"wide",context:"formatting"})||r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends zr{priority=120;parse(e,t,r){switch(t){case"q":case"qq":return pn(t.length,e);case"qo":return r.ordinalNumber(e,{unit:"quarter"});case"qqq":return r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(e,{width:"narrow",context:"standalone"});default:return r.quarter(e,{width:"wide",context:"standalone"})||r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends zr{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,r){const n=e=>e-1;switch(t){case"M":return cn(dn(Ir,e),n);case"MM":return cn(pn(2,e),n);case"Mo":return cn(r.ordinalNumber(e,{unit:"month"}),n);case"MMM":return r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(e,{width:"narrow",context:"formatting"});default:return r.month(e,{width:"wide",context:"formatting"})||r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}},L:new class extends zr{priority=110;parse(e,t,r){const n=e=>e-1;switch(t){case"L":return cn(dn(Ir,e),n);case"LL":return cn(pn(2,e),n);case"Lo":return cn(r.ordinalNumber(e,{unit:"month"}),n);case"LLL":return r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(e,{width:"narrow",context:"standalone"});default:return r.month(e,{width:"wide",context:"standalone"})||r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends zr{priority=100;parse(e,t,r){switch(t){case"w":return dn(qr,e);case"wo":return r.ordinalNumber(e,{unit:"week"});default:return pn(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r,n){return Bt(function(e,t,r){const n=Ht(e,r?.in),i=dr(n,r)-t;return n.setDate(n.getDate()-7*i),Ht(n,r?.in)}(e,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends zr{priority=100;parse(e,t,r){switch(t){case"I":return dn(qr,e);case"Io":return r.ordinalNumber(e,{unit:"week"});default:return pn(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r){return Rt(function(e,t,r){const n=Ht(e,r?.in),i=ur(n,r)-t;return n.setDate(n.getDate()-7*i),n}(e,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends zr{priority=90;subPriority=1;parse(e,t,r){switch(t){case"d":return dn(Yr,e);case"do":return r.ordinalNumber(e,{unit:"date"});default:return pn(t.length,e)}}validate(e,t){const r=bn(e.getFullYear()),n=e.getMonth();return r?t>=1&&t<=vn[n]:t>=1&&t<=wn[n]}set(e,t,r){return e.setDate(r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends zr{priority=90;subpriority=1;parse(e,t,r){switch(t){case"D":case"DD":return dn(Hr,e);case"Do":return r.ordinalNumber(e,{unit:"date"});default:return pn(t.length,e)}}validate(e,t){return bn(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,r){return e.setMonth(0,r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends zr{priority=90;parse(e,t,r){switch(t){case"E":case"EE":case"EEE":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=xn(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends zr{priority=90;parse(e,t,r,n){const i=e=>{const t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return cn(pn(t.length,e),i);case"eo":return cn(r.ordinalNumber(e,{unit:"day"}),i);case"eee":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeeee":return r.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=xn(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends zr{priority=90;parse(e,t,r,n){const i=e=>{const t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return cn(pn(t.length,e),i);case"co":return cn(r.ordinalNumber(e,{unit:"day"}),i);case"ccc":return r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"ccccc":return r.day(e,{width:"narrow",context:"standalone"});case"cccccc":return r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});default:return r.day(e,{width:"wide",context:"standalone"})||r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=xn(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends zr{priority=90;parse(e,t,r){const n=e=>0===e?7:e;switch(t){case"i":case"ii":return pn(t.length,e);case"io":return r.ordinalNumber(e,{unit:"day"});case"iii":return cn(r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n);case"iiiii":return cn(r.day(e,{width:"narrow",context:"formatting"}),n);case"iiiiii":return cn(r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n);default:return cn(r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n)}}validate(e,t){return t>=1&&t<=7}set(e,t,r){return(e=function(e,t,r){const n=Ht(e,r?.in),i=t-function(e,t){const r=Ht(e,t?.in).getDay();return 0===r?7:r}(n,r);return qt(n,i,r)}(e,r)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends zr{priority=80;parse(e,t,r){switch(t){case"a":case"aa":case"aaa":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(yn(r),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends zr{priority=80;parse(e,t,r){switch(t){case"b":case"bb":case"bbb":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(yn(r),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends zr{priority=80;parse(e,t,r){switch(t){case"B":case"BB":case"BBB":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(yn(r),0,0,0),e}incompatibleTokens=["a","b","t","T"]},h:new class extends zr{priority=70;parse(e,t,r){switch(t){case"h":return dn(Rr,e);case"ho":return r.ordinalNumber(e,{unit:"hour"});default:return pn(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,r){const n=e.getHours()>=12;return n&&r<12?e.setHours(r+12,0,0,0):n||12!==r?e.setHours(r,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]},H:new class extends zr{priority=70;parse(e,t,r){switch(t){case"H":return dn(Lr,e);case"Ho":return r.ordinalNumber(e,{unit:"hour"});default:return pn(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,r){return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends zr{priority=70;parse(e,t,r){switch(t){case"K":return dn(Br,e);case"Ko":return r.ordinalNumber(e,{unit:"hour"});default:return pn(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.getHours()>=12&&r<12?e.setHours(r+12,0,0,0):e.setHours(r,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]},k:new class extends zr{priority=70;parse(e,t,r){switch(t){case"k":return dn(Ur,e);case"ko":return r.ordinalNumber(e,{unit:"hour"});default:return pn(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,r){const n=r<=24?r%24:r;return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends zr{priority=60;parse(e,t,r){switch(t){case"m":return dn(Vr,e);case"mo":return r.ordinalNumber(e,{unit:"minute"});default:return pn(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setMinutes(r,0,0),e}incompatibleTokens=["t","T"]},s:new class extends zr{priority=50;parse(e,t,r){switch(t){case"s":return dn(Xr,e);case"so":return r.ordinalNumber(e,{unit:"second"});default:return pn(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setSeconds(r,0),e}incompatibleTokens=["t","T"]},S:new class extends zr{priority=30;parse(e,t){return cn(pn(t.length,e),e=>Math.trunc(e*Math.pow(10,3-t.length)))}set(e,t,r){return e.setMilliseconds(r),e}incompatibleTokens=["t","T"]},X:new class extends zr{priority=10;parse(e,t){switch(t){case"X":return hn(an,e);case"XX":return hn(sn,e);case"XXXX":return hn(on,e);case"XXXXX":return hn(un,e);default:return hn(ln,e)}}set(e,t,r){return t.timestampIsSet?e:Yt(e,e.getTime()-Xt(e)-r)}incompatibleTokens=["t","T","x"]},x:new class extends zr{priority=10;parse(e,t){switch(t){case"x":return hn(an,e);case"xx":return hn(sn,e);case"xxxx":return hn(on,e);case"xxxxx":return hn(un,e);default:return hn(ln,e)}}set(e,t,r){return t.timestampIsSet?e:Yt(e,e.getTime()-Xt(e)-r)}incompatibleTokens=["t","T","X"]},t:new class extends zr{priority=40;parse(e){return fn(e)}set(e,t,r){return[Yt(e,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends zr{priority=20;parse(e){return fn(e)}set(e,t,r){return[Yt(e,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},Sn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,An=/^'([^]*?)'?$/,Tn=/''/g,Pn=/\S/,Nn=/[a-zA-Z]/;function Dn(e){return e.match(An)[1].replace(Tn,"'")}function _n(e,t){const r=()=>Yt(t?.in,NaN),n=t?.additionalDigits??2,i=function(e){const t={},r=e.split(jn.dateTimeDelimiter);let n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],jn.timeZoneDelimiter.test(t.date)&&(t.date=e.split(jn.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){const e=jn.timezone.exec(n);e?(t.time=n.replace(e[1],""),t.timezone=e[1]):t.time=n}return t}(e);let a;if(i.date){const e=function(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const i=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:null===a?i:100*a,restDateString:e.slice((n[1]||n[2]).length)}}(i.date,n);a=function(e,t){if(null===t)/* @__PURE__ */return new Date(NaN);const r=e.match(Cn);if(!r)/* @__PURE__ */return new Date(NaN);const n=!!r[4],i=En(r[1]),a=En(r[2])-1,s=En(r[3]),o=En(r[4]),l=En(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,o,l)?function(e,t,r){const n=/* @__PURE__ */new Date(0);n.setUTCFullYear(e,0,4);const i=7*(t-1)+r+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+i),n}(t,o,l):/* @__PURE__ */new Date(NaN);{const e=/* @__PURE__ */new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(Fn[t]||(zn(e)?29:28))}(t,a,s)&&function(e,t){return t>=1&&t<=(zn(e)?366:365)}(t,i)?(e.setUTCFullYear(t,a,Math.max(i,s)),e):/* @__PURE__ */new Date(NaN)}}(e.restDateString,e.year)}if(!a||isNaN(+a))return r();const s=+a;let o,l=0;if(i.time&&(l=function(e){const t=e.match(On);if(!t)return NaN;const r=$n(t[1]),n=$n(t[2]),i=$n(t[3]);return function(e,t,r){return 24===e?0===t&&0===r:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}(r,n,i)?r*zt+n*Ft+1e3*i:NaN}(i.time),isNaN(l)))return r();if(!i.timezone){const e=new Date(s+l),r=Ht(0,t?.in);return r.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),r.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),r}return o=function(e){if("Z"===e)return 0;const t=e.match(Wn);if(!t)return 0;const r="+"===t[1]?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,i)?r*(n*zt+i*Ft):NaN}(i.timezone),isNaN(o)?r():Ht(s+l+o,t?.in)}var jn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Cn=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,On=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Wn=/^([+-])(\d{2})(?::?(\d{2}))?$/;function En(e){return e?parseInt(e):1}function $n(e){return e&&parseFloat(e.replace(",","."))||0}var Fn=[31,null,31,30,31,30,31,31,30,31,30,31];function zn(e){return e%400==0||e%4==0&&e%100!=0}var In=e=>{let t;return t="number"==typeof e?e<1e12?/* @__PURE__ */new Date(1e3*e):new Date(e):"string"==typeof e?_n(e):e,Math.floor((r=t,+Ht(r)/1e3)).toString();var r},Yn=e=>!("string"!=typeof e||!/^\d{4}-\d{2}-\d{2}$/.test(e))&&Jt(function(e,t,r,n){const i=()=>Yt(n?.in||r,NaN),a=Object.assign({},Ut()),s=n?.locale??a.locale??lr,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?i():Ht(r,n?.in);const u={firstWeekContainsDate:o,weekStartsOn:l,locale:s},c=[new Fr(n?.in,r)],d=t.match(Mn).map(e=>{const t=e[0];return t in vr?(0,vr[t])(e,s.formatLong):e}).join("").match(Sn),h=[];for(let y of d){!n?.useAdditionalWeekYearTokens&&Ar(y)&&Tr(y,t,e),!n?.useAdditionalDayOfYearTokens&&Mr(y)&&Tr(y,t,e);const r=y[0],a=kn[r];if(a){const{incompatibleTokens:t}=a;if(Array.isArray(t)){const e=h.find(e=>t.includes(e.token)||e.token===r);if(e)throw new RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${y}\` at the same time`)}else if("*"===a.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);h.push({token:r,fullToken:y});const n=a.run(e,y,s.match,u);if(!n)return i();c.push(n.setter),e=n.rest}else{if(r.match(Nn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");if("''"===y?y="'":"'"===r&&(y=Dn(y)),0!==e.indexOf(y))return i();e=e.slice(y.length)}}if(e.length>0&&Pn.test(e))return i();const f=c.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,r)=>r.indexOf(e)===t).map(e=>c.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]);let p=Ht(r,n?.in);if(isNaN(+p))return i();const m={};for(const y of f){if(!y.validate(p,u))return i();const e=y.set(p,m,u);Array.isArray(e)?(p=e[0],Object.assign(m,e[1])):p=e}return p}(e,"yyyy-MM-dd",/* @__PURE__ */new Date)),Hn={},qn=/* @__PURE__ */new Map,Ln=a({});function Un(e){return e&&(e.displayName||e.name)||"Component"}Ln.displayName="ComponentContext";var Bn={};Object.freeze(Bn);var Rn=(e,t="",r=".",n=!1)=>e&&"object"==typeof e?Object.keys(e).reduce((i,a)=>{a=a.replaceAll(r,"").replaceAll(".","");let s=`${t}${t?r:""}${a}`;return"object"!=typeof e[a]||Array.isArray(e[a])&&n?[...i,s]:[...i,s,...Rn(e[a],s,r,n)]},[]):[],Vn=(e,t=!0,r=!0)=>{let n="",i="abcdefghijklmnopqrstuvwxyz";t&&(i=`ABCDEFGHIJKLMNOPQRSTUVWXYZ${i}`),r&&(i=`${i}0123456789`);let a=i.length;for(let s=0;s<e;s++)n+=i.charAt(Math.floor(Math.random()*a));return n};function Xn(e,t){if(!e)return 0;let r={};try{let t=e.split(".")[1],n=typeof window<"u"?window.atob(t):Buffer.from(t,"base64").toString();r=JSON.parse(n)}catch{return 0}return t?Dt(r,"data.spaceId",0):r}function Zn(e){!e&&typeof window<"u"&&(e=window.location.search);let t={};if(!e||0===e.length)return t;let r=e.replace("?","").split("&");for(let n=0;n<r.length;n++){let e=r[n].split("="),i=decodeURIComponent(e[0]),a=decodeURIComponent(e[1]);void 0===t[i]?t[i]=decodeURIComponent(a):"string"==typeof t[i]?t[i]=[t[i],decodeURIComponent(a)]:t[i].push(decodeURIComponent(a))}return t}var Qn=({url:e="",internalProps:t,autoRegister:r=!0,plitziJsxSkipHOC:n=!1,plitziJsxProps:a=Bn})=>{let{register:s}=u(Ln),[o,c]=g(!1);h(()=>c(!0),[]);let d=m(()=>l(((e,t,r=!0,n=!1)=>async()=>{if(!qn.get(e)){let t=(async e=>{try{let t=await fetch(e),r=new Blob([await t.text()],{type:"text/javascript"});return await(import(
|
|
1
|
+
import{n as e}from"./rolldown-runtime-CxhCXM28.js";import{Component as t,Fragment as r,Profiler as n,Suspense as i,createContext as a,createElement as s,isValidElement as o,lazy as l,use as u,useCallback as c,useContext as d,useEffect as h,useId as f,useLayoutEffect as p,useMemo as m,useRef as y,useState as g,useSyncExternalStore as b}from"react";import{jsx as w}from"react/jsx-runtime";var v=a(void 0);v.displayName="ElementContext";var x=a(void 0);x.displayName="ElementParentContext";var k=e=>!1!==e&&"false"!==e,S=(e,t)=>{let r=new Set(t),n={};for(let i in e)!r.has(i)&&Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},M=()=>{},A=class{items=[];notifying=0;dead=0;get length(){return this.items.length-this.dead}add(e){return this.items.push(e),()=>this.remove(e)}remove(e){let t=this.items.indexOf(e);if(-1===t)return;if(this.notifying>0)return this.items[t]=M,void this.dead++;let r=this.items.pop();t<this.items.length&&(this.items[t]=r)}begin(){this.notifying++}end(){0===--this.notifying&&this.dead>0&&this.compact()}forEach(e,t){this.begin();try{let r,{items:n}=this,i=n.length,a=0,s=!1;for(;a<i;)try{for(;a<i;a++)e(n[a])}catch(e){s||(s=!0,r=e),a++}if(s){if(!t)throw r;t(r)}}finally{this.end()}}clear(){if(this.notifying>0){let{items:e}=this;for(let t=0,r=e.length;t<r;t++)e[t]=M;return void(this.dead=e.length)}this.items.length=0,this.dead=0}compact(){let{items:e}=this,t=0;for(let r=0;r<e.length;r++)e[r]!==M&&(e[t++]=e[r]);e.length=t,this.dead=0}},T=(e,t)=>"function"==typeof e?!e(t):!1===e,P=e=>"object"==typeof e&&!!e&&!Array.isArray(e),N=(e,t)=>{if(!P(e)||!P(t))return t;let r={...e};for(let n of Object.keys(t))"__proto__"!==n&&(r[n]=n in e?N(e[n],t[n]):t[n]);return r},D=/* @__PURE__ */new Map,_=e=>{let t=D.get(e);return void 0===t&&(t=e.split("."),D.size>=512&&D.delete(D.keys().next().value),D.set(e,t)),t},j=/* @__PURE__ */new Map;function C(e,t){let r=Array.isArray(t);if("string"!=typeof t&&!r||r&&!t.length||"string"==typeof t&&!t)return e;if("string"==typeof t&&-1===t.indexOf("."))return"object"==typeof e&&e&&t in e?e[t]:void 0;if("string"==typeof t)return(e=>{let t=j.get(e);if(!t){if(t=(e=>{if(1===e.length){let t=e[0];return e=>"object"==typeof e&&e&&t in e?e[t]:void 0}return t=>{let r=t;for(let n=0;n<e.length;n++){if("object"!=typeof r||!r)return;r=r[e[n]]}return r}})(_(e)),j.size>=512){let e=j.keys().next().value;j.delete(e)}j.set(e,t)}return t})(t)(e);let n=e;for(let i of t){if("object"!=typeof n||!n||!(i in n))return;n=n[i]}return n}var O,W=Symbol("unchanged"),E=e=>/^\d+$/.test(e),$=e=>Array.isArray(e)?e.slice():{...e},F=(e,t,r,n,i)=>{let a=t[r],s="object"==typeof e&&e?e:{};if(r===t.length-1){let e=s[a],t=i?n(e):n;if(e===t)return W;let r=$(s);return r[a]=t,r}let o=F(s[a],t,r+1,n,i);if(o===W)return W;let l=$(s);return l[a]=o,l},z=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,I=e=>z.test(e)?`.${e}`:`[${JSON.stringify(e)}]`,Y=e=>z.test(e)?e:JSON.stringify(e),H=e=>{let t=e.length,r="";for(let a=0;a<t-1;a++){let t=0===a?"o":"_"+(a-1);r+=`var _${a}=${t}==null?void 0:${t}${I(e[a])};\n`}let n=t>1?"_"+(t-2):"o";r+=`var _p=${n}==null?void 0:${n}${I(e[t-1])};\n`,r+="var _v=f?v(_p):v;\nif(_p===_v)return null;\n";let i="_v";for(let a=t-1;a>=0;a--)i=`{...${0===a?"o":`(_${a-1}||{})`},${Y(e[a])}:${i}}`;return r+=`return ${i};`,Function("o","v","f",r)},q=/* @__PURE__ */new Map,L=(e,t,r)=>{if("object"!=typeof e||!e)return W;let n=e,i=t[r];if(!Object.hasOwn(n,i))return W;if(r===t.length-1){let e=$(n);return Array.isArray(e)?e.splice(Number(i),1):delete e[i],e}let a=L(n[i],t,r+1);if(a===W)return W;let s=$(n);return s[i]=a,s},U=(e,t,r,n,i)=>{let a=((e,t)=>{if(!(()=>{if(typeof window>"u")return!1;if(void 0===O)try{H(["x","y"])({x:{}},1,!1),O=!0}catch{O=!1}return O})())return;let r=q.get(e);if(r)return r;if(t.some(E))return;let n=H(t);return q.size>=256&&q.delete(q.keys().next().value),q.set(e,n),n})(t,r);if(a){let t=a(e,n,i);return null===t?W:t}return F(e,r,0,n,i)},B=Symbol("@plitzi/nexus/cancel"),R=(()=>{try{return"production"}catch{}return"production"})(),V="production"===R,X=!V,Z="test"===R;var Q=e=>"number"==typeof e||""===e||isNaN(Number(e))?e:Number(e),G=e=>Array.isArray(e)?e.slice():{...e},J=(e,t,r,n)=>{let i=Q(t[r]),a=G(e);return a[i]=r===t.length-1?n:J(e[i]??{},t,r+1,n),a},K=Symbol("no-error"),ee=(e,t,r)=>{let n=0,i=K;for(;n<r;)try{for(;n<r;n++)e[n](t)}catch(e){i===K&&(i=e),n++}return i},te="__proto__";var re=(e,t)=>e===t||e.startsWith(`${t}.`),ne=class{reportError;records=/* @__PURE__ */new Map;listeners=/* @__PURE__ */new Set;announced=/* @__PURE__ */new Set;timer;snapshot;constructor(e){this.reportError=e}get size(){return this.records.size}getRecords(){return this.snapshot??=Object.fromEntries(this.records),this.snapshot}subscribe(e){return this.listeners.add(e),this.schedule(),()=>{this.listeners.delete(e),this.schedule()}}record(e,t,r,n){this.drop(e,n,!1);let i=Math.max(0,t),a={updatedAt:r,expiresAt:r+i,ttl:i};this.records.set(e,a),this.announced.delete(e),this.changed(),n||this.emit({path:e,type:"recorded",freshness:a})}drop(e,t,r=!0){if(0!==this.records.size)for(let n of[...this.records.keys()])(n===e?r:n.startsWith(`${e}.`))&&this.forget(n,t)}dropChanged(e,t,r){for(let n of[...this.records.keys()])C(e,n)!==C(t,n)&&this.forget(n,r)}get(e){if(0===this.records.size)return;let t=e;for(;;){let e=this.records.get(t);if(e)return e;let r=t.lastIndexOf(".");if(-1===r)return;t=t.slice(0,r)}}expire(e,t){let r=[];if(this.records.forEach((n,i)=>{(void 0===e||re(i,e)||re(e,i))&&(n.expiresAt>t&&this.records.set(i,{...n,expiresAt:t}),this.announced.add(i),r.push(i))}),r.length>0){this.changed();for(let e of r)this.emit({path:e,type:"expired",freshness:this.records.get(e)})}return r}forget(e,t){let r=this.records.get(e);this.records.delete(e),this.announced.delete(e),this.changed(),t||this.emit({path:e,type:"dropped",freshness:r})}changed(){this.snapshot=void 0,this.schedule()}emit(e){for(let t of[...this.listeners])try{t(e)}catch(Fs){this.reportError(Fs,e.path)}}schedule(){if(clearTimeout(this.timer),this.timer=void 0,0===this.listeners.size)return;let e=1/0;this.records.forEach((t,r)=>{!this.announced.has(r)&&t.expiresAt<e&&(e=t.expiresAt)}),e!==1/0&&(this.timer=setTimeout(()=>this.elapse(),Math.min(2147483647,Math.max(0,e-Date.now()))))}elapse(){let e=Date.now(),t=[];this.records.forEach((r,n)=>{!this.announced.has(n)&&r.expiresAt<=e&&(this.announced.add(n),t.push(n))});for(let r of t)this.emit({path:r,type:"elapsed",freshness:this.records.get(r)});this.schedule()}},ie=class{subscribers=null;children=null},ae=class{direct=/* @__PURE__ */new Map;descendants=/* @__PURE__ */new Map;root=new ie;size=0;add(e,t){let r=_(e),n=this.direct.get(e);if(!n){n=new A,this.direct.set(e,n);let t=this.root;for(let e of r){t.children||(t.children=/* @__PURE__ */new Map);let r=t.children.get(e);r||(r=new ie,t.children.set(e,r)),t=r}t.subscribers=n,this.size++;let i="";for(let n=0;n<r.length-1;n++){i=i?`${i}.${r[n]}`:r[n];let t=this.descendants.get(i);t||(t=/* @__PURE__ */new Set,this.descendants.set(i,t)),t.add(e)}}return n.add(t),()=>this.remove(e,n,t,r)}remove(e,t,r,n){if(this.direct.get(e)!==t||(t.remove(r),t.length>0))return;this.direct.delete(e),this.size--;let i=this.root;for(let s of n){if(!i.children)return;let e=i.children.get(s);if(!e)return;i=e}i.subscribers===t&&(i.subscribers=null);let a="";for(let s=0;s<n.length-1;s++){a=a?`${a}.${n[s]}`:n[s];let t=this.descendants.get(a);t&&(t.delete(e),0===t.size&&this.descendants.delete(a))}}walkAncestors(e,t){let r=this.root;for(let n of e){if(!r.children)return;let e=r.children.get(n);if(!e)return;r=e,r.subscribers&&t(r.subscribers)}}getDescendants(e){return this.descendants.get(e)}forEachAffected(e,t,r){let n=e=>{e&&e.forEach(t,r)};if("string"!=typeof e)return void this.direct.forEach(n);let i=_(e);this.walkAncestors(i,n),this.descendants.get(e)?.forEach(e=>n(this.direct.get(e)))}clear(){this.direct.clear(),this.descendants.clear(),this.root.children=null,this.root.subscribers=null,this.size=0}},se=0;function oe(e,t){let r,n,i,a={},s=new A,o=new A,l=new ae,u=new A,c=()=>{0!==u.length&&u.forEach(e=>e())},d=[],h=[],f=[],p=t?.parent,m=++se,y=(e,t,r)=>{if(0===h.length)throw e;let n={error:e,phase:t,path:r};for(let i=0,a=h.length;i<a;i++)h[i](n)},g=new ne((e,t)=>y(e,"notify",t)),b=()=>a,w=()=>r??={...a},{getState:v,getPath:x,invalidate:k,resetCache:S,getMergeCount:M}=function(e,t,r,n){if(!r)return{getState:t,getPath:t=>C(e(),t),invalidate:()=>{},resetCache:()=>{},getMergeCount:()=>0};let i,a=r,s=n&&n.length>0?new Set(n):void 0,o=!0,l=!1,u=0,c=/* @__PURE__ */new Map,d=/* @__PURE__ */new Map;return{getState:()=>((o||void 0===i)&&(i=(()=>{u++;let e=t(),r=N(a.getState(),e);if(s)for(let t of s)void 0!==e[t]&&(r[t]=e[t]);return r})(),o=!1),i),getPath:t=>{if(l)c.clear(),l=!1;else if(c.has(t))return c.get(t);let r=(t=>{if(s){let r=t.indexOf("."),n=-1===r?t:t.slice(0,r);if(s.has(n)&&void 0!==e()[n])return C(e(),t)}let r=C(e(),t);if(void 0===r)return a.getPath(t);let n=a.getPath(t);if(void 0===n||!P(r)||!P(n))return r;let i=d.get(t);if(i&&i.own===r&&i.parent===n)return i.value;u++;let o=N(n,r);return d.set(t,{own:r,parent:n,value:o}),o})(t);return c.set(t,r),r},invalidate:()=>{o=!0,l=!0},resetCache:()=>{c.clear(),d.clear(),i=void 0,o=!0,l=!1},getMergeCount:()=>u}}(b,w,p,t?.exclusive),T=()=>{k(),c()},D=!1;p&&(S(),i=p.subscribeInvalidate?.(T));let{setState:j,batch:O}=function(e){let{getOwnState:t,getOwnSnapshot:r,setOwnState:n,mutateOwnKey:i,deleteOwnKey:a,parent:s,listeners:o,pathListeners:l,changeListeners:u,interceptors:c,readOnly:d,freshness:h,reportError:f,invalidateDescendants:p,onDelegateToParent:m}=e,y=e=>{if(0===d.length||!(e=>{for(let t=0,r=d.length;t<r;t++){let r=d[t];if(e===r||e.startsWith(`${r}.`)||r.startsWith(`${e}.`))return!0}return!1})(e))return!1;if(X)throw Error(`@plitzi/nexus: refused to write to read-only path "${e}"`);return!0},g=(e,t,r)=>{let n=t;for(let i=0,a=c.length;i<a;i++){let a;try{a=c[i]({path:e,value:n,prev:r})}catch(t){return f(t,"beforeChange",e),B}if(a===B)return B;void 0!==a&&(n=a)}return n},b=(e,t,r)=>{void 0===t?h.size>0&&h.drop(e,r):h.record(e,t,Date.now(),r)},w=0,v=/* @__PURE__ */new Set,x=(e,t)=>{let{items:r}=e;if(w>0)for(let n=0,i=r.length;n<i;n++)v.add(r[n]);else if(0!==r.length){e.begin();try{let e=ee(r,t,r.length);e!==K&&f(e,"notify",t)}finally{e.end()}}},k=(e,t,r)=>{let n={path:e,prev:t,next:r,prevValue:void 0===e?t:C(t,e),nextValue:void 0===e?r:C(r,e)},{items:i}=u;u.begin();try{let t=ee(i,n,i.length);t!==K&&f(t,"onChange",e)}finally{u.end()}},S=(e,t,r,n)=>{let i=l.getDescendants(e);if(i)for(let a of i){let i=l.direct.get(a);if(!i)continue;let s=_(a).slice(n);C(t,s)!==C(r,s)&&x(i,e)}},M=(e,t,r,i,a)=>{let s=e?C(r,e):void 0,f=e?a?t(s):t:void 0;if(e&&c.length>0){let t=g(e,f,s);if(t===B)return;f=t}if(e&&s===f)return;let m=e?((e,t,r)=>{if("string"==typeof t){if(!t)return r;let n=_(t);if(1===n.length){let t=G(e);return t[Q(n[0])]=r,t}return J(e,n,0,r)}return Array.isArray(t)&&t.length?J(e,t,0,r):r})(r,e,f):a?t(r):{...r,...t};if(!e&&c.length>0){let e=g(void 0,m,r);if(e===B)return;m=e}if(m!==r){if(d.length>0)for(let e=0,t=d.length;e<t;e++){let t=d[e];if(C(r,t)!==C(m,t)){if(X)throw Error(`@plitzi/nexus: refused to write to read-only path "${d[e]}"`);return}}h.size>0&&h.dropChanged(r,m,!i),n(m),u.length>0&&k(e,r,m),p(),i&&(x(o,e),l.size>0&&l.direct.forEach((t,n)=>{C(r,n)!==C(m,n)&&x(t,e)}))}};return{setState:(e,d,f={})=>{let{canPropagate:w=!0,unmount:v=!1,raw:A=!1,ttl:T}=f,P=t(),N=!A&&"function"==typeof d;if("string"==typeof e&&-1!==e.indexOf(te)&&-1!==_(e).indexOf(te))throw Error(`@plitzi/nexus: refused to write to unsafe path "${e}" (\`__proto__\` segment)`);if("string"==typeof e&&y(e))return;if(s&&"string"==typeof e&&!(-1===e.indexOf(".")?Object.hasOwn(P,e):((e,t)=>{let r=e;for(let n=0,i=t.length;n<i;n++){if("object"!=typeof r||!r||!Object.hasOwn(r,t[n]))return!1;r=r[t[n]]}return!0})(P,_(e))))return m?.(e),void s.setState(e,d,{canPropagate:w,unmount:v,raw:A,ttl:T});if("string"!=typeof e)return void M(e,d,P,w,N);if(-1===e.indexOf(".")){if(v){if(!Object.hasOwn(P,e))return;let t=P[e];if(c.length>0&&g(e,void 0,t)===B)return;h.drop(e,!w);let n=u.length>0?r():void 0;if(a(e),void 0!==n&&k(e,n,r()),w&&(x(o,e),l.size>0)){let r=l.direct.get(e);r&&x(r,e),S(e,t,void 0,1)}return void p()}let t=P[e],n=N?d(t):d,s=n;if(c.length>0){let r=g(e,n,t);if(r===B)return;s=r}if(b(e,T,!w),t===s)return;let f=u.length>0?r():void 0;if(i(e,s),void 0!==f&&k(e,f,r()),w&&(x(o,e),l.size>0)){let r=l.direct.get(e);r&&x(r,e),S(e,t,s,1)}return void p()}let D,j=_(e);if(v){if(c.length>0&&g(e,void 0,C(P,e))===B)return;h.drop(e,!w),D=((e,t)=>L(e,t,0))(P,j)}else if(c.length>0){let t=C(P,e),r=N?d(t):d,n=g(e,r,t);if(n===B)return;D=U(P,e,j,n,!1)}else D=U(P,e,j,d,N);if(v||b(e,T,!w),D===W)return;let O=D;n(O),u.length>0&&k(e,P,O),w&&(x(o,e),l.size>0&&(((e,t)=>{l.walkAncestors(t,t=>x(t,e))})(e,j),S(e,P,O,0))),p()},batch:e=>{w++;try{return e()}finally{if(w--,0===w&&v.size>0){let e=[...v];v.clear();let t=ee(e,void 0,e.length);t!==K&&f(t,"notify",void 0)}}}}}({getOwnState:b,getOwnSnapshot:w,setOwnState:e=>{a=e,r=void 0,k()},mutateOwnKey:(e,t)=>{a[e]=t,k(),r=void 0},deleteOwnKey:e=>{delete a[e],k(),r=void 0},parent:p,listeners:s,pathListeners:l,changeListeners:o,interceptors:d,readOnly:t?.readOnly??[],freshness:g,reportError:y,invalidateDescendants:c,onDelegateToParent:X&&p?e=>p.scopeClaims?.claimDelegatedWrite(e,m):void 0}),E=()=>{n&&(n.unsubscribe(),n=void 0,S())},$=()=>{p&&(!D&&(s.length>0||l.size>0||o.length>0)?!n&&p&&(k(),S(),n=function(e,t,r,n,i,a,s){let o;return{unsubscribe:e.subscribe(e=>{s();let l=e;if(t.forEach(t=>t(e),e=>a(e,"notify",l)),r.size>0&&r.forEachAffected(e,t=>t(e),e=>a(e,"notify",l)),n.length>0){let e=i(),t=o??e,r={path:l,prev:t,next:e,prevValue:void 0===l?t:C(t,l),nextValue:void 0===l?e:C(e,l)};o=e,n.forEach(e=>e(r),e=>a(e,"onChange",l))}}),seedBaseline:()=>{o??=i()}}}(p,s,l,o,v,y,k),o.length>0&&n.seedBaseline()):E())},F=e=>($(),()=>{e(),$()}),z=e=>F(s.add(e)),I=(e,t)=>F(l.add(e,t)),Y=e=>{let t=F(o.add(e));return n?.seedBaseline(),t};a="function"==typeof e?e(j,v):e;let H=e=>g.get(e)??p?.getFreshness(e),q={id:t?.id,scopePath:t?.scopePath,getState:v,getOwnState:w,getPath:x,setState:j,get:e=>void 0===e?v():x(e),set:j,watch:(e,t)=>"function"==typeof e?z(e):I(e,t),withBase:e=>{let t=(t,r,n)=>j(void 0===t?e:`${e}.${t}`,r,n);return{getState:t=>{let r=x(e);return void 0===r&&void 0!==t?t:r},getPath:(t,r)=>{let n=x(`${e}.${t}`);return void 0===n&&void 0!==r?r:n},setState:t,subscribe:t=>I(e,t),subscribePath:(t,r)=>I(`${e}.${t}`,r),get:t=>x(void 0===t?e:`${e}.${t}`),set:t,watch:(t,r)=>"function"==typeof t?I(e,t):I(`${e}.${t}`,r)}},batch:O,subscribe:z,subscribePath:I,subscribeChange:Y,getFreshness:H,isStale:e=>{let t=H(e);return!t||Date.now()>=t.expiresAt},expire:e=>{let t=g.expire(e,Date.now()),r=p?p.expire(e):[];return 0===r.length?t:[...t,...r]},watchFreshness:(e,t)=>{let r="function"==typeof e?void 0:e,n="function"==typeof e?e:t,i=void 0===r?n:e=>{let t=e.path;(t===r||t.startsWith(`${r}.`)||r.startsWith(`${t}.`))&&n(e)},a=g.subscribe(i),s=p?.watchFreshness(i);return()=>{a(),s?.()}},getFreshnessRecords:()=>g.getRecords(),destroy:()=>{D=!0,E(),s.clear(),l.clear(),o.clear(),u.clear(),i?.(),X&&p&&p.scopeClaims?.releaseScope(m)},reconnect:()=>{D=!1,p&&(i?.(),i=p.subscribeInvalidate?.(T)),$()},subscribeInvalidate:e=>u.add(e),hydrate:()=>{for(let e of f)e()}};if(t?.middlewares)for(let A of t.middlewares){let e=A(q);e?.beforeChange&&d.push(e.beforeChange),e?.onChange&&Y(e.onChange),e?.onError&&h.push(e.onError);let r=e?.hydrate;r&&(t.deferHydrate?f.push(()=>r(q)):r(q))}return X&&(q.scopeClaims=(()=>{let e=/* @__PURE__ */new Map,t=/* @__PURE__ */new Map;return{claimDelegatedWrite(r,n){let i=e.get(r);if(void 0!==i){if(i===n)return;if(Z)throw Error((e=>`@plitzi/nexus: scope collision — two sibling scopes under the same parent both delegate a write to "${e}", clobbering each other through the shared parent. Write to a path each scope owns, or move the shared value into the parent and update it there.`)(r));return}e.set(r,n);let a=t.get(n);a?a.add(r):t.set(n,/* @__PURE__ */new Set([r]))},releaseScope(r){let n=t.get(r);if(n){for(let t of n)e.delete(t);t.delete(r)}}}})()),Z&&(q.listeners=s,q.pathListeners=l,q.changeListeners=o,q.interceptors=d,q.errorHandlers=h,q.invalidateListeners=u,q.getMergeCount=M),q}var le=a(void 0);le.displayName="StoreContext";var ue=a(void 0);ue.displayName="StoreRegistryContext";var ce=(e,t)=>{for(let r=e;r;r=r.parent)if(r.id===t)return r.store},de=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Object.is(e[r],t[r]))return!1;return!0};function he(e,t,r){let n=d(le),i=d(ue);if(e)return e;if(void 0!==r){let e=ce(i,r);if(!e)throw Error(`${t}: no store registered with id "${r}" in any ancestor StoreProvider`);return e}if(!n)throw Error(`${t} must be used inside a StoreProvider`);return n}function fe(e,t,r){let n=t.current.length;return m(()=>Array.from({length:n},(r,n)=>(r,i)=>{let a=t.current[n],s="function"==typeof a?a(e.getState()):a;e.setState(s,r,i)}),[e,r])}var pe=typeof window<"u"?p:h,me=(e,t)=>{if(Object.is(e,t))return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i of r)if(!Object.is(e[i],t[i]))return!1;return!0};function ye(e,t,r={}){let n=r,i=he(n.store,"useStoreSync",n.storeId);Array.isArray(e)?function(e,t,r,n){let{mode:i="sync",enabled:a=!0,syncStrategy:s="afterRender",raw:o=!1,ttl:l}=n,u=t.map((e,t)=>"function"==typeof e?`fn_${t}`:e).join("|"),c=y(!1),d=!c.current;c.current=!0;let h=y(void 0),f=a&&(d||"sync"===i&&r.some((e,t)=>!Object.is(h.current?.[t],e))),p=(n=!0)=>{h.current=r,e.batch(()=>{t.forEach((t,i)=>{let a="function"==typeof t?t(e.getState()):t;e.setState(a,r[i],{canPropagate:n,raw:o,ttl:l})})})};"render"===s?f&&p():(f&&d&&p(!1),pe(()=>{f&&!d&&p()},[f,r,u]))}(i,e,t,r):function(e,t,r,n){let i=void 0===t,a="function"==typeof t,s=i?me:Object.is,{mode:o="sync",enabled:l=!0,equalityFn:u=s,syncStrategy:c="afterRender",raw:d=!1,ttl:h}=n,f=y(void 0),p=y(!1),m=!p.current;p.current=!0;let g=f.current,b=l&&(m||"sync"===o&&(void 0===g||!u(g,r))),w=(n=!0)=>{if(f.current=r,i)e.setState(void 0,e=>({...e,...r}),{canPropagate:n});else if(a){let i=t(e.getState());e.setState(i,r,{canPropagate:n,raw:d,ttl:h})}else e.setState(t,r,{canPropagate:n,raw:d,ttl:h})};"render"===c?b&&w():(b&&m&&w(!1),pe(()=>{b&&!m&&w()},[b,r,t]))}(i,e,t,r)}var ge=[];var be=()=>({useStore:function(e,t){return function(e,t={}){let r=he(t.store,"useStore",t.storeId),n=Array.isArray(e),i=function(e,t,r){let n=r.mode??"sync",i=r.enabled??!0,a=void 0===t,s=r.equalityFn??(a?me:Object.is),o=r.transformer,l=y(o);l.current=o;let u=m(()=>function(e,t){return()=>{if("string"==typeof t)return e.getPath(t);if("function"==typeof t){let r=e.getState();return C(r,t(r))}return e.getState()}}(e,t),[e,t]),d=y(u()),h=m(()=>r=>i&&"mount"!==n?"string"==typeof t?e.subscribePath(t,r):e.subscribe(r):()=>{},[i,n,t,e]),f=()=>{if(!i)return d.current;if("mount"===n)return u();let e=u();return s(d.current,e)?d.current:(d.current=e,e)},p=b(h,f,f);return[m(()=>l.current?l.current(p):p,[p]),c((r,n)=>{a?e.setState(void 0,r,n):"function"==typeof t?e.setState(t(e.getState()),r,n):e.setState(t,r,n)},[e,t])]}(r,n?void 0:e,n?{...t,enabled:!1,transformer:void 0}:t),a=function(e,t,r){let n=r.mode??"sync",i=r.enabled??!0,a=r.equalityFn??de,s=r.transformer,o=y(s);o.current=s;let l=y(t);l.current=t;let u=t.map((e,t)=>"function"==typeof e?`fn_${t}`:e).join("|"),d=y(null),h=m(()=>function(e,t,r,n={}){let{equalityFn:i=de}=n;return()=>{let n=t.current,a=n.some(e=>"function"==typeof e)?e.getState():void 0,s=n.map(t=>"function"==typeof t?C(a,t(a)):e.getPath(t)),o=r.current;return null!==o&&i(o,s)?o:(r.current=s,s)}}(e,l,d,{equalityFn:a}),[e,u,a]),f=function(e,t,r,n,i){return m(()=>r=>{if(!n||"mount"===i)return()=>{};let a=t.current;if(a.some(e=>"function"==typeof e))return e.subscribe(r);let s=a.map(t=>e.subscribePath(t,r));return()=>s.forEach(e=>e())},[e,r,n,i])}(e,l,u,i,n),p=function(e,t,r,n){let i=c(()=>{if(!r){let e=n.current??t();return n.current=e,e}return t()},[r,t,n]);return b(e,i,i)}(f,h,i,d);return[m(()=>o.current?o.current(p):p,[p]),...fe(e,l,u)]}(r,n?e:ge,n?t:{...t,enabled:!1,transformer:void 0});return n?a:i}(e,t)},useStoreSync:function(e,t,r){ye(e,t,r)},useStoreGetter:function(e,t){return function(e,t){let r="string"==typeof e?e:void 0,n=Array.isArray(e)?e:void 0,i="object"!=typeof e||Array.isArray(e)?t:e,a=he(i?.store,"useStoreGetter",i?.storeId),s=n?.map(e=>"function"==typeof e?e.toString():e).join("|");return m(()=>{if(n)return n.map(e=>(t,r)=>{let n="function"==typeof e?e(a.getState()):C(a.getState(),e);if(void 0!==t){let e=C(n,t);return void 0===e&&void 0!==r?r:e}return void 0===n&&void 0!==r?r:n});if(void 0!==r){let e=a.withBase(r);return(t,r)=>void 0===t?void 0===r?e.getState():e.getState(r):void 0===r?e.getPath(t):e.getPath(t,r)}return(e,t)=>{let r=a.getState();if(void 0!==e){let n=C(r,e);return void 0===n&&void 0!==t?t:n}return r}},[a,r,s])}(e,t)},useStoreSetter:function(e,t){return function(e,t){let r="string"==typeof e?e:void 0,n="object"==typeof e?e:t,i=he(n?.store,"useStoreSetter",n?.storeId);return m(()=>void 0===r?i.setState:i.withBase(r).setState,[i,r])}(e,t)},useFreshness:function(e,t){return function(e,t={}){let{enabled:r=!0}=t,n=he(t.store,"useFreshness",t.storeId),i=y(void 0),a=c(t=>r?n.watchFreshness(e,t):()=>{},[n,e,r]),s=c(()=>{let t=(e=>({isStale:!e||Date.now()>=e.expiresAt,updatedAt:e?.updatedAt,expiresAt:e?.expiresAt}))(n.getFreshness(e));return i.current&&((e,t)=>e.isStale===t.isStale&&e.updatedAt===t.updatedAt&&e.expiresAt===t.expiresAt)(i.current,t)?i.current:(i.current=t,t)},[n,e]);return b(a,s,s)}(e,t)},useOnStale:function(e,t,r){!function(e,t,r={}){let{enabled:n=!0}=r,i=he(r.store,"useOnStale",r.storeId),a=y(t);h(()=>{a.current=t},[t]),h(()=>{if(n)return i.watchFreshness(e,e=>{("expired"===e.type||"elapsed"===e.type)&&a.current(e)})},[i,e,n])}(e,t,r)}});function we(e){return he(void 0,"useStoreById",e)}var{useStore:ve,useStoreSync:xe,useStoreGetter:ke,useStoreSetter:Se}=be(),{useStore:Me,useStoreSync:Ae,useStoreGetter:Te,useStoreSetter:Pe}=be(),{useStore:Ne,useStoreSync:De,useStoreGetter:_e,useStoreSetter:je}=be(),Ce=Symbol("twigArrowParams"),Oe=(e,t)=>e===t?0:null==e?-1:null==t?1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t)),We=e=>null==e?"":String(e),Ee=e=>"object"==typeof e&&!!e&&"__PLITZI_RAW__"===e.__marker,$e=e=>Ee(e)?e.__raw:e,Fe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ze=/* @__PURE__ */new Map,Ie={raw:e=>(e=>({__raw:e,__marker:"__PLITZI_RAW__"}))(e),to_json:e=>"object"==typeof e&&e?JSON.stringify(e):We(e),json_encode:e=>"object"==typeof e&&e?JSON.stringify(e):We(e),object_as_json:e=>"object"==typeof e&&e?JSON.stringify(e):e,default:(e,t)=>(e=>null==e||""===e)(e)?t[0]:e,upper:e=>"string"==typeof e?e.toUpperCase():e,lower:e=>"string"==typeof e?e.toLowerCase():e,trim:e=>"string"==typeof e?e.trim():e,capitalize:e=>"string"==typeof e&&e.length>0?e[0].toUpperCase()+e.slice(1).toLowerCase():e,title:e=>"string"==typeof e?e.replace(/\b\w/g,e=>e.toUpperCase()):e,camelize:e=>"string"==typeof e?e.replace(/[-_]+(.)?/g,(e,t)=>t?t.toUpperCase():""):e,kebab:e=>"string"==typeof e?e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():e,snake:e=>"string"==typeof e?e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase():e,ltrim:e=>"string"==typeof e?e.trimStart():e,rtrim:e=>"string"==typeof e?e.trimEnd():e,pad:(e,t)=>{if("string"!=typeof e)return e;let r=Number(t[0])||0,n=t.length>1?We(t[1]):" ";if(""===n)return e;let i=r-e.length;if(i<=0)return e;let a=Math.ceil(i/n.length);return n.repeat(a).slice(0,i)+e},padRight:(e,t)=>{if("string"!=typeof e)return e;let r=Number(t[0])||0,n=t.length>1?We(t[1]):" ";if(""===n)return e;let i=r-e.length;if(i<=0)return e;let a=Math.ceil(i/n.length);return e+n.repeat(a).slice(0,i)},number:(e,t)=>{if("number"==typeof e){let r=Number(t[0])||0;return e.toFixed(r)}if("string"!=typeof e)return e;let r=e.match(/-?\d+(?:\.\d+)?/);return r?Number(r[0]):0},replace:(e,t)=>"string"!=typeof e||0===t.length?e:e.split(We(t[0])).join(We(t[1])),slice:(e,t)=>{if(0===t.length)return e;let r=Number(t[0])||0,n=t.length>1&&Number.isFinite(Number(t[1]))?r+Number(t[1]):void 0;return"string"==typeof e||Array.isArray(e)?e.slice(r,n):e},split:(e,t)=>"string"==typeof e&&t.length>0?e.split(We(t[0])):e,join:(e,t)=>Array.isArray(e)?e.join(0===t.length?"":We(t[0])):e,reverse:e=>"string"==typeof e?e.split("").reverse().join(""):Array.isArray(e)?[...e].reverse():e,length:e=>"string"==typeof e||Array.isArray(e)?e.length:"number"==typeof e?We(e).length:"object"==typeof e&&e?Object.keys(e).length:0,first:e=>"string"==typeof e?e.length>0?e[0]:"":Array.isArray(e)?e.length>0?e[0]:void 0:e,last:e=>"string"==typeof e?e.length>0?e[e.length-1]:"":Array.isArray(e)?e.length>0?e[e.length-1]:void 0:e,contains:(e,t)=>{if(0===t.length)return!1;let r=t[0];return"string"==typeof e?e.includes(We(r)):!!Array.isArray(e)&&e.includes(r)},startswith:(e,t)=>"string"==typeof e&&t.length>0&&e.startsWith(We(t[0])),endswith:(e,t)=>"string"==typeof e&&t.length>0&&e.endsWith(We(t[0])),number_format:(e,t)=>{if("number"!=typeof e)return e;let r=Number(t[0])||0,n=null==t[1]?".":We(t[1]),i=null==t[2]?"":We(t[2]),a=e.toFixed(r);if(""===i)return a.replace(".",n);let s=a.split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,i),s.join(n)},sort:(e,t)=>{if(!Array.isArray(e))return e;let r=[...e],n=t[0];if("function"==typeof n){let e=n;return(e[Ce]??1)>=2?r.sort((t,r)=>Number(e(t,r))):r.sort((t,r)=>Oe(e(t),e(r)))}return r.sort(Oe)},batch:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=Number(t[0]);if(r<=0)return e;let n=[];for(let i=0;i<e.length;i+=r)n.push(e.slice(i,i+r));return n},map:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=t[0];return"function"==typeof r?e.map((e,t)=>r(e,t)):e},reduce:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=t[0];if("function"!=typeof r)return e;let n=t[1],i=+(void 0===n),a=void 0===n?e[0]:n;for(let s=i;s<e.length;s++)a=r(a,e[s],s);return a},merge:(e,t)=>{if(0===t.length)return e;let r=t[0];return Array.isArray(e)&&Array.isArray(r)?[...e,...r]:"object"==typeof e&&e&&"object"==typeof r&&r&&!Array.isArray(r)?{...e,...r}:e},keys:e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.keys(e):e,values:e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.values(e):e,filter:(e,t)=>{if(!Array.isArray(e))return e;if(0===t.length)return e.filter(Boolean);let r=t[0];if("function"==typeof r)return e.filter((e,t)=>r(e,t));let n=We(r);return e.filter(e=>{if("object"==typeof e&&e){let t=e[n];return null!=t&&!1!==t&&""!==t}return!!e})},column:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=We(t[0]);return e.map(e=>"object"==typeof e&&e?e[r]:void 0)},url_encode:e=>"string"==typeof e?encodeURIComponent(e):"object"==typeof e&&e&&!Array.isArray(e)?new URLSearchParams(Object.fromEntries(Object.entries(e).map(([e,t])=>[e,We(t)]))).toString():e,nl2br:e=>"string"==typeof e?e.replace(/\n/g,"<br>"):e,striptags:(e,t)=>{if("string"!=typeof e)return e;let r=t.length>0?We(t[0]).trim():"";if(r){let t=r.split(/(?:\s*>\s*<\s*|<\s*|>\s*)/).filter(Boolean).map(e=>e.replace(/[/>]/g,"").trim());if(t.length>0){let r=RegExp(`<(?!/?(?:${t.join("|")})\\b)[^>]+>`,"gi");return e.replace(r,"").replace(/\s+/g," ").trim()}}return e.replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()},abs:e=>"number"==typeof e?Math.abs(e):e,round:(e,t)=>{if("number"!=typeof e)return e;let r=Number(t[0])||0,n=null==t[1]?"common":We(t[1]),i=10**r;return"ceil"===n?Math.ceil(e*i)/i:"floor"===n?Math.floor(e*i)/i:Math.round(e*i)/i},format:(e,t)=>{if("string"!=typeof e)return e;let r=0;return e.replace(/%s|%d|%f|%%/g,e=>{if("%%"===e)return"%";let n=t[r];return r++,void 0===n?e:"%d"===e?String(Math.floor(Number(n))):"%f"===e?String(Number(n)):We(n)})},spaceless:e=>"string"==typeof e?e.replace(/>\s+</g,"><").trim():e,random:e=>Array.isArray(e)?e.length>0?e[Math.floor(Math.random()*e.length)]:void 0:"string"==typeof e?e.length>0?e[Math.floor(Math.random()*e.length)]:"":"number"==typeof e?Math.floor(Math.random()*e):e,date:(e,t)=>{if(0===t.length)return e;let r=We(t[0]),n=e instanceof Date?e:new Date(String(e));if(Number.isNaN(n.getTime()))return"";let i=((e,t)=>{if(!t)return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),weekday:e.getDay()};let r=(e=>{if(!ze.has(e))try{ze.set(e,new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",weekday:"short"}))}catch{ze.set(e,null)}return ze.get(e)??null})(t);if(!r)return;let n=r.formatToParts(e),i=e=>n.find(t=>t.type===e)?.value??"";return{year:Number(i("year")),month:Number(i("month")),day:Number(i("day")),hours:Number(i("hour")),minutes:Number(i("minute")),seconds:Number(i("second")),weekday:Fe.indexOf(i("weekday"))}})(n,t.length>1?We(t[1]):"");if(!i)return"";let a=e=>String(e).padStart(2,"0"),s={Y:String(i.year),m:a(i.month),n:String(i.month),d:a(i.day),j:String(i.day),H:a(i.hours),G:String(i.hours),i:a(i.minutes),s:a(i.seconds),w:String(i.weekday),N:String(0===i.weekday?7:i.weekday),U:String(Math.floor(n.getTime()/1e3)),l:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][i.weekday],F:["January","February","March","April","May","June","July","August","September","October","November","December"][i.month-1],M:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][i.month-1]},o="";for(let l of r)o+=Object.prototype.hasOwnProperty.call(s,l)?s[l]:l;return o},base64_encode:e=>"string"==typeof e?(e=>{let t=(new TextEncoder).encode(e),r="";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return btoa(r)})(e):e,base64_decode:e=>"string"==typeof e?(e=>{let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return(new TextDecoder).decode(r)})(e):e,md5:e=>"string"==typeof e?(e=>{let t=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],r=/* @__PURE__ */new Uint32Array(64);for(let p=0;p<64;p++)r[p]=Math.floor(4294967296*Math.abs(Math.sin(p+1)));let n=(new TextEncoder).encode(e),i=8*n.length,a=1+(n.length+8>>6)<<6,s=new Uint8Array(a);s.set(n),s[n.length]=128;let o=new DataView(s.buffer);o.setUint32(a-8,i>>>0,!0),o.setUint32(a-4,Math.floor(i/4294967296)>>>0,!0);let l=1732584193,u=4023233417,c=2562383102,d=271733878,h=(e,t)=>e<<t|e>>>32-t;for(let p=0;p<a;p+=64){let e=/* @__PURE__ */new Uint32Array(16);for(let t=0;t<16;t++)e[t]=o.getUint32(p+4*t,!0);let n=l,i=u,a=c,s=d;for(let o=0;o<64;o++){let l,u;o<16?(l=i&a|~i&s,u=o):o<32?(l=s&i|~s&a,u=(5*o+1)%16):o<48?(l=i^a^s,u=(3*o+5)%16):(l=a^(i|~s),u=7*o%16),l=l+n+r[o]+e[u]|0,n=s,s=a,a=i,i=i+h(l,t[o])|0}l=l+n|0,u=u+i|0,c=c+a|0,d=d+s|0}let f=e=>{let t="";for(let r=0;r<4;r++)t+=(e>>>8*r&255).toString(16).padStart(2,"0");return t};return f(l)+f(u)+f(c)+f(d)})(e):e,without:(e,t)=>{if("object"!=typeof e||!e||Array.isArray(e))return e;let r=t.map(We),n={};for(let[i,a]of Object.entries(e))r.includes(i)||(n[i]=a);return n},only:(e,t)=>{if("object"!=typeof e||!e||Array.isArray(e))return e;let r=t.map(We),n={};for(let[i,a]of Object.entries(e))r.includes(i)&&(n[i]=a);return n},find:(e,t)=>{if(!Array.isArray(e)||0===t.length)return;let r=t[0];if("function"==typeof r)return e.find((e,t)=>r(e,t));if(t.length<2)return;let n=We(r),i=t[1];return e.find(e=>"object"==typeof e&&e?e[n]===i:e===i)},pluck:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=We(t[0]);return e.map(e=>"object"==typeof e&&e?e[r]:void 0)},unique:e=>Array.isArray(e)?[...new Set(e)]:e,flatten:e=>Array.isArray(e)?e.flat():e,sum:e=>Array.isArray(e)?e.reduce((e,t)=>e+("number"==typeof t?t:0),0):e,chunk:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=Number(t[0]);if(r<=0)return e;let n=[];for(let i=0;i<e.length;i+=r)n.push(e.slice(i,i+r));return n},index_by:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=We(t[0]),n={};for(let i of e)"object"==typeof i&&i&&(n[String(i[r]??"")]=i);return n},group_by:(e,t)=>{if(!Array.isArray(e)||0===t.length)return e;let r=We(t[0]),n={};for(let i of e)if("object"==typeof i&&i){let e=String(i[r]??"");n[e]=n[e]??[],n[e].push(i)}return n}},Ye=e=>!(null==e||!1===e||""===e||0===e||Array.isArray(e)&&0===e.length),He=(e,t)=>"string"==typeof t?t.includes(String(e)):Array.isArray(t)?t.includes(e):!("object"!=typeof t||!t)&&String(e)in t,qe=[],Le=class e{variables;keepEmptyTokens;breakFlag=!1;continueFlag=!1;hasSet=!1;constructor(e,t=!1){this.variables={...e},this.keepEmptyTokens=t}evalNodes(e){let t=e.length;if(0===t)return"";if(1===t)return this.evalNode(e[0]);let r="";for(let n=0;n<t&&(r+=this.evalNode(e[n]),!this.breakFlag&&!this.continueFlag);n++);return r}evalNode(e){switch(e.type){case"text":return e.value;case"variable":return this.evalVariable(e);case"if":return this.evalIf(e);case"for":return this.evalFor(e);case"set":return this.evalSet(e);case"apply":return this.evalApply(e);case"break":return this.breakFlag=!0,"";case"continue":return this.continueFlag=!0,""}}evalVariable(e){let t=this.evalExpression(e.expression);return!this.keepEmptyTokens||null!=t&&""!==t?Ee(t)?String($e(t)):"function"==typeof t?"":null!=t&&"object"!=typeof t?String(t):e.raw?null==t?"":String(t):"object"==typeof t&&t?JSON.stringify(t):"":e.source}evalIf(e){if(Ye(this.evalExpression(e.condition)))return this.evalNodes(e.body);for(let t of e.elseifClauses)if(Ye(this.evalExpression(t.condition)))return this.evalNodes(t.body);return e.elseBody?this.evalNodes(e.elseBody):""}evalFor(e){let t=this.evalExpression(e.collection);if(void 0!==e.source&&void 0===t)return e.source;let r,n=null;if(null!==e.keyVar){let i=(e=>"object"==typeof e&&e&&!Array.isArray(e)?Object.entries(e):null)(t);if(!i||0===i.length)return e.elseBody?this.evalNodes(e.elseBody):"";let a=i.length;n=Array(a),r=Array(a);for(let e=0;e<a;e++)n[e]=i[e][0],r[e]=i[e][1]}else{let n=(e=>Array.isArray(e)?e:"object"==typeof e&&e?Object.values(e):null)(t);if(!n||0===n.length)return e.elseBody?this.evalNodes(e.elseBody):"";r=n}return this.runLoop(e,r,n)}runLoop(e,t,r){let{valueVar:n,keyVar:i,body:a}=e,s=t.length,o=this.variables.loop,l={index:0,index0:0,first:!1,last:!1,length:s,revindex:0};this.variables.loop=l;let u="";for(let c=0;c<s;c++){if(l.index=c+1,l.index0=c,l.first=0===c,l.last=c===s-1,l.revindex=s-c,null!==r&&null!==i&&(this.variables[i]=r[c]),this.variables[n]=t[c],u+=this.evalNodes(a),this.breakFlag){this.breakFlag=!1;break}this.continueFlag&&=!1}return void 0===o?delete this.variables.loop:this.variables.loop=o,u}evalSet(e){return this.hasSet=!0,this.variables[e.name]=Array.isArray(e.value)?this.evalNodes(e.value):this.evalExpression(e.value),""}evalApply(e){let t=this.applyFilters(this.evalNodes(e.body),e.filters);return Ee(t)?String($e(t)):"object"==typeof t&&t?JSON.stringify(t):null==t?"":String(t)}applyFilters(e,t){let r=e;for(let n of t){let e=Ie[n.name];void 0!==e&&(r=e(r,0===n.args.length?qe:this.evalArgs(n.args)))}return r}evalArgs(e){let t=e.length,r=Array(t);for(let n=0;n<t;n++)r[n]=this.evalExpression(e[n]);return r}evalExpression(e){switch(e.type){case"literal":return e.value;case"array":{let t=e.elements,r=Array(t.length);for(let e=0;e<t.length;e++)r[e]=this.evalExpression(t[e]);return r}case"object":{let t={};for(let r of e.entries){let e=this.evalExpression(r.key);t["string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):""]=this.evalExpression(r.value)}return t}case"range":return this.evalRange(e.start,e.end);case"path":return this.resolvePath(e.segments);case"index":return this.resolveIndex(e.object,e.index);case"function":return this.evalFunction(e.name,e.args);case"filter":return this.applyFilters(this.evalExpression(e.subject),e.filters);case"concat":{let t=e.parts,r=t.length,n="";for(let e=0;e<r;e++){let r=this.evalExpression(t[e]);n+=null==r?"":String(r)}return n}case"unary":return"-"===e.operator?-Number(this.evalExpression(e.operand)):!Ye(this.evalExpression(e.operand));case"binary":return this.evalBinary(e.operator,e.left,e.right);case"default":return this.evalExpression(e.value)??this.evalExpression(e.defaultExpr);case"ternary":return Ye(this.evalExpression(e.condition))?this.evalExpression(e.trueExpr):this.evalExpression(e.falseExpr);case"arrow":return this.createArrowFunction(e.params,e.body)}}createArrowFunction(t,r){let n={...this.variables},i=this.keepEmptyTokens,a=(...a)=>{let s=new e(n,i);for(let e=0;e<t.length;e++)s.variables[t[e]]=a[e];return s.evalExpression(r)};return a[Ce]=t.length,a}resolvePath(e){let t=e.length;if(0===t)return;let r=this.variables[e[0]];for(let n=1;n<t;n++){if(null==r)return;r=r[e[n]]}return r}resolveIndex(e,t){let r=this.evalExpression(e);if(null==r)return;let n=this.evalExpression(t);return null!=n?r[String(n)]:void 0}evalRange(e,t){let r=Number(this.evalExpression(e)),n=Number(this.evalExpression(t)),i=r<=n,a=1+(i?n-r:r-n),s=Array(a);for(let o=0;o<a;o++)s[o]=i?r+o:r-o;return s}evalFunction(e,t){let r=this.evalArgs(t);switch(e){case"cycle":{let e=r[0],t=r[1];return Array.isArray(e)&&"number"==typeof t?e[t%e.length]:""}case"max":return this.minMax(r,Math.max);case"min":return this.minMax(r,Math.min);case"range":return this.rangeFunction(r);default:return""}}minMax(e,t){return 0===e.length?void 0:t(...1===e.length&&Array.isArray(e[0])?e[0]:e)}rangeFunction(e){if(0===e.length)return[];if(1===e.length){let t=Number(e[0]),r=Array(t+1);for(let e=0;e<=t;e++)r[e]=e;return r}let t=Number(e[0]),r=Number(e[1]),n=e.length>2?Number(e[2]):t<=r?1:-1;if(0===n)return[];let i=Math.floor((n>0?r-t:t-r)/Math.abs(n))+1;if(i<=0)return[];let a=Array(i);for(let s=0;s<i;s++)a[s]=t+s*n;return a}evalBinary(e,t,r){if("or"===e)return Ye(this.evalExpression(t))||Ye(this.evalExpression(r));if("and"===e)return Ye(this.evalExpression(t))&&Ye(this.evalExpression(r));let n=this.evalExpression(t),i=this.evalExpression(r),a="number"==typeof n&&"number"==typeof i;switch(e){case"+":return a?n+i:Number(n)+Number(i);case"-":return a?n-i:Number(n)-Number(i);case"*":return a?n*i:Number(n)*Number(i);case"/":return a?n/i:Number(n)/Number(i);case"%":return a?n%i:Number(n)%Number(i);case"==":return n===i||String(n)===String(i);case"!=":return n!==i&&String(n)!==String(i);case">":return a?n>i:Number(n)>Number(i);case"<":return a?n<i:Number(n)<Number(i);case">=":return a?n>=i:Number(n)>=Number(i);case"<=":return a?n<=i:Number(n)<=Number(i);case"in":return He(n,i);case"not in":return!He(n,i);case"is":return n===i;case"is not":return n!==i;default:return!1}}},Ue=(e,t)=>e[t],Be=(e,t)=>{let r=t.indexOf(".");if(-1===r)return e[t];let n=e[t.slice(0,r)],i=r+1,a=t.length;for(;i<a;){if(null==n)return;let e=t.indexOf(".",i);if(-1===e)return n[t.slice(i)];n=n[t.slice(i,e)],i=e+1}return n},Re=e=>null==e?"":"object"==typeof e?JSON.stringify(e):String(e),Ve=e=>{try{return JSON.parse(e)||e}catch{return e}},Xe=41,Ze=e=>e>=97&&e<=122||e>=65&&e<=90||95===e,Qe=e=>Ze(e)||e>=48&&e<=57,Ge=e=>Qe(e)||45===e,Je=e=>e>=48&&e<=57,Ke=e=>32===e||9===e||10===e||13===e,et=e=>{let t=e.length;if(0===t||!Ze(e.charCodeAt(0)))return!1;for(let r=1;r<t;r++)if(!Qe(e.charCodeAt(r)))return!1;return!0},tt=e=>{let t=e.length;if(0===t||!Ze(e.charCodeAt(0)))return!1;let r=!1,n=!1;for(let i=1;i<t;i++){let t=e.charCodeAt(i);if(46!==t){if(r){if(n=Je(t),!n&&!Ze(t))return!1;r=!1}else if(n?!Je(t):!Qe(t))return!1}else{if(r)return!1;r=!0,n=!1}}return!r},rt=e=>et(e),nt=(e,t)=>t?`{{{${e}}}}`:`{{${e}}}`,it=e=>{switch(e.type){case"text":return e.value;case"variable":return nt(e.content,e.raw);case"tag":return`{%${e.content}%}`}},at=class{src;pos=0;constructor(e){this.src=e}eof(){return this.pos>=this.src.length}peek(){return this.pos<this.src.length?this.src.charCodeAt(this.pos):-1}at(e){let t=this.pos+e;return t<this.src.length?this.src.charCodeAt(t):-1}skipWs(){for(;this.pos<this.src.length&&Ke(this.src.charCodeAt(this.pos));)this.pos++}scanName(){let e=this.pos;if(!this.eof()&&Ze(this.src.charCodeAt(this.pos)))for(this.pos++;!this.eof()&&Ge(this.src.charCodeAt(this.pos));)this.pos++;return this.src.slice(e,this.pos)}scanIndex(){let e=this.pos;for(;!this.eof()&&Je(this.src.charCodeAt(this.pos));)this.pos++;return this.src.slice(e,this.pos)}scanStringLiteral(){let e=this.src.charCodeAt(this.pos);this.pos++;let t="";for(;this.pos<this.src.length&&this.src.charCodeAt(this.pos)!==e;)if(92===this.src.charCodeAt(this.pos)&&this.pos+1<this.src.length){this.pos++;let r=this.src.charCodeAt(this.pos);t+=110===r?"\n":116===r?"\t":114===r?"\r":92===r?"\\":r===e?String.fromCharCode(r):String.fromCharCode(92)+String.fromCharCode(r),this.pos++}else t+=this.src[this.pos],this.pos++;return this.pos<this.src.length&&this.pos++,t}scanNumber(){let e=this.pos;for(45===this.src.charCodeAt(this.pos)&&this.pos++;this.pos<this.src.length&&Je(this.src.charCodeAt(this.pos));)this.pos++;if(46===this.src.charCodeAt(this.pos))for(this.pos++;this.pos<this.src.length&&Je(this.src.charCodeAt(this.pos));)this.pos++;return Number(this.src.slice(e,this.pos))}matchKeyword(e){let t=this.pos+e.length;if(t>this.src.length)return!1;for(let r=0;r<e.length;r++)if(this.src.charCodeAt(this.pos+r)!==e.charCodeAt(r))return!1;return!(t<this.src.length&&Qe(this.src.charCodeAt(t))||(this.pos=t,this.skipWs(),0))}matchBinaryOp(){this.skipWs();let e=this.peek();if(61===this.at(1)){if(61===e)return this.pos+=2,"==";if(33===e)return this.pos+=2,"!=";if(62===e)return this.pos+=2,">=";if(60===e)return this.pos+=2,"<="}return 62===e?(this.pos++,">"):60===e?(this.pos++,"<"):null}},st=e=>new ot(e).parseTernary(),ot=class extends at{parseTernary(){let e=this.parseOr();if(this.skipWs(),63===this.peek()){this.pos++,this.skipWs();let t=this.parseOr();if(this.skipWs(),58===this.peek())return this.pos++,this.skipWs(),{type:"ternary",condition:e,trueExpr:t,falseExpr:this.parseTernary()}}return e}parseOr(){let e=this.parseAnd();for(this.skipWs();this.matchKeyword("or");)e={type:"binary",operator:"or",left:e,right:this.parseAnd()},this.skipWs();return e}parseAnd(){let e=this.parseNot();for(this.skipWs();this.matchKeyword("and");)e={type:"binary",operator:"and",left:e,right:this.parseNot()},this.skipWs();return e}parseNot(){return this.skipWs(),this.matchKeyword("not")?{type:"unary",operator:"not",operand:this.parseComparison()}:this.parseComparison()}parseComparison(){let e=this.parseConcat();for(this.skipWs();!this.eof();){if(this.matchKeyword("is")){this.skipWs(),e={type:"binary",operator:this.matchKeyword("not")?"is not":"is",left:e,right:this.parseConcat()},this.skipWs();continue}if(this.matchKeyword("not")){if(this.skipWs(),this.matchKeyword("in")){e={type:"binary",operator:"not in",left:e,right:this.parseConcat()},this.skipWs();continue}let t=this.src.slice(this.pos-4);return this.pos=this.src.length,{type:"unary",operator:"not",operand:st(t)}}if(this.matchKeyword("in")){e={type:"binary",operator:"in",left:e,right:this.parseConcat()},this.skipWs();continue}let t=this.matchBinaryOp();if(!t)break;e={type:"binary",operator:t,left:e,right:this.parseConcat()},this.skipWs()}return e}parseConcat(){let e=this.parseAdditive();for(this.skipWs();126===this.peek();){this.pos++;let t=this.parseAdditive();e="concat"===e.type?{type:"concat",parts:[...e.parts,t]}:{type:"concat",parts:[e,t]},this.skipWs()}return e}parseAdditive(){let e=this.parseMultiplicative();this.skipWs();for(let t=this.peek();43===t||45===t;t=this.peek())this.pos++,e={type:"binary",operator:43===t?"+":"-",left:e,right:this.parseMultiplicative()},this.skipWs();return e}parseMultiplicative(){let e=this.parseDefault();this.skipWs();for(let t=this.peek();42===t||47===t||37===t;t=this.peek())this.pos++,e={type:"binary",operator:42===t?"*":47===t?"/":"%",left:e,right:this.parseDefault()},this.skipWs();return e}parseDefault(){if(this.skipWs(),45===this.peek()&&Je(this.at(1)))return this.maybeTrailingFilters({type:"literal",value:this.scanNumber()});if(45===this.peek())return this.pos++,{type:"unary",operator:"-",operand:this.parseDefault()};let e=this.parseAtom();for(this.skipWs();63===this.peek()&&63===this.at(1);)this.pos+=2,this.skipWs(),e={type:"default",value:e,defaultExpr:this.parseAtom()},this.skipWs();return e}parseAtom(){this.skipWs();let e=this.peek();if(40===e){this.pos++,this.skipWs();let e=this.pos,t=this.tryParseArrowParams();if(null!==t)return this.maybeTrailingFilters({type:"arrow",params:t,body:this.parseTernary()});this.pos=e;let r=this.parseTernary();return this.skipWs(),this.peek()===Xe&&this.pos++,this.maybeTrailingFilters(r)}return 39===e||34===e?this.maybeTrailingFilters({type:"literal",value:this.scanStringLiteral()}):Je(e)?this.maybeTrailingFilters({type:"literal",value:this.scanNumber()}):91===e?(this.pos++,this.maybeTrailingFilters({type:"array",elements:this.parseArgList(93)})):123===e?(this.pos++,this.maybeTrailingFilters(this.parseObjectLiteral())):this.parsePathOrFunctionOrArrow()}tryParseArrowParams(){let e=this.pos,t=[];for(this.skipWs();this.peek()!==Xe;){let r=this.scanName();if(!r)return this.pos=e,null;if(t.push(r),this.skipWs(),44!==this.peek())break;this.pos++,this.skipWs()}return this.skipWs(),this.peek()===Xe&&(this.pos++,this.skipWs(),61===this.peek()&&62===this.at(1))?(this.pos+=2,t):(this.pos=e,null)}parsePathOrFunctionOrArrow(){let e=this.scanName();if(!e)return this.pos++,{type:"literal",value:""};if("true"===e||"false"===e)return this.maybeTrailingFilters({type:"literal",value:"true"===e});if(this.skipWs(),61===this.peek()&&62===this.at(1))return this.pos+=2,this.maybeTrailingFilters({type:"arrow",params:[e],body:this.parseTernary()});if(40===this.peek()){this.pos++;let t=this.parseArgList(Xe);return this.maybeTrailingFilters(this.parseAccessChain({type:"function",name:e,args:t},null))}let t=[e];return this.maybeTrailingFilters(this.parseAccessChain({type:"path",segments:t},t))}parseAccessChain(e,t){let r=e,n=t;for(;;){let e=this.peek();if(46===e){let e=this.pos;this.pos++;let t=this.scanName()||this.scanIndex();if(!t){this.pos=e;break}n?n.push(t):r={type:"index",object:r,index:{type:"literal",value:t}};continue}if(91!==e)break;this.pos++;let t=this.parseTernary();this.skipWs(),93===this.peek()&&this.pos++,n&&"literal"===t.type&&"boolean"!=typeof t.value?n.push(String(t.value)):(n&&=(r={type:"path",segments:n},null),r={type:"index",object:r,index:t})}return n?{type:"path",segments:n}:r}maybeTrailingFilters(e){return this.skipWs(),124===this.peek()?{type:"filter",subject:e,filters:this.parseTrailingFilters()}:e}parseObjectLiteral(){let e=[];for(this.skipWs();!this.eof()&&125!==this.peek();){let t=this.parseObjectKey();this.skipWs(),58===this.peek()&&this.pos++,this.skipWs(),e.push({key:t,value:this.parseTernary()}),this.skipWs(),44===this.peek()&&(this.pos++,this.skipWs())}return 125===this.peek()&&this.pos++,{type:"object",entries:e}}parseObjectKey(){let e=this.peek();if(39===e||34===e)return{type:"literal",value:this.scanStringLiteral()};if(Je(e))return{type:"literal",value:this.scanNumber()};if(40===e){this.pos++,this.skipWs();let e=this.parseTernary();return this.skipWs(),this.peek()===Xe&&this.pos++,e}return{type:"literal",value:this.scanName()}}parseArgList(e){let t=[];for(this.skipWs();!this.eof()&&this.peek()!==e;)t.push(this.parseTernary()),this.skipWs(),44===this.peek()&&(this.pos++,this.skipWs());return this.peek()===e&&this.pos++,t}parseTrailingFilters(){let e=[];for(;124===this.peek();)this.pos++,this.skipWs(),e.push(this.readFilter()),this.skipWs();return e}parseApplyChain(){this.skipWs();let e=[this.readFilter()];for(this.skipWs();124===this.peek();)this.pos++,this.skipWs(),e.push(this.readFilter()),this.skipWs();return e}readFilter(){let e=this.scanName();return this.skipWs(),40===this.peek()?(this.pos++,{name:e,args:this.parseArgList(Xe)}):{name:e,args:[]}}},lt=e=>{let t=0;for(;t<e.length&&!Ke(e.charCodeAt(t));)t++;return e.slice(0,t)},ut=(e,t=!1)=>{let r=new dt(e,t),n=r.parseBody();if(!r.error){let e=r.peek();if(e&&"tag"===e.type){let t=lt(e.content.trim());ct.has(t)&&(r.error=`Orphan closing tag: {% ${t} %} without matching opening tag`)}}return{nodes:n,error:r.error}},ct=/* @__PURE__ */new Set(["endif","endfor","endset","endapply","else","elseif"]),dt=class{tokens;keepEmptyTokens;pos=0;error=null;constructor(e,t=!1){this.tokens=e,this.keepEmptyTokens=t}peek(){return this.tokens[this.pos]}advance(){let e=this.tokens[this.pos];return e&&this.pos++,e}isTag(e){let t=this.peek();if(!t||"tag"!==t.type)return!1;let r=t.content.trim();return r===e||r.startsWith(e+" ")||r.startsWith(e+"\t")}parseBody(){let e=[];for(;this.pos<this.tokens.length;){let t=this.peek();if(!t||"tag"===t.type&&ct.has(lt(t.content.trim())))break;let r=this.parseNode();r&&e.push(r)}return e}parseNode(){let e=this.peek();return e?"text"===e.type?(this.advance(),{type:"text",value:e.value}):"variable"===e.type?this.parseVariable():this.parseTag():null}parseVariable(){let e=this.advance();if(!e||"variable"!==e.type)return{type:"variable",raw:!1,expression:{type:"literal",value:""},source:""};let t=e.content.trim(),r=this.keepEmptyTokens?nt(e.content,e.raw):"";if(et(t))return{type:"variable",raw:e.raw,expression:{type:"path",segments:[t]},source:r};let n=st(t);return{type:"variable",raw:e.raw,expression:n,source:r}}parseTag(){let e=this.peek();if(!e||"tag"!==e.type)return null;let t=e.content.trim();switch(lt(t)){case"if":return this.parseIf();case"for":return this.parseFor();case"set":return this.parseSet();case"apply":return this.parseApply();case"break":return this.advance(),{type:"break"};case"continue":return this.advance(),{type:"continue"};default:return this.advance(),null}}parseIf(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return this.error="Malformed {% if %} tag",{type:"if",condition:{type:"literal",value:!1},body:[],elseifClauses:[],elseBody:null};let t=e.content.trim(),r=-1===t.indexOf(" ")?"":t.slice(t.indexOf(" ")+1).trim();if(!r)return this.error="Malformed {% if %} tag: missing condition",{type:"if",condition:{type:"literal",value:!1},body:[],elseifClauses:[],elseBody:null};let n=st(r),i=this.parseBody(),a=[],s=null,o=!1;for(;this.peek();){let e=this.peek();if(!e||"tag"!==e.type)break;let t=lt(e.content.trim());if("elseif"===t){this.advance();let t=e.content.trim(),r=t.slice(t.indexOf(" ")+1).trim(),n=st(r),i=this.parseBody();a.push({condition:n,body:i})}else{if("else"!==t){if("endif"===t){this.advance(),o=!0;break}break}this.advance(),s=this.parseBody()}}return o||(this.error="Malformed {% if %} block: missing {% endif %}"),{type:"if",condition:n,body:i,elseifClauses:a,elseBody:s}}parseFor(){let e=this.pos;this.advance();let t=this.tokens[this.pos-1];if("tag"!==t.type)return{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let r=t.content.trim(),n=r.slice(r.indexOf(" ")+1).trim(),i=/\sin\s/.exec(n);if(!i)return this.error="Invalid {% for %} syntax: missing the `in` keyword",{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let a=n.slice(0,i.index).trim(),s=n.slice(i.index+i[0].length).trim(),o=(e=>{let t=0;for(let r=0;r+1<e.length;r++){let n=e.charCodeAt(r);if(0!==t)n===t&&(t=0);else if(39===n||34===n)t=n;else if(46===n&&46===e.charCodeAt(r+1))return[e.slice(0,r).trim(),e.slice(r+2).trim()]}return null})(s),l=o?{type:"range",start:st(o[0]),end:st(o[1])}:st(s),u=a.indexOf(","),c=-1===u?null:a.slice(0,u).trim(),d=-1===u?a:a.slice(u+1).trim();if(!rt(d))return this.error=`Invalid {% for %} variable name: "${d}"`,{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};if(null!==c&&!rt(c))return this.error=`Invalid {% for %} key variable name: "${c}"`,{type:"for",valueVar:"_item",keyVar:null,collection:{type:"literal",value:""},body:[],elseBody:null};let h=this.parseBody(),f=null;if(this.peek()){let e=this.peek();e&&"tag"===e.type&&"else"===lt(e.content.trim())&&(this.advance(),f=this.parseBody())}let p=this.peek();return p&&"tag"===p.type&&"endfor"===lt(p.content.trim())?this.advance():this.error="Malformed {% for %} block: missing {% endfor %}",{type:"for",valueVar:d,keyVar:c,collection:l,body:h,elseBody:f,source:this.keepEmptyTokens?this.reconstructRange(e,this.pos):void 0}}reconstructRange(e,t){let r="";for(let n=e;n<t;n++)r+=it(this.tokens[n]);return r}parseSet(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return{type:"set",name:"_unknown",value:{type:"literal",value:""}};let t=e.content.trim(),r=t.slice(t.indexOf(" ")+1).trim(),n=r.indexOf("=");if(-1===n){let e=r.trim(),t=this.parseBody(),n=this.peek();return n&&"tag"===n.type&&this.advance(),{type:"set",name:e,value:t}}let i=r.slice(0,n).trim(),a=r.slice(n+1).trim();return{type:"set",name:i,value:st(a)}}parseApply(){this.advance();let e=this.tokens[this.pos-1];if("tag"!==e.type)return{type:"apply",filters:[],body:[]};let t=e.content.trim(),r=(e=>new ot(e).parseApplyChain())(t.slice(t.indexOf(" ")+1).trim()),n=this.parseBody(),i=this.peek();return i&&"tag"===i.type&&this.advance(),{type:"apply",filters:r,body:n}}},ht=/* @__PURE__ */new Map,ft={hits:0,misses:0},pt=e=>{let t=ht.get(e);if(t)return ft.hits++,t;ft.misses++;let r=(e=>{let t=(e=>{let t=[],r=0;for(;r<e.length;){let n,i,a=e.indexOf("{{",r),s=e.indexOf("{%",r);if(-1===a&&-1===s)break;if(-1===a?(n=s,i=!0):-1===s||a<s?(n=a,i=!1):(n=s,i=!0),n>r&&t.push({type:"text",value:e.slice(r,n)}),i||123!==e.charCodeAt(n+2))if(i){let i=e.indexOf("%}",n+2);if(-1===i)return{tokens:t,error:"Unclosed tag"};t.push({type:"tag",content:e.slice(n+2,i)}),r=i+2}else{let i=e.indexOf("}}",n+2);if(-1===i)return{tokens:t,error:"Unclosed double-brace token"};t.push({type:"variable",content:e.slice(n+2,i),raw:!1}),r=i+2}else{let i=e.indexOf("}}}",n+3);if(-1===i)return{tokens:t,error:"Unclosed triple-brace token"};t.push({type:"variable",content:e.slice(n+3,i),raw:!0}),r=i+3}}return r<e.length&&t.push({type:"text",value:e.slice(r)}),{tokens:t,error:null}})(e);if(t.error)return null;let r=t.tokens,{hasTags:n,allSimpleOrDotted:i}=(e=>{let t=!1,r=!0;for(let n=0;n<e.length;n++){let i=e[n];if("tag"===i.type){t=!0;break}if("variable"===i.type&&!tt(i.content.trim())){r=!1;break}}return{hasTags:t,allSimpleOrDotted:r}})(r),a=null,s=null;if(n||!i){let e=ut(r,!1);if(e.error)return null;a=e.nodes;let t=ut(r,!0);t.error||(s=t.nodes)}else{let e=ut(r,!0);e.error||(s=e.nodes)}return{tokens:r,hasTags:n,allSimpleOrDotted:i,nodes:a,nodesWithSource:s}})(e);return r?((()=>{if(ht.size>=256){let e=ht.keys().next().value;void 0!==e&&ht.delete(e)}})(),ht.set(e,r),r):null},mt=(e,t={},r=!1,n=!1)=>{if("string"!=typeof e)return e;try{if(-1===e.indexOf("{%")&&-1===e.indexOf("{{"))return e;let i="variables"in t?(e=>{let t={},r=e.variables;for(let n in r)t[n]=r[n];for(let n in e)t[n]=e[n];return t})(t):t,a=pt(e);if(!a)return e;if(!r&&!a.hasTags&&a.allSimpleOrDotted){let e=((e,t)=>{let r="";for(let n of e.tokens)if("text"===n.type)r+=n.value;else if("variable"===n.type){let e=n.content.trim(),i=-1===n.content.indexOf(".")?Ue(t,e):Be(t,e);r+=n.raw?null==i?"":String(i):Re(i)}return r})(a,i);return n?Ve(e):e}let s=((e,t)=>t?e.nodesWithSource:e.nodes)(a,r);if(!s)return e;let{output:o,variables:l,hasSet:u}=((e,t,r=!1)=>{let n=new Le(t,r);return{output:n.evalNodes(e),variables:n.variables,hasSet:n.hasSet}})(s,i,r);return u&&Object.assign(t,l),r&&o===e?e:n?Ve(o):o}catch{return e}},yt="[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*",gt=`(?:${yt}|\\d+)`,bt=`\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${yt}(?:\\.${gt})*)\\s*\\]`,wt=`${yt}(?:${bt})*(?:\\??\\.${gt}(?:${bt})*)*(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`,vt=`(?:\\{\\{\\{\\s*${wt}\\s*\\}\\}\\}|\\{\\{\\s*${wt}\\s*\\}\\})`,xt=new RegExp(vt,"g"),kt=RegExp(`^${vt}$`),St=(e,t=!1)=>{if("string"!=typeof e)return!1;let r=t?kt:xt;return r.lastIndex=0,r.test(e.trim())},Mt=(e,t)=>{if(Array.isArray(e))for(let r of e)Mt(r,t);else if("object"==typeof e&&e){if("type"in e&&"path"===e.type&&"segments"in e&&Array.isArray(e.segments)){let r=e.segments[0];return void("string"==typeof r&&t.add(r))}for(let r of Object.values(e))Mt(r,t)}},At=e=>{let t=pt(e);if(!t)return[];let r=/* @__PURE__ */new Set;return Mt(t.nodes??t.nodesWithSource,r),[...r]},Tt=({source:e,transformers:t})=>{let r=[];if(e){let t=e.indexOf(".");r.push(t>-1?e.substring(0,t):e)}for(let{action:n,params:i}of t??[])"twigTemplate"===n&&"string"==typeof i.template&&i.template&&r.push(...At(i.template));return r};function Pt(e){if("string"==typeof e||"number"==typeof e){let t=String(e);return""===t?null:/^[a-zA-Z0-9_-]+$/.test(t)||/^\d+$/.test(t)?t:null}return null}function Nt(e,t=!0){return e?"string"==typeof e?function(e,t){if(!e||e.startsWith(".")||e.endsWith(".")||/[^a-zA-Z0-9_.[\]-]/.test(e)||t&&(/\.\.|(\[\])/g.test(e)||(e.match(/\[/g)||[]).length!==(e.match(/\]/g)||[]).length||/\][^.[]/.test(e)))return[];let r,n=[],i=/([^.[\]]+)|\[(\d+)\]/g;for(;r=i.exec(e);)if(r[1]){if(!t&&""===r[1])continue;let e=Pt(r[1]);if(null!==e)n.push(e);else if(t)return[]}else if(r[2]){let e=Pt(r[2]);if(null!==e)n.push(e);else if(t)return[]}return n.length?n:[]}(e,t):Array.isArray(e)?function(e,t){if(!Array.isArray(e))return[];let r=[];for(let n of e){let e=Pt(n);if(null!==e)r.push(e);else if(t)return[]}return r}(e,t):[]:[]}function Dt(e,t,r){if(null==e||!t)return r;let n=Nt(t);if(!n.length)return r;let i=e;for(let a of n){if("object"!=typeof i||!i)return r;i=Array.isArray(i)?i[Number(a)]:i[a]}return void 0===i?r:i}function _t(e,t,r){let n=Nt(t);if(!n.length)return e;let i=e;for(let s=0;s<n.length-1;s++){let t=n[s],r=n[s+1];if("object"!=typeof i||!i)return e;let a=i;(null==a[t]||"object"!=typeof a[t])&&(a[t]=/^\d+$/.test(r)?[]:{}),i=a[t]}let a=n[n.length-1];return"object"==typeof i&&i&&(i[a]=r),e}function jt(e,t=/* @__PURE__ */new WeakMap){if("object"!=typeof e||!e)return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let r=/* @__PURE__ */new Map;return t.set(e,r),e.forEach((e,n)=>r.set(n,jt(e,t))),r}if(e instanceof Set){let r=/* @__PURE__ */new Set;return t.set(e,r),e.forEach(e=>r.add(jt(e,t))),r}if(ArrayBuffer.isView(e)){if(e instanceof DataView){let r=new DataView(jt(e.buffer,t),e.byteOffset,e.byteLength);return t.set(e,r),r}let r=new(0,e.constructor)(e.buffer.slice(0),e.byteOffset,e.length);return t.set(e,r),r}if(e instanceof ArrayBuffer){let r=e.slice(0);return t.set(e,r),r}if(Array.isArray(e)){let r=[];return t.set(e,r),e.forEach((e,n)=>r[n]=jt(e,t)),r}let r=Object.getPrototypeOf(e),n=Object.create(r);t.set(e,n);for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=jt(e[i],t));return n}var Ct=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),e);function Ot(e,t){let r=Nt(t),n=Array.isArray(e)?[...e]:Ct(e);if(!r.length)return n;let i=e,a=n;for(let s=0;s<r.length;s++){let e=r[s],t=i?.[e];if(!t||"object"!=typeof t){a[e]=t;break}let n=Array.isArray(t)?[...t]:Ct(t);a[e]=n,i=t,a=n}return n}function Wt(e,t){if(null===e)return!1;let r=Nt(t),n=e;for(let i of r){if(null==n||!(i in n))return!1;n=n[i]}return!0}function Et(e,t){let r=Array.isArray(t)?t:t?[t]:[];if(0===r.length)return{...e};let n=[],i=[];for(let s of r){let e=Nt(s);0!==e.length&&(1===e.length?n.push(e[0]):i.push(s))}let a=e;if(n.length){let e;for(let t of n)Object.prototype.hasOwnProperty.call(a,t)&&(e??=Ct(a),delete e[t]);e&&(a=e)}for(let s of i){let e=Nt(s);if(!Wt(a,s))continue;let t=Ot(a,s),r=t;for(let n=0;n<e.length-1&&r&&"object"==typeof r;n++)r=r[e[n]];if(r&&"object"==typeof r){let t=e[e.length-1];Object.prototype.hasOwnProperty.call(r,t)&&delete r[t]}a=t}return a}Math.pow(10,8);var $t=6048e5,Ft=6e4,zt=36e5,It=Symbol.for("constructDateFrom");function Yt(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&It in e?e[It](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ht(e,t){return Yt(t||e,e)}function qt(e,t,r){const n=Ht(e,r?.in);return isNaN(t)?Yt(r?.in||e,NaN):t?(n.setDate(n.getDate()+t),n):n}var Lt={};function Ut(){return Lt}function Bt(e,t){const r=Ut(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=Ht(e,t?.in),a=i.getDay(),s=(a<n?7:0)+a-n;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function Rt(e,t){return Bt(e,{...t,weekStartsOn:1})}function Vt(e,t){const r=Ht(e,t?.in),n=r.getFullYear(),i=Yt(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const a=Rt(i),s=Yt(r,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const o=Rt(s);return r.getTime()>=a.getTime()?n+1:r.getTime()>=o.getTime()?n:n-1}function Xt(e){const t=Ht(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Zt(e,...t){const r=Yt.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}function Qt(e,t){const r=Ht(e,t?.in);return r.setHours(0,0,0,0),r}function Gt(e,t){const r=+Ht(e)-+Ht(t);return r<0?-1:r>0?1:r}function Jt(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+Ht(e)));var t}function Kt(e,t){return+Ht(e)-+Ht(t)}function er(e,t,r){const[n,i,a]=Zt(r?.in,e,e,t),s=Gt(i,a),o=Math.abs(function(e,t){const[r,n]=Zt(void 0,e,t);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}(i,a));if(o<1)return 0;1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-s*o);let l=Gt(i,a)===-s;(function(e,t){const r=Ht(e,t?.in);return+function(e,t){const r=Ht(e,t?.in);return r.setHours(23,59,59,999),r}(r,t)===+function(e,t){const r=Ht(e,t?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}(r,t)})(n)&&1===o&&1===Gt(n,a)&&(l=!1);const u=s*(o-+l);return 0===u?0:u}var tr={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function rr(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var nr={date:rr({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:rr({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:rr({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ir={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ar(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,i=r?.width?String(r.width):t;n=e.formattingValues[i]||e.formattingValues[t]}else{const t=e.defaultWidth,i=r?.width?String(r.width):e.defaultWidth;n=e.values[i]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function sr(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const s=a[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}(o,e=>e.test(s)):function(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(o,e=>e.test(s));let u;return u=e.valueCallback?e.valueCallback(l):l,u=r.valueCallback?r.valueCallback(u):u,{value:u,rest:t.slice(s.length)}}}function or(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];return s=r.valueCallback?r.valueCallback(s):s,{value:s,rest:t.slice(i.length)}}}var lr={code:"en-US",formatDistance:(e,t,r)=>{let n;const i=tr[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:nr,formatRelative:(e,t,r,n)=>ir[e],localize:{ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:ar({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ar({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:ar({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:ar({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:ar({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:or({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:sr({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:sr({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:sr({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:sr({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:sr({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ur(e,t){const r=Ht(e,t?.in),n=+Rt(r)-+function(e,t){const r=Vt(e,t),n=Yt(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Rt(n)}(r);return Math.round(n/$t)+1}function cr(e,t){const r=Ht(e,t?.in),n=r.getFullYear(),i=Ut(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=Yt(t?.in||e,0);s.setFullYear(n+1,0,a),s.setHours(0,0,0,0);const o=Bt(s,t),l=Yt(t?.in||e,0);l.setFullYear(n,0,a),l.setHours(0,0,0,0);const u=Bt(l,t);return+r>=+o?n+1:+r>=+u?n:n-1}function dr(e,t){const r=Ht(e,t?.in),n=+Bt(r,t)-+function(e,t){const r=Ut(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=cr(e,t),a=Yt(t?.in||e,0);return a.setFullYear(i,0,n),a.setHours(0,0,0,0),Bt(a,t)}(r,t);return Math.round(n/$t)+1}function hr(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}var fr={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return hr("yy"===t?n%100:n,t.length)},M(e,t){const r=e.getMonth();return"M"===t?String(r+1):hr(r+1,2)},d:(e,t)=>hr(e.getDate(),t.length),a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>hr(e.getHours()%12||12,t.length),H:(e,t)=>hr(e.getHours(),t.length),m:(e,t)=>hr(e.getMinutes(),t.length),s:(e,t)=>hr(e.getSeconds(),t.length),S(e,t){const r=t.length,n=e.getMilliseconds();return hr(Math.trunc(n*Math.pow(10,r-3)),t.length)}},pr={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){const t=e.getFullYear(),n=t>0?t:1-t;return r.ordinalNumber(n,{unit:"year"})}return fr.y(e,t)},Y:function(e,t,r,n){const i=cr(e,n),a=i>0?i:1-i;return"YY"===t?hr(a%100,2):"Yo"===t?r.ordinalNumber(a,{unit:"year"}):hr(a,t.length)},R:function(e,t){return hr(Vt(e),t.length)},u:function(e,t){return hr(e.getFullYear(),t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return hr(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return hr(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return fr.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return hr(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=dr(e,n);return"wo"===t?r.ordinalNumber(i,{unit:"week"}):hr(i,t.length)},I:function(e,t,r){const n=ur(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):hr(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):fr.d(e,t)},D:function(e,t,r){const n=function(e,t){const r=Ht(e,t?.in);return function(e,t){const[r,n]=Zt(void 0,e,t),i=Qt(r),a=Qt(n),s=+i-Xt(i),o=+a-Xt(a);return Math.round((s-o)/864e5)}(r,function(e){const t=Ht(e,void 0);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}(r))+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):hr(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return hr(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return hr(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return hr(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(i=12===n?"noon":0===n?"midnight":n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(i=n>=17?"evening":n>=12?"afternoon":n>=4?"morning":"night",t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return fr.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):fr.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):hr(n,t.length)},k:function(e,t,r){let n=e.getHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):hr(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):fr.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):fr.s(e,t)},S:function(e,t){return fr.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return yr(n);case"XXXX":case"XX":return gr(n);default:return gr(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return yr(n);case"xxxx":case"xx":return gr(n);default:return gr(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+mr(n,":");default:return"GMT"+gr(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+mr(n,":");default:return"GMT"+gr(n,":")}},t:function(e,t,r){return hr(Math.trunc(+e/1e3),t.length)},T:function(e,t,r){return hr(+e,t.length)}};function mr(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),a=n%60;return 0===a?r+String(i):r+String(i)+t+hr(a,2)}function yr(e,t){return e%60==0?(e>0?"-":"+")+hr(Math.abs(e)/60,2):gr(e,t)}function gr(e,t=""){const r=e>0?"-":"+",n=Math.abs(e);return r+hr(Math.trunc(n/60),2)+t+hr(n%60,2)}var br=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},wr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},vr={p:wr,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return br(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",br(n,t)).replace("{{time}}",wr(i,t))}},xr=/^D+$/,kr=/^Y+$/,Sr=["D","DD","YY","YYYY"];function Mr(e){return xr.test(e)}function Ar(e){return kr.test(e)}function Tr(e,t,r){const n=function(e,t,r){const n="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,r);if(Sr.includes(e))throw new RangeError(n)}var Pr=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Nr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dr=/^'([^]*?)'?$/,_r=/''/g,jr=/[a-zA-Z]/;function Cr(e,t,r){const n=Ut(),i=r?.locale??n.locale??lr,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=Ht(e,r?.in);if(!Jt(o))throw new RangeError("Invalid time value");let l=t.match(Nr).map(e=>{const t=e[0];return"p"===t||"P"===t?(0,vr[t])(e,i.formatLong):e}).join("").match(Pr).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Or(e)};if(pr[t])return{isToken:!0,value:e};if(t.match(jr))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(l=i.localize.preprocessor(o,l));const u={firstWeekContainsDate:a,weekStartsOn:s,locale:i};return l.map(n=>{if(!n.isToken)return n.value;const a=n.value;return(!r?.useAdditionalWeekYearTokens&&Ar(a)||!r?.useAdditionalDayOfYearTokens&&Mr(a))&&Tr(a,t,String(e)),(0,pr[a[0]])(o,a,i.localize,u)}).join("")}function Or(e){const t=e.match(Dr);return t?t[1].replace(_r,"'"):e}function Wr(e,t){return function(e,t,r){const n=Ut(),i=r?.locale??n.locale??lr,a=Gt(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const s=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:a}),[o,l]=Zt(r?.in,...a>0?[t,e]:[e,t]),u=function(e,t,r){const n=Kt(e,t)/1e3;return(i=r?.roundingMethod,e=>{const t=(i?Math[i]:Math.trunc)(e);return 0===t?0:t})(n);var i}(l,o),c=(Xt(l)-Xt(o))/1e3,d=Math.round((u-c)/60);let h;if(d<2)return r?.includeSeconds?u<5?i.formatDistance("lessThanXSeconds",5,s):u<10?i.formatDistance("lessThanXSeconds",10,s):u<20?i.formatDistance("lessThanXSeconds",20,s):u<40?i.formatDistance("halfAMinute",0,s):u<60?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",1,s):0===d?i.formatDistance("lessThanXMinutes",1,s):i.formatDistance("xMinutes",d,s);if(d<45)return i.formatDistance("xMinutes",d,s);if(d<90)return i.formatDistance("aboutXHours",1,s);if(d<1440){const e=Math.round(d/60);return i.formatDistance("aboutXHours",e,s)}if(d<2520)return i.formatDistance("xDays",1,s);if(d<43200){const e=Math.round(d/1440);return i.formatDistance("xDays",e,s)}if(d<86400)return h=Math.round(d/43200),i.formatDistance("aboutXMonths",h,s);if(h=er(l,o),h<12){const e=Math.round(d/43200);return i.formatDistance("xMonths",e,s)}{const e=h%12,t=Math.trunc(h/12);return e<3?i.formatDistance("aboutXYears",t,s):e<9?i.formatDistance("overXYears",t,s):i.formatDistance("almostXYears",t+1,s)}}(e,function(e){return Yt(e,Date.now())}(e),t)}var Er=class{subPriority=0;validate(e,t){return!0}},$r=class extends Er{constructor(e,t,r,n,i){super(),this.value=e,this.validateValue=t,this.setValue=r,this.priority=n,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,r){return this.setValue(e,t,this.value,r)}},Fr=class extends Er{priority=10;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>Yt(t,e))}set(e,t){return t.timestampIsSet?e:Yt(e,function(e,t){const r=function(e){return"function"==typeof e&&e.prototype?.constructor===e}(t)?new t(0):Yt(t,0);return r.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),r}(e,this.context))}},zr=class{run(e,t,r,n){const i=this.parse(e,t,r,n);return i?{setter:new $r(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,r){return!0}},Ir=/^(1[0-2]|0?\d)/,Yr=/^(3[0-1]|[0-2]?\d)/,Hr=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,qr=/^(5[0-3]|[0-4]?\d)/,Lr=/^(2[0-3]|[0-1]?\d)/,Ur=/^(2[0-4]|[0-1]?\d)/,Br=/^(1[0-1]|0?\d)/,Rr=/^(1[0-2]|0?\d)/,Vr=/^[0-5]?\d/,Xr=/^[0-5]?\d/,Zr=/^\d/,Qr=/^\d{1,2}/,Gr=/^\d{1,3}/,Jr=/^\d{1,4}/,Kr=/^-?\d+/,en=/^-?\d/,tn=/^-?\d{1,2}/,rn=/^-?\d{1,3}/,nn=/^-?\d{1,4}/,an=/^([+-])(\d{2})(\d{2})?|Z/,sn=/^([+-])(\d{2})(\d{2})|Z/,on=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ln=/^([+-])(\d{2}):(\d{2})|Z/,un=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function cn(e,t){return e?{value:t(e.value),rest:e.rest}:e}function dn(e,t){const r=t.match(e);return r?{value:parseInt(r[0],10),rest:t.slice(r[0].length)}:null}function hn(e,t){const r=t.match(e);if(!r)return null;if("Z"===r[0])return{value:0,rest:t.slice(1)};const n="+"===r[1]?1:-1,i=r[2]?parseInt(r[2],10):0,a=r[3]?parseInt(r[3],10):0,s=r[5]?parseInt(r[5],10):0;return{value:n*(i*zt+a*Ft+1e3*s),rest:t.slice(r[0].length)}}function fn(e){return dn(Kr,e)}function pn(e,t){switch(e){case 1:return dn(Zr,t);case 2:return dn(Qr,t);case 3:return dn(Gr,t);case 4:return dn(Jr,t);default:return dn(new RegExp("^\\d{1,"+e+"}"),t)}}function mn(e,t){switch(e){case 1:return dn(en,t);case 2:return dn(tn,t);case 3:return dn(rn,t);case 4:return dn(nn,t);default:return dn(new RegExp("^-?\\d{1,"+e+"}"),t)}}function yn(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function gn(e,t){const r=t>0,n=r?t:1-t;let i;if(n<=50)i=e||100;else{const t=n+50;i=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return r?i:1-i}function bn(e){return e%400==0||e%4==0&&e%100!=0}var wn=[31,28,31,30,31,30,31,31,30,31,30,31],vn=[31,29,31,30,31,30,31,31,30,31,30,31];function xn(e,t,r){const n=Ut(),i=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Ht(e,r?.in),s=a.getDay(),o=7-i;return qt(a,t<0||t>6?t-(s+o)%7:((t%7+7)%7+o)%7-(s+o)%7,r)}var kn={G:new class extends zr{priority=140;parse(e,t,r){switch(t){case"G":case"GG":case"GGG":return r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"});case"GGGGG":return r.era(e,{width:"narrow"});default:return r.era(e,{width:"wide"})||r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"})}}set(e,t,r){return t.era=r,e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]},y:new class extends zr{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,r){const n=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return cn(pn(4,e),n);case"yo":return cn(r.ordinalNumber(e,{unit:"year"}),n);default:return cn(pn(t.length,e),n)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r){const n=e.getFullYear();if(r.isTwoDigitYear){const t=gn(r.year,n);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const i="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}},Y:new class extends zr{priority=130;parse(e,t,r){const n=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return cn(pn(4,e),n);case"Yo":return cn(r.ordinalNumber(e,{unit:"year"}),n);default:return cn(pn(t.length,e),n)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,r,n){const i=cr(e,n);if(r.isTwoDigitYear){const t=gn(r.year,i);return e.setFullYear(t,0,n.firstWeekContainsDate),e.setHours(0,0,0,0),Bt(e,n)}const a="era"in t&&1!==t.era?1-r.year:r.year;return e.setFullYear(a,0,n.firstWeekContainsDate),e.setHours(0,0,0,0),Bt(e,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends zr{priority=130;parse(e,t){return mn("R"===t?4:t.length,e)}set(e,t,r){const n=Yt(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Rt(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends zr{priority=130;parse(e,t){return mn("u"===t?4:t.length,e)}set(e,t,r){return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends zr{priority=120;parse(e,t,r){switch(t){case"Q":case"QQ":return pn(t.length,e);case"Qo":return r.ordinalNumber(e,{unit:"quarter"});case"QQQ":return r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(e,{width:"narrow",context:"formatting"});default:return r.quarter(e,{width:"wide",context:"formatting"})||r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends zr{priority=120;parse(e,t,r){switch(t){case"q":case"qq":return pn(t.length,e);case"qo":return r.ordinalNumber(e,{unit:"quarter"});case"qqq":return r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(e,{width:"narrow",context:"standalone"});default:return r.quarter(e,{width:"wide",context:"standalone"})||r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,r){return e.setMonth(3*(r-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends zr{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,r){const n=e=>e-1;switch(t){case"M":return cn(dn(Ir,e),n);case"MM":return cn(pn(2,e),n);case"Mo":return cn(r.ordinalNumber(e,{unit:"month"}),n);case"MMM":return r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(e,{width:"narrow",context:"formatting"});default:return r.month(e,{width:"wide",context:"formatting"})||r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}},L:new class extends zr{priority=110;parse(e,t,r){const n=e=>e-1;switch(t){case"L":return cn(dn(Ir,e),n);case"LL":return cn(pn(2,e),n);case"Lo":return cn(r.ordinalNumber(e,{unit:"month"}),n);case"LLL":return r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(e,{width:"narrow",context:"standalone"});default:return r.month(e,{width:"wide",context:"standalone"})||r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends zr{priority=100;parse(e,t,r){switch(t){case"w":return dn(qr,e);case"wo":return r.ordinalNumber(e,{unit:"week"});default:return pn(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r,n){return Bt(function(e,t,r){const n=Ht(e,r?.in),i=dr(n,r)-t;return n.setDate(n.getDate()-7*i),Ht(n,r?.in)}(e,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends zr{priority=100;parse(e,t,r){switch(t){case"I":return dn(qr,e);case"Io":return r.ordinalNumber(e,{unit:"week"});default:return pn(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,r){return Rt(function(e,t,r){const n=Ht(e,r?.in),i=ur(n,r)-t;return n.setDate(n.getDate()-7*i),n}(e,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends zr{priority=90;subPriority=1;parse(e,t,r){switch(t){case"d":return dn(Yr,e);case"do":return r.ordinalNumber(e,{unit:"date"});default:return pn(t.length,e)}}validate(e,t){const r=bn(e.getFullYear()),n=e.getMonth();return r?t>=1&&t<=vn[n]:t>=1&&t<=wn[n]}set(e,t,r){return e.setDate(r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends zr{priority=90;subpriority=1;parse(e,t,r){switch(t){case"D":case"DD":return dn(Hr,e);case"Do":return r.ordinalNumber(e,{unit:"date"});default:return pn(t.length,e)}}validate(e,t){return bn(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,r){return e.setMonth(0,r),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends zr{priority=90;parse(e,t,r){switch(t){case"E":case"EE":case"EEE":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=xn(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends zr{priority=90;parse(e,t,r,n){const i=e=>{const t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return cn(pn(t.length,e),i);case"eo":return cn(r.ordinalNumber(e,{unit:"day"}),i);case"eee":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeeee":return r.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=xn(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends zr{priority=90;parse(e,t,r,n){const i=e=>{const t=7*Math.floor((e-1)/7);return(e+n.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return cn(pn(t.length,e),i);case"co":return cn(r.ordinalNumber(e,{unit:"day"}),i);case"ccc":return r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"ccccc":return r.day(e,{width:"narrow",context:"standalone"});case"cccccc":return r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});default:return r.day(e,{width:"wide",context:"standalone"})||r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,r,n){return(e=xn(e,r,n)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends zr{priority=90;parse(e,t,r){const n=e=>0===e?7:e;switch(t){case"i":case"ii":return pn(t.length,e);case"io":return r.ordinalNumber(e,{unit:"day"});case"iii":return cn(r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n);case"iiiii":return cn(r.day(e,{width:"narrow",context:"formatting"}),n);case"iiiiii":return cn(r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n);default:return cn(r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),n)}}validate(e,t){return t>=1&&t<=7}set(e,t,r){return(e=function(e,t,r){const n=Ht(e,r?.in),i=t-function(e,t){const r=Ht(e,t?.in).getDay();return 0===r?7:r}(n,r);return qt(n,i,r)}(e,r)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends zr{priority=80;parse(e,t,r){switch(t){case"a":case"aa":case"aaa":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(yn(r),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends zr{priority=80;parse(e,t,r){switch(t){case"b":case"bb":case"bbb":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(yn(r),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends zr{priority=80;parse(e,t,r){switch(t){case"B":case"BB":case"BBB":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(e,{width:"narrow",context:"formatting"});default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,r){return e.setHours(yn(r),0,0,0),e}incompatibleTokens=["a","b","t","T"]},h:new class extends zr{priority=70;parse(e,t,r){switch(t){case"h":return dn(Rr,e);case"ho":return r.ordinalNumber(e,{unit:"hour"});default:return pn(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,r){const n=e.getHours()>=12;return n&&r<12?e.setHours(r+12,0,0,0):n||12!==r?e.setHours(r,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]},H:new class extends zr{priority=70;parse(e,t,r){switch(t){case"H":return dn(Lr,e);case"Ho":return r.ordinalNumber(e,{unit:"hour"});default:return pn(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,r){return e.setHours(r,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends zr{priority=70;parse(e,t,r){switch(t){case"K":return dn(Br,e);case"Ko":return r.ordinalNumber(e,{unit:"hour"});default:return pn(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,r){return e.getHours()>=12&&r<12?e.setHours(r+12,0,0,0):e.setHours(r,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]},k:new class extends zr{priority=70;parse(e,t,r){switch(t){case"k":return dn(Ur,e);case"ko":return r.ordinalNumber(e,{unit:"hour"});default:return pn(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,r){const n=r<=24?r%24:r;return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends zr{priority=60;parse(e,t,r){switch(t){case"m":return dn(Vr,e);case"mo":return r.ordinalNumber(e,{unit:"minute"});default:return pn(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setMinutes(r,0,0),e}incompatibleTokens=["t","T"]},s:new class extends zr{priority=50;parse(e,t,r){switch(t){case"s":return dn(Xr,e);case"so":return r.ordinalNumber(e,{unit:"second"});default:return pn(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,r){return e.setSeconds(r,0),e}incompatibleTokens=["t","T"]},S:new class extends zr{priority=30;parse(e,t){return cn(pn(t.length,e),e=>Math.trunc(e*Math.pow(10,3-t.length)))}set(e,t,r){return e.setMilliseconds(r),e}incompatibleTokens=["t","T"]},X:new class extends zr{priority=10;parse(e,t){switch(t){case"X":return hn(an,e);case"XX":return hn(sn,e);case"XXXX":return hn(on,e);case"XXXXX":return hn(un,e);default:return hn(ln,e)}}set(e,t,r){return t.timestampIsSet?e:Yt(e,e.getTime()-Xt(e)-r)}incompatibleTokens=["t","T","x"]},x:new class extends zr{priority=10;parse(e,t){switch(t){case"x":return hn(an,e);case"xx":return hn(sn,e);case"xxxx":return hn(on,e);case"xxxxx":return hn(un,e);default:return hn(ln,e)}}set(e,t,r){return t.timestampIsSet?e:Yt(e,e.getTime()-Xt(e)-r)}incompatibleTokens=["t","T","X"]},t:new class extends zr{priority=40;parse(e){return fn(e)}set(e,t,r){return[Yt(e,1e3*r),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends zr{priority=20;parse(e){return fn(e)}set(e,t,r){return[Yt(e,r),{timestampIsSet:!0}]}incompatibleTokens="*"}},Sn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,An=/^'([^]*?)'?$/,Tn=/''/g,Pn=/\S/,Nn=/[a-zA-Z]/;function Dn(e){return e.match(An)[1].replace(Tn,"'")}function _n(e,t){const r=()=>Yt(t?.in,NaN),n=t?.additionalDigits??2,i=function(e){const t={},r=e.split(jn.dateTimeDelimiter);let n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],jn.timeZoneDelimiter.test(t.date)&&(t.date=e.split(jn.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){const e=jn.timezone.exec(n);e?(t.time=n.replace(e[1],""),t.timezone=e[1]):t.time=n}return t}(e);let a;if(i.date){const e=function(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const i=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:null===a?i:100*a,restDateString:e.slice((n[1]||n[2]).length)}}(i.date,n);a=function(e,t){if(null===t)/* @__PURE__ */return new Date(NaN);const r=e.match(Cn);if(!r)/* @__PURE__ */return new Date(NaN);const n=!!r[4],i=En(r[1]),a=En(r[2])-1,s=En(r[3]),o=En(r[4]),l=En(r[5])-1;if(n)return function(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}(0,o,l)?function(e,t,r){const n=/* @__PURE__ */new Date(0);n.setUTCFullYear(e,0,4);const i=7*(t-1)+r+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+i),n}(t,o,l):/* @__PURE__ */new Date(NaN);{const e=/* @__PURE__ */new Date(0);return function(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(Fn[t]||(zn(e)?29:28))}(t,a,s)&&function(e,t){return t>=1&&t<=(zn(e)?366:365)}(t,i)?(e.setUTCFullYear(t,a,Math.max(i,s)),e):/* @__PURE__ */new Date(NaN)}}(e.restDateString,e.year)}if(!a||isNaN(+a))return r();const s=+a;let o,l=0;if(i.time&&(l=function(e){const t=e.match(On);if(!t)return NaN;const r=$n(t[1]),n=$n(t[2]),i=$n(t[3]);return function(e,t,r){return 24===e?0===t&&0===r:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}(r,n,i)?r*zt+n*Ft+1e3*i:NaN}(i.time),isNaN(l)))return r();if(!i.timezone){const e=new Date(s+l),r=Ht(0,t?.in);return r.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),r.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),r}return o=function(e){if("Z"===e)return 0;const t=e.match(Wn);if(!t)return 0;const r="+"===t[1]?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,i)?r*(n*zt+i*Ft):NaN}(i.timezone),isNaN(o)?r():Ht(s+l+o,t?.in)}var jn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Cn=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,On=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Wn=/^([+-])(\d{2})(?::?(\d{2}))?$/;function En(e){return e?parseInt(e):1}function $n(e){return e&&parseFloat(e.replace(",","."))||0}var Fn=[31,null,31,30,31,30,31,31,30,31,30,31];function zn(e){return e%400==0||e%4==0&&e%100!=0}var In=e=>{let t;return t="number"==typeof e?e<1e12?/* @__PURE__ */new Date(1e3*e):new Date(e):"string"==typeof e?_n(e):e,Math.floor((r=t,+Ht(r)/1e3)).toString();var r},Yn=e=>!("string"!=typeof e||!/^\d{4}-\d{2}-\d{2}$/.test(e))&&Jt(function(e,t,r,n){const i=()=>Yt(n?.in||r,NaN),a=Object.assign({},Ut()),s=n?.locale??a.locale??lr,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?i():Ht(r,n?.in);const u={firstWeekContainsDate:o,weekStartsOn:l,locale:s},c=[new Fr(n?.in,r)],d=t.match(Mn).map(e=>{const t=e[0];return t in vr?(0,vr[t])(e,s.formatLong):e}).join("").match(Sn),h=[];for(let y of d){!n?.useAdditionalWeekYearTokens&&Ar(y)&&Tr(y,t,e),!n?.useAdditionalDayOfYearTokens&&Mr(y)&&Tr(y,t,e);const r=y[0],a=kn[r];if(a){const{incompatibleTokens:t}=a;if(Array.isArray(t)){const e=h.find(e=>t.includes(e.token)||e.token===r);if(e)throw new RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${y}\` at the same time`)}else if("*"===a.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);h.push({token:r,fullToken:y});const n=a.run(e,y,s.match,u);if(!n)return i();c.push(n.setter),e=n.rest}else{if(r.match(Nn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");if("''"===y?y="'":"'"===r&&(y=Dn(y)),0!==e.indexOf(y))return i();e=e.slice(y.length)}}if(e.length>0&&Pn.test(e))return i();const f=c.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,r)=>r.indexOf(e)===t).map(e=>c.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]);let p=Ht(r,n?.in);if(isNaN(+p))return i();const m={};for(const y of f){if(!y.validate(p,u))return i();const e=y.set(p,m,u);Array.isArray(e)?(p=e[0],Object.assign(m,e[1])):p=e}return p}(e,"yyyy-MM-dd",/* @__PURE__ */new Date)),Hn={},qn=/* @__PURE__ */new Map,Ln=a({});function Un(e){return e&&(e.displayName||e.name)||"Component"}Ln.displayName="ComponentContext";var Bn={};Object.freeze(Bn);var Rn=(e,t="",r=".",n=!1)=>e&&"object"==typeof e?Object.keys(e).reduce((i,a)=>{a=a.replaceAll(r,"").replaceAll(".","");let s=`${t}${t?r:""}${a}`;return"object"!=typeof e[a]||Array.isArray(e[a])&&n?[...i,s]:[...i,s,...Rn(e[a],s,r,n)]},[]):[],Vn=(e,t=!0,r=!0)=>{let n="",i="abcdefghijklmnopqrstuvwxyz";t&&(i=`ABCDEFGHIJKLMNOPQRSTUVWXYZ${i}`),r&&(i=`${i}0123456789`);let a=i.length;for(let s=0;s<e;s++)n+=i.charAt(Math.floor(Math.random()*a));return n};function Xn(e,t){if(!e)return 0;let r={};try{let t=e.split(".")[1],n=typeof window<"u"?window.atob(t):Buffer.from(t,"base64").toString();r=JSON.parse(n)}catch{return 0}return t?Dt(r,"data.spaceId",0):r}function Zn(e){!e&&typeof window<"u"&&(e=window.location.search);let t={};if(!e||0===e.length)return t;let r=e.replace("?","").split("&");for(let n=0;n<r.length;n++){let e=r[n].split("="),i=decodeURIComponent(e[0]),a=decodeURIComponent(e[1]);void 0===t[i]?t[i]=decodeURIComponent(a):"string"==typeof t[i]?t[i]=[t[i],decodeURIComponent(a)]:t[i].push(decodeURIComponent(a))}return t}var Qn=({url:e="",internalProps:t,autoRegister:r=!0,plitziJsxSkipHOC:n=!1,plitziJsxProps:a=Bn})=>{let{register:s}=u(Ln),[o,c]=g(!1);h(()=>c(!0),[]);let d=m(()=>l(((e,t,r=!0,n=!1)=>async()=>{if(!qn.get(e)){let t=(async e=>{try{let t=await fetch(e),r=new Blob([await t.text()],{type:"text/javascript"});return await(import(
|
|
2
2
|
/* @vite-ignore */
|
|
3
3
|
/* webpackIgnore: true */
|
|
4
4
|
URL.createObjectURL(r)))}catch(e){return}})(e).finally(()=>{qn.delete(e)});qn.set(e,{promise:t,timestamp:Date.now()})}let i=await(qn.get(e)?.promise),[{default:a},{default:s},{nestedInject:o}]=await Promise.all([Promise.resolve().then(()=>lo),import("./plitzi-sdk.js").then(e=>e.t),import("./plitzi-sdk.js").then(e=>e.n)]);if(!i)return{default:s};let{type:l,pluginSettings:u}=Dt(i,"default",{}),{version:c,initialItems:d,plugins:h}=i;if(!l)return{default:s};let f=i.default;return n||(f=a(i.default)),f.version=c,f.origin="remote",f.type=l,f.initialItems=d,f.pluginSettings=u,f.plugins=o(h,"remote"),r&&t(f),{default:f}})(e,s,r,n)),[e]);return o?/* @__PURE__ */w(i,n?{children:/* @__PURE__ */w(d,{internalProps:t,plitziJsxSkipHOC:n,...a})}:{children:/* @__PURE__ */w(d,{internalProps:t})}):null},Gn=({type:e,plugins:t})=>{let r=(e?t[e]:void 0)??((e,t)=>Object.values(e).find(e=>e.subPlugins.find(e=>e===t)))(t,e);if(!r)return;let n=Dt(r,"assets",[]).filter(e=>"script"===e.type);return{url:n.find(e=>e.isMain)?.params.src??Dt(n,"0.params.src","")}},Jn=({key:e,plitziElementLayout:t,type:r,internalProps:n,components:i,plugins:a})=>{let s={...n,plitziElementLayout:t},o=i.notFound?/* @__PURE__ */w(i.notFound,{internalProps:s},e):void 0;if(!r)return o;let l=i[r];if(l)/* @__PURE__ */return w(l,{internalProps:s,extraProps:l.extraProps},e);let u=Gn({type:r,plugins:a});return u?/* @__PURE__ */w(Qn,{url:u.url,internalProps:s},e):o},Kn=a(void 0);Kn.displayName="LayoutBodyContext";var ei=()=>{},ti=({body:e,children:t})=>{let[r]=g(()=>({current:e,listeners:/* @__PURE__ */new Set}));return p(()=>{r.current!==e&&(r.current=e,r.listeners.forEach(e=>e()))},[e,r]),/* @__PURE__ */w(Kn,{value:r,children:t})},ri=e=>{let t={};for(let r of e.split(";")){let e=r.indexOf(":");if(-1===e)continue;let n=r.slice(0,e).trim(),i=r.slice(e+1).trim();if(n&&i){let e=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());t[e]=i}}return t},ni=({id:e,children:t})=>{let[r]=g(()=>{if(typeof document>"u")return null;let t=document.querySelector(`[data-rsc-id="${e}"]`);if(!t)return null;let r={};for(let e=0;e<t.attributes.length;e++){let{name:n,value:i}=t.attributes[e];"class"!==n&&"style"!==n&&"data-rsc-id"!==n&&(r[n]=i)}let n=t.getAttribute("style");return{tag:t.tagName.toLowerCase(),className:t.className,style:n?ri(n):void 0,attrs:r,html:t.innerHTML}});return r?s(r.tag,{"data-rsc-id":e,className:r.className||void 0,style:r.style,...r.attrs,dangerouslySetInnerHTML:{__html:r.html}}):t},ii={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},ai={date:rr({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:rr({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:rr({formats:{full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},si={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},oi={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},li={code:"es",formatDistance:(e,t,r)=>{let n;const i=ii[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"en "+n:"hace "+n:n},formatLong:ai,formatRelative:(e,t,r,n)=>1!==t.getHours()?oi[e]:si[e],localize:{ordinalNumber:(e,t)=>Number(e)+"º",era:ar({values:{narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},defaultWidth:"wide"}),quarter:ar({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:ar({values:{narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},defaultWidth:"wide"}),day:ar({values:{narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},defaultWidth:"wide"}),dayPeriod:ar({values:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:or({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:sr({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:"any"}),quarter:sr({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:sr({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:"any"}),day:sr({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:sr({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:1}},ui={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},ci={date:rr({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},defaultWidth:"full"}),time:rr({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:rr({formats:{full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},di={lastWeek:e=>{const t=e.getDay();return"'"+(0===t||6===t?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},hi={code:"pt",formatDistance:(e,t,r)=>{let n;const i=ui[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",String(t)),r?.addSuffix?r.comparison&&r.comparison>0?"daqui a "+n:"há "+n:n},formatLong:ci,formatRelative:(e,t,r,n)=>{const i=di[e];return"function"==typeof i?i(t):i},localize:{ordinalNumber:(e,t)=>Number(e)+"º",era:ar({values:{narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},defaultWidth:"wide"}),quarter:ar({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:ar({values:{narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},defaultWidth:"wide"}),day:ar({values:{narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},defaultWidth:"wide"}),dayPeriod:ar({values:{narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},defaultWidth:"wide",formattingValues:{narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:or({matchPattern:/^(\d+)(º|ª)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:sr({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},defaultParseWidth:"any"}),quarter:sr({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:sr({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:sr({matchPatterns:{narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},defaultParseWidth:"any"}),dayPeriod:sr({matchPatterns:{narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:4}};var fi={year:0,month:1,day:2,hour:3,minute:4,second:5},pi={},mi=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(/* @__PURE__ */new Date("2014-06-25T04:00:00.123Z")),yi="06/25/2014, 00:00:00"===mi||"06/25/2014 00:00:00"===mi;function gi(e,t,r,n,i,a,s){const o=/* @__PURE__ */new Date(0);return o.setUTCFullYear(e,t,r),o.setUTCHours(n,i,a,s),o}var bi=36e5,wi={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function vi(e,t,r){if(!e)return 0;let n,i,a=wi.timezoneZ.exec(e);if(a)return 0;if(a=wi.timezoneHH.exec(e),a)return n=parseInt(a[1],10),ki(n)?-n*bi:NaN;if(a=wi.timezoneHHMM.exec(e),a){n=parseInt(a[2],10);const e=parseInt(a[3],10);return ki(n,e)?(i=Math.abs(n)*bi+6e4*e,"+"===a[1]?-i:i):NaN}if(function(e){if(Si[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Si[e]=!0,!0}catch(t){return!1}}(e)){t=new Date(t||Date.now());const n=xi(r?t:function(e){return gi(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),e);return-(r?n:function(e,t,r){let n=e.getTime()-t;const i=xi(new Date(n),r);if(t===i)return t;n-=i-t;const a=xi(new Date(n),r);return i===a?i:Math.max(i,a)}(t,n,e))}return NaN}function xi(e,t){const r=function(e,t){const r=function(e){return pi[e]||(pi[e]=yi?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),pi[e]}(t);return"formatToParts"in r?function(e,t){try{const r=e.formatToParts(t),n=[];for(let e=0;e<r.length;e++){const t=fi[r[e].type];void 0!==t&&(n[t]=parseInt(r[e].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}(r,e):function(e,t){const r=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}(r,e)}(e,t),n=gi(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=e.getTime();const a=i%1e3;return i-=a>=0?a:1e3+a,n-i}function ki(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var Si={};function Mi(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}var Ai=36e5,Ti={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function Pi(e,t,r){t=t||0,r=r||0;const n=/* @__PURE__ */new Date(0);n.setUTCFullYear(e,0,4);const i=7*t+r+1-(n.getUTCDay()||7);return n.setUTCDate(n.getUTCDate()+i),n}var Ni=[31,28,31,30,31,30,31,31,30,31,30,31],Di=[31,29,31,30,31,30,31,31,30,31,30,31];function _i(e){return e%400==0||e%4==0&&e%100!=0}function ji(e,t,r){if(t<0||t>11)return!1;if(null!=r){if(r<1)return!1;const n=_i(e);if(n&&r>Di[t])return!1;if(!n&&r>Ni[t])return!1}return!0}function Ci(e,t){return!(e<0||e>52||null!=t&&(t<0||t>6))}function Oi(e,t,r){return!(e<0||e>=25||null!=t&&(t<0||t>=60)||null!=r&&(r<0||r>=60))}var Wi={en:lr,es:li,pt:hi},Ei=e=>{let t;return t="number"==typeof e?e<1e12?/* @__PURE__ */new Date(1e3*e):new Date(e):"string"==typeof e?_n(e):e,t};function $i(e,t="dd MMMM, yyyy",r="en"){return e?Cr(Ei(e),t,{locale:Wi[r]}):""}function Fi(e,t="dd MMMM, yyyy",r="en"){return e?Cr(function(e){const t=vi("UTC",e=function(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)/* @__PURE__ */return new Date(NaN);const r=null==t.additionalDigits?2:Number(t.additionalDigits);if(2!==r&&1!==r&&0!==r)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))/* @__PURE__ */return new Date(NaN);const n=function(e){const t={};let r,n=Ti.dateTimePattern.exec(e);if(n?(t.date=n[1],r=n[3]):(n=Ti.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const e=Ti.timeZone.exec(r);e?(t.time=r.replace(e[1],""),t.timeZone=e[1].trim()):t.time=r}return t}(e),{year:i,restDateString:a}=function(e,t){if(e){const r=Ti.YYY[t],n=Ti.YYYYY[t];let i=Ti.YYYY.exec(e)||n.exec(e);if(i){const t=i[1];return{year:parseInt(t,10),restDateString:e.slice(t.length)}}if(i=Ti.YY.exec(e)||r.exec(e),i){const t=i[1];return{year:100*parseInt(t,10),restDateString:e.slice(t.length)}}}return{year:null}}(n.date,r),s=function(e,t){if(null===t)return null;let r,n,i;if(!e||!e.length)return r=/* @__PURE__ */new Date(0),r.setUTCFullYear(t),r;let a=Ti.MM.exec(e);if(a)return r=/* @__PURE__ */new Date(0),n=parseInt(a[1],10)-1,ji(t,n)?(r.setUTCFullYear(t,n),r):/* @__PURE__ */new Date(NaN);if(a=Ti.DDD.exec(e),a){r=/* @__PURE__ */new Date(0);const e=parseInt(a[1],10);return function(e,t){if(t<1)return!1;const r=_i(e);return!(r&&t>366||!r&&t>365)}(t,e)?(r.setUTCFullYear(t,0,e),r):/* @__PURE__ */new Date(NaN)}if(a=Ti.MMDD.exec(e),a){r=/* @__PURE__ */new Date(0),n=parseInt(a[1],10)-1;const e=parseInt(a[2],10);return ji(t,n,e)?(r.setUTCFullYear(t,n,e),r):/* @__PURE__ */new Date(NaN)}if(a=Ti.Www.exec(e),a)return i=parseInt(a[1],10)-1,Ci(i)?Pi(t,i):/* @__PURE__ */new Date(NaN);if(a=Ti.WwwD.exec(e),a){i=parseInt(a[1],10)-1;const e=parseInt(a[2],10)-1;return Ci(i,e)?Pi(t,i,e):/* @__PURE__ */new Date(NaN)}return null}(a,i);if(null===s||isNaN(s.getTime()))/* @__PURE__ */return new Date(NaN);if(s){const e=s.getTime();let r,i=0;if(n.time&&(i=function(e){let t,r,n=Ti.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),Oi(t)?t%24*Ai:NaN;if(n=Ti.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),Oi(t,r)?t%24*Ai+6e4*r:NaN;if(n=Ti.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const e=parseFloat(n[3].replace(",","."));return Oi(t,r,e)?t%24*Ai+6e4*r+1e3*e:NaN}return null}(n.time),null===i||isNaN(i)))/* @__PURE__ */return new Date(NaN);if(n.timeZone||t.timeZone){if(r=vi(n.timeZone||t.timeZone,new Date(e+i)),isNaN(r))/* @__PURE__ */return new Date(NaN)}else r=Mi(new Date(e+i)),r=Mi(new Date(e+i+r));return new Date(e+i+r)}/* @__PURE__ */return new Date(NaN)}(e,void 0),!0),r=new Date(e.getTime()-t),n=/* @__PURE__ */new Date(0);return n.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),n.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),n}(Ei(e)),t,{locale:Wi[r]}):""}function zi(e,t){let r=Ei(e);return Kt(Ei(t),r)}var Ii=e=>"number"==typeof e||"string"==typeof e&&!e.includes(",")&&!Number.isNaN(parseFloat(e)),Yi=e=>{if(!e||"object"!=typeof e)return;let{combinator:t,enabled:r}=e,{rules:n}=e;return Array.isArray(n)?(n=n.map(e=>{if((e=>"rules"in e)(e))return Yi(e);let{field:t,value:r,operator:n,enabled:i,isBinding:a}=e;return{field:t,value:r,operator:n,enabled:i,isBinding:a}}).filter(Boolean),{rules:n,combinator:t,enabled:r}):void 0},Hi=(e,t="json")=>Yi(e),qi=(e,t)=>"boolean"==typeof e&&"string"==typeof t?e===(t="true"===(t=t.toLowerCase())||"1"===t):"string"==typeof e&&"boolean"==typeof t?(e="true"===(e=e.toLowerCase())||"1"===e)===t:("number"==typeof e&&(e=`${e}`),"number"==typeof t&&(t=`${t}`),e===t),Li=(e,t)=>null!=e&&null!=t&&(Yn(e)&&Yn(t)?(e=In(e),t=In(t),parseFloat(t)>parseFloat(e)):Ii(e)?(e=parseFloat(e),t=parseFloat(t),Ii(t)&&t>e):t>e),Ui=(e,t)=>Li(e,t)||qi(e,t),Bi=(e,t)=>null!=e&&null!=t&&(Yn(e)&&Yn(t)?(e=In(e),t=In(t),parseFloat(t)<parseFloat(e)):Ii(e)?(e=parseFloat(e),t=parseFloat(t),Ii(t)&&t<e):t<e),Ri=(e,t)=>Bi(e,t)||qi(e,t),Vi=(e,t)=>"string"==typeof e&&"string"==typeof t&&t.toLowerCase().includes(e.toLowerCase()),Xi=(e,t)=>"string"==typeof t&&"string"==typeof e&&t.toLowerCase().startsWith(e.toLowerCase()),Zi=(e,t)=>"string"==typeof t&&"string"==typeof e&&t.toLowerCase().endsWith(e.toLowerCase()),Qi=e=>{switch(typeof e){case"boolean":case"number":case"function":return!1;case"object":case"undefined":return null==e||0===Object.keys(e).length;default:return!e}},Gi=(e,t)=>("string"==typeof e&&e.includes(",")?e=e.split(",").map(e=>e.trim()):("string"==typeof e||"number"==typeof e)&&(e=[e]),!!Array.isArray(e)&&("string"==typeof t&&t.includes(",")&&(t=t.split(",").map(e=>e.trim())),Array.isArray(t)?t.some(t=>Ii(t)?e.includes(`${t}`)||e.includes(parseFloat(t)):e.includes(t)):Ii(t)?e.includes(`${t}`)||e.includes(parseFloat(t)):e.includes(t))),Ji=(e,t)=>{let r=[];return"string"==typeof e&&(r=e.split(",").map(e=>e.trim())),!(r.length<2)&&Ui(r[0],t)&&Ri(r[1],t)},Ki=(e,t={},r=!1,n=!1)=>{if(!e)return n;let{combinator:i,rules:a,enabled:s}=e;if(!Array.isArray(a))return n;if(!1===s)return!0;let o=a.filter(e=>!1!==e.enabled).map(e=>"rules"in e?Ki(e,t,r):((e,t)=>{let{field:r,operator:n,isBinding:i}=e,{value:a}=e,s=Dt(t,r);switch(i&&(a=Dt(t,e.value)),n){case"=":return qi(a,s);case"!=":return!qi(a,s);case"<":return Bi(a,s);case">":return Li(a,s);case"<=":return Ri(a,s);case">=":return Ui(a,s);case"contains":return Vi(a,s);case"doesNotContain":return!Vi(a,s);case"beginsWith":return Xi(a,s);case"doesNotBeginWith":return!Xi(a,s);case"endsWith":return Zi(a,s);case"doesNotEndWith":return!Zi(a,s);case"empty":return Qi(s);case"notEmpty":return!Qi(s);case"in":return Gi(a,s);case"notIn":return!Gi(a,s);case"between":return Ji(a,s);case"notBetween":return!Ji(a,s);default:return!1}})(e,t));return r?o:"and"===i?!o.includes(!1):o.includes(!0)},ea=(e,t={},r=!1,n=!1)=>Ki(Hi(e),t,r,n),ta=(e,t,r,n=!1)=>{let{rules:i,enabled:a}=e;if(!Array.isArray(i)||!1===a)return{};let s=i.filter(e=>!1!==e.enabled).flatMap(e=>"rules"in e?ta(e,t,r,!0):e);return n?s:s.reduce((e,n)=>{let{field:i,isBinding:a,value:s}=n;return a&&_t(e,s,Dt(t,s,r)),_t(e,i,Dt(t,i,r)),e},{})},ra=(e,t={},r=void 0)=>ta(Hi(e),t,r),na={action:"arrayMap",title:"Array Map",type:"utility",params:{keys:{defaultValue:'[{"from": "", "to": ""}]',type:"textarea"}},preview:{sourceParsed:""},callback:(e,t)=>{let{keys:r}=t;if(!Array.isArray(e))return e;try{"string"==typeof r&&(r=JSON.parse(r))}catch{return e}return e.map(e=>{let t={};return r.forEach(r=>{"object"==typeof r&&r.from&&r.to&&_t(t,r.to,Dt(e,r.from,""))}),t})}},ia={action:"dateConverter",title:"Date Converter",type:"utility",params:{format:{defaultValue:"dd/MM/yyyy",type:"text"},asAge:{defaultValue:!1,type:"checkbox"},isUnix:{defaultValue:!0,type:"checkbox"},isUtc:{defaultValue:!1,type:"checkbox"},locale:{defaultValue:"en",type:"select",options:[{label:"en",value:"en"},{label:"es",value:"es"},{label:"pt",value:"pt"}]}},preview:{format:"",asAge:"",isUnix:"",isUtc:"",locale:""},callback:(e,{format:t="dd/MM/yyyy",asAge:r=!1,isUnix:n=!0,isUtc:i=!1,locale:a="en"})=>{if("string"!=typeof e&&"number"!=typeof e)return e;try{let s=Ei(n?Number(e):e);return isNaN(s.getTime())?e:r?function(e,t="en",r){if(!e)return"";let n=Ei(e);return isNaN(n.getTime())?"":Wr(n,{...r,locale:Wi[t]})}(s,a,{addSuffix:!0}):i?Fi(s,t,a):$i(s,t,a)}catch{return e}}},aa=/* @__PURE__ */new Set(["false","0",""]),sa={action:"not",title:"Not",type:"utility",params:{},preview:{content:""},callback:e=>!(e=>"string"==typeof e?!aa.has(e.trim().toLowerCase()):Array.isArray(e)?e.length>0:!!e)(e)},oa={action:"styleSelector",title:"Style Selector",type:"utility",params:{originalSelector:{label:"Original Selector",description:"This will append the original selector (require append option enabled)",defaultValue:!1,disabled:({append:e})=>!e,type:"checkbox"},append:{label:"Append Selector",defaultValue:!1,type:"checkbox"},selector:{label:"Selector",defaultValue:"",type:"select",options:(e,t,r)=>{let n=r?.stylePlatform;return n?Object.keys(n).map(e=>({label:e,options:Object.values(n[e]).filter(e=>"class"===e.type).map(e=>({label:e.name,value:e.name}))})):[]}}},preview:{append:"",originalSelector:"",selector:""},callback:(e,t,r,n={})=>{let{originalSelector:i,append:a,selector:s}=t,o=[];if(a&&!i&&n.sourceTo)o.push(n.sourceTo,s);else if(i&&a){let e=Dt(r,"definition.styleSelectors.base","");e?o.push(e,s):o.push(s)}return o.length?1===o.length?o[0]:o.join(" "):""}},la={action:"styleVariant",title:"Style Variant",type:"utility",params:{key:{label:"Selector Key",defaultValue:"",type:"select",options:(e,t)=>{let r=t?.definition?.styleSelectors;if(!t||!t.definition||!r)return[];let n=t.definition.type;return(e=>{let t=e.reduce((e,{groupLabel:t,option:r})=>(t in e||(e[t]=[]),e[t].push(r),e),{});return Object.entries(t).map(([e,t])=>({label:e,options:t}))})(Object.entries(r).flatMap(([e,t])=>(t?[n,...t.split(" ")]:[n]).map(t=>({groupLabel:e,option:{value:`${t}.${e}`,label:`${t} (${e})`}}))))}},variant:{label:"Variant",defaultValue:"",type:"select",options:(e,t,r)=>{let n=t?.definition?.styleSelectors,i=e.key||"";if(!(t&&t.definition&&n&&r?.stylePlatform&&i.includes(".")))return[];let a=t.definition.type,s=i.split(".").pop()||"",o=n[s];if(!o)return[];let l=[],u=[a,...o.split(" ").filter(Boolean)];return Object.entries(r.stylePlatform).forEach(([e,t])=>{u.forEach(r=>{let n=t[r];if(!n)return;let i=n.attributes[s];Object.keys(i.variants||{}).forEach(t=>{l.push({value:t,label:`${e}: ${t}`})})})}),l}},append:{label:"Append to Variant",description:"Merge with existing variant values instead of replacing",defaultValue:!1,type:"checkbox"}},preview:{key:"",variant:"",append:""},callback:(e,t,r,n={})=>{let{key:i,variant:a,append:s}=t;if(!i)return n.sourceTo??{};let o=i||"base",l=a||e;return"object"!=typeof l||Array.isArray(l)?_t(s?{...n.sourceTo}:{},o,l):l}},ua={action:"twigTemplate",title:"Twig Template",type:"utility",params:{template:{label:"Template",defaultValue:"Tokens {{source}} from the value selected to bind previously, {{sourceTo}} is your original value, other tokens via autocomplete",type:"codemirror-text"}},preview:{template:""},callback:(e,t,r,n={})=>{let{template:i}=t,a=e;try{let t=mt(i,{source:e,...n});("string"==typeof t||"object"==typeof t&&t)&&(a=t)}catch{a=e}return a}},ca={twigTemplate:ua,dateConverter:ia,staticValue:{action:"staticValue",title:"Static Value",type:"utility",params:{valueType:{label:"Value Type",defaultValue:"text",type:"select",options:[{label:"Text",value:"text"},{label:"Long Text",value:"textarea"},{label:"Boolean",value:"select"}]},value:{defaultValue:"",type:({valueType:e})=>e,options:[{label:"True",value:"true"},{label:"False",value:"false"}]}},preview:{valueType:"",value:""},callback:(e,t)=>{let{valueType:r,value:n}=t;return"select"===r?"true"===n:n}},capitalize:{action:"capitalize",title:"Capitalize",type:"utility",params:{},preview:{content:""},callback:e=>"string"==typeof e?function(e){return null!=e&&"string"==typeof e&&e.trim()?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}(e):e},arrayMap:na,stringToArray:{action:"stringToArray",title:"Text to List",type:"utility",params:{separator:{label:"Separator",defaultValue:",",type:"text"}},preview:{valueType:"",value:""},callback:(e,t)=>{let{separator:r}=t;return"string"==typeof e?e.split(r).map(e=>e.trim()):e}},not:sa,styleSelector:oa,styleVariant:la},da=(Object.values(ca).map(({title:e,action:t})=>({label:e,value:t})),Symbol.for("immer-nothing")),ha=Symbol.for("immer-draftable"),fa=Symbol.for("immer-state");function pa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ma=Object,ya=ma.getPrototypeOf,ga="constructor",ba="prototype",wa="configurable",va="enumerable",xa="writable",ka="value",Sa=e=>!!e&&!!e[fa];function Ma(e){return!!e&&(Pa(e)||Oa(e)||!!e[ha]||!!e[ga]?.[ha]||Wa(e)||Ea(e))}var Aa=ma[ba][ga].toString(),Ta=/* @__PURE__ */new WeakMap;function Pa(e){if(!e||!$a(e))return!1;const t=ya(e);if(null===t||t===ma[ba])return!0;const r=ma.hasOwnProperty.call(t,ga)&&t[ga];if(r===Object)return!0;if(!Fa(r))return!1;let n=Ta.get(r);return void 0===n&&(n=Function.toString.call(r),Ta.set(r,n)),n===Aa}function Na(e,t,r=!0){0===Da(e)?(r?Reflect.ownKeys(e):ma.keys(e)).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function Da(e){const t=e[fa];return t?t.type_:Oa(e)?1:Wa(e)?2:Ea(e)?3:0}var _a=(e,t,r=Da(e))=>2===r?e.has(t):ma[ba].hasOwnProperty.call(e,t),ja=(e,t,r=Da(e))=>2===r?e.get(t):e[t],Ca=(e,t,r,n=Da(e))=>{2===n?e.set(t,r):3===n?e.add(r):e[t]=r},Oa=Array.isArray,Wa=e=>e instanceof Map,Ea=e=>e instanceof Set,$a=e=>"object"==typeof e,Fa=e=>"function"==typeof e,za=e=>"boolean"==typeof e,Ia=e=>e.copy_||e.base_,Ya=e=>e.modified_?e.copy_:e.base_;function Ha(e,t){if(Wa(e))return new Map(e);if(Ea(e))return new Set(e);if(Oa(e))return Array[ba].slice.call(e);const r=Pa(e);if(!0===t||"class_only"===t&&!r){const t=ma.getOwnPropertyDescriptors(e);delete t[fa];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){const i=r[n],a=t[i];!1===a[xa]&&(a[xa]=!0,a[wa]=!0),(a.get||a.set)&&(t[i]={[wa]:!0,[xa]:!0,[va]:a[va],[ka]:e[i]})}return ma.create(ya(e),t)}{const t=ya(e);if(null!==t&&r)return{...e};const n=ma.create(t);return ma.assign(n,e)}}function qa(e,t=!1){return Ua(e)||Sa(e)||!Ma(e)||(Da(e)>1&&ma.defineProperties(e,{set:La,add:La,clear:La,delete:La}),ma.freeze(e),t&&Na(e,(e,t)=>{qa(t,!0)},!1)),e}var La={[ka]:function(){pa(2)}};function Ua(e){return null===e||!$a(e)||ma.isFrozen(e)}var Ba="MapSet",Ra="Patches",Va="ArrayMethods",Xa={};function Za(e){const t=Xa[e];return t||pa(0),t}var Qa,Ga=e=>!!Xa[e],Ja=()=>Qa;function Ka(e,t){t&&(e.patchPlugin_=Za(Ra),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function es(e){ts(e),e.drafts_.forEach(ns),e.drafts_=null}function ts(e){e===Qa&&(Qa=e.parent_)}var rs=e=>Qa={drafts_:[],parent_:Qa,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:/* @__PURE__ */new Set,processedForPatches_:/* @__PURE__ */new Set,mapSetPlugin_:Ga(Ba)?Za(Ba):void 0,arrayMethodsPlugin_:Ga(Va)?Za(Va):void 0};function ns(e){const t=e[fa];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function is(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(void 0!==e&&e!==r){r[fa].modified_&&(es(t),pa(4)),Ma(e)&&(e=as(t,e));const{patchPlugin_:n}=t;n&&n.generateReplacementPatches_(r[fa].base_,e,t)}else e=as(t,r);return function(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&qa(t,r)}(t,e,!0),es(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==da?e:void 0}function as(e,t){if(Ua(t))return t;const r=t[fa];if(!r)return ds(t,e.handledSet_,e);if(!os(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:t}=r;if(t)for(;t.length>0;)t.pop()(e);cs(r,e)}return r.copy_}function ss(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var os=(e,t)=>e.scope_===t,ls=[];function us(e,t,r,n){const i=Ia(e),a=e.type_;if(void 0!==n&&ja(i,n,a)===t)return void Ca(i,n,r,a);if(!e.draftLocations_){const t=e.draftLocations_=/* @__PURE__ */new Map;Na(i,(e,r)=>{if(Sa(r)){const n=t.get(r)||[];n.push(e),t.set(r,n)}})}const s=e.draftLocations_.get(t)??ls;for(const o of s)Ca(i,o,r,a)}function cs(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const n=r.getPath(e);n&&r.generatePatches_(e,n,t)}ss(e)}}function ds(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Sa(e)||t.has(e)||!Ma(e)||Ua(e)||(t.add(e),Na(e,(n,i)=>{if(Sa(i)){const t=i[fa];os(t,r)&&(Ca(e,n,Ya(t),e.type_),ss(t))}else Ma(i)&&ds(i,t,r)})),e}var hs={get(e,t){if(t===fa)return e;let r=e.scope_.arrayMethodsPlugin_;const n=1===e.type_&&"string"==typeof t;if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=Ia(e);if(!_a(i,t,e.type_))return function(e,t,r){const n=ms(t,r);return n?ka in n?n[ka]:n.get?.call(e.draft_):void 0}(e,i,t);const a=i[t];if(e.finalized_||!Ma(a))return a;if(n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return a;if(a===ps(e.base_,t)||function(e,t,r){return!(1!==e.type_||!e.allIndicesReassigned_||e.assigned_?.get(t)||!Ma(r)||r[fa])&&e.baseRefs_.has(r)}(e,t,a)){gs(e);const r=1===e.type_?+t:t,n=bs(e.scope_,a,e,r);return e.copy_[r]=n}return a},has:(e,t)=>t in Ia(e),ownKeys:e=>Reflect.ownKeys(Ia(e)),set(e,t,r){const n=ms(Ia(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=ps(Ia(e),t),i=n?.[fa];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(r,n)&&(void 0!==r||_a(e.base_,t,e.type_)))return!0;gs(e),ys(e)}return e.copy_[t]===r&&(void 0!==r||_a(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),function(e,t,r){const{scope_:n}=e;if(Sa(r)){const i=r[fa];os(i,n)&&i.callbacks_.push(function(){gs(e),us(e,r,Ya(i),t)})}else Ma(r)&&e.callbacks_.push(function(){const i=Ia(e);3===e.type_?i.has(r)&&ds(r,n.handledSet_,n):ja(i,t,e.type_)===r&&n.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&ds(ja(e.copy_,t,e.type_),n.handledSet_,n)})}(e,t,r)),!0},deleteProperty:(e,t)=>(gs(e),void 0!==ps(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),ys(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=Ia(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{[xa]:!0,[wa]:1!==e.type_||"length"!==t,[va]:n[va],[ka]:r[t]}:n},defineProperty(){pa(11)},getPrototypeOf:e=>ya(e.base_),setPrototypeOf(){pa(12)}},fs={};for(let co in hs){let e=hs[co];fs[co]=function(){const t=arguments;return t[0]=t[0][0],e.apply(this,t)}}function ps(e,t){const r=e[fa];return(r?Ia(r):e)[t]}function ms(e,t){if(!(t in e))return;let r=ya(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=ya(r)}}function ys(e){e.modified_||(e.modified_=!0,e.parent_&&ys(e.parent_))}function gs(e){e.copy_||(e.assigned_=/* @__PURE__ */new Map,e.copy_=Ha(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function bs(e,t,r,n){const[i,a]=Wa(t)?Za(Ba).proxyMap_(t,r):Ea(t)?Za(Ba).proxySet_(t,r):function(e,t){const r=Oa(e),n={type_:r?1:0,scope_:t?t.scope_:Ja(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,a=hs;r&&(i=[n],a=fs);const{revoke:s,proxy:o}=Proxy.revocable(i,a);return n.draft_=o,n.revoke_=s,[o,n]}(t,r);return(r?.scope_??Ja()).drafts_.push(i),a.callbacks_=r?.callbacks_??[],a.key_=n,r&&void 0!==n?function(e,t,r){e.callbacks_.push(function(n){const i=t;if(!i||!os(i,n))return;n.mapSetPlugin_?.fixSetContents(i);const a=Ya(i);us(e,i.draft_??i,a,r),cs(i,n)})}(r,a,n):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);const{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function ws(e){if(!Ma(e)||Ua(e))return e;const t=e[fa];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Ha(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Ha(e,!0);return Na(r,(e,t)=>{Ca(r,e,ws(t))},n),t&&(t.finalized_=!1),r}fs.deleteProperty=function(e,t){return fs.set.call(this,e,t,void 0)},fs.set=function(e,t,r){return hs.set.call(this,e[0],t,r,e[0])},globalThis.Iterator;var vs=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,r)=>{if(Fa(e)&&!Fa(t)){const r=t;t=e;const n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}let n;if(Fa(t)||pa(6),void 0===r||Fa(r)||pa(7),Ma(e)){const i=rs(this),a=bs(0,e,void 0);let s=!0;try{n=t(a),s=!1}finally{s?es(i):ts(i)}return Ka(i,r),is(n,i)}if(!e||!$a(e)){if(n=t(e),void 0===n&&(n=e),n===da&&(n=void 0),this.autoFreeze_&&qa(n,!0),r){const t=[],i=[];Za(Ra).generateReplacementPatches_(e,n,{patches_:t,inversePatches_:i}),r(t,i)}return n}pa(1)},this.produceWithPatches=(e,t)=>{if(Fa(e))return(t,...r)=>this.produceWithPatches(t,t=>e(t,...r));let r,n;return[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},za(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),za(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),za(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;Ma(e)||pa(8),Sa(e)&&(Sa(t=e)||pa(10),e=ws(t));const r=rs(this),n=bs(0,e,void 0);return n[fa].isManual_=!0,ts(r),n}finishDraft(e,t){const r=e&&e[fa];r&&r.isManual_||pa(9);const{scope_:n}=r;return Ka(n,t),is(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=Za(Ra).applyPatches_;return Sa(e)?n(e,t):this.produce(e,e=>n(e,t))}},xs=vs.produce,ks=a({});ks.displayName="PlitziServiceContext";var Ss=()=>{let e=u(ks);if(void 0===e)throw Error("ServiceContext value is undefined. Make sure you use the PlitziServiceProvider before using the hook.");return e},Ms=e=>{let{children:t,value:r}=e;/* @__PURE__ */
|