const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./fCUp34qd.js","./GW_nhZxv.js","./4D5F-n5U.js","./BEk9thJj.js","./DZPZEOli.js","./iXu5QeM3.js","./DXEgXodZ.js","./Cu5ilWky.js","./krC2xWPP.js"])))=>i.map(i=>d[i]); import"./DsnmJJEf.js";import{bn as GT,i as ge,br as I0,av as HT,g as f,j as k,aJ as Ja,v as ad,D as Wt,p as Me,u as We,m as Pt,e as _e,f as me,a as y,b as Re,h as A,d as x,r as b,t as B,s as M,c as P,l as vs,q as xt,am as KT,x as tS,B as mr,aA as ta,n as na,ak as nS,E as JT,af as rS,G as eA,bs as iS,bt as _n,al as tA}from"./krC2xWPP.js";import{e as Ue,s as Ve,r as En,c as Jn,n as Qt,f as hl,i as dn,b as yi,a as ld,h as lr,j as cr,t as xi,B as sS,k as gf}from"./Lvd_r9sp.js";import{p as ee,i as Z,r as Tt,s as _i}from"./DjsWWzyL.js";import{d as It,s as $,a as Ce,e as en,k as oS,o as xn}from"./CddAxf8c.js";import{h as lt}from"./DSIsCMt7.js";import{s as Je,c as ro,a as pf}from"./j_DJpx8B.js";import{i as ve,g as Ro,c as _t,b as Ns,a as Um}from"./Cu5ilWky.js";import{a as X0}from"./CmljtmCp.js";import{b as gn}from"./CpuCZOqP.js";import{r as nA}from"./BVTiZ3e2.js";import{R as rA}from"./CRjkBTWq.js";import{p as Z0,P as iA}from"./DI46g3k0.js";import{o as tr,a as sA}from"./DukJHxi2.js";import{C as aS,U as oA,R as aA,H as lA,k as cA,l as uA,B as hA,I as dA,S as fA,m as mA,Q as gA,L as pA,n as OA,o as vA,b as lS,p as bA,P as yA,r as xA,A as SA,W as N0,T as wA,q as kA,s as _A}from"./mRQytvOt.js";import{c as Gt}from"./BcwIk3O9.js";import{p as Of}from"./BzvfRedh.js";import{_ as de}from"./PPVm8Dsz.js";import{C as PA}from"./CurHnm4X.js";import{L as QA}from"./CPwAX0SU.js";import{I as CA}from"./CM67Jphm.js";import{M as TA}from"./Uy4Qmey4.js";import{a as AA}from"./DKn7_j4m.js";import{P as EA}from"./h5MFuJx-.js";import{C as Sc}from"./BxhjPWJA.js";import{b as Vp}from"./ciapVzar.js";import{g as V0}from"./CuL3Sd6G.js";import{D as Dl}from"./nlum2O0L.js";import{S as cS}from"./agE6NDSA.js";import{X as ji}from"./CiIMiELt.js";import{L as qm}from"./C_E2vM9U.js";import{a as F0,b as DA,F as MA}from"./H7qjuNF4.js";import{C as $m}from"./DEuEFefA.js";import{C as da}from"./ZWbUro-G.js";import{G as Fp}from"./9QV-A355.js";import{P as uS}from"./C1jLV8_5.js";import{T as RA}from"./CSNyvbvN.js";import{C as LA}from"./1ntGG_wQ.js";import{U as hS,X as dS,I as IA,g as XA,h as ZA,i as NA,j as VA,f as jp,k as FA,B as jA}from"./DXEgXodZ.js";import{U as fS}from"./hiAQl6ey.js";import{s as nt}from"./C4MegWN0.js";import{i as BA}from"./BbvEV2h7.js";import{R as zA}from"./DmaMvHCd.js";import{F as j0}from"./BVtAzxt8.js";import{C as WA}from"./BOa1XZtG.js";import{C as mS}from"./BVZX0JD2.js";import{T as gS}from"./zdwqcrP5.js";import{D as YA}from"./DBVjMAyX.js";import{C as UA}from"./Cv606Ht4.js";import{c as qA}from"./YfSC2Q4o.js";import{c as Gc}from"./CJohx04Q.js";import{b as $A}from"./BSopV7IU.js";function GA(){return Symbol(GT)}class HA extends Map{#e=new Map;#t=ge(0);#n=ge(0);#r=I0||-1;constructor(e){if(super(),e){for(var[n,r]of e)super.set(n,r);this.#n.v=super.size}}#i(e){return I0===this.#r?ge(e):HT(e)}has(e){var n=this.#e,r=n.get(e);if(r===void 0)if(super.has(e))r=this.#i(0),n.set(e,r);else return f(this.#t),!1;return f(r),!0}forEach(e,n){this.#o(),super.forEach(e,n)}get(e){var n=this.#e,r=n.get(e);if(r===void 0)if(super.has(e))r=this.#i(0),n.set(e,r);else{f(this.#t);return}return f(r),super.get(e)}set(e,n){var r=this.#e,i=r.get(e),s=super.get(e),o=super.set(e,n),a=this.#t;if(i===void 0)i=this.#i(0),r.set(e,i),k(this.#n,super.size),Ja(a);else if(s!==n){Ja(i);var l=a.reactions===null?null:new Set(a.reactions),c=l===null||!i.reactions?.every(u=>l.has(u));c&&Ja(a)}return o}delete(e){var n=this.#e,r=n.get(e),i=super.delete(e);return r!==void 0&&(n.delete(e),k(r,-1)),i&&(k(this.#n,super.size),Ja(this.#t)),i}clear(){if(super.size!==0){super.clear();var e=this.#e;k(this.#n,0);for(var n of e.values())k(n,-1);Ja(this.#t),e.clear()}}#o(){f(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var n of super.keys())if(!e.has(n)){var r=this.#i(0);e.set(n,r)}}for([,r]of this.#e)f(r)}keys(){return f(this.#t),super.keys()}values(){return this.#o(),super.values()}entries(){return this.#o(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return f(this.#n),super.size}}const pS="formCommit";function KA(){const t=new Set;return{register(e){return t.add(e),()=>t.delete(e)},async emit(){const e=[...t];for(const n of e)try{await n()}catch(r){console.warn("[formCommit] listener threw:",r)}}}}function Cee(){const t=KA();return ad(pS,t),t}function JA(){return Wt(pS)??null}function OS(t,e){const n=e.toLowerCase(),r=ve.tMaybe;return[t.label?r(t.label):"",t.help?r(t.help):"",t.name,t.title?r(t.title):"",t.description?r(t.description):""].some(s=>s.toLowerCase().includes(n))}function Bp(t,e,n){return OS(t,e)||t.type==="list"&&n!==void 0&&eE(n,e)?!0:t.fields?t.fields.some(r=>Bp(r,e)):!1}function eE(t,e){const n=e.toLowerCase();if(!n)return!1;if(Array.isArray(t))return t.some(r=>$u(r,n));if(t!==null&&typeof t=="object"){for(const[r,i]of Object.entries(t))if(r.toLowerCase().includes(n)||$u(i,n))return!0}return!1}function $u(t,e){return t==null?!1:typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t).toLowerCase().includes(e):Array.isArray(t)?t.some(n=>$u(n,e)):typeof t=="object"?Object.values(t).some(n=>$u(n,e)):!1}function B0(t){let e=!1,n=!1,r=0,i=0,s=0;function o(c){c.pointerType==="touch"||c.button!==0||c.target?.closest('input, textarea, select, [contenteditable="true"]')||(e=!0,n=!1,r=c.clientX,i=t.scrollLeft,s=c.pointerId)}function a(c){if(!e)return;const u=c.clientX-r;!n&&Math.abs(u)>4&&(n=!0,t.setPointerCapture(s),t.style.cursor="grabbing",t.style.userSelect="none"),n&&(t.scrollLeft=i-u,c.preventDefault())}function l(){if(n){t.style.cursor="",t.style.userSelect="";const c=u=>{u.stopPropagation(),u.preventDefault(),t.removeEventListener("click",c,!0)};t.addEventListener("click",c,!0)}e=!1,n=!1}return t.addEventListener("pointerdown",o),t.addEventListener("pointermove",a),t.addEventListener("pointerup",l),t.addEventListener("pointercancel",l),{destroy(){t.removeEventListener("pointerdown",o),t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",l),t.removeEventListener("pointercancel",l)}}}var tE=P(""),nE=P('
'),rE=P("
"),iE=P('
'),sE=P(""),oE=P('
'),aE=P("
"),lE=P('
');function cE(t,e){Me(e,!0);let n=ee(e,"filter",3,"");const r=ve.tMaybe,i=A(()=>(e.field.fields??[]).filter(C=>C.type==="tab"||C.fields&&(C.title||C.label))),s=A(()=>e.field.classes?.includes("side-tabs")??!1),o=A(()=>n()?new Set(f(i).filter(C=>C.fields?.some(T=>Bp(T,n()))).map(C=>C.name)):null),a=A(()=>!!n()&&!!f(o)&&f(o).size===0);We(()=>{if(f(o)&&f(o).size>0){const C=f(i)[f(u)];if(!C||!f(o).has(C.name)){const T=f(i).findIndex(S=>f(o).has(S.name));T>=0&&k(u,T,!0)}}});function l(){return typeof window>"u"?[]:window.location.hash.slice(1).split("--").map(C=>C.toLowerCase())}function c(){const C=l();if(C.length===0)return 0;for(const T of[...C].reverse()){const S=f(i).findIndex(Q=>Q.name.toLowerCase()===T);if(S>=0)return S}return 0}let u=ge(Pt(c()));const h=A(()=>f(i).map(C=>C.name).join(","));let d=ge(Pt(f(h))),m=ge(void 0),g=ge(void 0);We(()=>{if(!f(m)||!f(g))return;const C=()=>{const D=parseFloat(getComputedStyle(f(g).parentElement).getPropertyValue("--sticky-header-height"))||0,I=f(m).getBoundingClientRect().height;f(g).style.setProperty("--sticky-header-height-base",D+"px"),f(g).style.setProperty("--sticky-header-height",D+I+"px")},T=new ResizeObserver(C);T.observe(f(m));let S=f(g).parentElement;for(;S&&!S.style.getPropertyValue("--sticky-header-height");)S=S.parentElement;const Q=S?new MutationObserver(C):null;return S&&Q&&Q.observe(S,{attributes:!0,attributeFilter:["style"]}),C(),()=>{T.disconnect(),Q?.disconnect()}}),We(()=>{f(h)!==f(d)&&(k(d,f(h),!0),f(i).length!==0&&k(u,c(),!0))});function p(C){k(u,C,!0);const T=f(i)[C];if(T){const S=l(),Q=T.name.toLowerCase(),D=new Set(f(i).map(L=>L.name.toLowerCase())),X=[...S.filter(L=>!D.has(L)),Q].join("--");nA(`#${X}`,{})}}We(()=>{function C(){const T=l();for(const S of[...T].reverse()){const Q=f(i).findIndex(D=>D.name.toLowerCase()===S);if(Q>=0&&Q!==f(u)){k(u,Q,!0);return}}}return window.addEventListener("hashchange",C),()=>window.removeEventListener("hashchange",C)});var O=_e(),v=me(O);{var w=C=>{var T=iE(),S=x(T),Q=x(S);Ue(Q,23,()=>f(i),R=>R.name,(R,F,U)=>{const j=A(()=>!f(o)||f(o).has(f(F).name));var Y=_e(),ie=me(Y);{var N=z=>{var he=tE(),te=x(he,!0);b(he),B(V=>{Je(he,1,`shrink-0 whitespace-nowrap rounded-md px-3 py-2 text-start text-sm font-medium transition-colors ${f(U)===f(u)?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"}`),$(te,V)},[()=>r(f(F).title||f(F).label||f(F).name)]),Ce("click",he,()=>p(f(U))),y(z,he)};Z(ie,z=>{(!n()||f(j))&&z(N)})}y(R,Y)}),b(Q),X0(Q,R=>B0?.(R)),b(S);var D=M(S,2),I=x(D);{var X=R=>{var F=nE(),U=x(F,!0);b(F),B(j=>$(U,j),[()=>ve.t("ADMIN_NEXT.FIELDS.TABS.NO_FIELDS_MATCH_YOUR_FILTER")]),y(R,F)},L=R=>{var F=_e(),U=me(F);Ue(U,19,()=>f(i),j=>j.name,(j,Y,ie)=>{var N=_e(),z=me(N);{var he=te=>{var V=rE();let J;Ue(V,21,()=>f(Y).fields,q=>q.name,(q,re)=>{{let oe=A(()=>e.getValue(f(re).name)),Se=A(()=>e.onFieldCommit?(se,pe)=>e.onFieldCommit(f(re).name,se,pe):void 0);Cr(q,{get field(){return f(re)},get value(){return f(oe)},onchange:se=>e.onFieldChange(f(re).name,se),get oncommit(){return f(Se)},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit},get filter(){return n()}})}}),b(V),B(()=>J=Je(V,1,"space-y-4",null,J,{hidden:f(ie)!==f(u)})),y(te,V)};Z(z,te=>{f(Y).fields&&te(he)})}y(j,N)}),y(R,F)};Z(I,R=>{f(a)?R(X):R(L,-1)})}b(D),b(T),y(C,T)},_=C=>{var T=lE(),S=x(T);Ue(S,23,()=>f(i),X=>X.name,(X,L,R)=>{const F=A(()=>!f(o)||f(o).has(f(L).name));var U=_e(),j=me(U);{var Y=ie=>{var N=sE(),z=x(N,!0);b(N),B(he=>{Je(N,1,`shrink-0 whitespace-nowrap border-b-2 px-4 py-2 text-sm font-medium transition-colors ${f(R)===f(u)?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`),$(z,he)},[()=>r(f(L).title||f(L).label||f(L).name)]),Ce("click",N,()=>p(f(R))),y(ie,N)};Z(j,ie=>{(!n()||f(F))&&ie(Y)})}y(X,U)}),b(S),gn(S,X=>k(m,X),()=>f(m)),X0(S,X=>B0?.(X));var Q=M(S,2);{var D=X=>{var L=oE(),R=x(L,!0);b(L),B(F=>$(R,F),[()=>ve.t("ADMIN_NEXT.FIELDS.TABS.NO_FIELDS_MATCH_YOUR_FILTER")]),y(X,L)},I=X=>{var L=_e(),R=me(L);Ue(R,19,()=>f(i),F=>F.name,(F,U,j)=>{var Y=_e(),ie=me(Y);{var N=z=>{var he=aE();let te;Ue(he,21,()=>f(U).fields,V=>V.name,(V,J)=>{{let q=A(()=>e.getValue(f(J).name)),re=A(()=>e.onFieldCommit?(oe,Se)=>e.onFieldCommit(f(J).name,oe,Se):void 0);Cr(V,{get field(){return f(J)},get value(){return f(q)},onchange:oe=>e.onFieldChange(f(J).name,oe),get oncommit(){return f(re)},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit},get filter(){return n()}})}}),b(he),B(()=>te=Je(he,1,"space-y-4 pt-4",null,te,{hidden:f(j)!==f(u)})),y(z,he)};Z(ie,z=>{f(U).fields&&z(N)})}y(F,Y)}),y(X,L)};Z(Q,X=>{f(a)?X(D):X(I,-1)})}b(T),gn(T,X=>k(g,X),()=>f(g)),y(C,T)};Z(v,C=>{f(s)?C(w):C(_,-1)})}y(t,O),Re()}It(["click"]);var uE=P('');function Wo(t,e){Me(e,!0);const n=Wt("configOverrides"),r=A(()=>!!n?.isOverridden(e.path));function i(){const l=n?.getFallback(e.path);return l==null||l===""?ve.t("ADMIN_NEXT.CONFIG.OVERRIDE.DEFAULT_EMPTY"):typeof l=="object"?JSON.stringify(l):String(l)}var s=_e(),o=me(s);{var a=l=>{var c=uE(),u=x(c);rA(u,{size:12,strokeWidth:2.25}),b(c),B((h,d)=>{Ve(c,"title",h),Ve(c,"aria-label",d),c.disabled=!n.canRevert},[()=>ve.t("ADMIN_NEXT.CONFIG.OVERRIDE.REVERT_TOOLTIP",{value:i()}),()=>ve.t("ADMIN_NEXT.CONFIG.OVERRIDE.REVERT_TOOLTIP",{value:i()})]),Ce("click",c,h=>{h.preventDefault(),h.stopPropagation(),n.revert(e.path)}),y(l,c)};Z(o,l=>{n&&f(r)&&l(a)})}y(t,s),Re()}It(["click"]);var hE=KT(''),dE=P(''),fE=P('

'),mE=P('

'),gE=P('

'),pE=P("
"),OE=P('*'),vE=P(' '),bE=P('

'),yE=P('
'),xE=P('
'),SE=P('
');function wE(t,e){Me(e,!0);const n=(_,C=xt,T=xt)=>{var S=dE(),Q=x(S);{var D=I=>{var X=hE();y(I,X)};Z(Q,I=>{T()&&I(D)})}b(S),B(()=>Je(S,1,`mt-0.5 flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded border transition-colors ${T()?"border-primary bg-primary":"border-input bg-muted/50"}`)),Ce("click",S,()=>g(C().name,C())),y(_,S)};let r=ee(e,"filter",3,"");const i=ve.tMaybe,s=A(()=>r()&&e.field.fields?e.field.fields.filter(_=>OS(_,r())):e.field.fields??[]),o=new Set(["cronstatus","webhook-status","tabs","tab","section","fieldset","columns","column","pagemedia","spacer"]),a=new Set(["save-redirect"]),l=new Set(["order_title","header.order_by","header.order_manual","enabled","health_status","active_triggers","webhook_token_generate"]),c=new Set(["webhook_examples"]);function u(_){if(c.has(_.name))return!1;if(l.has(_.name))return!0;if(_.type==="display"){const C=_.content||_.text||_.description||"";if(C===""||C.includes("$1')}var O=_e(),v=me(O);{var w=_=>{var C=SE(),T=x(C);{var S=I=>{var X=gE(),L=x(X),R=x(L,!0);b(L);var F=M(L,2);{var U=j=>{const Y=A(()=>i(e.field.text||e.field.description));var ie=_e(),N=me(ie);{var z=te=>{var V=fE();lt(V,()=>Ro.parseInline(f(Y)),!0),b(V),y(te,V)},he=te=>{var V=mE();lt(V,()=>f(Y),!0),b(V),y(te,V)};Z(N,te=>{e.field.markdown?te(z):te(he,-1)})}y(j,ie)};Z(F,j=>{(e.field.text||e.field.description)&&j(U)})}b(X),B(j=>$(R,j),[()=>i(e.field.title||e.field.label)]),y(I,X)};Z(T,I=>{(e.field.title||e.field.label)&&I(S)})}var Q=M(T,2);{var D=I=>{var X=xE();Ue(X,21,()=>f(s),L=>L.name,(L,R)=>{const F=A(()=>d(f(R)));var U=_e(),j=me(U);{var Y=te=>{},ie=A(()=>u(f(R))),N=te=>{var V=pE(),J=x(V);{let q=A(()=>m(f(R),f(F))),re=A(()=>e.onFieldCommit?(oe,Se)=>e.onFieldCommit(f(R).name,oe,Se):void 0);Cr(J,{get field(){return f(R)},get value(){return f(q)},onchange:oe=>e.onFieldChange(f(R).name,oe),get oncommit(){return f(re)},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit}})}b(V),B(()=>Je(V,1,`transition-opacity ${f(R).toggleable&&!f(F)?"pointer-events-none opacity-50":""}`)),y(te,V)},z=A(()=>h(f(R))),he=te=>{var V=yE(),J=x(V),q=x(J);{var re=H=>{n(H,()=>f(R),()=>f(F))};Z(q,H=>{f(R).toggleable&&H(re)})}var oe=M(q,2),Se=x(oe);{var se=H=>{var ue=vE(),ye=x(ue),De=x(ye);{var W=Te=>{var Qe=_e(),Be=me(Qe);lt(Be,()=>p(i(f(R).label))),y(Te,Qe)},ce=Te=>{var Qe=vs();B(Be=>$(Qe,Be),[()=>i(f(R).label)]),y(Te,Qe)};Z(De,Te=>{r()?Te(W):Te(ce,-1)})}var we=M(De,2);{var xe=Te=>{var Qe=OE();y(Te,Qe)};Z(we,Te=>{f(R).validate?.required&&Te(xe)})}b(ye);var fe=M(ye,2);Wo(fe,{get path(){return f(R).name}}),b(ue),B(()=>Je(ye,1,`text-sm font-semibold ${f(F)?"text-foreground":"text-muted-foreground"}`)),y(H,ue)};Z(Se,H=>{f(R).label&&H(se)})}var pe=M(Se,2);{var ae=H=>{var ue=bE(),ye=x(ue);{var De=ce=>{var we=_e(),xe=me(we);lt(xe,()=>p(i(f(R).help))),y(ce,we)},W=ce=>{var we=_e(),xe=me(we);lt(xe,()=>i(f(R).help)),y(ce,we)};Z(ye,ce=>{r()?ce(De):ce(W,-1)})}b(ue),y(H,ue)};Z(pe,H=>{f(R).help&&H(ae)})}b(oe),b(J);var G=M(J,2),K=x(G);{let H=A(()=>({...f(R),label:void 0,help:void 0})),ue=A(()=>m(f(R),f(F))),ye=A(()=>e.onFieldCommit?(De,W)=>e.onFieldCommit(f(R).name,De,W):void 0);Cr(K,{get field(){return f(H)},get value(){return f(ue)},onchange:De=>e.onFieldChange(f(R).name,De),get oncommit(){return f(ye)},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit}})}b(G),b(V),B(()=>Je(G,1,`transition-opacity ${f(R).toggleable&&!f(F)?"pointer-events-none opacity-50":""}`)),y(te,V)};Z(j,te=>{f(ie)?te(Y):f(z)?te(N,1):te(he,-1)})}y(L,U)}),b(X),y(I,X)};Z(Q,I=>{f(s).length>0&&I(D)})}b(C),y(_,C)};Z(v,_=>{(!r()||f(s).length>0)&&_(w)})}y(t,O),Re()}It(["click"]);var kE=P('

'),_E=P('
');function PE(t,e){Me(e,!0);const n=ve.tMaybe;var r=_e(),i=me(r);{var s=a=>{var l=kE(),c=x(l),u=x(c,!0);b(c),b(l),B(h=>$(u,h),[()=>n(e.field.title)]),y(a,l)},o=a=>{var l=_E();y(a,l)};Z(i,a=>{e.field.title?a(s):e.field.underline!==!1&&a(o,1)})}y(t,r),Re()}function Gu(t){switch(t){case"x-small":return"max-w-24";case"small":return"max-w-48";case"medium":return"max-w-80";case"large":return"max-w-[28rem]";default:return""}}var QE=P('*'),CE=P(''),TE=P('

'),AE=P("
"),EE=P(' '),DE=P(' '),ME=P('
'),RE=P(""),LE=P('

'),IE=P('

'),XE=P('

'),ZE=P('
'),NE=P('');function VE(t,e){Me(e,!0);const n=ve.tMaybe,r=e.field.type==="number"?"number":e.field.type==="color"?"color":e.field.type==="range"?"range":e.field.type==="password"?"password":e.field.type==="email"?"email":e.field.type==="url"?"url":e.field.type==="date"?"date":e.field.type==="datetime"?"datetime-local":e.field.type==="time"?"time":"text";function i(c){const u=c.target,h=e.field.type==="number"?u.value?Number(u.value):void 0:u.value;e.onchange(h)}var s=_e(),o=me(s);{var a=c=>{var u=ZE(),h=x(u);{var d=C=>{var T=AE(),S=x(T);{var Q=X=>{var L=CE(),R=x(L),F=M(R);{var U=j=>{var Y=QE();y(j,Y)};Z(F,j=>{e.field.validate?.required&&j(U)})}b(L),B(j=>$(R,`${j??""} `),[()=>n(e.field.label)]),y(X,L)};Z(S,X=>{e.field.label&&X(Q)})}var D=M(S,2);{var I=X=>{var L=TE();lt(L,()=>n(e.field.help),!0),b(L),y(X,L)};Z(D,X=>{e.field.help&&X(I)})}b(T),y(C,T)};Z(h,C=>{(e.field.label||e.field.help)&&C(d)})}var m=M(h,2);{var g=C=>{var T=ME(),S=x(T);{var Q=L=>{var R=EE(),F=x(R,!0);b(R),B(U=>$(F,U),[()=>n(e.field.prepend)]),y(L,R)};Z(S,L=>{e.field.prepend&&L(Q)})}var D=M(S,2);En(D);var I=M(D,2);{var X=L=>{var R=DE(),F=x(R,!0);b(R),B(U=>$(F,U),[()=>n(e.field.append)]),y(L,R)};Z(I,L=>{e.field.append&&L(X)})}b(T),B((L,R)=>{Ve(D,"type",r),Je(D,1,`flex h-10 min-w-0 flex-1 border bg-muted/50 px-3 py-2 text-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring ${L??""} ${e.error?"border-destructive ring-1 ring-destructive":"border-input"} ${e.field.prepend&&e.field.append?"":e.field.prepend?"rounded-r-lg":e.field.append?"rounded-l-lg":"rounded-lg"}`),Jn(D,e.value??e.field.default??""),Ve(D,"placeholder",R),D.disabled=e.field.disabled,D.readOnly=e.field.readonly,Ve(D,"min",e.field.min),Ve(D,"max",e.field.max),Ve(D,"step",e.field.step)},[()=>Gu(e.field.size),()=>n(e.field.placeholder)]),Ce("input",D,i),y(C,T)},p=C=>{var T=RE();En(T),B((S,Q)=>{Ve(T,"type",r),Je(T,1,`flex h-10 w-full rounded-lg border bg-muted/50 px-3 py-2 text-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring ${S??""} ${e.error?"border-destructive ring-1 ring-destructive":"border-input"}`),Jn(T,e.value??e.field.default??""),Ve(T,"placeholder",Q),T.disabled=e.field.disabled,T.readOnly=e.field.readonly,Ve(T,"min",e.field.min),Ve(T,"max",e.field.max),Ve(T,"step",e.field.step)},[()=>Gu(e.field.size),()=>n(e.field.placeholder)]),Ce("input",T,i),y(C,T)};Z(m,C=>{e.field.prepend||e.field.append?C(g):C(p,-1)})}var O=M(m,2);{var v=C=>{const T=A(()=>n(e.field.description));var S=_e(),Q=me(S);{var D=X=>{var L=LE();lt(L,()=>Ro.parseInline(f(T)),!0),b(L),y(X,L)},I=X=>{var L=IE(),R=x(L,!0);b(L),B(()=>$(R,f(T))),y(X,L)};Z(Q,X=>{e.field.markdown?X(D):X(I,-1)})}y(C,S)};Z(O,C=>{e.field.description&&C(v)})}var w=M(O,2);{var _=C=>{var T=XE(),S=x(T,!0);b(T),B(()=>$(S,e.error)),y(C,T)};Z(w,C=>{e.error&&C(_)})}b(u),y(c,u)},l=c=>{var u=NE();En(u),B(()=>Jn(u,e.value??e.field.default??"")),y(c,u)};Z(o,c=>{e.field.type!=="hidden"?c(a):c(l,-1)})}y(t,s),Re()}It(["input"]);var FE=P('*'),jE=P(''),BE=P('

'),zE=P("
"),WE=P('

'),YE=P('
');function UE(t,e){Me(e,!0);const n=ve.tMaybe,r=A(()=>e.field.password_policy!==!1);We(()=>{f(r)&&Z0.load().catch(()=>{})});const i=A(()=>e.value??"");var s=YE(),o=x(s);{var a=d=>{var m=zE(),g=x(m);{var p=w=>{var _=jE(),C=x(_),T=M(C);{var S=Q=>{var D=FE();y(Q,D)};Z(T,Q=>{e.field.validate?.required&&Q(S)})}b(_),B(Q=>$(C,`${Q??""} `),[()=>n(e.field.label)]),y(w,_)};Z(g,w=>{e.field.label&&w(p)})}var O=M(g,2);{var v=w=>{var _=BE();lt(_,()=>n(e.field.help),!0),b(_),y(w,_)};Z(O,w=>{e.field.help&&w(v)})}b(m),y(d,m)};Z(o,d=>{(e.field.label||e.field.help)&&d(a)})}var l=M(o,2),c=x(l);{let d=A(()=>f(r)?Z0.current:void 0);iA(c,{get id(){return e.field.name},label:"",get value(){return f(i)},onchange:m=>e.onchange(m),get policy(){return f(d)},autocomplete:"new-password",get placeholder(){return e.field.placeholder},get showMeter(){return f(r)},get showHint(){return f(r)}})}b(l);var u=M(l,2);{var h=d=>{var m=WE(),g=x(m,!0);b(m),B(()=>$(g,e.error)),y(d,m)};Z(u,d=>{e.error&&d(h)})}b(s),B(d=>Je(l,1,d),[()=>ro(Gu(e.field.size))]),y(t,s),Re()}let Gm=[],vS=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e>1;if(t=vS[r])e=r+1;else return!0;if(e==n)return!1}}function z0(t){return t>=127462&&t<=127487}const W0=8205;function $E(t,e,n=!0,r=!0){return(n?bS:GE)(t,e,r)}function bS(t,e,n){if(e==t.length)return e;e&&yS(t.charCodeAt(e))&&xS(t.charCodeAt(e-1))&&e--;let r=vf(t,e);for(e+=Y0(r);e=0&&z0(vf(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function GE(t,e,n){for(;e>0;){let r=bS(t,e-2,n);if(r=56320&&t<57344}function xS(t){return t>=55296&&t<56320}function Y0(t){return t<65536?1:2}class bt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=fa(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),ui.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=fa(this,e,n);let r=[];return this.decompose(e,n,r,0),ui.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new bl(this),s=new bl(e);for(let o=n,a=n;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new bl(this,e)}iterRange(e,n=this.length){return new SS(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new wS(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?bt.empty:e.length<=32?new Ht(e):ui.from(Ht.split(e,[]))}}class Ht extends bt{constructor(e,n=HE(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((n?r:a)>=e)return new KE(i,a,r,o);i=a+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new Ht(U0(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=Au(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new Ht(a,o.length+s.length));else{let l=a.length>>1;r.push(new Ht(a.slice(0,l)),new Ht(a.slice(l)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof Ht))return super.replace(e,n,r);[e,n]=fa(this,e,n);let i=Au(this.text,Au(r.text,U0(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new Ht(i,s):ui.from(Ht.split(i,[]),s)}sliceString(e,n=this.length,r=` `){[e,n]=fa(this,e,n);let i="";for(let s=0,o=0;s<=n&&oe&&o&&(i+=r),es&&(i+=a.slice(Math.max(0,e-s),n-s)),s=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new Ht(r,i)),r=[],i=-1);return i>-1&&n.push(new Ht(r,i)),n}}class ui extends bt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,l=r+o.lines-1;if((n?l:a)>=e)return o.lineInner(e,n,r,i);i=a+1,r=l+1}}decompose(e,n,r,i){for(let s=0,o=0;o<=n&&s=o){let c=i&((o<=e?1:0)|(l>=n?2:0));o>=e&&l<=n&&!c?r.push(a):a.decompose(e-o,n-o,r,c)}o=l+1}}replace(e,n,r){if([e,n]=fa(this,e,n),r.lines=s&&n<=a){let l=o.replace(e-s,n-s,r),c=this.lines-o.lines+l.lines;if(l.lines>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new ui(u,this.length-(n-e)+r.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` `){[e,n]=fa(this,e,n);let i="";for(let s=0,o=0;se&&s&&(i+=r),eo&&(i+=a.sliceString(e-o,n-o,r)),o=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof ui))return 0;let r=0,[i,s,o,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==o||s==a)return r;let l=this.children[i],c=e.children[s];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let m of e)r+=m.lines;if(r<32){let m=[];for(let g of e)g.flatten(m);return new Ht(m,n)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],l=0,c=-1,u=[];function h(m){let g;if(m.lines>s&&m instanceof ui)for(let p of m.children)h(p);else m.lines>o&&(l>o||!l)?(d(),a.push(m)):m instanceof Ht&&l&&(g=u[u.length-1])instanceof Ht&&m.lines+g.lines<=32?(l+=m.lines,c+=m.length+1,u[u.length-1]=new Ht(g.text.concat(m.text),g.length+1+m.length)):(l+m.lines>i&&d(),l+=m.lines,c+=m.length+1,u.push(m))}function d(){l!=0&&(a.push(u.length==1?u[0]:ui.from(u,c)),c=-1,l=u.length=0)}for(let m of e)h(m);return d(),a.length==1?a[0]:new ui(a,n)}}bt.empty=new Ht([""],0);function HE(t){let e=-1;for(let n of t)e+=n.length+1;return e}function Au(t,e,n=0,r=1e9){for(let i=0,s=0,o=!0;s=n&&(l>r&&(a=a.slice(0,r-i)),i0?1:(e instanceof Ht?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,a=i instanceof Ht?i.text.length:i.children.length;if(o==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(i instanceof Ht){let l=i.text[o+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Ht?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class SS{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new bl(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class wS{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(bt.prototype[Symbol.iterator]=function(){return this.iter()},bl.prototype[Symbol.iterator]=SS.prototype[Symbol.iterator]=wS.prototype[Symbol.iterator]=function(){return this});let KE=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function fa(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function fn(t,e,n=!0,r=!0){return $E(t,e,n,r)}function JE(t){return t>=56320&&t<57344}function eD(t){return t>=55296&&t<56320}function Vs(t,e){let n=t.charCodeAt(e);if(!eD(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return JE(r)?(n-55296<<10)+(r-56320)+65536:n}function kS(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function wc(t){return t<65536?1:2}const Hm=/\r\n?|\n/;var Tn=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Tn||(Tn={}));class Si{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return s+(e-i);s+=a}else{if(r!=Tn.Simple&&c>=e&&(r==Tn.TrackDel&&ie||r==Tn.TrackBefore&&ie))return null;if(c>e||c==e&&n<0&&!a)return e==i||n<0?s:s+l;s+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r=0&&i<=n&&a>=e)return in?"cover":!0;i=a}return!1}toString(){let e="";for(let n=0;n=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Si(e)}static create(e){return new Si(e)}}class on extends Si{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Km(this,(n,r,i,s,o)=>e=e.replace(i,i+(r-n),o),!1),e}mapDesc(e,n=!1){return Jm(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i=0){n[i]=a,n[i+1]=o;let l=i>>1;for(;r.length0&&ds(r,n,s.text),s.forward(u),a+=u}let c=e[o++];for(;a>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],o=0,a=null;function l(u=!1){if(!u&&!i.length)return;od||h<0||d>n)throw new RangeError(`Invalid change range ${h} to ${d} (in doc of length ${n})`);let g=m?typeof m=="string"?bt.of(m.split(r||Hm)):m:bt.empty,p=g.length;if(h==d&&p==0)return;ho&&Cn(i,h-o,-1),Cn(i,d-h,p),ds(s,i,g),o=d}}return c(e),l(!a),a}static empty(e){return new on(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;ia&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function ds(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],l=t.sections[o++];e(i,c,s,u,h),i=c,s=u}}}function Jm(t,e,n,r=!1){let i=[],s=r?[]:null,o=new Ml(t),a=new Ml(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let c=Math.min(o.len,a.len);Cn(i,c,-1),o.forward(c),a.forward(c)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len=0&&l=0){let c=0,u=o.len;for(;u;)if(a.ins==-1){let h=Math.min(u,a.len);c+=h,u-=h,a.forward(h)}else if(a.ins==0&&a.lenl||o.ins>=0&&o.len>l)&&(a||r.length>c),s.forward2(l),o.forward(l)}}}}class Ml{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?bt.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?bt.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class io{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new io(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return Oe.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Oe.range(this.anchor,i,void 0,void 0,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Oe.range(e.anchor,e.head)}static create(e,n,r){return new io(e,n,r)}}class Oe{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Oe.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Oe(e.ranges.map(n=>io.fromJSON(n)),e.main)}static single(e,n=e){return new Oe([Oe.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ii.from-s.from),n=e.indexOf(r);for(let i=1;is.head?Oe.range(l,a):Oe.range(a,l))}}return new Oe(e,n)}}function PS(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let zp=0;class Ze{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=zp++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Ze(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:Wp),!!e.static,e.enables)}of(e){return new Eu([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Eu(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Eu(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function Wp(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class Eu{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=zp++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?c=!0:(((n=e[h.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(e[h.id]);return{create(h){return h.values[o]=r(h),1},update(h,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||eg(h,u)){let m=r(h);if(a?!q0(m,h.values[o],i):!i(m,h.values[o]))return h.values[o]=m,1}return 0},reconfigure:(h,d)=>{let m,g=d.config.address[s];if(g!=null){let p=Ku(d,g);if(this.dependencies.every(O=>O instanceof Ze?d.facet(O)===h.facet(O):O instanceof yr?d.field(O,!1)==h.field(O,!1):!0)||(a?q0(m=r(h),p,i):i(m=r(h),p)))return h.values[o]=p,0}else m=r(h);return h.values[o]=m,1}}}}function q0(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[l.id]),i=n.map(l=>l.type),s=r.filter(l=>!(l&1)),o=t[e.id]>>1;function a(l){let c=[];for(let u=0;ur===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Hc).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[n]=o,1)},reconfigure:(r,i)=>{let s=r.facet(Hc),o=i.facet(Hc),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(r.values[n]=a.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Hc.of({field:this,create:e})]}get extension(){return this}}const Js={lowest:4,low:3,default:2,high:1,highest:0};function el(t){return e=>new QS(e,t)}const Lo={highest:el(Js.highest),high:el(Js.high),default:el(Js.default),low:el(Js.low),lowest:el(Js.lowest)};class QS{constructor(e,n){this.inner=e,this.prec=n}}class cd{of(e){return new tg(this,e)}reconfigure(e){return cd.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class tg{constructor(e,n){this.compartment=e,this.inner=n}}class Hu{constructor(e,n,r,i,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let i=[],s=Object.create(null),o=new Map;for(let d of nD(e,n,o))d instanceof yr?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(m=>d.slot(m));let u=r?.config.facets;for(let d in s){let m=s[d],g=m[0].facet,p=u&&u[d]||[];if(m.every(O=>O.type==0))if(a[g.id]=l.length<<1|1,Wp(p,m))l.push(r.facet(g));else{let O=g.combine(m.map(v=>v.value));l.push(r&&g.compare(O,r.facet(g))?r.facet(g):O)}else{for(let O of m)O.type==0?(a[O.id]=l.length<<1|1,l.push(O.value)):(a[O.id]=c.length<<1,c.push(v=>O.dynamicSlot(v)));a[g.id]=c.length<<1,c.push(O=>tD(O,g,m))}}let h=c.map(d=>d(a));return new Hu(e,o,h,a,l,s)}}function nD(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(o,a){let l=i.get(o);if(l!=null){if(l<=a)return;let c=r[l].indexOf(o);c>-1&&r[l].splice(c,1),o instanceof tg&&n.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let c of o)s(c,a);else if(o instanceof tg){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;n.set(o.compartment,c),s(c,a)}else if(o instanceof QS)s(o.inner,o.prec);else if(o instanceof yr)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof Eu)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,Js.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,a)}}return s(t,Js.default),r.reduce((o,a)=>o.concat(a))}function yl(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function Ku(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const CS=Ze.define(),ng=Ze.define({combine:t=>t.some(e=>e),static:!0}),TS=Ze.define({combine:t=>t.length?t[0]:void 0,static:!0}),AS=Ze.define(),ES=Ze.define(),DS=Ze.define(),MS=Ze.define({combine:t=>t.length?t[0]:!1});class $r{constructor(e,n){this.type=e,this.value=n}static define(){return new rD}}class rD{of(e){return new $r(this,e)}}class iD{constructor(e){this.map=e}of(e){return new yt(this,e)}}class yt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new yt(this.type,n)}is(e){return this.type==e}static define(e={}){return new iD(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}yt.reconfigure=yt.define();yt.appendConfig=yt.define();let Bn=class dl{constructor(e,n,r,i,s,o){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&PS(r,n.newLength),s.some(a=>a.type==dl.time)||(this.annotations=s.concat(dl.time.of(Date.now())))}static create(e,n,r,i,s,o){return new dl(e,n,r,i,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(dl.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}};Bn.time=$r.define();Bn.userEvent=$r.define();Bn.addToHistory=$r.define();Bn.remote=$r.define();function sD(t,e){let n=[];for(let r=0,i=0;;){let s,o;if(r=t[r]))s=t[r++],o=t[r++];else if(i=0;i--){let s=r[i](t);s instanceof Bn?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Bn?t=s[0]:t=LS(e,ra(s),!1)}return t}function aD(t){let e=t.startState,n=e.facet(DS),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=RS(r,rg(e,s,t.changes.newLength),!0))}return r==t?t:Bn.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const lD=[];function ra(t){return t==null?lD:Array.isArray(t)?t:[t]}var Zt=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Zt||(Zt={}));const cD=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ig;try{ig=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function uD(t){if(ig)return ig.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||cD.test(n)))return!0}return!1}function hD(t){return e=>{if(!/\S/.test(e))return Zt.Space;if(uD(e))return Zt.Word;for(let n=0;n-1)return Zt.Word;return Zt.Other}}class ot{constructor(e,n,r,i,s,o){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;ai.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(yt.reconfigure)?(n=null,r=a.value):a.is(yt.appendConfig)&&(n=null,r=ra(r).concat(a.value));let s;n?s=e.startState.values.slice():(n=Hu.resolve(r,i,this),s=new ot(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let o=e.startState.facet(ng)?e.newSelection:e.newSelection.asSingle();new ot(n,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Oe.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],o=ra(r.effects);for(let a=1;ao.spec.fromJSON(a,l)))}}return ot.create({doc:e.doc,selection:Oe.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Hu.resolve(e.extensions||[],new Map),r=e.doc instanceof bt?e.doc:bt.of((e.doc||"").split(n.staticFacet(ot.lineSeparator)||Hm)),i=e.selection?e.selection instanceof Oe?e.selection:Oe.single(e.selection.anchor,e.selection.head):Oe.single(0);return PS(i,r.length),n.staticFacet(ng)||(i=i.asSingle()),new ot(n,r,i,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(ot.tabSize)}get lineBreak(){return this.facet(ot.lineSeparator)||` `}get readOnly(){return this.facet(MS)}phrase(e,...n){for(let r of this.facet(ot.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(CS))for(let o of s(this,n,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return hD(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=fn(n,o,!1);if(s(n.slice(l,o))!=Zt.Word)break;o=l}for(;at.length?t[0]:4});ot.lineSeparator=TS;ot.readOnly=MS;ot.phrases=Ze.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});ot.languageData=CS;ot.changeFilter=AS;ot.transactionFilter=ES;ot.transactionExtender=DS;cd.reconfigure=yt.define();function Fs(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class xs{eq(e){return this==e}range(e,n=e){return sg.create(e,n,this)}}xs.prototype.startSide=xs.prototype.endSide=0;xs.prototype.point=!1;xs.prototype.mapMode=Tn.TrackDel;function Yp(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let sg=class IS{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new IS(e,n,r)}};function og(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Up{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let l=o+a>>1,c=s[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==o)return c>=0?o:a;c>=0?a=l:o=l+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(r,1e9,!1,s);sm||d==m&&c.startSide>0&&c.endSide<=0)continue;(m-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(a=Math.max(a,m-d)),r.push(c),i.push(d-o),s.push(m-o))}return{mapped:r.length?new Up(i,s,r,a):null,pos:o}}}class ft{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new ft(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(og)),this.isEmpty)return n.length?ft.of(n):this;let a=new XS(this,null,-1).goto(0),l=0,c=[],u=new Ss;for(;a.value||l=0){let h=n[l++];u.addInner(h.from,h.to,h.value)||c.push(h)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||sa.to||s=s&&e<=s+o.length&&o.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Rl.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Rl.from(e).goto(n)}static compare(e,n,r,i,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),a=n.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),l=$0(o,a,r),c=new tl(o,l,s),u=new tl(a,l,s);r.iterGaps((h,d,m)=>G0(c,h,u,d,m,i)),r.empty&&r.length==0&&G0(c,0,u,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),o=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=$0(s,o),l=new tl(s,a,0).goto(r),c=new tl(o,a,0).goto(r);for(;;){if(l.to!=c.to||!ag(l.active,c.active)||l.point&&(!c.point||!Yp(l.point,c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,n,r,i,s=-1){let o=new tl(e,null,s).goto(n),a=n,l=o.openStart;for(;;){let c=Math.min(o.to,r);if(o.point){let u=o.activeForPoint(o.to),h=o.pointFroma&&(i.span(a,c,o.active,l),l=o.openEnd(c));if(o.to>r)return l+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,n=!1){let r=new Ss;for(let i of e instanceof sg?[e]:n?dD(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return ft.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=ft.empty;i=i.nextLayer)n=new ft(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}ft.empty=new ft([],[],null,-1);function dD(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(og);e=r}return t}ft.empty.nextLayer=ft.empty;class Ss{finishChunk(e){this.chunks.push(new Up(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Ss)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(ft.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=ft.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function $0(t,e,n){let r=new Map;for(let s of t)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&i.push(new XS(o,n,r,s));return i.length==1?i[0]:new Rl(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)bf(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)bf(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),bf(this.heap,0)}}}function bf(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class tl{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Rl.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Kc(this.active,e),Kc(this.activeTo,e),Kc(this.activeRank,e),this.minActive=H0(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n0;)n++;Jc(this.active,n,r),Jc(this.activeTo,n,i),Jc(this.activeRank,n,s),e&&Jc(e,n,this.cursor.from),this.minActive=H0(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Kc(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[i]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function G0(t,e,n,r,i,s){t.goto(e),n.goto(r);let o=r+i,a=r,l=r-e,c=!!s.boundChange;for(let u=!1;;){let h=t.to+l-n.to,d=h||t.endSide-n.endSide,m=d<0?t.to+l:n.to,g=Math.min(m,o);if(t.point||n.point?(t.point&&n.point&&Yp(t.point,n.point)&&ag(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(a,g,t.point,n.point),u=!1):(u&&s.boundChange(a),g>a&&!ag(t.active,n.active)&&s.compareRange(a,g,t.active,n.active),c&&go)break;a=m,d<=0&&t.next(),d>=0&&n.next()}}function ag(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function H0(t,e){let n=-1,r=1e9;for(let i=0;i=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=fn(t,i)}return t.length}const lg="ͼ",K0=typeof Symbol>"u"?"__"+lg:Symbol.for(lg),cg=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),J0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ws{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,c){let u=[],h=/^@(\w+)\b/.exec(o[0]),d=h&&h[1]=="keyframes";if(h&&a==null)return l.push(o[0]+";");for(let m in a){let g=a[m];if(/&/.test(m))s(m.split(/,\s*/).map(p=>o.map(O=>p.replace(/&/,O))).reduce((p,O)=>p.concat(O)),g,l);else if(g&&typeof g=="object"){if(!h)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(i(m),g,u,d)}else g!=null&&u.push(m.replace(/_.*/,"").replace(/[A-Z]/g,p=>"-"+p.toLowerCase())+": "+g+";")}(u.length||d)&&l.push((r&&!h&&!c?o.map(r):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=J0[K0]||1;return J0[K0]=e+1,lg+e.toString(36)}static mount(e,n,r){let i=e[cg],s=r&&r.nonce;i?s&&i.setNonce(s):i=new mD(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let eb=new Map;class mD{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=eb.get(r);if(s)return e[cg]=s;this.sheet=new i.CSSStyleSheet,eb.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[cg]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let o=0;o-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),r)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},gD=typeof navigator<"u"&&/Mac/.test(navigator.platform),pD=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var yn=0;yn<10;yn++)ks[48+yn]=ks[96+yn]=String(yn);for(var yn=1;yn<=24;yn++)ks[yn+111]="F"+yn;for(var yn=65;yn<=90;yn++)ks[yn]=String.fromCharCode(yn+32),Ll[yn]=String.fromCharCode(yn);for(var yf in ks)Ll.hasOwnProperty(yf)||(Ll[yf]=ks[yf]);function OD(t){var e=gD&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||pD&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ll:ks)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function un(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e2);var Xe={mac:nb||/Mac/.test(Vn.platform),windows:/Win/.test(Vn.platform),linux:/Linux|X11/.test(Vn.platform),ie:ud,ie_version:NS?ug.documentMode||6:dg?+dg[1]:hg?+hg[1]:0,gecko:tb,gecko_version:tb?+(/Firefox\/(\d+)/.exec(Vn.userAgent)||[0,0])[1]:0,chrome:!!xf,chrome_version:xf?+xf[1]:0,ios:nb,android:/Android\b/.test(Vn.userAgent),webkit_version:vD?+(/\bAppleWebKit\/(\d+)/.exec(Vn.userAgent)||[0,0])[1]:0,safari:fg,safari_version:fg?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Vn.userAgent)||[0,0])[1]:0,tabSize:ug.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function qp(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Ju=Object.create(null);function $p(t,e,n){if(t==e)return!0;t||(t=Ju),e||(e=Ju);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function bD(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function rb(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function yD(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new bo(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=VS(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(o?n?2e8:1:-6e8)+1}return new bo(e,r,i,n,e.widget||null,!0)}static line(e){return new _c(e)}static set(e,n=!1){return ft.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ze.none=ft.empty;class kc extends ze{constructor(e){let{start:n,end:r}=VS(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?qp(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Ju}eq(e){return this==e||e instanceof kc&&this.tagName==e.tagName&&$p(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}kc.prototype.point=!1;class _c extends ze{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof _c&&this.spec.class==e.spec.class&&$p(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}_c.prototype.mapMode=Tn.TrackBefore;_c.prototype.point=!0;class bo extends ze{constructor(e,n,r,i,s,o){super(n,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?n<=0?Tn.TrackBefore:Tn.TrackAfter:Tn.TrackDel}get type(){return this.startSide!=this.endSide?Sn.WidgetRange:this.startSide<=0?Sn.WidgetBefore:Sn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof bo&&xD(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}bo.prototype.point=!0;function VS(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function xD(t,e){return t==e||!!(t&&e&&t.compare(e))}function ia(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class Il extends xs{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof Il&&this.tagName==e.tagName&&$p(this.attributes,e.attributes)}static create(e){return new Il(e.tagName,e.attributes||Ju)}static set(e,n=!1){return ft.of(e,n)}}Il.prototype.startSide=Il.prototype.endSide=-1;function Xl(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function mg(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function xl(t,e){if(!e.anchorNode)return!1;try{return mg(t,e.anchorNode)}catch{return!1}}function Sl(t){return t.nodeType==3?Nl(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function wl(t,e,n,r){return n?ib(t,e,n,r,-1)||ib(t,e,n,r,1):!1}function _s(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function eh(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function ib(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Bi(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=_s(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Bi(t):0}else return!1}}function Bi(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Zl(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function SD(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function FS(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function wD(t,e,n,r,i,s,o,a){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,h=!1;u&&!h;)if(u.nodeType==1){let d,m=u==l.body,g=1,p=1;if(m)d=SD(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(h=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let w=u.getBoundingClientRect();({scaleX:g,scaleY:p}=FS(u,w)),d={left:w.left,right:w.left+u.clientWidth*g,top:w.top,bottom:w.top+u.clientHeight*p}}let O=0,v=0;if(i=="nearest")e.top0&&e.bottom>d.bottom+v&&(v=e.bottom-d.bottom+o)):e.bottom>d.bottom&&(v=e.bottom-d.bottom+o,n<0&&e.top-v0&&e.right>d.right+O&&(O=e.right-d.right+s)):e.right>d.right&&(O=e.right-d.right+s,n<0&&e.leftd.bottom||e.leftd.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function jS(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||r)&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class kD{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?Bi(n):0),r,Math.min(e.focusOffset,r?Bi(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Ks=null;Xe.safari&&Xe.safari_version>=26&&(Ks=!1);function BS(t){if(t.setActive)return t.setActive();if(Ks)return t.focus(Ks);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Ks==null?{get preventScroll(){return Ks={preventScroll:!0},!0}}:void 0),!Ks){Ks=!1;for(let n=0;nMath.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function WS(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Bi(n)}else if(n.parentNode&&!eh(n))r=_s(n),n=n.parentNode;else return null}}function YS(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r=n){if(a.level==r)return o;(s<0||(i!=0?i<0?a.fromn:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function $S(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;p-=3)if(ni[p+1]==-m){let O=ni[p+2],v=O&2?i:O&4?O&1?s:i:0;v&&(Dt[h]=Dt[ni[p]]=v),a=p;break}}else{if(ni.length==189)break;ni[a++]=h,ni[a++]=d,ni[a++]=l}else if((g=Dt[h])==2||g==1){let p=g==i;l=p?0:1;for(let O=a-3;O>=0;O-=3){let v=ni[O+2];if(v&2)break;if(p)ni[O+2]|=2;else{if(v&4)break;ni[O+2]|=4}}}}}function DD(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let o=i?n[i-1].to:t,a=il;)g==O&&(g=n[--p].from,O=p?n[p-1].to:t),Dt[--g]=m;l=u}else s=c,l++}}}function pg(t,e,n,r,i,s,o){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;ll&&o.push(new fi(l,p.from,m));let O=p.direction==yo!=!(m%2);Og(t,O?r+1:r,i,p.inner,p.from,p.to,o),l=p.to}g=p.to}else{if(g==n||(u?Dt[g]!=a:Dt[g]==a))break;g++}d?pg(t,l,g,r+1,i,d,o):le;){let u=!0,h=!1;if(!c||l>s[c-1].to){let p=Dt[l-1];p!=a&&(u=!1,h=p==16)}let d=!u&&a==1?[]:null,m=u?r:r+1,g=l;e:for(;;)if(c&&g==s[c-1].to){if(h)break e;let p=s[--c];if(!u)for(let O=p.from,v=c;;){if(O==e)break e;if(v&&s[v-1].to==O)O=s[--v].from;else{if(Dt[O-1]==a)break e;break}}if(d)d.push(p);else{p.toDt.length;)Dt[Dt.length]=256;let r=[],i=e==yo?0:1;return Og(t,i,i,n,0,t.length,r),r}function GS(t){return[new fi(0,t,0)]}let HS="";function RD(t,e,n,r,i){var s;let o=r.head-t.from,a=fi.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),l=e[a],c=l.side(i,n);if(o==c){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],o=l.side(!i,n),c=l.side(i,n)}let u=fn(t.text,o,l.forward(i,n));(ul.to)&&(u=c),HS=t.text.slice(Math.min(o,u),Math.max(o,u));let h=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return h&&u==c&&h.level+(i?0:1)t.some(e=>e)}),sw=Ze.define({combine:t=>t.some(e=>e)}),ow=Ze.define();class oa{constructor(e,n="nearest",r="nearest",i=5,s=5,o=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new oa(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new oa(Oe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const eu=yt.define({map:(t,e)=>t.map(e)}),aw=yt.define();function mi(t,e,n){let r=t.facet(tw);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Li=Ze.define({combine:t=>t.length?t[0]:!0});let ID=0;const Ho=Ze.define({combine(t){return t.filter((e,n)=>{for(let r=0;r{let l=[];return o&&l.push(hd.of(c=>{let u=c.plugin(a);return u?o(u):ze.none})),s&&l.push(s(a)),l})}static fromClass(e,n){return nn.define((r,i)=>new e(r,i),n)}}class Sf{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(mi(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){mi(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){mi(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const lw=Ze.define(),Jp=Ze.define(),hd=Ze.define(),cw=Ze.define(),eO=Ze.define(),Pc=Ze.define(),uw=Ze.define();function ob(t,e){let n=t.state.facet(uw);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return ft.spans(r,e.from,e.to,{point(){},span(s,o,a,l){let c=s-e.from,u=o-e.from,h=i;for(let d=a.length-1;d>=0;d--,l--){let m=a[d].spec.bidiIsolate,g;if(m==null&&(m=LD(e.text,c,u)),l>0&&h.length&&(g=h[h.length-1]).to==c&&g.direction==m)g.to=u,h=g.inner;else{let p={from:c,to:u,direction:m,inner:[]};h.push(p),h=p.inner}}}}),i}const hw=Ze.define();function dw(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(hw)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:n,top:r,bottom:i}}const fl=Ze.define();class wr{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new wr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toAi.push(new wr(s,o,a,l))),this.changedRanges=i}static create(e,n,r){return new th(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const XD=[];class Yt{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return XD}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&bD(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=_s(this.dom),i=this.length?e>0:n>0;return new Nr(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof fd)return e;return null}static get(e){return e.cmTile}}class dd extends Yt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,i,s=e?.node==n?e:null,o=0;for(let a of this.children){if(a.sync(e),o+=a.length+a.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=a.dom&&(s.written=!0),a.dom.parentNode==n)for(;i&&i!=a.dom;)i=ab(i);else n.insertBefore(a.dom,i);r=a.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=ab(i);this.length=o}}function ab(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class fd extends dd{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Yt.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let o=r.children[i++];if(o instanceof Xi)n.push(i),r=o,i=0;else{let a=s+o.length,l=e(o,s);if(l!==void 0)return l;s=a+o.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,o=-1;if(this.blockTiles((a,l)=>{let c=l+a.length;if(e>=l&&e<=c){if(a.isWidget()&&n>=-1&&n<=1){if(a.flags&32)return!0;a.flags&16&&(r=void 0)}(le||e==l&&(n>1?a.length:a.covers(-1)))&&(!s||!a.isWidget()&&s.isWidget())&&(s=a,o=e-l)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:o}}}class Xi extends dd{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new Xi(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class ma extends dd{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new ma(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,s=-1,o=null,a=-1;function l(u,h){for(let d=0,m=0;d=h&&(g.isComposite()?l(g,h-m):(!o||o.isHidden&&(n>0||r&&ND(o,g)))&&(p>h||g.flags&32)?(o=g,a=h-m):(mr&&(e=r);let i=e,s=e,o=0;e==0&&n<0||e==r&&n>=0?Xe.chrome||Xe.gecko||(e?(i--,o=1):s=0)?0:a.length-1];return Xe.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),o?Zl(l,o<0):l||null}static of(e,n){let r=new so(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class xo extends Yt{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return Zl(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let a=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=a?s.length-1:0;o=s[l],!(e>0?l==0:l==s.length-1||o.top0;)if(i.isComposite())if(o){if(!e)break;r&&r.break(),e--,o=!1}else if(s==i.children.length){if(!e&&!a.length)break;r&&r.leave(i),o=!!i.breakAfter,{tile:i,index:s}=a.pop(),s++}else{let l=i.children[s],c=l.breakAfter;(n>0?l.length<=e:l.length=0;a--){let l=n.marks[a],c=i.lastChild;if(c instanceof Un&&c.mark.eq(l.mark))c.dom!=l.dom&&c.setDOM(wf(l.dom)),i=c;else{if(this.cache.reused.get(l)){let h=Yt.get(l.dom);h&&h.setDOM(wf(l.dom))}let u=Un.of(l.mark,l.dom);i.append(u),i=u}this.cache.reused.set(l,2)}let s=Yt.get(e.text);s&&this.cache.reused.set(s,2);let o=new so(e.text,e.text.nodeValue);o.flags|=8,i.append(o)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=fw);let i=ma.start(e,n||((r=this.cache.find(ma))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],a;if(n>0&&(a=i.lastChild)&&a instanceof Un&&a.mark.eq(o))i=a,n--;else{let l=Un.of(o,(r=this.cache.find(Un,c=>c.mark.eq(o)))===null||r===void 0?void 0:r.dom);i.append(l),i=l,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!lb(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Xe.ios&&lb(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(kf,0,32)||new xo(kf.toDOM(),0,kf,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to=this.pos){let n=new FD(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.fromo.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(nh,void 0,1);return r&&(r.flags=n),r||new nh(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class BD{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=i;let a=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,a)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const rh=[xo,ma,so,Un,nh,Xi,fd];for(let t=0;t[]),this.index=rh.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,s=this.buckets[i],o=this.index[i];for(let a=s.length-1;a>=0;a--){let l=(a+o)%s.length,c=s[l];if((!n||n(c))&&!this.reused.has(c))return s.splice(l,1),l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,o=0;;){let a=oi){let c=l-i;this.preserve(c,!o,!a),i=l,s+=c}if(!a)break;n&&a.fromA<=n.range.fromA&&a.toA>=n.range.toA?(this.forward(a.fromA,n.range.fromA,n.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let c=l>0||a{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Un&&i.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?i.length&&(i.length=s=0):o instanceof Un&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,s=0,o=ft.spans(this.decorations,e,n,{point:(a,l,c,u,h,d)=>{if(c instanceof bo){if(this.disallowBlockEffectsFor[d]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=u.length,h>u.length)i.continueWidget(l-a);else{let m=c.widget||(c.block?ga.block:ga.inline),g=YD(c),p=this.cache.findWidget(m,l-a,g)||xo.of(m,this.view,l-a,g);c.block?(c.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(p)):(i.ensureLine(r),i.addInlineWidget(p,u,h))}r=null}else r=UD(r,c);l>a&&this.text.skip(l-a)},span:(a,l,c,u)=>{for(let h=a;hs,this.openMarks=o}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=Yt.get(i);if(i==this.view.contentDOM)break;s instanceof Un?n.push(s):s?.isLine()?r=s:s instanceof Xi||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new ma(i,fw):r||n.push(Un.of(new kc({tagName:i.nodeName.toLowerCase(),attributes:yD(i)}),i)))}return{line:r,marks:n}}}function lb(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function YD(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const fw={class:"cm-line"};function UD(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&qp(n,t),r&&(t.class+=" "+r)),t}function qD(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof Un&&e.push(r.mark)}return e}function wf(t){let e=Yt.get(t);return e&&e.setDOM(t.cloneNode()),t}class ga extends Gr{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}ga.inline=new ga("span");ga.block=new ga("div");const kf=new class extends Gr{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class cb{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=ze.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new fd(e,e.contentDOM),this.updateInner([new wr(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!r5(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?GD(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:h}=this.hasComposition;r=new wr(u,h,e.changes.mapPos(u,-1),e.changes.mapPos(h,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Xe.ie||Xe.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.blockWrappers;this.updateDeco();let l=JD(o,this.decorations,e.changes);l.length&&(r=wr.extendWithRanges(r,l));let c=t5(a,this.blockWrappers,e.changes);return c.length&&(r=wr.extendWithRanges(r,c)),s&&!r.some(u=>u.fromA<=s.range.fromA&&u.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let o=this.tile,a=new WD(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Yt.get(n.text)&&a.cache.reused.set(Yt.get(n.text),2),this.tile=a.run(e,n),bg(o,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Xe.chrome||Xe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to-1)&&xl(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||o))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c,u;if(l.empty?u=c=this.inlineDOMNearPos(l.anchor,l.assoc||1):(u=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),c=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),Xe.gecko&&l.empty&&!this.hasComposition&&$D(c)){let d=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(d,c.node.childNodes[c.offset]||null)),c=u=new Nr(d,0),a=!0}let h=this.view.observer.selectionRange;(a||!h.focusNode||(!wl(c.node,c.offset,h.anchorNode,h.anchorOffset)||!wl(u.node,u.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{Xe.android&&Xe.chrome&&r.contains(h.focusNode)&&n5(h.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let d=Xl(this.view.root);if(d)if(l.empty){if(Xe.gecko){let m=HD(c.node,c.offset);if(m&&m!=3){let g=(m==1?WS:YS)(c.node,c.offset);g&&(c=new Nr(g.node,g.offset))}}d.collapse(c.node,c.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(c.node,c.offset);try{d.extend(u.node,u.offset)}catch{}}else{let m=document.createRange();l.anchor>l.head&&([c,u]=[u,c]),m.setEnd(u.node,u.offset),m.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(m)}o&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new Nr(h.anchorNode,h.anchorOffset),this.impreciseHead=u.precise?null:new Nr(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&wl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Xl(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let a=o.posAtStart;if(n.head==a||n.head==a+o.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[n];else{let o=Bi(e)==0?0:n==0?-1:1;for(;;){let a=e.parentNode;if(a==r.dom)break;o==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?o=-1:o=1),e=a}o<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!Yt.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let o=0,a=i;;o++){let l=r.children[o];if(l.dom==s)return a;a+=l.length+l.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,s=!1,o,a=-1,l=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(s=!0)}else{let h=u+c.length;if(u<=e&&(r=c,i=e-u,s=h=e&&!o&&(o=c,a=e-u,l=u>e),u>e&&o)return!0}}),!r&&!o?this.domAtPos(e,n):(s&&o?r=null:l&&r&&(o=null),r&&n<0||!o?r.domIn(i,n):o.domIn(a,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof _f?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(s,o){if(s.isComposite())for(let a of s.children){if(a.length>=o){let l=i(a,o);if(l)return l}if(o-=a.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Nt.LTR,c=0,u=(h,d,m)=>{for(let g=0;gi);g++){let p=h.children[g],O=d+p.length,v=p.dom.getBoundingClientRect(),{height:w}=v;if(m&&!g&&(c+=v.top-m.top),p instanceof Xi)O>r&&u(p,d,v);else if(d>=r&&(c>0&&n.push(-c),n.push(w+c),c=0,o)){let _=p.dom.lastChild,C=_?Sl(_):[];if(C.length){let T=C[C.length-1],S=l?T.right-v.left:v.right-T.left;S>a&&(a=S,this.minWidth=s,this.minWidthFrom=d,this.minWidthTo=O)}}m&&g==h.children.length-1&&(c+=m.bottom-v.bottom),d=O+p.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Nt.RTL:Nt.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let a=0,l;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=Sl(c.dom);if(u.length!=1)return;a+=u[0].width,l=u[0].height}if(a)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:a/o.length,textHeight:l}}});if(e)return e;let n=document.createElement("div"),r,i,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=Sl(n.firstChild)[0];r=n.getBoundingClientRect().height,i=o&&o.width?o.width/27:7,s=o&&o.height?o.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],o=s?s.from-1:this.view.state.doc.length;if(o>r){let a=(n.lineBlockAt(o).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(ze.replace({widget:new _f(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return ze.set(e)}updateDeco(){let e=1,n=this.view.state.facet(hd).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(eO).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(ft.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof s=="function"?s(this.view):s)}scrollIntoView(e){var n;if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(ow))try{if(u(this.view,e.range,e))return!0}catch(h){mi(this.view.state,h,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),s;if(!i)return;!r.empty&&(s=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let o=dw(this.view),a={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(wD(this.view.scrollDOM,a,r.head1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottomr.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){bg(this.tile)}}function bg(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)bg(r,e)}}function $D(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function mw(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=WS(n.focusNode,n.focusOffset),i=YS(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let a=Yt.get(i.node);if(!a||a.isText()&&a.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let l=Yt.get(r.node);!l||l.isText()&&l.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function GD(t,e,n){let r=mw(t,n);if(!r)return null;let{node:i,from:s,to:o}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||t.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc;return{range:new wr(l.mapPos(s),l.mapPos(o),s,o),text:i}}function HD(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{re.from&&(n=!0)}),n}class _f extends Gr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function i5(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return Oe.cursor(e);s==0?n=1:s==i.length&&(n=-1);let o=s,a=s;n<0?o=fn(i.text,s,!1):a=fn(i.text,s);let l=r(i.text.slice(o,a));for(;o>0;){let c=fn(i.text,o,!1);if(r(i.text.slice(c,o))!=l)break;o=c}for(;at.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);s+=l*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+fD(o,s,t.state.tabSize)}function yg(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.toe)return s;(!i||s.type==Sn.Text&&(i.type!=s.type||(n<0?s.frome)))&&(i=s)}}return i||r}return r}function o5(t,e,n,r){let i=yg(t,e.head,e.assoc||-1),s=!r||i.type!=Sn.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==Nt.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return Oe.cursor(l,n?-1:1)}return Oe.cursor(n?i.to:i.from,n?-1:1)}function ub(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),o=t.textDirectionAt(i.from);for(let a=e,l=null;;){let c=RD(i,s,o,a,n),u=HS;if(!c){if(i.number==(n?t.state.doc.lines:1))return a;u=` `,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function a5(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let o=r(s);return i==Zt.Space&&(i=o),i==o}}function l5(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return Oe.cursor(i,e.assoc);let o=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),u=t.documentTop;if(c)o==null&&(o=c.left-l.left),a=s<0?c.top:c.bottom;else{let g=t.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-g.from))),a=(s<0?g.top:g.bottom)+u}let h=l.left+o,d=t.viewState.heightOracle.textHeight>>1,m=r??d;for(let g=0;;g+=d){let p=a+(m+g)*s,O=xg(t,{x:h,y:p},!1,s);if(n?p>l.bottom:pa:w{if(e>s&&ei(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Oe.cursor(r,rt.viewState.docHeight)return new hi(t.state.doc.length,-1);if(c=t.elementAtHeight(l),r==null)break;if(c.type==Sn.Text){if(r<0?c.tot.viewport.to)break;let d=t.docView.coordsAt(r<0?c.from:c.to,r>0?-1:1);if(d&&(r<0?d.top<=l+s:d.bottom>=l+s))break}let h=t.viewState.heightOracle.textHeight/2;l=r>0?c.bottom+h:c.top-h}if(t.viewport.from>=c.to||t.viewport.to<=c.from){if(n)return null;if(c.type==Sn.Text){let h=s5(t,i,c,o,a);return new hi(h,h==c.from?1:-1)}}if(c.type!=Sn.Text)return l<(c.top+c.bottom)/2?new hi(c.from,1):new hi(c.to,-1);let u=t.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=t.docView.lineAt(c.from,-2)),new c5(t,o,a,t.textDirectionAt(c.from)).scanTile(u,c.from)}class c5{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from>1;t:if(s.has(g)){let O=r+Math.floor(Math.random()*m);for(let v=0;v1)){if(v.bottomthis.y)(!l||l.top>v.top)&&(l=v),w=-1;else{let _=v.left>this.x?this.x-v.left:v.right(h.left+h.right)/2==d}}scanText(e,n){let r=[];for(let s=0;s{let o=r[s]-n,a=r[s+1]-n;return Nl(e.dom,o,a).getClientRects()});return i.after?new hi(r[i.i+1],-1):new hi(r[i.i],1)}scanTile(e,n){if(!e.length)return new hi(n,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,n);if(a.isComposite())return this.scanTile(a,n)}let r=[n];for(let a=0,l=n;a{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:Nl(l.dom,0,l.length)).getClientRects()}),s=e.children[i.i],o=r[i.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):i.after?new hi(r[i.i+1],-1):new hi(o,1)}}const Yo="￿";class u5{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(ot.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Yo}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let o=Yt.get(i),a=i.nextSibling;if(a==n){o?.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let l=Yt.get(a);(o&&l?o.breakAfter:(o?o.breakAfter:eh(i))||eh(a)&&(i.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!d5(a,n)&&this.lineBreak(),i=a}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(n))&&(s=a.index,o=a[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);r=s+o}}readNode(e){let n=Yt.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(h5(e,r.node,r.offset)?n:0))}}function h5(t,e,n){for(;;){if(!e||n-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,a=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=pw(e.docView.tile,n,r,0))){let l=s||o?[]:g5(e),c=new u5(l,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=p5(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!mg(e.contentDOM,l.focusNode)?a.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),u=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!mg(e.contentDOM,l.anchorNode)?a.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((Xe.ios||Xe.chrome)&&a.main.empty&&c!=u&&(h.from>0||h.to-1&&a.ranges.length>1)this.newSel=a.replaceRange(Oe.range(u,c));else if(e.lineWrapping&&u==c&&!(a.main.empty&&a.main.head==c)&&e.inputState.lastTouchTime>Date.now()-100){let d=e.coordsAtPos(c,-1),m=0;d&&(m=e.inputState.lastTouchY<=d.bottom?-1:1),this.newSel=Oe.create([Oe.cursor(c,m)])}else this.newSel=Oe.single(u,c)}}}function pw(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,o=-1,a=-1;for(let l=0,c=r,u=r;ln)return pw(h,e,n,c);if(d>=e&&i==-1&&(i=l,s=c),c>n&&h.dom.parentNode==t.dom){o=l,a=u;break}u=d,c=d+h.breakAfter}return{from:s,to:a<0?r+t.length:a,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o=0?t.children[o].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function Ow(t,e){let n,{newSel:r}=e,{state:i}=t,s=i.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:l}=e.bounds,c=s.from,u=null;(o===8||Xe.android&&e.text.length=a&&s.to<=l&&(e.typeOver||h!=e.text)&&h.slice(0,s.from-a)==e.text.slice(0,s.from-a)&&h.slice(s.to-a)==e.text.slice(d=e.text.length-(h.length-(s.to-a)))?n={from:s.from,to:s.to,insert:bt.of(e.text.slice(s.from-a,d).split(Yo))}:(m=vw(h,e.text,c-a,u))&&(Xe.chrome&&o==13&&m.toB==m.from+2&&e.text.slice(m.from,m.toB)==Yo+Yo&&m.toB--,n={from:a+m.from,to:a+m.toA,insert:bt.of(e.text.slice(m.from,m.toB).split(Yo))})}else r&&(!t.hasFocus&&i.facet(Li)||ih(r,s))&&(r=null);if(!n&&!r)return!1;if((Xe.mac||Xe.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Oe.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:bt.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(s.from).toDate.now()-50?n={from:s.from,to:s.to,insert:i.toText(t.inputState.insertingText)}:Xe.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` `&&t.lineWrapping&&(r&&(r=Oe.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:bt.of([" "])}),n)return tO(t,n,r,o);if(r&&!ih(r,s)){let a=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=gw(i.facet(Pc).map(c=>c(t)),r))),t.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function tO(t,e,n,r=-1){if(Xe.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(Xe.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&sa(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.lengthi.head)&&sa(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&sa(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,a=()=>o||(o=m5(t,e,n));return t.state.facet(nw).some(l=>l(t,e.from,e.to,s,a))||t.dispatch(a()),!0}function m5(t,e,n){let r,i=t.state,s=i.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let l=e.fromh(t)),c,l);e.from==u&&(o=u)}if(o>-1)r={changes:e,selection:Oe.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let l=s.frome.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(l+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let l=i.changes(e),c=n&&n.main.to<=l.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let u=t.state.sliceDoc(e.from,e.to),h,d=n&&mw(t,n.main.head);if(d){let g=e.insert.length-(e.to-e.from);h={from:d.from,to:d.to-g}}else h=t.state.doc.lineAt(s.head);let m=s.to-e.to;r=i.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:l,range:c||g.map(l)};let p=g.to-m,O=p-u.length;if(t.state.sliceDoc(O,p)!=u||p>=h.from&&O<=h.to)return{range:g};let v=i.changes({from:O,to:p,insert:e.insert}),w=g.to-s.to;return{changes:v,range:c?Oe.range(Math.max(0,c.anchor+w),Math.max(0,c.head+w)):g.map(v)}})}else r={changes:l,selection:c&&i.selection.replaceRange(c)}}let a="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function vw(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s0&&a>0&&t.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,s-Math.min(o,a));n-=o+l-s}if(o=o?s-n:0;s-=l,a=s+(a-o),o=s}else if(a=a?s-n:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function g5(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new hb(n,r)),(i!=n||s!=r)&&e.push(new hb(i,s))),e}function p5(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Oe.single(n+e,r+e):null}function ih(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class O5{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Xe.safari&&e.contentDOM.addEventListener("input",()=>null),Xe.gecko&&D5(e.contentDOM.ownerDocument)}handleEvent(e){!_5(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=v5(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&yw.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Xe.android&&Xe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Xe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((n=bw.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||b5.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:Xe.safari&&!Xe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function db(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){mi(n.state,i)}}}function v5(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,o=i&&i.plugin.domEventObservers;if(s)for(let a in s){let l=s[a];l&&n(a).handlers.push(db(r.value,l))}if(o)for(let a in o){let l=o[a];l&&n(a).observers.push(db(r.value,l))}}for(let r in Br)n(r).handlers.push(Br[r]);for(let r in er)n(r).observers.push(er[r]);return e}const bw=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],b5="dthko",yw=[16,17,18,20,91,92,224,225],tu=6;function nu(t){return Math.max(0,t)*.7+8}function y5(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class x5{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=jS(e.contentDOM),this.atoms=e.state.facet(Pc).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(ot.allowMultipleSelections)&&S5(e,n),this.dragging=k5(e,n)&&ww(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&y5(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=dw(this.view);e.clientX-l.left<=i+tu?n=-nu(i-e.clientX):e.clientX+l.right>=o-tu&&(n=nu(e.clientX-o)),e.clientY-l.top<=s+tu?r=-nu(s-e.clientY):e.clientY+l.bottom>=a-tu&&(r=nu(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=gw(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function S5(t,e){let n=t.state.facet(KS);return n.length?n[0](e):Xe.mac?e.metaKey:e.ctrlKey}function w5(t,e){let n=t.state.facet(JS);return n.length?n[0](e):Xe.mac?!e.altKey:!e.ctrlKey}function k5(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Xl(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function _5(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Yt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Br=Object.create(null),er=Object.create(null),xw=Xe.ie&&Xe.ie_version<15||Xe.ios&&Xe.webkit_version<604;function P5(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),Sw(t,n.value)},50)}function md(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function Sw(t,e){e=md(t.state,Hp,e);let{state:n}=t,r,i=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(Sg!=null&&n.selection.ranges.every(l=>l.empty)&&Sg==s.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let h=n.toText((o?s.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:h},range:Oe.cursor(c.from+h.length)}})}else o?r=n.changeByRange(l=>{let c=s.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:Oe.cursor(l.from+c.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}er.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};er.wheel=er.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};Br.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);er.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};er.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Br.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(ew))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=C5(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new x5(t,e,n,r)),r&&t.observer.ignore(()=>{BS(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function fb(t,e,n,r){if(r==1)return Oe.cursor(e,n);if(r==2)return i5(t.state,e,n);{let i=t.docView.lineAt(e,n),s=t.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return aDate.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(gb+1)%3:1}function C5(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=ww(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,o,a){let l=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,u=fb(t,l.pos,l.assoc,r);if(n.pos!=l.pos&&!o){let h=fb(t,n.pos,n.assoc,r),d=Math.min(h.from,u.from),m=Math.max(h.to,u.to);u=d1&&(c=T5(i,l.pos))?c:a?i.addRange(u):Oe.create([u])}}}function T5(t,e){for(let n=0;n=e)return Oe.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Br.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,o=s+i.length;(s>=n.to||o<=n.from)&&(n=Oe.range(s,o))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",md(t.state,Kp,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Br.dragend=t=>(t.inputState.draggedContent=null,!1);function Ob(t,e,n,r){if(n=md(t.state,Hp,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=r&&s&&w5(t,e)?{from:s.from,to:s.to}:null,a={from:i,insert:n},l=t.state.changes(o?[o,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Br.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&Ob(t,e,r.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(n[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Ob(t,e,r,!0),!0}return!1};Br.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=xw?null:e.clipboardData;return n?(Sw(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(P5(t),!1)};function A5(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function E5(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>i&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),i=o.number}r=!0}return{text:md(t,Kp,e.join(t.lineBreak)),ranges:n,linewise:r}}let Sg=null;Br.copy=Br.cut=(t,e)=>{if(!xl(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=E5(t.state);if(!n&&!i)return!1;Sg=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=xw?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(A5(t,n),!1)};const kw=$r.define();function _w(t,e){let n=[];for(let r of t.facet(rw)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:kw.of(!0)}):null}function Pw(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=_w(t.state,e);n?t.dispatch(n):t.update([])}},10)}er.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),Pw(t)};er.blur=t=>{t.observer.clearSelectionRange(),Pw(t)};er.compositionstart=er.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};er.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Xe.chrome&&Xe.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};er.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Br.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return tO(t,{from:l,to:c,insert:t.state.toText(s)},null),!0}}let i;if(Xe.chrome&&Xe.android&&(i=bw.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return Xe.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Xe.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>er.compositionend(t,e),20),!1};const vb=new Set;function D5(t){vb.has(t)||(vb.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const bb=["pre-wrap","normal","pre-line","break-spaces"];let pa=!1;function yb(){pa=!1}class M5{constructor(e){this.lineWrapping=e,this.doc=bt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return bb.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,l=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=a||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,l){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Du&&(pa=!0),this.height=e)}replace(e,n,r){return zn.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,o=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:h}=i[a],d=s.lineAt(l,Lt.ByPosNoHeight,r.setDoc(n),0,0),m=d.to>=c?d:s.lineAt(c,Lt.ByPosNoHeight,r,0,0);for(h+=m.to-c,c=m.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,ls*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(s>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(i=s&&o(this.lineAt(0,Lt.ByPos,r,i,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class hr extends Qw{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new Zr(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof hr||i instanceof bn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof bn?i=new hr(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):zn.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class bn extends zn{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:a}}blockAt(e,n,r,i){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e0){let s=r[r.length-1];s instanceof bn?r[r.length-1]=new bn(s.length+i):r.push(null,new bn(i-1))}if(e>0){let s=r[0];s instanceof bn?r[0]=new bn(e+s.length):r.unshift(new bn(e-1),null)}return zn.of(r)}decomposeLeft(e,n){n.push(new bn(e-1),null)}decomposeRight(e,n){n.push(null,new bn(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let o=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&o.push(new bn(i.from-n-1).updateHeight(e,n));a<=s&&i.more;){let u=e.doc.lineAt(a).length;o.length&&o.push(null);let h=i.heights[i.index++],d=0;h<0&&(d=-h,h=i.heights[i.index++]),l==-1?l=h:Math.abs(h-l)>=Du&&(l=-2);let m=new hr(u,h,d);m.outdated=!1,o.push(m),a+=u+1}a<=s&&o.push(null,new bn(s-a).updateHeight(e,a));let c=zn.of(o);return(l<0||Math.abs(c.height-this.height)>=Du||Math.abs(l-this.heightMetrics(e,n).perLine)>=Du)&&(pa=!0),sh(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class I5 extends zn{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return ea))return c;let u=n==Lt.ByPosNoHeight?Lt.ByPosNoHeight:Lt.ByPos;return l?c.join(this.right.lineAt(a,u,r,o,a)):this.left.lineAt(a,u,r,i,s).join(c)}forEachLine(e,n,r,i,s,o){let a=i+this.left.height,l=s+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,n,r,a,l,o);else{let c=this.lineAt(l,Lt.ByPos,r,i,s);e=e&&c.from<=n&&o(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,o)}}replace(e,n,r){let i=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&xb(s,o-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e2*n.size||n.size>2*e.size?zn.of(this.break?[e,null,n]:[e,n]):(this.left=sh(this.left,e),this.right=sh(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:o}=this,a=n+s.length+this.break,l=null;return i&&i.from<=n+s.length&&i.more?l=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=a+o.length&&i.more?l=o=o.updateHeight(e,a,r,i):o.updateHeight(e,a,r),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function xb(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof bn&&(r=t[e+1])instanceof bn&&t.splice(e-1,3,new bn(n.length+1+r.length))}const X5=5;class nO{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof hr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new hr(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=X5)&&this.addLineDeco(i,s,o)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenToe&&this.nodes.push(new hr(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new bn(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof hr)return e;let n=new hr(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof hr)&&!this.isCovered?this.nodes.push(new hr(0,-1,0)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&h.overflow!="visible"){let d=u.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),a=Math.max(a,d.top),l=Math.min(c==t.parentNode?i.innerHeight:l,d.bottom)}c=h.position=="absolute"||h.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function F5(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function j5(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Qf{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;rtypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new M5(r),this.stateDeco=kb(n),this.heightMap=zn.empty().applyChanges(this.stateDeco,bt.empty,this.heightOracle.setDoc(n.doc),[new wr(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ze.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new ru(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?wb:new rO(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(ml(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=kb(this.state);let i=e.changedRanges,s=wr.extendWithRanges(i,Z5(r,this.stateDeco,e?e.changes:on.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);yb(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||pa)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(sw)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Nt.RTL:Nt.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",a=n.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:T,scaleY:S}=FS(n,a);(T>.005&&Math.abs(this.scaleX-T)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=T,this.scaleY=S,c|=16,o=l=!0)}let h=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=d)&&(this.paddingTop=h,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let m=jS(this.view.contentDOM,!1).y;m!=this.scrollParent&&(this.scrollParent=m,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=zS(this.scrollParent||e.win);let p=(this.printing?j5:V5)(n,this.paddingTop),O=p.top-this.pixelViewport.top,v=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(l=!0)),!this.inView&&!this.scrollTarget&&!F5(e.dom))return 0;let _=a.width;if((this.contentDOMWidth!=_||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let T=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(T)&&(o=!0),o||i.lineWrapping&&Math.abs(_-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:Q,textHeight:D}=e.docView.measureTextSize();o=S>0&&i.refresh(s,S,Q,D,Math.max(5,_/Q),T),o&&(e.docView.minWidth=0,c|=16)}O>0&&v>0?u=Math.max(O,v):O<0&&v<0&&(u=Math.min(O,v)),yb();for(let S of this.viewports){let Q=S.from==this.viewport.from?T:e.docView.measureVisibleLineHeights(S);this.heightMap=(o?zn.empty().applyChanges(this.stateDeco,bt.empty,this.heightOracle,[new wr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new R5(S.from,Q))}pa&&(c|=2)}let C=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return C&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new ru(i.lineAt(o-r*1e3,Lt.ByHeight,s,0,0).from,i.lineAt(a+(1-r)*1e3,Lt.ByHeight,s,0,0).to);if(n){let{head:c}=n.range;if(cl.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=i.lineAt(c,Lt.ByPos,s,0,0),d;n.y=="center"?d=(h.top+h.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c=a+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s>1,o=i<<1;if(this.defaultTextDirection!=Nt.LTR&&!r)return[];let a=[],l=(u,h,d,m)=>{if(h-uu&&vv.from>=d.from&&v.to<=d.to&&Math.abs(v.from-u)v.fromw));if(!O){if(h_.from<=h&&_.to>=h)){let _=n.moveToLineBoundary(Oe.cursor(h),!1,!0).head;_>u&&(h=_)}let v=this.gapSize(d,u,h,m),w=r||v<2e6?v:2e6;O=new Qf(u,h,v,w)}a.push(O)},c=u=>{if(u.length2e6)for(let S of e)S.from>=u.from&&S.fromu.from&&l(u.from,m,u,h),gn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];ft.spans(n,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||ml(this.heightMap.lineAt(e,Lt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||ml(this.heightMap.lineAt(this.scaler.fromDOM(e),Lt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return ml(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ru{constructor(e,n){this.from=e,this.to=n}}function z5(t,e,n){let r=[],i=t,s=0;return ft.spans(n,t,e,{span(){},point(o,a){o>i&&(r.push({from:i,to:o}),s+=o-i),i=a}},20),i=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(r<=a)return s+r;r-=a}}function su(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function W5(t,e){for(let n of t)if(e(n))return n}const wb={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function kb(t){let e=t.facet(hd).filter(r=>typeof r!="function"),n=t.facet(eO).filter(r=>typeof r!="function");return n.length&&e.push(ft.join(n)),e}class rO{constructor(e,n,r){let i=0,s=0,o=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,Lt.ByPos,e,0,0).top,u=n.lineAt(l,Lt.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=nn.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function ml(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Zr(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>ml(i,e)):t._content)}const ou=Ze.define({combine:t=>t.join(" ")}),wg=Ze.define({combine:t=>t.indexOf(!0)>-1}),kg=ws.newName(),Cw=ws.newName(),Tw=ws.newName(),Aw={"&light":"."+Cw,"&dark":"."+Tw};function _g(t,e,n){return new ws(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const Y5=_g("."+kg,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Aw),U5={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Cf=Xe.ie&&Xe.ie_version<=11;class q5{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new kD,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(Xe.ie&&Xe.ie_version<=11||Xe.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Xe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Xe.chrome&&Xe.chrome_version<126)&&(this.editContext=new G5(e),e.state.facet(Li)&&(e.contentDOM.editContext=this.editContext.editContext)),Cf&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Li)?r.root.activeElement!=this.dom:!xl(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Xe.ie&&Xe.ie_version<=11||Xe.android&&Xe.chrome)&&!r.state.selection.main.empty&&i.focusNode&&wl(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Xl(e.root);if(!n)return!1;let r=Xe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&$5(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=xl(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&sa(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),n==-1?{from:n,to:r}=o:(n=Math.min(o.from,n),r=Math.max(o.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&xl(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new f5(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=Ow(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!ih(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=_b(n,e.previousSibling||e.target.previousSibling,-1),i=_b(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Li)!=e.state.facet(Li)&&(e.view.contentDOM.editContext=e.state.facet(Li)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function _b(t,e,n){for(;e;){let r=Yt.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function Pb(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return wl(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function $5(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Pb(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?Pb(t,n):null}class G5{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c=l-a>r.text.length;a==this.from&&sthis.to&&(l=s);let u=vw(e.state.sliceDoc(a,l),r.text,(c?i.from:i.to)-a,c?"end":null);if(!u){let d=Oe.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));ih(d,i)||e.dispatch({selection:d,userEvent:"select"});return}let h={from:u.from+a,to:u.toA+a,insert:bt.of(r.text.slice(u.from,u.toB).split(` `))};if((Xe.mac||Xe.android)&&h.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:l,insert:bt.of([r.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let d=this.to-this.from+(h.to-h.from+h.insert.length);tO(e,h,Oe.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(l{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Xl(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,c)=>{if(r)return;let u=c.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=u,this.to+=u;else if(sthis.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ae{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||_D(e.parent)||document,this.viewState=new Sb(this,e.state||ot.create(e)),e.scrollTo&&e.scrollTo.is(eu)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ho).map(i=>new Sf(i));for(let i of this.plugins)i.update(this);this.observer=new q5(this),this.inputState=new O5(this),this.inputState.ensureHandlers(this.plugins),this.docView=new cb(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof Bn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(kw))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=_w(s,o),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(ot.phrases)!=this.state.facet(ot.phrases))return this.setState(s);i=th.create(this,s,e),i.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(h&&(h=h.map(d.changes)),d.scrollIntoView){let{main:m}=d.state.selection;h=new oa(m.empty?m:Oe.cursor(m.head,m.head>m.anchor?-1:1))}for(let m of d.effects)m.is(eu)&&(h=m.value.clip(this.state))}this.viewState.update(i,h),this.bidiCache=oh.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(fl)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(ou)!=i.state.facet(ou)&&(this.viewState.mustMeasureContent=!0),(n||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(vg))try{d(i)}catch(m){mi(this.state,m,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!Ow(this,u)&&c.force&&sa(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new Sb(this,e),this.plugins=e.facet(Ho).map(r=>new Sf(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new cb(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Ho),r=e.state.facet(Ho);if(n!=r){let i=[];for(let s of r){let o=n.indexOf(s);if(o<0)i.push(new Sf(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(zS(r||this.win))s=-1,o=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(i);s=m.from,o=m.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(m=>{try{return m.read(this)}catch(g){return mi(this.state,g),Qb}}),h=th.create(this,this.state,[]),d=!1;h.flags|=l,n?n.flags|=l:n=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),d=this.docView.update(h),d&&this.docViewUpdate());for(let m=0;m1||g<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+g,r?r.scrollTop+=g:this.win.scrollBy(0,g),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(vg))a(n)}get themeClasses(){return kg+" "+(this.state.facet(wg)?Tw:Cw)+" "+this.state.facet(ou)}updateAttrs(){let e=Cb(this,lw,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Li)?"true":"false",class:"cm-content",style:`${Xe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Cb(this,Jp,n);let r=this.observer.ignore(()=>{let i=rb(this.contentDOM,this.contentAttrs,n),s=rb(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(Ae.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(fl);let e=this.state.facet(Ae.cspNonce);ws.mount(this.root,this.styleModules.concat(Y5).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;nr.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return Pf(this,e,ub(this,e,n,r))}moveByGroup(e,n){return Pf(this,e,ub(this,e,n,r=>a5(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return Oe.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return o5(this,e,n,r)}moveVertically(e,n,r){return Pf(this,e,l5(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=xg(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),xg(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[fi.find(s,e-i.from,-1,n)];return Zl(r,o.dir==Nt.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(iw)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>H5)return GS(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||$S(s.isolates,r=ob(this,e))))return s.order;r||(r=ob(this,e));let i=MD(e.text,n,r);return this.bidiCache.push(new oh(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Xe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{BS(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return eu.of(new oa(typeof e=="number"?Oe.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return eu.of(new oa(Oe.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return nn.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return nn.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=ws.newName(),i=[ou.of(r),fl.of(_g(`.${r}`,e))];return n&&n.dark&&i.push(wg.of(!0)),i}static baseTheme(e){return Lo.lowest(fl.of(_g("."+kg,e,Aw)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Yt.get(r)||Yt.get(e);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}Ae.styleModule=fl;Ae.inputHandler=nw;Ae.clipboardInputFilter=Hp;Ae.clipboardOutputFilter=Kp;Ae.scrollHandler=ow;Ae.focusChangeEffect=rw;Ae.perLineTextDirection=iw;Ae.exceptionSink=tw;Ae.updateListener=vg;Ae.editable=Li;Ae.mouseSelectionStyle=ew;Ae.dragMovesSelection=JS;Ae.clickAddsSelectionRange=KS;Ae.decorations=hd;Ae.blockWrappers=cw;Ae.outerDecorations=eO;Ae.atomicRanges=Pc;Ae.bidiIsolatedRanges=uw;Ae.scrollMargins=hw;Ae.darkTheme=wg;Ae.cspNonce=Ze.define({combine:t=>t.length?t[0]:""});Ae.contentAttributes=Jp;Ae.editorAttributes=lw;Ae.lineWrapping=Ae.contentAttributes.of({class:"cm-lineWrapping"});Ae.announce=yt.define();const H5=4096,Qb={};class oh{constructor(e,n,r,i,s,o){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Nt.LTR;for(let s=Math.max(0,e.length-10);s=0;i--){let s=r[i],o=typeof s=="function"?s(t):s;o&&qp(o,n)}return n}const K5=Xe.mac?"mac":Xe.windows?"win":Xe.linux?"linux":"key";function J5(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,o,a;for(let l=0;lr.concat(i),[]))),n}function tM(t,e,n){return Dw(Ew(t.state),e,t,n)}let ls=null;const nM=4e3;function rM(t,e=K5){let n=Object.create(null),r=Object.create(null),i=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,c,u)=>{var h,d;let m=n[o]||(n[o]=Object.create(null)),g=a.split(/ (?!$)/).map(v=>J5(v,e));for(let v=1;v{let C=ls={view:_,prefix:w,scope:o};return setTimeout(()=>{ls==C&&(ls=null)},nM),!0}]})}let p=g.join(" ");i(p,!1);let O=m[p]||(m[p]={preventDefault:!1,stopPropagation:!1,run:((d=(h=m._any)===null||h===void 0?void 0:h.run)===null||d===void 0?void 0:d.slice())||[]});l&&O.run.push(l),c&&(O.preventDefault=!0),u&&(O.stopPropagation=!0)};for(let o of t){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let d in u)u[d].run.push(m=>h(m,Pg))}let l=o[e]||o.key;if(l)for(let c of a)s(c,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return n}let Pg=null;function Dw(t,e,n,r){Pg=e;let i=OD(e),s=Vs(i,0),o=wc(s)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;ls&&ls.view==n&&ls.scope==r&&(a=ls.prefix+" ",yw.indexOf(e.keyCode)<0&&(c=!0,ls=null));let h=new Set,d=O=>{if(O){for(let v of O.run)if(!h.has(v)&&(h.add(v),v(n)))return O.stopPropagation&&(u=!0),!0;O.preventDefault&&(O.stopPropagation&&(u=!0),c=!0)}return!1},m=t[r],g,p;return m&&(d(m[a+au(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Xe.windows&&e.ctrlKey&&e.altKey)&&!(Xe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(g=ks[e.keyCode])&&g!=i?(d(m[a+au(g,e,!0)])||e.shiftKey&&(p=Ll[e.keyCode])!=i&&p!=g&&d(m[a+au(p,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(m[a+au(i,e,!0)])&&(l=!0),!l&&d(m._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),Pg=null,l}class uo{constructor(e,n,r,i,s){this.className=e,this.left=n,this.top=r,this.width=i,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let s=Mw(e);return[new uo(n,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return iM(e,n,r)}}function Mw(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Nt.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function Ab(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let s=t.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,a=t.posAtCoords({x:s.left+1,y:o}),l=t.posAtCoords({x:s.right-1,y:o});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function iM(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),s=t.textDirection==Nt.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),l=Mw(t),c=o.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),h=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),m=yg(t,r,1),g=yg(t,i,-1),p=m.type==Sn.Text?m:null,O=g.type==Sn.Text?g:null;if(p&&(t.lineWrapping||m.widgetLineBreaks)&&(p=Ab(t,r,1,p)),O&&(t.lineWrapping||g.widgetLineBreaks)&&(O=Ab(t,i,-1,O)),p&&O&&p.from==O.from&&p.to==O.to)return w(_(n.from,n.to,p));{let T=p?_(n.from,null,p):C(m,!1),S=O?_(null,n.to,O):C(g,!0),Q=[];return(p||m).to<(O||g).from-(p&&O?1:0)||m.widgetLineBreaks>1&&T.bottom+t.defaultLineHeight/2R&&U.from=Y)break;he>j&&L(Math.max(z,j),T==null&&z<=R,Math.min(he,Y),S==null&&he>=F,N.dir)}if(j=ie.to+1,j>=Y)break}return X.length==0&&L(R,T==null,F,S==null,t.textDirection),{top:D,bottom:I,horizontal:X}}function C(T,S){let Q=a.top+(S?T.top:T.bottom);return{top:Q,bottom:Q,horizontal:[]}}}function sM(t,e){return t.constructor==e.constructor&&t.eq(e)}class oM{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(Mu)!=e.state.facet(Mu)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(Mu);for(;n!sM(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e,Xe.safari&&Xe.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Mu=Ze.define();function Rw(t){return[nn.define(e=>new oM(e,t)),Mu.of(t)]}const Oa=Ze.define({combine(t){return Fs(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function Lw(t={}){return[Oa.of(t),aM,lM,cM,sw.of(!0)]}function Iw(t){return t.startState.facet(Oa)!=t.state.facet(Oa)}const aM=Rw({above:!0,markers(t){let{state:e}=t,n=e.facet(Oa),r=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||n.drawRangeCursor&&!(s&&Xe.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:Oe.cursor(i.head,i.assoc);for(let l of uo.forRange(t,o,a))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=Iw(t);return n&&Eb(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){Eb(e.state,t)},class:"cm-cursorLayer"});function Eb(t,e){e.style.animationDuration=t.facet(Oa).cursorBlinkRate+"ms"}const lM=Rw({above:!1,markers(t){let e=[],{main:n,ranges:r}=t.state.selection;for(let i of r)if(!i.empty)for(let s of uo.forRange(t,"cm-selectionBackground",i))e.push(s);if(Xe.ios&&!n.empty&&t.state.facet(Oa).iosSelectionHandles){for(let i of uo.forRange(t,"cm-selectionHandle cm-selectionHandle-start",Oe.cursor(n.from,1)))e.push(i);for(let i of uo.forRange(t,"cm-selectionHandle cm-selectionHandle-end",Oe.cursor(n.to,1)))e.push(i)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Iw(t)},class:"cm-selectionLayer"}),cM=Lo.highest(Ae.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));function Db(t,e,n,r,i){e.lastIndex=0;for(let s=t.iterRange(n,r),o=n,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)i(o+a.index,a)}function uM(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:s}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=s:r.push({from:i,to:s});return r}class hM{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:s,maxLength:o=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let h=r(a,l,c);h&&u(c,c+a[0].length,h)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let n=new Ss,r=n.add.bind(n);for(let{from:i,to:s}of uM(e,this.maxLength))Db(e.state.doc,this.regexp,i,s,(o,a)=>this.addMatch(a,e,o,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let s of e.visibleRanges){let o=Math.max(s.from,r),a=Math.min(s.to,i);if(a>=o){let l=e.state.doc.lineAt(o),c=l.tol.from;o--)if(this.boundary.test(l.text[o-1-l.from])){u=o;break}for(;ad.push(v.range(p,O));if(l==c)for(this.regexp.lastIndex=u-l.from;(m=this.regexp.exec(l.text))&&m.indexthis.addMatch(O,e,p,g));n=n.update({filterFrom:u,filterTo:h,filter:(p,O)=>ph,add:d})}}return n}}const Qg=/x/.unicode!=null?"gu":"g",dM=new RegExp(`[\0-\b --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Qg),fM={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Tf=null;function mM(){var t;if(Tf==null&&typeof document<"u"&&document.body){let e=document.body.style;Tf=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Tf||!1}const Ru=Ze.define({combine(t){let e=Fs(t,{render:null,specialChars:dM,addSpecialChars:null});return(e.replaceTabs=!mM())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Qg)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Qg)),e}});function gM(t={}){return[Ru.of(t),pM()]}let Mb=null;function pM(){return Mb||(Mb=nn.fromClass(class{constructor(t){this.view=t,this.decorations=ze.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(Ru)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new hM({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,s=Vs(e[0],0);if(s==9){let o=i.lineAt(r),a=n.state.tabSize,l=Pi(o.text,a,r-o.from);return ze.replace({widget:new yM((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=ze.replace({widget:new bM(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(Ru);t.startState.facet(Ru)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const OM="•";function vM(t){return t>=32?OM:t==10?"␤":String.fromCharCode(9216+t)}class bM extends Gr{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=vM(this.code),r=e.state.phrase("Control character")+" "+(fM[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let s=document.createElement("span");return s.textContent=n,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class yM extends Gr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function xM(){return wM}const SM=ze.line({class:"cm-activeLine"}),wM=nn.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(SM.range(i.from)),e=i.from)}return ze.set(n)}},{decorations:t=>t.decorations});class kM extends Gr{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?Sl(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=Zl(n[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function iO(t){let e=nn.fromClass(class{constructor(n){this.view=n,this.placeholder=t?ze.set([ze.widget({widget:new kM(t),side:1}).range(0)]):ze.none}get decorations(){return this.view.state.doc.length?ze.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Ae.contentAttributes.of({"aria-placeholder":t})]:e}const Rb=Ze.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function Xw(t,e){let n=t.plugin(Zw),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const Zw=nn.fromClass(class{constructor(t){this.input=t.state.facet(ah),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(Rb);this.top=new lu(t,!0,e.topContainer),this.bottom=new lu(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(Rb);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new lu(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new lu(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(ah);if(n!=this.input){let r=n.filter(l=>l),i=[],s=[],o=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(t.view),a.push(u)):(u=this.panels[c],u.update&&u.update(t)),i.push(u),(u.top?s:o).push(u)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Ae.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class lu{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=Lb(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=Lb(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Lb(t){let e=t.nextSibling;return t.remove(),e}const ah=Ze.define({enables:Zw});function _M(t,e){let n,r=new Promise(o=>n=o),i=o=>PM(o,e,n);t.state.field(Af,!1)?t.dispatch({effects:Nw.of(i)}):t.dispatch({effects:yt.appendConfig.of(Af.init(()=>[i]))});let s=Vw.of(i);return{close:s,result:r.then(o=>((t.win.queueMicrotask||(l=>t.win.setTimeout(l,10)))(()=>{t.state.field(Af).indexOf(i)>-1&&t.dispatch({effects:s})}),o))}}const Af=yr.define({create(){return[]},update(t,e){for(let n of e.effects)n.is(Nw)?t=[n.value].concat(t):n.is(Vw)&&(t=t.filter(r=>r!=n.value));return t},provide:t=>ah.computeN([t],e=>e.field(t))}),Nw=yt.define(),Vw=yt.define();function PM(t,e,n){let r=e.content?e.content(t,()=>o(null)):null;if(!r){if(r=un("form"),e.input){let a=un("input",e.input);/^(text|password|number|email|tel|url)$/.test(a.type)&&a.classList.add("cm-textfield"),a.name||(a.name="input"),r.appendChild(un("label",(e.label||"")+": ",a))}else r.appendChild(document.createTextNode(e.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(un("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let a=0;a{c.keyCode==27?(c.preventDefault(),o(null)):c.keyCode==13&&(c.preventDefault(),o(l))}),l.addEventListener("submit",c=>{c.preventDefault(),o(l)})}let s=un("div",r,un("button",{onclick:()=>o(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(a){s.contains(s.ownerDocument.activeElement)&&t.focus(),n(a)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let a;typeof e.focus=="string"?a=r.querySelector(e.focus):a=r.querySelector("input")||r.querySelector("button"),a&&"select"in a?a.select():a&&"focus"in a&&a.focus()}}}}class zi extends xs{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}zi.prototype.elementClass="";zi.prototype.toDOM=void 0;zi.prototype.mapMode=Tn.TrackBefore;zi.prototype.startSide=zi.prototype.endSide=-1;zi.prototype.point=!0;const Lu=Ze.define(),QM=Ze.define(),CM={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ft.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},_l=Ze.define();function TM(t){return[Fw(),_l.of({...CM,...t})]}const Ib=Ze.define({combine:t=>t.some(e=>e)});function Fw(t){return[AM]}const AM=nn.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(_l).map(e=>new Zb(t,e)),this.fixed=!t.state.facet(Ib);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Ib)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=ft.iter(this.view.state.facet(Lu),this.view.viewport.from),r=[],i=this.gutters.map(s=>new EM(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==Sn.Text&&o){Cg(n,r,a.from);for(let l of i)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(s.type==Sn.Text){Cg(n,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(_l),n=t.state.facet(_l),r=t.docChanged||t.heightChanged||t.viewportChanged||!ft.eq(t.startState.facet(Lu),t.state.facet(Lu),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let s of n){let o=e.indexOf(s);o<0?i.push(new Zb(this.view,s)):(this.gutters[o].update(t),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Ae.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Nt.LTR?{left:r,right:i}:{right:r,left:i}})});function Xb(t){return Array.isArray(t)?t:[t]}function Cg(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class EM{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=ft.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==i.elements.length){let a=new jw(e,o,s,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];Cg(this.cursor,i,n.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,n,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let s of e.state.facet(QM)){let o=s(e,n.widget,n);o&&(i||(i=[])).push(o)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class Zb{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=Xb(n.markers(e)),n.initialSpacer&&(this.spacer=new jw(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=Xb(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!ft.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class jw{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),DM(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=ss(a,l,c)||o(a,l,c):o}return r}})}});class Ef extends zi{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Df(t,e){return t.state.facet(Ko).formatNumber(e,t.state)}const LM=_l.compute([Ko],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(MM)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new Ef(Df(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(RM)){let s=i(e,n,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Ko)!=e.state.facet(Ko),initialSpacer(e){return new Ef(Df(e,Nb(e.state.doc.lines)))},updateSpacer(e,n){let r=Df(n.view,Nb(n.view.state.doc.lines));return r==e.number?e:new Ef(r)},domEventHandlers:t.facet(Ko).domEventHandlers,side:"before"}));function IM(t={}){return[Ko.of(t),Fw(),LM]}function Nb(t){let e=9;for(;e{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(XM.range(i)))}return ft.of(e)});function NM(){return ZM}const Bw=1024;let VM=0;class kr{constructor(e,n){this.from=e,this.to=n}}class et{constructor(e={}){this.id=VM++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=rn.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}et.closedBy=new et({deserialize:t=>t.split(" ")});et.openedBy=new et({deserialize:t=>t.split(" ")});et.group=new et({deserialize:t=>t.split(" ")});et.isolate=new et({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});et.contextHash=new et({perNode:!0});et.lookAhead=new et({perNode:!0});et.mounted=new et({perNode:!0});class aa{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[et.mounted.id]}}const FM=Object.create(null);class rn{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):FM,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new rn(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(et.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(et.group),s=-1;s<(i?i.length:0);s++){let o=n[s<0?r.name:i[s]];if(o)return o}}}}rn.none=new rn("",Object.create(null),0,8);class La{constructor(e){this.types=e;for(let n=0;n0;for(let l=this.cursor(o|St.IncludeAnonymous);;){let c=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:aO(rn.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new mt(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new mt(rn.none,n,r,i)))}static build(e){return WM(e)}}mt.empty=new mt(rn.none,[],[],0);class sO{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new sO(this.buffer,this.index)}}class Ps{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return rn.none}toString(){let e=[];for(let n=0;n0));l=o[l+3]);return a}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),o=0;for(let a=e,l=0;a=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Vl(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?a.length:-1;e!=c;e+=n){let u=a[e],h=l[e]+o.from,d;if(!(!(s&St.EnterBracketed&&u instanceof mt&&(d=aa.get(u))&&!d.overlay&&d.bracketed&&r>=h&&r<=h+u.length)&&!zw(i,r,h,h+u.length))){if(u instanceof Ps){if(s&St.ExcludeBuffers)continue;let m=u.findChild(0,u.buffer.length,n,r-h,i);if(m>-1)return new gi(new jM(o,u,e,h),null,m)}else if(s&St.IncludeAnonymous||!u.type.isAnonymous||oO(u)){let m;if(!(s&St.IgnoreMounts)&&(m=aa.get(u))&&!m.overlay)return new Dn(m.tree,h,e,o);let g=new Dn(u,h,e,o);return s&St.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?u.children.length-1:0,n,r,i,s)}}}if(s&St.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let i;if(!(r&St.IgnoreOverlays)&&(i=aa.get(this._tree))&&i.overlay){let s=e-this.from,o=r&St.EnterBracketed&&i.bracketed;for(let{from:a,to:l}of i.overlay)if((n>0||o?a<=s:a=s:l>s))return new Dn(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Fb(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function Tg(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class jM{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class gi extends Ww{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new gi(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&St.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new gi(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new gi(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new gi(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),n.push(0)}return new mt(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Yw(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;sn.from||o.to=e){let a=new Dn(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Vl(a,e,n,!1))}}return i?Yw(i):r}class lh{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~St.EnterBracketed,e instanceof Dn)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Dn?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&St.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&St.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&St.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index-1)for(let s=n+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&St.IncludeAnonymous||a instanceof Ps||!a.type.isAnonymous||oO(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;n=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i=0;s--){if(s<0)return Tg(this._tree,e,i);let o=r[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function oO(t){return t.children.some(e=>e instanceof Ps||!e.type.isAnonymous||oO(e))}function WM(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=Bw,reused:s=[],minRepeatType:o=r.types.length}=t,a=Array.isArray(n)?new sO(n,n.length):n,l=r.types,c=0,u=0;function h(T,S,Q,D,I,X){let{id:L,start:R,end:F,size:U}=a,j=u,Y=c;if(U<0)if(a.next(),U==-1){let te=s[L];Q.push(te),D.push(R-T);return}else if(U==-3){c=L;return}else if(U==-4){u=L;return}else throw new RangeError(`Unrecognized record size: ${U}`);let ie=l[L],N,z,he=R-T;if(F-R<=i&&(z=O(a.pos-S,I))){let te=new Uint16Array(z.size-z.skip),V=a.pos-z.size,J=te.length;for(;a.pos>V;)J=v(z.start,te,J);N=new Ps(te,F-z.start,r),he=z.start-T}else{let te=a.pos-U;a.next();let V=[],J=[],q=L>=o?L:-1,re=0,oe=F;for(;a.pos>te;)q>=0&&a.id==q&&a.size>=0?(a.end<=oe-i&&(g(V,J,R,re,a.end,oe,q,j,Y),re=V.length,oe=a.end),a.next()):X>2500?d(R,te,V,J):h(R,te,V,J,q,X+1);if(q>=0&&re>0&&re-1&&re>0){let Se=m(ie,Y);N=aO(ie,V,J,0,V.length,0,F-R,Se,Se)}else N=p(ie,V,J,F-R,j-F,Y)}Q.push(N),D.push(he)}function d(T,S,Q,D){let I=[],X=0,L=-1;for(;a.pos>S;){let{id:R,start:F,end:U,size:j}=a;if(j>4)a.next();else{if(L>-1&&F=0;U-=3)R[j++]=I[U],R[j++]=I[U+1]-F,R[j++]=I[U+2]-F,R[j++]=j;Q.push(new Ps(R,I[2]-F,r)),D.push(F-T)}}function m(T,S){return(Q,D,I)=>{let X=0,L=Q.length-1,R,F;if(L>=0&&(R=Q[L])instanceof mt){if(!L&&R.type==T&&R.length==I)return R;(F=R.prop(et.lookAhead))&&(X=D[L]+R.length+F)}return p(T,Q,D,I,X,S)}}function g(T,S,Q,D,I,X,L,R,F){let U=[],j=[];for(;T.length>D;)U.push(T.pop()),j.push(S.pop()+Q-I);T.push(p(r.types[L],U,j,X-I,R-X,F)),S.push(I-Q)}function p(T,S,Q,D,I,X,L){if(X){let R=[et.contextHash,X];L=L?[R].concat(L):[R]}if(I>25){let R=[et.lookAhead,I];L=L?[R].concat(L):[R]}return new mt(T,S,Q,D,L)}function O(T,S){let Q=a.fork(),D=0,I=0,X=0,L=Q.end-i,R={size:0,start:0,skip:0};e:for(let F=Q.pos-T;Q.pos>F;){let U=Q.size;if(Q.id==S&&U>=0){R.size=D,R.start=I,R.skip=X,X+=4,D+=4,Q.next();continue}let j=Q.pos-U;if(U<0||j=o?4:0,ie=Q.start;for(Q.next();Q.pos>j;){if(Q.size<0)if(Q.size==-3||Q.size==-4)Y+=4;else break e;else Q.id>=o&&(Y+=4);Q.next()}I=ie,D+=U,X+=Y}return(S<0||D==T)&&(R.size=D,R.start=I,R.skip=X),R.size>4?R:void 0}function v(T,S,Q){let{id:D,start:I,end:X,size:L}=a;if(a.next(),L>=0&&D4){let F=a.pos-(L-4);for(;a.pos>F;)Q=v(T,S,Q)}S[--Q]=R,S[--Q]=X-T,S[--Q]=I-T,S[--Q]=D}else L==-3?c=D:L==-4&&(u=D);return Q}let w=[],_=[];for(;a.pos>0;)h(t.start||0,t.bufferStart||0,w,_,-1,0);let C=(e=t.length)!==null&&e!==void 0?e:w.length?_[0]+w[0].length:0;return new mt(l[t.topID],w.reverse(),_.reverse(),C)}const jb=new WeakMap;function Iu(t,e){if(!t.isAnonymous||e instanceof Ps||e.type!=t)return 1;let n=jb.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof mt)){n=1;break}n+=Iu(t,r)}jb.set(e,n)}return n}function aO(t,e,n,r,i,s,o,a,l){let c=0;for(let g=r;g=u)break;S+=Q}if(_==C+1){if(S>u){let Q=g[C];m(Q.children,Q.positions,0,Q.children.length,p[C]+w);continue}h.push(g[C])}else{let Q=p[_-1]+g[_-1].length-T;h.push(aO(t,g,p,C,_,T,Q,null,l))}d.push(T+w-s)}}return m(e,n,r,i,0),(a||l)(h,d,o)}class Uw{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof gi?this.setBuffer(e.context.buffer,e.index,n):e instanceof Dn&&this.map.set(e.tree,n)}get(e){return e instanceof gi?this.getBuffer(e.context.buffer,e.index):e instanceof Dn?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Zi{constructor(e,n,r,i,s=!1,o=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Zi(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a=r)for(;o&&o.from=d.from||h<=d.to||c){let m=Math.max(d.from,l)-c,g=Math.min(d.to,h)-c;d=m>=g?null:new Zi(m,g,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),o.to>h)break;o=snew kr(i.from,i.to)):[new kr(0,0)]:[new kr(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}}class YM{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function lO(t){return(e,n,r,i)=>new qM(e,t,n,r,i)}class Bb{constructor(e,n,r,i,s,o){this.parser=e,this.parse=n,this.overlay=r,this.bracketed=i,this.target=s,this.from=o}}function zb(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class UM{constructor(e,n,r,i,s,o,a,l){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=s,this.bracketed=o,this.target=a,this.prev=l,this.depth=0,this.ranges=[]}}const Ag=new et({perNode:!0});class qM{constructor(e,n,r,i,s){this.nest=n,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new mt(r.type,r.children,r.positions,r.length,r.propValues.concat([[Ag,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[et.mounted.id]=new aa(n,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(n){let c=n.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let h=u.from+c.pos,d=u.to+c.pos;h>=i.from&&d<=i.to&&!n.ranges.some(m=>m.fromh)&&n.ranges.push({from:h,to:d})}}a=!1}else if(r&&(o=$M(r.ranges,i.from,i.to)))a=o!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.fromnew kr(h.from-i.from,h.to-i.from)):null,!!s.bracketed,i.tree,u.length?u[0].from:i.from)),s.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):a=!1}}else if(n&&(l=n.predicate(i))&&(l===!0&&(l=new kr(i.from,i.to)),l.from=0&&n.ranges[c].to==l.from?n.ranges[c]={from:n.ranges[c].from,to:l.to}:n.ranges.push(l)}if(a&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=Ub(this.ranges,n.ranges);c.length&&(zb(c),this.inner.splice(n.index,0,new Bb(n.parser,n.parser.startParse(this.input,qb(n.mounts,c),c),n.ranges.map(u=>new kr(u.from-n.start,u.to-n.start)),n.bracketed,n.target,c[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function $M(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function Wb(t,e,n,r,i,s){if(e=e&&n.enter(r,1,St.IgnoreOverlays|St.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof mt)n=n.children[0];else break}return!1}}let HM=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(Ag))!==null&&n!==void 0?n:r.to,this.inner=new Yb(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(Ag))!==null&&e!==void 0?e:n.to,this.inner=new Yb(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(r=s.tree)===null||r===void 0?void 0:r.prop(et.mounted);if(o&&o.parser==n)for(let a=this.fragI;a=s.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:s.from-l.offset,mount:o})}}}return i}};function Ub(t,e){let n=null,r=e;for(let i=1,s=0;i=a)break;l.to<=o||(n||(r=n=e.slice()),l.froma&&n.splice(s+1,0,new kr(a,l.to))):l.to>a?n[s--]=new kr(a,l.to):n.splice(s--,1))}}return r}function KM(t,e,n,r){let i=0,s=0,o=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==t.length?1e9:o?t[i].to:t[i].from,h=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let d=Math.max(l,n),m=Math.min(u,h,r);dnew kr(d.from+r,d.to+r)),h=KM(e,u,l,c);for(let d=0,m=l;;d++){let g=d==h.length,p=g?c:h[d].from;if(p>m&&n.push(new Zi(m,p,i.tree,-o,s.from>=m||s.openStart,s.to<=p||s.openEnd)),g)break;m=h[d].to}}else n.push(new Zi(l,c,i.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return n}var $b={};class ch{constructor(e,n,r,i,s,o,a,l,c,u=0,h){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=h}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new ch(e,[],n,r,r,0,[],0,i?new Gb(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(n==r)return;if(o.buffer[a-2]>=n){o.buffer[a-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,n,r,i);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>r;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=r,this.buffer[o+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=i;let a=o.stateFlag(s,1);!a&&(i>r||n<=o.maxNode)&&(this.reducePos=i),this.pushState(s,a?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=o.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new ch(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new JM(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let s=0,o;sl&1&&a==o)||i.push(n[s],o)}n=i}let r=[];for(let i=0;i>19,i=n&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,s)=>{if(!n.includes(i))return n.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(o,s+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n0&&this.emitLookAhead()}}class Gb{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class JM{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class uh{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new uh(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new uh(this.stack,this.pos,this.index)}}function gl(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class Xu{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Hb=new Xu;class eR{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Hb,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;sr.to:s>=r.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];s+=o.from-r.to,r=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n=this.chunk2Pos&&ra.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=Hb,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class la{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;qw(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}la.prototype.contextual=la.prototype.fallback=la.prototype.extend=!1;class hh{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?gl(e):e}token(e,n){let r=e.pos,i=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(qw(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,o==null)break;e.reset(o,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}hh.prototype.contextual=la.prototype.fallback=la.prototype.extend=!1;class Pn{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function qw(t,e,n,r,i,s){let o=0,a=1<0){let g=t[m];if(l.allows(g)&&(e.token.value==-1||e.token.value==g||tR(g,e.token.value,i,s))){e.acceptToken(g);break}}let u=e.next,h=0,d=t[o+2];if(e.next<0&&d>h&&t[c+d*3-3]==65535){o=t[c+d*3-1];continue e}for(;h>1,g=c+m+(m<<1),p=t[g],O=t[g+1]||65536;if(u=O)h=m+1;else{o=t[g+2],e.advance();continue e}}break}}function Kb(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function tR(t,e,n,r){let i=Kb(n,r,e);return i<0||Kb(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}let nR=class{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Jb(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Jb(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof mt){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}};class rR{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Xu)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,o=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;ch.end+25&&(l=Math.max(h.lookAhead,l)),h.value!=0)){let d=n;if(h.extended>-1&&(n=this.addActions(e,h.extended,h.end,n)),n=this.addActions(e,h.value,h.end,n),!u.extend&&(r=h,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new Xu,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Xu,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let s=0;se.bufferLength*4?new nR(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;on)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],s=[]),i.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!r.length){let o=i&&oR(i);if(o)return rr&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw rr&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(o)return rr&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((a,l)=>l.score-a.score);r.length>o;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let o=0;o500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(o--,1);continue e}}}r.length>12&&(r.sort((o,a)=>a.score-o.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let h=this.fragments.nodeAt(i);h;){let d=this.parser.nodeSet.types[h.type.id]==h.type?s.getGoto(e.state,h.type.id):-1;if(d>-1&&h.length&&(!c||(h.prop(et.contextHash)||0)==u))return e.useNode(h,d),rr&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(h.type.id)})`),!0;if(!(h instanceof mt)||h.children.length==0||h.positions[0]>0)break;let m=h.children[0];if(m instanceof mt&&h.positions[0]==0)h=m;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),rr&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;ci?n.push(g):r.push(g)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return ey(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let o=0;o ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),rr&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let h=a.split(),d=u;for(let m=0;m<10&&h.forceReduce()&&(rr&&console.log(d+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,r));m++)rr&&(d=this.stackID(h)+" -> ");for(let m of a.recoverByInsert(l))rr&&console.log(u+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),rr&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),ey(a,r)):(!i||i.scoret;class cO{constructor(e){this.start=e.start,this.shift=e.shift||Rf,this.reduce=e.reduce||Rf,this.reuse=e.reuse||Rf,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Qs extends gd{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;ae.topRules[a][1]),i=[];for(let a=0;a=0)s(u,l,a[c++]);else{let h=a[c+-u];for(let d=-u;d>0;d--)s(a[c++],l,h);c++}}}this.nodeSet=new La(n.map((a,l)=>rn.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Bw;let o=gl(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new la(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new iR(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let s=i[n+1];;){let o=i[s++],a=o&1,l=i[s++];if(a&&r)return l;for(let c=s+(o>>1);s0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Ri(this.data,s+2);else break;i=n(Ri(this.data,s+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Ri(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((s,o)=>o&1&&s==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Qs.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(a=>a.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return n.specializers[i]=ty(o),o})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(r[o]=!0)}let i=null;for(let s=0;sr)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}let aR=0,ci=class Eg{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=aR++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Eg&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let i=new Eg(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new dh(e);return r=>r.modified.indexOf(n)>-1?r:dh.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}},lR=0;class dh{constructor(e){this.name=e,this.instances=[],this.id=lR++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&cR(n,a.modified));if(r)return r;let i=[],s=new ci(e.name,i,e,n);for(let a of n)a.instances.push(s);let o=uR(n);for(let a of e.set)if(!a.modified.length)for(let l of o)i.push(dh.get(a,l));return s}}function cR(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function uR(t){let e=[[]];for(let n=0;nr.length-n.length)}function js(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],o=2,a=i;for(let h=0;;){if(a=="..."&&h>0&&h+3==i.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),h+=d[0].length,h==i.length)break;let m=i[h++];if(h==i.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+i);a=i.slice(h)}let l=s.length-1,c=s[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new Fl(r,o,l>0?s.slice(0,l):null);e[c]=u.sort(e[c])}}return $w.add(e)}const $w=new et({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new Fl(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class Fl{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=i;for(let a of s)for(let l of a.set){let c=n[l.id];if(c){o=o?o+" "+c:c;break}}return o},scope:r}}function hR(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function dR(t,e,n,r=0,i=t.length){let s=new fR(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class fR{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,s){let{type:o,from:a,to:l}=e;if(a>=r||l<=n)return;o.isTop&&(s=this.highlighters.filter(m=>!m.scope||m.scope(o)));let c=i,u=mR(e)||Fl.empty,h=hR(s,u.tags);if(h&&(c&&(c+=" "),c+=h,u.mode==1&&(i+=(i?" ":"")+h)),this.startSpan(Math.max(n,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(et.mounted);if(d&&d.overlay){let m=e.node.enter(d.overlay[0].from+a,1),g=this.highlighters.filter(O=>!O.scope||O.scope(d.tree.type)),p=e.firstChild();for(let O=0,v=a;;O++){let w=O=_||!e.nextSibling())););if(!w||_>r)break;v=w.to+a,v>n&&(this.highlightRange(m.cursor(),Math.max(n,w.from+a),Math.min(r,v),"",g),this.startSpan(Math.min(r,v),c))}p&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,s),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function mR(t){let e=t.type.prop($w);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Le=ci.define,uu=Le(),os=Le(),ny=Le(os),ry=Le(os),as=Le(),hu=Le(as),Lf=Le(as),li=Le(),$s=Le(li),ri=Le(),ii=Le(),Dg=Le(),nl=Le(Dg),du=Le(),E={comment:uu,lineComment:Le(uu),blockComment:Le(uu),docComment:Le(uu),name:os,variableName:Le(os),typeName:ny,tagName:Le(ny),propertyName:ry,attributeName:Le(ry),className:Le(os),labelName:Le(os),namespace:Le(os),macroName:Le(os),literal:as,string:hu,docString:Le(hu),character:Le(hu),attributeValue:Le(hu),number:Lf,integer:Le(Lf),float:Le(Lf),bool:Le(as),regexp:Le(as),escape:Le(as),color:Le(as),url:Le(as),keyword:ri,self:Le(ri),null:Le(ri),atom:Le(ri),unit:Le(ri),modifier:Le(ri),operatorKeyword:Le(ri),controlKeyword:Le(ri),definitionKeyword:Le(ri),moduleKeyword:Le(ri),operator:ii,derefOperator:Le(ii),arithmeticOperator:Le(ii),logicOperator:Le(ii),bitwiseOperator:Le(ii),compareOperator:Le(ii),updateOperator:Le(ii),definitionOperator:Le(ii),typeOperator:Le(ii),controlOperator:Le(ii),punctuation:Dg,separator:Le(Dg),bracket:nl,angleBracket:Le(nl),squareBracket:Le(nl),paren:Le(nl),brace:Le(nl),content:li,heading:$s,heading1:Le($s),heading2:Le($s),heading3:Le($s),heading4:Le($s),heading5:Le($s),heading6:Le($s),contentSeparator:Le(li),list:Le(li),quote:Le(li),emphasis:Le(li),strong:Le(li),link:Le(li),monospace:Le(li),strikethrough:Le(li),inserted:Le(),deleted:Le(),changed:Le(),invalid:Le(),meta:du,documentMeta:Le(du),annotation:Le(du),processingInstruction:Le(du),definition:ci.defineModifier("definition"),constant:ci.defineModifier("constant"),function:ci.defineModifier("function"),standard:ci.defineModifier("standard"),local:ci.defineModifier("local"),special:ci.defineModifier("special")};for(let t in E){let e=E[t];e instanceof ci&&(e.name=t)}Gw([{tag:E.link,class:"tok-link"},{tag:E.heading,class:"tok-heading"},{tag:E.emphasis,class:"tok-emphasis"},{tag:E.strong,class:"tok-strong"},{tag:E.keyword,class:"tok-keyword"},{tag:E.atom,class:"tok-atom"},{tag:E.bool,class:"tok-bool"},{tag:E.url,class:"tok-url"},{tag:E.labelName,class:"tok-labelName"},{tag:E.inserted,class:"tok-inserted"},{tag:E.deleted,class:"tok-deleted"},{tag:E.literal,class:"tok-literal"},{tag:E.string,class:"tok-string"},{tag:E.number,class:"tok-number"},{tag:[E.regexp,E.escape,E.special(E.string)],class:"tok-string2"},{tag:E.variableName,class:"tok-variableName"},{tag:E.local(E.variableName),class:"tok-variableName tok-local"},{tag:E.definition(E.variableName),class:"tok-variableName tok-definition"},{tag:E.special(E.variableName),class:"tok-variableName2"},{tag:E.definition(E.propertyName),class:"tok-propertyName tok-definition"},{tag:E.typeName,class:"tok-typeName"},{tag:E.namespace,class:"tok-namespace"},{tag:E.className,class:"tok-className"},{tag:E.macroName,class:"tok-macroName"},{tag:E.propertyName,class:"tok-propertyName"},{tag:E.operator,class:"tok-operator"},{tag:E.comment,class:"tok-comment"},{tag:E.meta,class:"tok-meta"},{tag:E.invalid,class:"tok-invalid"},{tag:E.punctuation,class:"tok-punctuation"}]);const Uo=63,iy=64,gR=1,pR=2,Hw=3,OR=4,Kw=5,vR=6,bR=7,Jw=65,yR=66,xR=8,SR=9,wR=10,kR=11,_R=12,ek=13,PR=19,QR=20,CR=29,TR=33,AR=34,ER=47,DR=0,uO=1,Mg=2,jl=3,Rg=4;let eo=class{constructor(e,n,r){this.parent=e,this.depth=n,this.type=r,this.hash=(e?e.hash+e.hash<<8:0)+n+(n<<4)+r}};eo.top=new eo(null,-1,DR);function Pl(t,e){for(let n=0,r=e-t.pos-1;;r--,n++){let i=t.peek(r);if(Wi(i)||i==-1)return n}}function Lg(t){return t==32||t==9}function Wi(t){return t==10||t==13}function tk(t){return Lg(t)||Wi(t)}function oo(t){return t<0||tk(t)}const MR=new cO({start:eo.top,reduce(t,e){return t.type==jl&&(e==QR||e==AR)?t.parent:t},shift(t,e,n,r){if(e==Hw)return new eo(t,Pl(r,r.pos),uO);if(e==Jw||e==Kw)return new eo(t,Pl(r,r.pos),Mg);if(e==Uo)return t.parent;if(e==PR||e==TR)return new eo(t,0,jl);if(e==ek&&t.type==Rg)return t.parent;if(e==ER){let i=/[1-9]/.exec(r.read(r.pos,n.pos));if(i)return new eo(t,t.depth+ +i[0],Rg)}return t},hash(t){return t.hash}});function va(t,e,n=0){return t.peek(n)==e&&t.peek(n+1)==e&&t.peek(n+2)==e&&oo(t.peek(n+3))}const RR=new Pn((t,e)=>{if(t.next==-1&&e.canShift(iy))return t.acceptToken(iy);let n=t.peek(-1);if((Wi(n)||n<0)&&e.context.type!=jl){if(va(t,45))if(e.canShift(Uo))t.acceptToken(Uo);else return t.acceptToken(gR,3);if(va(t,46))if(e.canShift(Uo))t.acceptToken(Uo);else return t.acceptToken(pR,3);let r=0;for(;t.next==32;)r++,t.advance();(r{if(e.context.type==jl){t.next==63&&(t.advance(),oo(t.next)&&t.acceptToken(bR));return}if(t.next==45)t.advance(),oo(t.next)&&t.acceptToken(e.context.type==uO&&e.context.depth==Pl(t,t.pos-1)?OR:Hw);else if(t.next==63)t.advance(),oo(t.next)&&t.acceptToken(e.context.type==Mg&&e.context.depth==Pl(t,t.pos-1)?vR:Kw);else{let n=t.pos;for(;;)if(Lg(t.next)){if(t.pos==n)return;t.advance()}else if(t.next==33)nk(t);else if(t.next==38)Ig(t);else if(t.next==42){Ig(t);break}else if(t.next==39||t.next==34){if(hO(t,!0))break;return}else if(t.next==91||t.next==123){if(!XR(t))return;break}else{rk(t,!0,!1,0);break}for(;Lg(t.next);)t.advance();if(t.next==58){if(t.pos==n&&e.canShift(CR))return;let r=t.peek(1);oo(r)&&t.acceptTokenTo(e.context.type==Mg&&e.context.depth==Pl(t,n)?yR:Jw,n)}}},{contextual:!0});function IR(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function sy(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function oy(t,e){return t.next==37?(t.advance(),sy(t.next)&&t.advance(),sy(t.next)&&t.advance(),!0):IR(t.next)||e&&t.next==44?(t.advance(),!0):!1}function nk(t){if(t.advance(),t.next==60){for(t.advance();;)if(!oy(t,!0)){t.next==62&&t.advance();break}}else for(;oy(t,!1););}function Ig(t){for(t.advance();!oo(t.next)&&fh(t.next)!="f";)t.advance()}function hO(t,e){let n=t.next,r=!1,i=t.pos;for(t.advance();;){let s=t.next;if(s<0)break;if(t.advance(),s==n)if(s==39)if(t.next==39)t.advance();else break;else break;else if(s==92&&n==34)t.next>=0&&t.advance();else if(Wi(s)){if(e)return!1;r=!0}else if(e&&t.pos>=i+1024)return!1}return!r}function XR(t){for(let e=[],n=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!hO(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>n||Wi(t.next))return!1;t.advance()}}const ZR="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function fh(t){return t<33?"u":t>125?"s":ZR[t-33]}function If(t,e){let n=fh(t);return n!="u"&&!(e&&n=="f")}function rk(t,e,n,r){if(fh(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&If(t.peek(1),n))t.advance();else return!1;let i=t.pos;for(;;){let s=t.next,o=0,a=r+1;for(;tk(s);){if(Wi(s)){if(e)return!1;a=0}else a++;s=t.peek(++o)}if(!(s>=0&&(s==58?If(t.peek(o+1),n):s==35?t.peek(o-1)!=32:If(s,n)))||!n&&a<=r||a==0&&!n&&(va(t,45,o)||va(t,46,o)))break;if(e&&fh(s)=="f")return!1;for(let c=o;c>=0;c--)t.advance();if(e&&t.pos>i+1024)return!1}return!0}const NR=new Pn((t,e)=>{if(t.next==33)nk(t),t.acceptToken(_R);else if(t.next==38||t.next==42){let n=t.next==38?wR:kR;Ig(t),t.acceptToken(n)}else t.next==39||t.next==34?(hO(t,!1),t.acceptToken(SR)):rk(t,!1,e.context.type==jl,e.context.depth)&&t.acceptToken(xR)}),VR=new Pn((t,e)=>{let n=e.context.type==Rg?e.context.depth:-1,r=t.pos;e:for(;;){let i=0,s=t.next;for(;s==32;)s=t.peek(++i);if(!i&&(va(t,45,i)||va(t,46,i))||!Wi(s)&&(n<0&&(n=Math.max(e.context.depth+1,i)),iYAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:MR,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[FR],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[RR,LR,NR,VR,0,1],topRules:{Stream:[0,15]},tokenPrec:0});var Xf;const fs=new et;function pd(t){return Ze.define({combine:t?e=>e.concat(t):void 0})}const dO=new et;class gr{constructor(e,n,r=[],i=""){this.data=e,this.name=i,ot.prototype.hasOwnProperty("tree")||Object.defineProperty(ot.prototype,"tree",{get(){return Et(this)}}),this.parser=n,this.extension=[Ts.of(this),ot.languageData.of((s,o,a)=>{let l=ay(s,o,a),c=l.type.prop(fs);if(!c)return[];let u=s.facet(c),h=l.type.prop(dO);if(h){let d=l.resolve(o-l.from,a);for(let m of h)if(m.test(d,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return ay(e,n,r).type.prop(fs)==this.data}findRegions(e){let n=e.facet(Ts);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(fs)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(et.mounted);if(a){if(a.tree.prop(fs)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;lr.isTop?n:void 0)]}),e.name)}configure(e,n){return new Cs(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Et(t){let e=t.field(gr.state,!1);return e?e.tree:mt.empty}class BR{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let rl=null;class So{constructor(e,n,r=[],i,s,o,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new So(e,n,[],mt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new BR(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=mt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Zi.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=rl;rl=this;try{return e()}finally{rl=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=ly(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,h,d)=>l.push({fromA:c,toA:u,fromB:h,toB:d})),r=Zi.applyChanges(r,l),i=mt.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);ue.from&&(this.fragments=ly(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends gd{createParse(n,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let l=rl;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new mt(rn.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return rl}}function ly(t,e,n){return Zi.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class ba{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new ba(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=So.create(e.facet(Ts).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new ba(r)}}gr.state=yr.define({create:ba.init,update(t,e){for(let n of e.effects)if(n.is(gr.setState))return n.value;return e.startState.facet(Ts)!=e.state.facet(Ts)?ba.init(e.state):t.apply(e)}});let ik=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(ik=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Zf=typeof navigator<"u"&&(!((Xf=navigator.scheduling)===null||Xf===void 0)&&Xf.isInputPending)?()=>navigator.scheduling.isInputPending():null,zR=nn.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(gr.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(gr.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=ik(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEndi+1e3,l=s.context.work(()=>Zf&&Zf()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:gr.setState.of(new ba(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>mi(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ts=Ze.define({combine(t){return t.length?t[0]:null},enables:t=>[gr.state,zR,Ae.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Yi{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class le{constructor(e,n,r,i,s,o=void 0){this.name=e,this.alias=n,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:r}=e;if(!n){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(r)}return new le(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,n,r)}static matchFilename(e,n){for(let i of e)if(i.filename&&i.filename.test(n))return i;let r=/\.([^.]+)$/.exec(n);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,n,r=!0){n=n.toLowerCase();for(let i of e)if(i.alias.some(s=>s==n))return i;if(r)for(let i of e)for(let s of i.alias){let o=n.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(n[o-1])&&!/\w/.test(n[o+s.length])))return i}return null}}const WR=Ze.define(),Qc=Ze.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function wo(t){let e=t.facet(Qc);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Bl(t,e){let n="",r=t.tabSize,i=t.facet(Qc)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s=e?YR(t,n,e):null}class Od{constructor(e,n={}){this.state=e,this.options=n,this.unit=wo(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return Pi(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Xo=new et;function YR(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let o=i;o&&!(o.fromr.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return sk(r,t,n)}function sk(t,e,n){for(let r=t;r;r=r.next){let i=qR(r.node);if(i)return i(mO.create(e,n,r))}return 0}function UR(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function qR(t){let e=t.type.prop(Xo);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(et.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>ok(o,!0,1,void 0,s&&!UR(o)?i.from:void 0)}return t.parent==null?$R:null}function $R(){return 0}class mO extends Od{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new mO(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(GR(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return sk(this.context.next,this.base,this.pos)}}function GR(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function HR(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let c=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+c}}a=l.to}}function Xg({closing:t,align:e=!0,units:n=1}){return r=>ok(r,e,n,t)}function ok(t,e,n,r,i){let s=t.textAfter,o=s.match(/^\s*/)[0].length,a=r&&s.slice(o,o+r.length)==r||i==t.pos+o,l=e?HR(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}const KR=t=>t.baseIndent;function Zu({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const JR=200;function vd(){return ot.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+JR)return t;let s=n.sliceString(i.from,r);if(!e.some(c=>c.test(s)))return t;let{state:o}=t,a=-1,l=[];for(let{head:c}of o.selection.ranges){let u=o.doc.lineAt(c);if(u.from==a)continue;a=u.from;let h=fO(o,u.from);if(h==null)continue;let d=/^\s*/.exec(u.text)[0],m=Bl(o,h);d!=m&&l.push({from:u.from,to:u.from+d.length,insert:m})}return l.length?[t,{changes:l,sequential:!0}]:t})}const ak=Ze.define(),Zo=new et;function gO(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(s&&a.from=e&&c.to>n&&(s=c)}}return s}function tL(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function mh(t,e,n){for(let r of t.facet(ak)){let i=r(t,e,n);if(i)return i}return eL(t,e,n)}function lk(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const bd=yt.define({map:lk}),Cc=yt.define({map:lk});function ck(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const ko=yr.define({create(){return ze.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=cy(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(bd)&&!nL(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(dk),i=r?ze.replace({widget:new cL(r(e.state,n.value))}):uy;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(Cc)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));return e.selection&&(t=cy(t,e.selection.main.head)),t},provide:t=>Ae.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{ie&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,s)=>i>=n||s<=e}):t}function gh(t,e,n){var r;let i=null;return(r=t.field(ko,!1))===null||r===void 0||r.between(e,n,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function nL(t,e,n){let r=!1;return t.between(e,e,(i,s)=>{i==e&&s==n&&(r=!0)}),r}function uk(t,e){return t.field(ko,!1)?e:e.concat(yt.appendConfig.of(fk()))}const rL=t=>{for(let e of ck(t)){let n=mh(t.state,e.from,e.to);if(n)return t.dispatch({effects:uk(t.state,[bd.of(n),hk(t,n)])}),!0}return!1},iL=t=>{if(!t.state.field(ko,!1))return!1;let e=[];for(let n of ck(t)){let r=gh(t.state,n.from,n.to);r&&e.push(Cc.of(r),hk(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function hk(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return Ae.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const sL=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(ko,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(Cc.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},aL=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:rL},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:iL},{key:"Ctrl-Alt-[",run:sL},{key:"Ctrl-Alt-]",run:oL}],lL={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},dk=Ze.define({combine(t){return Fs(t,lL)}});function fk(t){return[ko,dL]}function mk(t,e){let{state:n}=t,r=n.facet(dk),i=o=>{let a=t.lineBlockAt(t.posAtDOM(o.target)),l=gh(t.state,a.from,a.to);l&&t.dispatch({effects:Cc.of(l)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const uy=ze.replace({widget:new class extends Gr{toDOM(t){return mk(t,null)}}});class cL extends Gr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return mk(e,this.value)}}const uL={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Nf extends zi{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function hL(t={}){let e={...uL,...t},n=new Nf(e,!0),r=new Nf(e,!1),i=nn.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Ts)!=o.state.facet(Ts)||o.startState.field(ko,!1)!=o.state.field(ko,!1)||Et(o.startState)!=Et(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new Ss;for(let l of o.viewportLineBlocks){let c=gh(o.state,l.from,l.to)?r:mh(o.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:s}=e;return[i,TM({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(i))===null||a===void 0?void 0:a.markers)||ft.empty},initialSpacer(){return new Nf(e,!1)},domEventHandlers:{...s,click:(o,a,l)=>{if(s.click&&s.click(o,a,l))return!0;let c=gh(o.state,a.from,a.to);if(c)return o.dispatch({effects:Cc.of(c)}),!0;let u=mh(o.state,a.from,a.to);return u?(o.dispatch({effects:bd.of(u)}),!0):!1}}}),fk()]}const dL=Ae.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Tc{constructor(e,n){this.specs=e;let r;function i(a){let l=ws.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,o=n.scope;this.scope=o instanceof gr?a=>a.prop(fs)==o.data:o?a=>a==o:void 0,this.style=Gw(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new ws(r):null,this.themeType=n.themeType}static define(e,n){return new Tc(e,n||{})}}const Zg=Ze.define(),gk=Ze.define({combine(t){return t.length?[t[0]]:null}});function Vf(t){let e=t.facet(Zg);return e.length?e:t.facet(gk)}function Ac(t,e){let n=[mL],r;return t instanceof Tc&&(t.module&&n.push(Ae.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(gk.of(t)):r?n.push(Zg.computeN([Ae.darkTheme],i=>i.facet(Ae.darkTheme)==(r=="dark")?[t]:[])):n.push(Zg.of(t)),n}class fL{constructor(e){this.markCache=Object.create(null),this.tree=Et(e.state),this.decorations=this.buildDeco(e,Vf(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=Et(e.state),r=Vf(e.state),i=r!=Vf(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return ze.none;let r=new Ss;for(let{from:i,to:s}of e.visibleRanges)dR(this.tree,n,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=ze.mark({class:l})))},i,s);return r.finish()}}const mL=Lo.high(nn.fromClass(fL,{decorations:t=>t.decorations})),yd=Tc.define([{tag:E.meta,color:"#404740"},{tag:E.link,textDecoration:"underline"},{tag:E.heading,textDecoration:"underline",fontWeight:"bold"},{tag:E.emphasis,fontStyle:"italic"},{tag:E.strong,fontWeight:"bold"},{tag:E.strikethrough,textDecoration:"line-through"},{tag:E.keyword,color:"#708"},{tag:[E.atom,E.bool,E.url,E.contentSeparator,E.labelName],color:"#219"},{tag:[E.literal,E.inserted],color:"#164"},{tag:[E.string,E.deleted],color:"#a11"},{tag:[E.regexp,E.escape,E.special(E.string)],color:"#e40"},{tag:E.definition(E.variableName),color:"#00f"},{tag:E.local(E.variableName),color:"#30a"},{tag:[E.typeName,E.namespace],color:"#085"},{tag:E.className,color:"#167"},{tag:[E.special(E.variableName),E.macroName],color:"#256"},{tag:E.definition(E.propertyName),color:"#00c"},{tag:E.comment,color:"#940"},{tag:E.invalid,color:"#f00"}]),gL=Ae.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),pk=1e4,Ok="()[]{}",vk=Ze.define({combine(t){return Fs(t,{afterCursor:!0,brackets:Ok,maxScanDistance:pk,renderMatch:vL})}}),pL=ze.mark({class:"cm-matchingBracket"}),OL=ze.mark({class:"cm-nonmatchingBracket"});function vL(t){let e=[],n=t.matched?pL:OL;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}function hy(t){let e=[],n=t.facet(vk);for(let r of t.selection.ranges){if(!r.empty)continue;let i=pi(t,r.head,-1,n)||r.head>0&&pi(t,r.head-1,1,n)||n.afterCursor&&(pi(t,r.head,1,n)||r.headt.decorations}),yL=[bL,gL];function bk(t={}){return[vk.of(t),yL]}const yk=new et;function Ng(t,e,n){let r=t.prop(e<0?et.openedBy:et.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function Vg(t){let e=t.type.prop(yk);return e?e(t.node):t}function pi(t,e,n,r={}){let i=r.maxScanDistance||pk,s=r.brackets||Ok,o=Et(t),a=o.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=Ng(l.type,n,s);if(c&&l.from0?e>=u.from&&eu.from&&e<=u.to))return xL(t,e,n,l,u,c,s)}}return SL(t,e,n,o,a.type,i,s)}function xL(t,e,n,r,i,s,o){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),h=0;for(let d=0;!u.next().done&&d<=s;){let m=u.value;n<0&&(d+=m.length);let g=e+d*n;for(let p=n>0?0:m.length-1,O=n>0?m.length:-1;p!=O;p+=n){let v=o.indexOf(m[p]);if(!(v<0||r.resolveInner(g+p,1).type!=i))if(v%2==0==n>0)h++;else{if(h==1)return{start:c,end:{from:g+p,to:g+p+1},matched:v>>1==l>>1};h--}}n>0&&(d+=m.length)}return u.done?{start:c,matched:!1}:null}function dy(t,e,n,r=0,i=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let s=i;for(let o=r;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posn}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosr?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return i(s)==i(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&n!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function wL(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||kL,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||vO,mergeTokens:t.mergeTokens!==!1}}function kL(t){if(typeof t!="object")return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const fy=new WeakMap;class pO extends gr{constructor(e){let n=pd(e.languageData),r=wL(e),i,s=new class extends gd{createParse(o,a,l){return new PL(i,o,a,l)}};super(n,s,[],e.name),this.topNode=TL(n,this),i=this,this.streamParser=r,this.stateAfter=new et({perNode:!0}),this.tokenTable=e.tokenTable?new _k(r.tokenTable):CL}static define(e){return new pO(e)}getIndent(e){let n,{overrideIndentation:r}=e.options;r&&(n=fy.get(e.state),n!=null&&n1e4)return null;for(;s=r&&n+e.length<=i&&e.prop(t.stateAfter);if(s)return{state:t.streamParser.copyState(s),pos:n+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],l=n+e.positions[o],c=a instanceof mt&&l=e.length)return e;!i&&n==0&&e.type==t.topNode&&(i=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],a=e.children[s],l;if(on&&OO(t,s.tree,0-s.offset,n,a),c;if(l&&l.pos<=r&&(c=Sk(t,s.tree,n+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:c}}return{state:t.streamParser.startState(i?wo(i):4),tree:mt.empty}}class PL{constructor(e,n,r,i){this.lang=e,this.input=n,this.fragments=r,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let s=So.get(),o=i[0].from,{state:a,tree:l}=_L(e,r,o,this.to,s?.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let c=0;cc.from<=s.viewport.from&&c.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(wo(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=So.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(n,this.chunkStart+512);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==` `&&(n="");else{let r=n.indexOf(` `);r>-1&&(n=n.slice(0,r))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),r=e+n.length;for(let i=this.rangeIndex;;){let s=this.ranges[i].to;if(s>=r||(n=n.slice(0,s-(r-n.length)),i++,i==this.ranges.length))break;let o=this.ranges[i].from,a=this.lineAfter(o);n+=a,r=o+a.length}return{line:n,end:r}}skipGapsTo(e,n,r){for(;;){let i=this.ranges[this.rangeIndex].to,s=e+n;if(r>0?i>s:i>=s)break;let o=this.ranges[++this.rangeIndex].from;n+=o-i}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){i=this.skipGapsTo(n,i,1),n+=i;let a=this.chunk.length;i=this.skipGapsTo(r,i,-1),r+=i,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==n?this.chunk[o+2]=r:this.chunk.push(e,n,r,s),i}parseLine(e){let{line:n,end:r}=this.nextLine(),i=0,{streamParser:s}=this.lang,o=new xk(n,e?e.state.tabSize:4,e?wo(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=wk(s.token,o,this.state);if(a&&(i=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,i)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPose.start)return i}throw new Error("Stream parser failed to advance stream.")}const vO=Object.create(null),zl=[rn.none],QL=new La(zl),my=[],gy=Object.create(null),kk=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])kk[t]=Pk(vO,e);class _k{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),kk)}resolve(e){return e?this.table[e]||(this.table[e]=Pk(this.extra,e)):0}}const CL=new _k(vO);function Ff(t,e){my.indexOf(t)>-1||(my.push(t),console.warn(e))}function Pk(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=t[c]||E[c];u?typeof u=="function"?l.length?l=l.map(u):Ff(c,`Modifier ${c} used at start of tag`):l.length?Ff(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:Ff(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),s=gy[i];if(s)return s.id;let o=gy[i]=rn.define({id:zl.length,name:r,props:[js({[r]:n})]});return zl.push(o),o.id}function TL(t,e){let n=rn.define({id:zl.length,name:"Document",props:[fs.add(()=>t),Xo.add(()=>r=>e.getIndent(r))],top:!0});return zl.push(n),n}Nt.RTL,Nt.LTR;const AL=Qs.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"⚠ Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),bO=Cs.define({name:"yaml",parser:jR.configure({props:[Xo.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.fromt.pos)return null}}return null},FlowMapping:Xg({closing:"}"}),FlowSequence:Xg({closing:"]"})}),Zo.add({"FlowMapping FlowSequence":gO,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function xd(){return new Yi(bO)}const EL=Cs.define({name:"yaml-frontmatter",parser:AL.configure({props:[js({DashLine:E.meta})]})});function DL(t){let{language:e,support:n}=t.content instanceof Yi?t.content:{language:t.content,support:[]};return new Yi(EL.configure({wrap:lO(r=>r.name=="FrontmatterContent"?{parser:bO.parser}:r.name=="Body"?{parser:e.parser}:null)}),n)}const ML=Object.freeze(Object.defineProperty({__proto__:null,yaml:xd,yamlFrontmatter:DL,yamlLanguage:bO},Symbol.toStringTag,{value:"Module"})),RL=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=xO(t.state,n.from);return r.line?LL(t):r.block?XL(t):!1};function yO(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const LL=yO(VL,0),IL=yO(Qk,0),XL=yO((t,e)=>Qk(t,e,NL(e)),0);function xO(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const il=50;function ZL(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-il,r),o=t.sliceDoc(i,i+il),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,c=s.length-a;if(s.slice(c-e.length,c)==e&&o.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,h;i-r<=2*il?u=h=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+il),h=t.sliceDoc(i-il,i));let d=/^\s*/.exec(u)[0].length,m=/\s*$/.exec(h)[0].length,g=h.length-m-n.length;return u.slice(d,d+e.length)==e&&h.slice(g,g+n.length)==n?{open:{pos:r+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:i-m-n.length,margin:/\s/.test(h.charAt(g-1))?1:0}}:null}function NL(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function Qk(t,e,n=e.selection.ranges){let r=n.map(s=>xO(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,o)=>ZL(e,r[o],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,o)=>i[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let o=0,a;oi&&(s==o||o>h.from)){i=h.from;let d=/^\s*/.exec(h.text)[0].length,m=d==h.length,g=h.text.slice(d,d+c.length)==c?d:-1;ds.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:c,empty:u,single:h}of r)(h||!u)&&s.push({from:a.from+c,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of r)if(a>=0){let c=o.from+a,u=c+l.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}const Fg=$r.define(),FL=$r.define(),jL=Ze.define(),Ck=Ze.define({combine(t){return Fs(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),Tk=yr.define({create(){return Oi.empty},update(t,e){let n=e.state.facet(Ck),r=e.annotation(Fg);if(r){let l=Gn.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=Oh(u,u.length,n.minDepth,l):u=Ek(u,e.startState.selection),new Oi(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(FL);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Bn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=Gn.fromTransaction(e),o=e.annotation(Bn.time),a=e.annotation(Bn.userEvent);return s?t=t.addChanges(s,o,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,a,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Oi(t.done.map(Gn.fromJSON),t.undone.map(Gn.fromJSON))}});function Sd(t={}){return[Tk,Ck.of(t),Ae.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?SO:e.inputType=="historyRedo"?ph:null;return r?(e.preventDefault(),r(n)):!1}})]}function wd(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(Tk,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const SO=wd(0,!1),ph=wd(1,!1),BL=wd(0,!0),zL=wd(1,!0);class Gn{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new Gn(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Gn(e.changes&&on.fromJSON(e.changes),[],e.mapped&&Si.fromJSON(e.mapped),e.startSelection&&Oe.fromJSON(e.startSelection),e.selectionsAfter.map(Oe.fromJSON))}static fromTransaction(e,n){let r=_r;for(let i of e.startState.facet(jL)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new Gn(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,_r)}static selection(e){return new Gn(void 0,_r,void 0,void 0,e)}}function Oh(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function WL(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,o,a)=>{for(let l=0;l=c&&o<=u&&(r=!0)}}),r}function YL(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function Ak(t,e){return t.length?e.length?t.concat(e):t:e}const _r=[],UL=200;function Ek(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-UL));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),Oh(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Gn.selection([e])]}function qL(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function jf(t,e){if(!t.length)return t;let n=t.length,r=_r;for(;n;){let i=$L(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Gn.selection(r)]:_r}function $L(t,e,n){let r=Ak(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):_r,n);if(!t.changes)return Gn.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new Gn(i,yt.mapEffects(t.effects,e),o,t.startSelection.map(s),r)}const GL=/^(input\.type|delete)($|\.)/;class Oi{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Oi(this.done,this.undone):this}addChanges(e,n,r,i,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||GL.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):_d(n,e))}function Ln(t){return t.textDirectionAt(t.state.selection.main.head)==Nt.LTR}const Mk=t=>Dk(t,!Ln(t)),Rk=t=>Dk(t,Ln(t));function Lk(t,e){return Kr(t,n=>n.empty?t.moveByGroup(n,e):_d(n,e))}const HL=t=>Lk(t,!Ln(t)),KL=t=>Lk(t,Ln(t));function JL(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Pd(t,e,n){let r=Et(t).resolveInner(e.head),i=n?et.closedBy:et.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;JL(t,c,i)?r=c:l=n?c.to:c.from}let s=r.type.prop(i),o,a;return s&&(o=n?pi(t,r.from,1):pi(t,r.to,-1))&&o.matched?a=n?o.end.to:o.end.from:a=n?r.to:r.from,Oe.cursor(a,n?-1:1)}const e3=t=>Kr(t,e=>Pd(t.state,e,!Ln(t))),t3=t=>Kr(t,e=>Pd(t.state,e,Ln(t)));function Ik(t,e){return Kr(t,n=>{if(!n.empty)return _d(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const Xk=t=>Ik(t,!1),Zk=t=>Ik(t,!0);function Nk(t){let e=t.scrollDOM.clientHeighto.empty?t.moveVertically(o,e,n.height):_d(o,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;o&&o.top>l&&o.bottomVk(t,!1),jg=t=>Vk(t,!0);function Bs(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=Oe.cursor(r.from+s))}return i}const n3=t=>Kr(t,e=>Bs(t,e,!0)),r3=t=>Kr(t,e=>Bs(t,e,!1)),i3=t=>Kr(t,e=>Bs(t,e,!Ln(t))),s3=t=>Kr(t,e=>Bs(t,e,Ln(t))),o3=t=>Kr(t,e=>Oe.cursor(t.lineBlockAt(e.head).from,1)),a3=t=>Kr(t,e=>Oe.cursor(t.lineBlockAt(e.head).to,-1));function l3(t,e,n){let r=!1,i=Ia(t.selection,s=>{let o=pi(t,s.head,-1)||pi(t,s.head,1)||s.head>0&&pi(t,s.head-1,1)||s.headl3(t,e);function Dr(t,e){let n=Ia(t.state.selection,r=>{let i=e(r);return Oe.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(Hr(t.state,n)),!0)}function Fk(t,e){return Dr(t,n=>t.moveByChar(n,e))}const jk=t=>Fk(t,!Ln(t)),Bk=t=>Fk(t,Ln(t));function zk(t,e){return Dr(t,n=>t.moveByGroup(n,e))}const u3=t=>zk(t,!Ln(t)),h3=t=>zk(t,Ln(t)),d3=t=>Dr(t,e=>Pd(t.state,e,!Ln(t))),f3=t=>Dr(t,e=>Pd(t.state,e,Ln(t)));function Wk(t,e){return Dr(t,n=>t.moveVertically(n,e))}const Yk=t=>Wk(t,!1),Uk=t=>Wk(t,!0);function qk(t,e){return Dr(t,n=>t.moveVertically(n,e,Nk(t).height))}const Oy=t=>qk(t,!1),vy=t=>qk(t,!0),m3=t=>Dr(t,e=>Bs(t,e,!0)),g3=t=>Dr(t,e=>Bs(t,e,!1)),p3=t=>Dr(t,e=>Bs(t,e,!Ln(t))),O3=t=>Dr(t,e=>Bs(t,e,Ln(t))),v3=t=>Dr(t,e=>Oe.cursor(t.lineBlockAt(e.head).from)),b3=t=>Dr(t,e=>Oe.cursor(t.lineBlockAt(e.head).to)),by=({state:t,dispatch:e})=>(e(Hr(t,{anchor:0})),!0),yy=({state:t,dispatch:e})=>(e(Hr(t,{anchor:t.doc.length})),!0),xy=({state:t,dispatch:e})=>(e(Hr(t,{anchor:t.selection.main.anchor,head:0})),!0),Sy=({state:t,dispatch:e})=>(e(Hr(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),y3=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),x3=({state:t,dispatch:e})=>{let n=Qd(t).map(({from:r,to:i})=>Oe.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:Oe.create(n),userEvent:"select"})),!0},S3=({state:t,dispatch:e})=>{let n=Ia(t.selection,r=>{let i=Et(t),s=i.resolveStack(r.from,1);if(r.empty){let o=i.resolveStack(r.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return Oe.range(a.to,a.from)}return r});return n.eq(t.selection)?!1:(e(Hr(t,n)),!0)};function $k(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to0)for(let a=s;;){let l=t.moveVertically(a,e);if(l.heado.to){i.some(c=>c.head==l.head)||i.push(l);break}else{if(l.head==a.head)break;a=l}}}return i.length==r.ranges.length?!1:(t.dispatch(Hr(n,Oe.create(i,i.length-1))),!0)}const w3=t=>$k(t,!1),k3=t=>$k(t,!0),_3=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Oe.create([n.main]):n.main.empty||(r=Oe.create([Oe.cursor(n.main.head)])),r?(e(Hr(t,r)),!0):!1};function Ec(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);lo&&(n="delete.forward",l=fu(t,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=fu(t,o,!1),a=fu(t,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:Oe.cursor(o,oi(t)))r.between(e,e,(i,s)=>{ie&&(e=n?s:i)});return e}const Gk=(t,e,n)=>Ec(t,r=>{let i=r.from,{state:s}=t,o=s.doc.lineAt(i),a,l;if(n&&!e&&i>o.from&&iGk(t,!1,!0),Hk=t=>Gk(t,!0,!1),Kk=(t,e)=>Ec(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let a=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=fn(s.text,r-s.from,e)+s.from,c=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),u=o(c);if(a!=null&&u!=a)break;(c!=" "||r!=n.head)&&(a=u),r=l}return r}),Jk=t=>Kk(t,!1),P3=t=>Kk(t,!0),Q3=t=>Ec(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headEc(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),T3=t=>Ec(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:bt.of(["",""])},range:Oe.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},E3=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),o=i==s.from?i-1:fn(s.text,i-s.from,!1)+s.from,a=i==s.to?i+1:fn(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(o,i))},range:Oe.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Qd(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function e_(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of Qd(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),a=o.length+1;if(n){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let l of s.ranges)i.push(Oe.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let l of s.ranges)i.push(Oe.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Oe.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const D3=({state:t,dispatch:e})=>e_(t,e,!1),M3=({state:t,dispatch:e})=>e_(t,e,!0);function t_(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of Qd(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const R3=({state:t,dispatch:e})=>t_(t,e,!1),L3=({state:t,dispatch:e})=>t_(t,e,!0),I3=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Qd(e).map(({from:i,to:s})=>(i>0?i--:s{let s;if(t.lineWrapping){let o=t.lineBlockAt(i.head),a=t.coordsAtPos(i.head,i.assoc||1);a&&(s=o.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function X3(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=Et(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(et.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const wy=n_(!1),Z3=n_(!0);function n_(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:o}=i,a=e.doc.lineAt(s),l=!t&&s==o&&X3(e,s);t&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let c=new Od(e,{simulateBreak:s,simulateDoubleBreak:!!l}),u=fO(c,s);for(u==null&&(u=Pi(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));oa.from&&s{let i=[];for(let o=r.from;o<=r.to;){let a=t.doc.lineAt(o);a.number>n&&(r.empty||r.to>a.from)&&(e(a,i,r),n=a.number),o=a.to+1}let s=t.changes(i);return{changes:i,range:Oe.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const N3=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Od(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),i=wO(t,(s,o,a)=>{let l=fO(r,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let c=/^\s*/.exec(s.text)[0],u=Bl(t,l);(c!=u||a.fromt.readOnly?!1:(e(t.update(wO(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Qc)})}),{userEvent:"input.indent"})),!0),i_=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(wO(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=Pi(i,t.tabSize),o=0,a=Bl(t,Math.max(0,s-wo(t)));for(;o(t.setTabFocusMode(),!0),F3=[{key:"Ctrl-b",run:Mk,shift:jk,preventDefault:!0},{key:"Ctrl-f",run:Rk,shift:Bk},{key:"Ctrl-p",run:Xk,shift:Yk},{key:"Ctrl-n",run:Zk,shift:Uk},{key:"Ctrl-a",run:o3,shift:v3},{key:"Ctrl-e",run:a3,shift:b3},{key:"Ctrl-d",run:Hk},{key:"Ctrl-h",run:Bg},{key:"Ctrl-k",run:Q3},{key:"Ctrl-Alt-h",run:Jk},{key:"Ctrl-o",run:A3},{key:"Ctrl-t",run:E3},{key:"Ctrl-v",run:jg}],j3=[{key:"ArrowLeft",run:Mk,shift:jk,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:HL,shift:u3,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:i3,shift:p3,preventDefault:!0},{key:"ArrowRight",run:Rk,shift:Bk,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:KL,shift:h3,preventDefault:!0},{mac:"Cmd-ArrowRight",run:s3,shift:O3,preventDefault:!0},{key:"ArrowUp",run:Xk,shift:Yk,preventDefault:!0},{mac:"Cmd-ArrowUp",run:by,shift:xy},{mac:"Ctrl-ArrowUp",run:py,shift:Oy},{key:"ArrowDown",run:Zk,shift:Uk,preventDefault:!0},{mac:"Cmd-ArrowDown",run:yy,shift:Sy},{mac:"Ctrl-ArrowDown",run:jg,shift:vy},{key:"PageUp",run:py,shift:Oy},{key:"PageDown",run:jg,shift:vy},{key:"Home",run:r3,shift:g3,preventDefault:!0},{key:"Mod-Home",run:by,shift:xy},{key:"End",run:n3,shift:m3,preventDefault:!0},{key:"Mod-End",run:yy,shift:Sy},{key:"Enter",run:wy,shift:wy},{key:"Mod-a",run:y3},{key:"Backspace",run:Bg,shift:Bg,preventDefault:!0},{key:"Delete",run:Hk,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Jk,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:P3,preventDefault:!0},{mac:"Mod-Backspace",run:C3,preventDefault:!0},{mac:"Mod-Delete",run:T3,preventDefault:!0}].concat(F3.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Cd=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e3,shift:d3},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t3,shift:f3},{key:"Alt-ArrowUp",run:D3},{key:"Shift-Alt-ArrowUp",run:R3},{key:"Alt-ArrowDown",run:M3},{key:"Shift-Alt-ArrowDown",run:L3},{key:"Mod-Alt-ArrowUp",run:w3},{key:"Mod-Alt-ArrowDown",run:k3},{key:"Escape",run:_3},{key:"Mod-Enter",run:Z3},{key:"Alt-l",mac:"Ctrl-l",run:x3},{key:"Mod-i",run:S3,preventDefault:!0},{key:"Mod-[",run:i_},{key:"Mod-]",run:r_},{key:"Mod-Alt-\\",run:N3},{key:"Shift-Mod-k",run:I3},{key:"Shift-Mod-\\",run:c3},{key:"Mod-/",run:RL},{key:"Alt-A",run:IL},{key:"Ctrl-m",mac:"Shift-Alt-m",run:V3}].concat(j3),Td={key:"Tab",run:r_,shift:i_},B3="#e5c07b",ky="#e06c75",z3="#56b6c2",W3="#ffffff",Nu="#abb2bf",zg="#7d8799",Y3="#61afef",U3="#98c379",_y="#d19a66",q3="#c678dd",$3="#21252b",Py="#2c313a",Qy="#282c34",Bf="#353a42",G3="#3E4451",Cy="#528bff",H3=Ae.theme({"&":{color:Nu,backgroundColor:Qy},".cm-content":{caretColor:Cy},".cm-cursor, .cm-dropCursor":{borderLeftColor:Cy},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:G3},".cm-panels":{backgroundColor:$3,color:Nu},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Qy,color:zg,border:"none"},".cm-activeLineGutter":{backgroundColor:Py},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Bf},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Bf,borderBottomColor:Bf},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Py,color:Nu}}},{dark:!0}),K3=Tc.define([{tag:E.keyword,color:q3},{tag:[E.name,E.deleted,E.character,E.propertyName,E.macroName],color:ky},{tag:[E.function(E.variableName),E.labelName],color:Y3},{tag:[E.color,E.constant(E.name),E.standard(E.name)],color:_y},{tag:[E.definition(E.name),E.separator],color:Nu},{tag:[E.typeName,E.className,E.number,E.changed,E.annotation,E.modifier,E.self,E.namespace],color:B3},{tag:[E.operator,E.operatorKeyword,E.url,E.escape,E.regexp,E.link,E.special(E.string)],color:z3},{tag:[E.meta,E.comment],color:zg},{tag:E.strong,fontWeight:"bold"},{tag:E.emphasis,fontStyle:"italic"},{tag:E.strikethrough,textDecoration:"line-through"},{tag:E.link,color:zg,textDecoration:"underline"},{tag:E.heading,fontWeight:"bold",color:ky},{tag:[E.atom,E.bool,E.special(E.variableName)],color:_y},{tag:[E.processingInstruction,E.string,E.inserted],color:U3},{tag:E.invalid,color:W3}]),Ad=[H3,Ac(K3)];function s_(t){return typeof t>"u"||t===null}function J3(t){return typeof t=="object"&&t!==null}function eI(t){return Array.isArray(t)?t:s_(t)?[]:[t]}function tI(t,e){var n,r,i,s;if(e)for(s=Object.keys(e),n=0,r=s.length;na&&(s=" ... ",e=r-a+s.length),n-r>a&&(o=" ...",n=r+a-o.length),{str:s+t.slice(e,n).replace(/\t/g,"→")+o,pos:r-e+s.length}}function Wf(t,e){return an.repeat(" ",e-t.length)+t}function uI(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],s,o=-1;s=n.exec(t.buffer);)i.push(s.index),r.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var a="",l,c,u=Math.min(t.line+e.linesAfter,i.length).toString().length,h=e.maxLength-(e.indent+u+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)c=zf(t.buffer,r[o-l],i[o-l],t.position-(r[o]-r[o-l]),h),a=an.repeat(" ",e.indent)+Wf((t.line-l+1).toString(),u)+" | "+c.str+` `+a;for(c=zf(t.buffer,r[o],i[o],t.position,h),a+=an.repeat(" ",e.indent)+Wf((t.line+1).toString(),u)+" | "+c.str+` `,a+=an.repeat("-",e.indent+u+3+c.pos)+`^ `,l=1;l<=e.linesAfter&&!(o+l>=i.length);l++)c=zf(t.buffer,r[o+l],i[o+l],t.position-(r[o]-r[o+l]),h),a+=an.repeat(" ",e.indent)+Wf((t.line+l+1).toString(),u)+" | "+c.str+` `;return a.replace(/\n$/,"")}var hI=uI,dI=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],fI=["scalar","sequence","mapping"];function mI(t){var e={};return t!==null&&Object.keys(t).forEach(function(n){t[n].forEach(function(r){e[String(r)]=n})}),e}function gI(t,e){if(e=e||{},Object.keys(e).forEach(function(n){if(dI.indexOf(n)===-1)throw new Fn('Unknown option "'+n+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(n){return n},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=mI(e.styleAliases||null),fI.indexOf(this.kind)===-1)throw new Fn('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var wn=gI;function Ty(t,e){var n=[];return t[e].forEach(function(r){var i=n.length;n.forEach(function(s,o){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=o)}),n[i]=r}),n}function pI(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,n;function r(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(e=0,n=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),TI=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function AI(t){return!(t===null||!TI.test(t)||t[t.length-1]==="_")}function EI(t){var e,n;return e=t.replace(/_/g,"").toLowerCase(),n=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:n*parseFloat(e,10)}var DI=/^[-+]?[0-9]+e/;function MI(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(an.isNegativeZero(t))return"-0.0";return n=t.toString(10),DI.test(n)?n.replace("e",".e"):n}function RI(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||an.isNegativeZero(t))}var g_=new wn("tag:yaml.org,2002:float",{kind:"scalar",resolve:AI,construct:EI,predicate:RI,represent:MI,defaultStyle:"lowercase"}),p_=h_.extend({implicit:[d_,f_,m_,g_]}),O_=p_,v_=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),b_=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function LI(t){return t===null?!1:v_.exec(t)!==null||b_.exec(t)!==null}function II(t){var e,n,r,i,s,o,a,l=0,c=null,u,h,d;if(e=v_.exec(t),e===null&&(e=b_.exec(t)),e===null)throw new Error("Date resolve error");if(n=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(n,r,i));if(s=+e[4],o=+e[5],a=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(u=+e[10],h=+(e[11]||0),c=(u*60+h)*6e4,e[9]==="-"&&(c=-c)),d=new Date(Date.UTC(n,r,i,s,o,a,l)),c&&d.setTime(d.getTime()-c),d}function XI(t){return t.toISOString()}var y_=new wn("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:LI,construct:II,instanceOf:Date,represent:XI});function ZI(t){return t==="<<"||t===null}var x_=new wn("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ZI}),kO=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function NI(t){if(t===null)return!1;var e,n,r=0,i=t.length,s=kO;for(n=0;n64)){if(e<0)return!1;r+=6}return r%8===0}function VI(t){var e,n,r=t.replace(/[\r\n=]/g,""),i=r.length,s=kO,o=0,a=[];for(e=0;e>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(r.charAt(e));return n=i%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function FI(t){var e="",n=0,r,i,s=t.length,o=kO;for(r=0;r>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]),n=(n<<8)+t[r];return i=s%3,i===0?(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]):i===2?(e+=o[n>>10&63],e+=o[n>>4&63],e+=o[n<<2&63],e+=o[64]):i===1&&(e+=o[n>>2&63],e+=o[n<<4&63],e+=o[64],e+=o[64]),e}function jI(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var S_=new wn("tag:yaml.org,2002:binary",{kind:"scalar",resolve:NI,construct:VI,predicate:jI,represent:FI}),BI=Object.prototype.hasOwnProperty,zI=Object.prototype.toString;function WI(t){if(t===null)return!0;var e=[],n,r,i,s,o,a=t;for(n=0,r=a.length;n>10)+55296,(t-65536&1023)+56320)}function A_(t,e,n){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:n}):t[e]=n}var E_=new Array(256),D_=new Array(256);for(var Bo=0;Bo<256;Bo++)E_[Bo]=Dy(Bo)?1:0,D_[Bo]=Dy(Bo);function aX(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||_O,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function M_(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=hI(n),new Fn(e,n)}function Ye(t,e){throw M_(t,e)}function yh(t,e){t.onWarning&&t.onWarning.call(null,M_(t,e))}var My={YAML:function(e,n,r){var i,s,o;e.version!==null&&Ye(e,"duplication of %YAML directive"),r.length!==1&&Ye(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Ye(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&Ye(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&yh(e,"unsupported YAML version of the document")},TAG:function(e,n,r){var i,s;r.length!==2&&Ye(e,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],C_.test(i)||Ye(e,"ill-formed tag handle (first argument) of the TAG directive"),As.call(e.tagMap,i)&&Ye(e,'there is a previously declared suffix for "'+i+'" tag handle'),T_.test(s)||Ye(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{Ye(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s}};function bs(t,e,n,r){var i,s,o,a;if(e1&&(t.result+=an.repeat(` `,e-1))}function lX(t,e,n){var r,i,s,o,a,l,c,u,h=t.kind,d=t.result,m;if(m=t.input.charCodeAt(t.position),Hn(m)||Jo(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96||(m===63||m===45)&&(i=t.input.charCodeAt(t.position+1),Hn(i)||n&&Jo(i)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,a=!1;m!==0;){if(m===58){if(i=t.input.charCodeAt(t.position+1),Hn(i)||n&&Jo(i))break}else if(m===35){if(r=t.input.charCodeAt(t.position-1),Hn(r))break}else{if(t.position===t.lineStart&&Ed(t)||n&&Jo(m))break;if(wi(m))if(l=t.line,c=t.lineStart,u=t.lineIndent,tn(t,!1,-1),t.lineIndent>=e){a=!0,m=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=l,t.lineStart=c,t.lineIndent=u;break}}a&&(bs(t,s,o,!1),QO(t,t.line-l),s=o=t.position,a=!1),ho(m)||(o=t.position+1),m=t.input.charCodeAt(++t.position)}return bs(t,s,o,!1),t.result?!0:(t.kind=h,t.result=d,!1)}function cX(t,e){var n,r,i;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(bs(t,r,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)r=t.position,t.position++,i=t.position;else return!0;else wi(n)?(bs(t,r,i,!0),QO(t,tn(t,!1,e)),r=i=t.position):t.position===t.lineStart&&Ed(t)?Ye(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Ye(t,"unexpected end of the stream within a single quoted scalar")}function uX(t,e){var n,r,i,s,o,a;if(a=t.input.charCodeAt(t.position),a!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;(a=t.input.charCodeAt(t.position))!==0;){if(a===34)return bs(t,n,t.position,!0),t.position++,!0;if(a===92){if(bs(t,n,t.position,!0),a=t.input.charCodeAt(++t.position),wi(a))tn(t,!1,e);else if(a<256&&E_[a])t.result+=D_[a],t.position++;else if((o=iX(a))>0){for(i=o,s=0;i>0;i--)a=t.input.charCodeAt(++t.position),(o=rX(a))>=0?s=(s<<4)+o:Ye(t,"expected hexadecimal character");t.result+=oX(s),t.position++}else Ye(t,"unknown escape sequence");n=r=t.position}else wi(a)?(bs(t,n,r,!0),QO(t,tn(t,!1,e)),n=r=t.position):t.position===t.lineStart&&Ed(t)?Ye(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}Ye(t,"unexpected end of the stream within a double quoted scalar")}function hX(t,e){var n=!0,r,i,s,o=t.tag,a,l=t.anchor,c,u,h,d,m,g=Object.create(null),p,O,v,w;if(w=t.input.charCodeAt(t.position),w===91)u=93,m=!1,a=[];else if(w===123)u=125,m=!0,a={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=a),w=t.input.charCodeAt(++t.position);w!==0;){if(tn(t,!0,e),w=t.input.charCodeAt(t.position),w===u)return t.position++,t.tag=o,t.anchor=l,t.kind=m?"mapping":"sequence",t.result=a,!0;n?w===44&&Ye(t,"expected the node content, but found ','"):Ye(t,"missed comma between flow collection entries"),O=p=v=null,h=d=!1,w===63&&(c=t.input.charCodeAt(t.position+1),Hn(c)&&(h=d=!0,t.position++,tn(t,!0,e))),r=t.line,i=t.lineStart,s=t.position,ya(t,e,vh,!1,!0),O=t.tag,p=t.result,tn(t,!0,e),w=t.input.charCodeAt(t.position),(d||t.line===r)&&w===58&&(h=!0,w=t.input.charCodeAt(++t.position),tn(t,!0,e),ya(t,e,vh,!1,!0),v=t.result),m?ea(t,a,g,O,p,v,r,i,s):h?a.push(ea(t,null,g,O,p,v,r,i,s)):a.push(p),tn(t,!0,e),w=t.input.charCodeAt(t.position),w===44?(n=!0,w=t.input.charCodeAt(++t.position)):n=!1}Ye(t,"unexpected end of the stream within a flow collection")}function dX(t,e){var n,r,i=Yf,s=!1,o=!1,a=e,l=0,c=!1,u,h;if(h=t.input.charCodeAt(t.position),h===124)r=!1;else if(h===62)r=!0;else return!1;for(t.kind="scalar",t.result="";h!==0;)if(h=t.input.charCodeAt(++t.position),h===43||h===45)Yf===i?i=h===43?Ay:JI:Ye(t,"repeat of a chomping mode identifier");else if((u=sX(h))>=0)u===0?Ye(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?Ye(t,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(ho(h)){do h=t.input.charCodeAt(++t.position);while(ho(h));if(h===35)do h=t.input.charCodeAt(++t.position);while(!wi(h)&&h!==0)}for(;h!==0;){for(PO(t),t.lineIndent=0,h=t.input.charCodeAt(t.position);(!o||t.lineIndenta&&(a=t.lineIndent),wi(h)){l++;continue}if(t.lineIndente)&&l!==0)Ye(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(O&&(o=t.line,a=t.lineStart,l=t.position),ya(t,e,bh,!0,i)&&(O?g=t.result:p=t.result),O||(ea(t,h,d,m,g,p,o,a,l),m=g=p=null),tn(t,!0,-1),w=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&w!==0)Ye(t,"bad indentation of a mapping entry");else if(t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndente?l=1:t.lineIndent===e?l=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),h=0,d=t.implicitTypes.length;h"),t.result!==null&&g.kind!==t.kind&&Ye(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Ye(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||u}function OX(t){var e=t.position,n,r,i,s=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(tn(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(s=!0,o=t.input.charCodeAt(++t.position),n=t.position;o!==0&&!Hn(o);)o=t.input.charCodeAt(++t.position);for(r=t.input.slice(n,t.position),i=[],r.length<1&&Ye(t,"directive name must not be less than one character in length");o!==0;){for(;ho(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!wi(o));break}if(wi(o))break;for(n=t.position;o!==0&&!Hn(o);)o=t.input.charCodeAt(++t.position);i.push(t.input.slice(n,t.position))}o!==0&&PO(t),As.call(My,r)?My[r](t,r,i):yh(t,'unknown document directive "'+r+'"')}if(tn(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,tn(t,!0,-1)):s&&Ye(t,"directives end mark is expected"),ya(t,t.lineIndent-1,bh,!1,!0),tn(t,!0,-1),t.checkLineBreaks&&tX.test(t.input.slice(e,t.position))&&yh(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Ed(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,tn(t,!0,-1));return}if(t.position"u"&&(n=e,e=null);var r=R_(t,n);if(typeof e!="function")return r;for(var i=0,s=r.length;i=55296&&n<=56319&&e+1=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function B_(t){var e=/^\n* /;return e.test(t)}var z_=1,qg=2,W_=3,Y_=4,qo=5;function UX(t,e,n,r,i,s,o,a){var l,c=0,u=null,h=!1,d=!1,m=r!==-1,g=-1,p=WX(pl(t,0))&&YX(pl(t,t.length-1));if(e||o)for(l=0;l=65536?l+=2:l++){if(c=pl(t,l),!ql(c))return qo;p=p&&Zy(c,u,a),u=c}else{for(l=0;l=65536?l+=2:l++){if(c=pl(t,l),c===Yl)h=!0,m&&(d=d||l-g-1>r&&t[g+1]!==" ",g=l);else if(!ql(c))return qo;p=p&&Zy(c,u,a),u=c}d=d||m&&l-g-1>r&&t[g+1]!==" "}return!h&&!d?p&&!o&&!i(t)?z_:s===Ul?qo:qg:n>9&&B_(t)?qo:o?s===Ul?qo:qg:d?Y_:W_}function qX(t,e,n,r,i){t.dump=(function(){if(e.length===0)return t.quotingType===Ul?'""':"''";if(!t.noCompatMode&&(ZX.indexOf(e)!==-1||NX.test(e)))return t.quotingType===Ul?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,n),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),a=r||t.flowLevel>-1&&n>=t.flowLevel;function l(c){return zX(t,c)}switch(UX(e,a,t.indent,o,l,t.quotingType,t.forceQuotes&&!r,i)){case z_:return e;case qg:return"'"+e.replace(/'/g,"''")+"'";case W_:return"|"+Ny(e,t.indent)+Vy(Iy(e,s));case Y_:return">"+Ny(e,t.indent)+Vy(Iy($X(e,o),s));case qo:return'"'+GX(e)+'"';default:throw new Fn("impossible error: invalid scalar style")}})()}function Ny(t,e){var n=B_(t)?String(e):"",r=t[t.length-1]===` `,i=r&&(t[t.length-2]===` `||t===` `),s=i?"+":r?"":"-";return n+s+` `}function Vy(t){return t[t.length-1]===` `?t.slice(0,-1):t}function $X(t,e){for(var n=/(\n+)([^\n]*)/g,r=(function(){var c=t.indexOf(` `);return c=c!==-1?c:t.length,n.lastIndex=c,Fy(t.slice(0,c),e)})(),i=t[0]===` `||t[0]===" ",s,o;o=n.exec(t);){var a=o[1],l=o[2];s=l[0]===" ",r+=a+(!i&&!s&&l!==""?` `:"")+Fy(l,e),i=s}return r}function Fy(t,e){if(t===""||t[0]===" ")return t;for(var n=/ [^ ]/g,r,i=0,s,o=0,a=0,l="";r=n.exec(t);)a=r.index,a-i>e&&(s=o>i?o:a,l+=` `+t.slice(i,s),i=s+1),o=a;return l+=` `,t.length-i>e&&o>i?l+=t.slice(i,o)+` `+t.slice(o+1):l+=t.slice(i),l.slice(1)}function GX(t){for(var e="",n=0,r,i=0;i=65536?i+=2:i++)n=pl(t,i),r=In[n],!r&&ql(n)?(e+=t[i],n>=65536&&(e+=t[i+1])):e+=r||FX(n);return e}function HX(t,e,n){var r="",i=t.tag,s,o,a;for(s=0,o=n.length;s"u"&&Ui(t,e,null,!1,!1))&&(r!==""&&(r+=","+(t.condenseFlow?"":" ")),r+=t.dump);t.tag=i,t.dump="["+r+"]"}function jy(t,e,n,r){var i="",s=t.tag,o,a,l;for(o=0,a=n.length;o"u"&&Ui(t,e+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Ug(t,e)),t.dump&&Yl===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}function KX(t,e,n){var r="",i=t.tag,s=Object.keys(n),o,a,l,c,u;for(o=0,a=s.length;o1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Ui(t,e,c,!1,!1)&&(u+=t.dump,r+=u));t.tag=i,t.dump="{"+r+"}"}function JX(t,e,n,r){var i="",s=t.tag,o=Object.keys(n),a,l,c,u,h,d;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new Fn("sortKeys must be a boolean or a function");for(a=0,l=o.length;a1024,h&&(t.dump&&Yl===t.dump.charCodeAt(0)?d+="?":d+="? "),d+=t.dump,h&&(d+=Ug(t,e)),Ui(t,e+1,u,!0,h)&&(t.dump&&Yl===t.dump.charCodeAt(0)?d+=":":d+=": ",d+=t.dump,i+=d));t.tag=s,t.dump=i||"{}"}function By(t,e,n){var r,i,s,o,a,l;for(i=n?t.explicitTypes:t.implicitTypes,s=0,o=i.length;s tag resolver accepts not "'+l+'" style');t.dump=r}return!0}return!1}function Ui(t,e,n,r,i,s,o){t.tag=null,t.dump=n,By(t,n,!1)||By(t,n,!0);var a=I_.call(t.dump),l=r,c;r&&(r=t.flowLevel<0||t.flowLevel>e);var u=a==="[object Object]"||a==="[object Array]",h,d;if(u&&(h=t.duplicates.indexOf(n),d=h!==-1),(t.tag!==null&&t.tag!=="?"||d||t.indent!==2&&e>0)&&(i=!1),d&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(u&&d&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),a==="[object Object]")r&&Object.keys(t.dump).length!==0?(JX(t,e,t.dump,i),d&&(t.dump="&ref_"+h+t.dump)):(KX(t,e,t.dump),d&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object Array]")r&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?jy(t,e-1,t.dump,i):jy(t,e,t.dump,i),d&&(t.dump="&ref_"+h+t.dump)):(HX(t,e,t.dump),d&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&qX(t,t.dump,e,s,l);else{if(a==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Fn("unacceptable kind of an object to dump "+a)}t.tag!==null&&t.tag!=="?"&&(c=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",t.dump=c+" "+t.dump)}return!0}function e4(t,e){var n=[],r=[],i,s;for($g(t,n,r),i=0,s=r.length;i*'),b4=P(''),y4=P('

'),x4=P("
"),S4=P('
'),w4=P("
",1),k4=P(''),_4=P('

'),P4=P('
');function Q4(t,e){Me(e,!0);const n=ve.tMaybe,r=!!e.field.yaml,i=A(()=>String(e.value??e.field.default??""));let s,o,a=ge(!1),l=!1,c=ge("");function u(){k(a,document.documentElement.classList.contains("dark"),!0)}const h=Ae.theme({"&":{fontSize:"13px",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'},".cm-content":{caretColor:"hsl(221 83% 53%)",padding:"8px 0",lineHeight:"1.5"},".cm-cursor":{borderLeftColor:"hsl(221 83% 53%)",borderLeftWidth:"2px"},".cm-scroller":{overflow:"auto"},".cm-gutters":{backgroundColor:"transparent",borderRight:"none",color:"hsl(240 3.8% 46.1%)",paddingRight:"4px"},".cm-activeLine":{backgroundColor:"hsl(240 4.8% 95.9% / 0.5)"},".cm-selectionBackground":{backgroundColor:"hsl(221 83% 53% / 0.15) !important"},".cm-line":{padding:"0 12px"}}),d=Ae.theme({"&":{fontSize:"13px",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'},".cm-content":{caretColor:"hsl(217 91% 60%)",padding:"8px 0",lineHeight:"1.5"},".cm-cursor":{borderLeftColor:"hsl(217 91% 60%)",borderLeftWidth:"2px"},".cm-scroller":{overflow:"auto"},".cm-gutters":{backgroundColor:"transparent",borderRight:"none",color:"hsl(240 5% 64.9%)",paddingRight:"4px"},".cm-activeLine":{backgroundColor:"hsl(240 3.7% 15.9% / 0.5)"},".cm-selectionBackground":{backgroundColor:"hsl(217 91% 60% / 0.2) !important"},".cm-line":{padding:"0 12px"}});function m(){if(!r||!s)return;o&&o.destroy();const Q=ot.create({doc:String(e.value??e.field.default??""),extensions:[xd(),Sd(),vd(),Ac(yd,{fallback:!0}),Io.of([...Cd,...kd,Td]),f(a)?Ad:h,f(a)?d:h,iO(e.field.placeholder?n(e.field.placeholder):""),Ae.updateListener.of(D=>{if(D.docChanged){l=!0;const I=D.state.doc.toString();try{Gg.load(I),k(c,"")}catch(X){k(c,X instanceof Error?X.message.split(` `)[0]:"Invalid YAML",!0)}e.onchange(I)}}),Ae.lineWrapping,ot.tabSize.of(2)]});o=new Ae({state:Q,parent:s})}r&&tr(()=>{u(),m();const Q=new MutationObserver(()=>{const D=f(a);u(),D!==f(a)&&m()});return Q.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{Q.disconnect(),o?.destroy()}});let g=ge(Pt(String(e.value??"")));We(()=>{if(!r||!o)return;const Q=String(e.value??"");Q!==f(g)&&(k(g,Q,!0),l?l=!1:Q!==o.state.doc.toString()&&o.dispatch({changes:{from:0,to:o.state.doc.length,insert:Q}}))});var p=P4(),O=x(p);{var v=Q=>{var D=x4(),I=x(D);{var X=F=>{var U=b4(),j=x(U),Y=M(j);{var ie=N=>{var z=v4();y(N,z)};Z(Y,N=>{e.field.validate?.required&&N(ie)})}b(U),B(N=>$(j,`${N??""} `),[()=>n(e.field.label)]),y(F,U)};Z(I,F=>{e.field.label&&F(X)})}var L=M(I,2);{var R=F=>{var U=y4();lt(U,()=>n(e.field.help),!0),b(U),y(F,U)};Z(L,F=>{e.field.help&&F(R)})}b(D),y(Q,D)};Z(O,Q=>{(e.field.label||e.field.help)&&Q(v)})}var w=M(O,2);{var _=Q=>{var D=w4(),I=me(D);gn(I,R=>s=R,()=>s);var X=M(I,2);{var L=R=>{var F=S4(),U=x(F);aS(U,{size:12,class:"mt-0.5 shrink-0"});var j=M(U,2),Y=x(j,!0);b(j),b(F),B(()=>$(Y,f(c))),y(R,F)};Z(X,R=>{f(c)&&R(L)})}B(()=>Je(I,1,`overflow-hidden rounded-lg border border-input bg-muted/50 shadow-sm focus-within:ring-1 focus-within:ring-ring ${f(c)?"border-red-500/50":""}`)),y(Q,D)},C=Q=>{var D=k4();tS(D),B(I=>{Je(D,1,`flex min-h-[80px] w-full rounded-lg border bg-muted/50 px-3 py-2.5 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring ${e.error?"border-destructive ring-1 ring-destructive":"border-input"}`),Ve(D,"rows",e.field.rows??4),Jn(D,f(i)),Ve(D,"placeholder",I),D.disabled=e.field.disabled,D.readOnly=e.field.readonly},[()=>n(e.field.placeholder)]),Ce("input",D,I=>e.onchange(I.target.value)),y(Q,D)};Z(w,Q=>{r?Q(_):Q(C,-1)})}var T=M(w,2);{var S=Q=>{var D=_4(),I=x(D,!0);b(D),B(()=>$(I,e.error)),y(Q,D)};Z(T,Q=>{e.error&&Q(S)})}b(p),y(t,p),Re()}It(["input"]);class C4{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=Et(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),s=i.search(D4(e));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function zy(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function T4(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;stypeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:T4(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}function E4(t,e){return n=>{for(let r=Et(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}function D4(t,e){var n;let{source:r}=t,i=r[r.length-1]!="$";return i?new RegExp(`(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":""):t}const M4=$r.define(),R4=Ae.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class L4{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class AO{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Tn.TrackDel),r=e.mapPos(this.to,1,Tn.TrackDel);return n==null||r==null?null:new AO(this.field,n,r)}}class EO{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],s=e.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(r.length){let c=o,u=/^\t*/.exec(l)[0].length;for(let h=0;hnew AO(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let n=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",c=-1,u=l.replace(/\\[{}]/g,h=>h[1]);for(let h=0;h=c&&d.field++}for(let h of i)if(h.line==r.length&&h.from>s.index){let d=s[2]?3+(s[1]||"").length:2;h.from-=d,h.to-=d}i.push(new L4(c,r.length,s.index,s.index+u.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(o)}return new EO(r,i)}}let I4=ze.widget({widget:new class extends Gr{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),X4=ze.mark({class:"cm-snippetField"});class Xa{constructor(e,n){this.ranges=e,this.active=n,this.deco=ze.set(e.map(r=>(r.from==r.to?I4:X4).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Xa(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const Dc=yt.define({map(t,e){return t&&t.map(e)}}),Z4=yt.define(),$l=yr.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Dc))return n.value;if(n.is(Z4)&&t)return new Xa(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Ae.decorations.from(t,e=>e?e.deco:ze.none)});function DO(t,e){return Oe.create(t.filter(n=>n.field==e).map(n=>Oe.range(n.from,n.to)))}function N4(t){let e=EO.parse(t);return(n,r,i,s)=>{let{text:o,ranges:a}=e.instantiate(n.state,i),{main:l}=n.state.selection,c={changes:{from:i,to:s==l.from?l.to:s,insert:bt.of(o)},scrollIntoView:!0,annotations:r?[M4.of(r),Bn.userEvent.of("input.complete")]:void 0};if(a.length&&(c.selection=DO(a,0)),a.some(u=>u.field>0)){let u=new Xa(a,0),h=c.effects=[Dc.of(u)];n.state.field($l,!1)===void 0&&h.push(yt.appendConfig.of([$l,z4,W4,R4]))}n.dispatch(n.state.update(c))}}function U_(t){return({state:e,dispatch:n})=>{let r=e.field($l,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,s=t>0&&!r.ranges.some(o=>o.field==i+t);return n(e.update({selection:DO(r.ranges,i),effects:Dc.of(s?null:new Xa(r.ranges,i)),scrollIntoView:!0})),!0}}const V4=({state:t,dispatch:e})=>t.field($l,!1)?(e(t.update({effects:Dc.of(null)})),!0):!1,F4=U_(1),j4=U_(-1),B4=[{key:"Tab",run:F4,shift:j4},{key:"Escape",run:V4}],Wy=Ze.define({combine(t){return t.length?t[0]:B4}}),z4=Lo.highest(Io.compute([Wy],t=>t.facet(Wy)));function Yn(t,e){return{...e,apply:N4(t)}}const W4=Ae.domEventHandlers({mousedown(t,e){let n=e.state.field($l,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:DO(n.ranges,i.field),effects:Dc.of(n.ranges.some(s=>s.field>i.field)?new Xa(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Gl={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ao=yt.define({map(t,e){let n=e.mapPos(t,-1,Tn.TrackAfter);return n??void 0}}),MO=new class extends xs{};MO.startSide=1;MO.endSide=-1;const q_=yr.define({create(){return ft.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(ao)&&(t=t.update({add:[MO.range(n.value,n.value+1)]}));return t}});function $_(){return[U4,q_]}const Uf="()[]{}<>«»»«[]{}";function G_(t){for(let e=0;e{if((Y4?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&wc(Vs(r,0))==1||e!=i.from||n!=i.to)return!1;let s=$4(t.state,r);return s?(t.dispatch(s),!0):!1}),q4=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=H_(t,t.selection.main.head).brackets||Gl.brackets,i=null,s=t.changeByRange(o=>{if(o.empty){let a=G4(t.doc,o.head);for(let l of r)if(l==a&&Dd(t.doc,o.head)==G_(Vs(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:Oe.cursor(o.head-l.length)}}return{range:i=o}});return i||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},K_=[{key:"Backspace",run:q4}];function $4(t,e){let n=H_(t,t.selection.main.head),r=n.brackets||Gl.brackets;for(let i of r){let s=G_(Vs(i,0));if(e==i)return s==i?J4(t,i,r.indexOf(i+i+i)>-1,n):H4(t,i,s,n.before||Gl.before);if(e==s&&J_(t,t.selection.main.from))return K4(t,i,s)}return null}function J_(t,e){let n=!1;return t.field(q_).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function Dd(t,e){let n=t.sliceString(e,e+2);return n.slice(0,wc(Vs(n,0)))}function G4(t,e){let n=t.sliceString(e-2,e);return wc(Vs(n,0))==n.length?n:n.slice(1)}function H4(t,e,n,r){let i=null,s=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:n,from:o.to}],effects:ao.of(o.to+e.length),range:Oe.range(o.anchor+e.length,o.head+e.length)};let a=Dd(t.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:o.head},effects:ao.of(o.head+e.length),range:Oe.cursor(o.head+e.length)}:{range:i=o}});return i?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function K4(t,e,n){let r=null,i=t.changeByRange(s=>s.empty&&Dd(t.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:Oe.cursor(s.head+n.length)}:r={range:s});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function J4(t,e,n,r){let i=r.stringPrefixes||Gl.stringPrefixes,s=null,o=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:ao.of(a.to+e.length),range:Oe.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=Dd(t.doc,l),u;if(c==e){if(Yy(t,l))return{changes:{insert:e+e,from:l},effects:ao.of(l+e.length),range:Oe.cursor(l+e.length)};if(J_(t,l)){let d=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:Oe.cursor(l+d.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(u=Uy(t,l-2*e.length,i))>-1&&Yy(t,u))return{changes:{insert:e+e+e+e,from:l},effects:ao.of(l+e.length),range:Oe.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=Zt.Word&&Uy(t,l,i)>-1&&!eZ(t,l,e,i))return{changes:{insert:e+e,from:l},effects:ao.of(l+e.length),range:Oe.cursor(l+e.length)}}return{range:s=a}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Yy(t,e){let n=Et(t).resolveInner(e+1);return n.parent&&n.from==e}function eZ(t,e,n,r){let i=Et(t).resolveInner(e,-1),s=r.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+s)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+l;){if(t.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function Uy(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Zt.Word)return e;for(let i of n){let s=e-i.length;if(t.sliceDoc(s,e)==i&&r(t.sliceDoc(s-1,s))!=Zt.Word)return s}return-1}class wh{static create(e,n,r,i,s){let o=i+(i<<8)+e+(n<<4)|0;return new wh(e,n,r,o,s,[],[])}constructor(e,n,r,i,s,o,a){this.type=e,this.value=n,this.from=r,this.hash=i,this.end=s,this.children=o,this.positions=a,this.hashProp=[[et.contextHash,i]]}addChild(e,n){e.prop(et.contextHash)!=this.hash&&(e=new mt(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(n)}toTree(e,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new mt(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(i,s,o)=>new mt(rn.none,i,s,o,this.hashProp)})}}var Ee;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(Ee||(Ee={}));class tZ{constructor(e,n){this.start=e,this.content=n,this.marks=[],this.parsers=[]}}class nZ{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Ql(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,n=0,r=0){for(let i=n;i=e.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(t.type==Ee.OrderedList?IO:LO)(n,e,!1);return r>0&&(t.type!=Ee.BulletList||RO(n,e,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==t.value}const e2={[Ee.Blockquote](t,e,n){return n.next!=62?!1:(n.markers.push(vt(Ee.QuoteMark,e.lineStart+n.pos,e.lineStart+n.pos+1)),n.moveBase(n.pos+(Mr(n.text.charCodeAt(n.pos+1))?2:1)),t.end=e.lineStart+n.text.length,!0)},[Ee.ListItem](t,e,n){return n.indent-1?!1:(n.moveBaseColumn(n.baseIndent+t.value),!0)},[Ee.OrderedList]:qy,[Ee.BulletList]:qy,[Ee.Document](){return!0}};function Mr(t){return t==32||t==9||t==10||t==13}function Ql(t,e=0){for(;en&&Mr(t.charCodeAt(e-1));)e--;return e}function t2(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(c2.SetextHeading)>-1||r<3?-1:1}function r2(t,e){for(let n=t.stack.length-1;n>=0;n--)if(t.stack[n].type==e)return!0;return!1}function LO(t,e,n){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||Mr(t.text.charCodeAt(t.pos+1)))&&(!n||r2(e,Ee.BulletList)||t.skipSpace(t.pos+2)=48&&i<=57;){r++;if(r==t.text.length)return-1;i=t.text.charCodeAt(r)}return r==t.pos||r>t.pos+9||i!=46&&i!=41||rt.pos+1||t.next!=49)?-1:r+1-t.pos}function i2(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e6?-1:n}function s2(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e/,a2=/\?>/,Kg=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(r);if(s)return t.append(vt(Ee.Comment,n,n+1+s[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return t.append(vt(Ee.ProcessingInstruction,n,n+1+o[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return a?t.append(vt(Ee.HTMLTag,n,n+1+a[0].length)):-1},Emphasis(t,e,n){if(e!=95&&e!=42)return-1;let r=n+1;for(;t.char(r)==e;)r++;let i=t.slice(n-1,n),s=t.slice(r,r+1),o=Kl.test(i),a=Kl.test(s),l=/\s|^$/.test(i),c=/\s|^$/.test(s),u=!c&&(!a||l||o),h=!l&&(!o||c||a),d=u&&(e==42||!h||o),m=h&&(e==42||!u||a);return t.append(new dr(e==95?m2:g2,n,r,(d?1:0)|(m?2:0)))},HardBreak(t,e,n){if(e==92&&t.char(n+1)==10)return t.append(vt(Ee.HardBreak,n,n+2));if(e==32){let r=n+1;for(;t.char(r)==32;)r++;if(t.char(r)==10&&r>=n+2)return t.append(vt(Ee.HardBreak,n,r+1))}return-1},Link(t,e,n){return e==91?t.append(new dr(to,n,n+1,1)):-1},Image(t,e,n){return e==33&&t.char(n+1)==91?t.append(new dr(kh,n,n+2,1)):-1},LinkEnd(t,e,n){if(e!=93)return-1;for(let r=t.parts.length-1;r>=0;r--){let i=t.parts[r];if(i instanceof dr&&(i.type==to||i.type==kh)){if(!i.side||t.skipSpace(i.to)==n&&!/[(\[]/.test(t.slice(n+1,n+2)))return t.parts[r]=null,-1;let s=t.takeContent(r),o=t.parts[r]=lZ(t,s,i.type==to?Ee.Link:Ee.Image,i.from,n+1);if(i.type==to)for(let a=0;ae?vt(Ee.URL,e+n,s+n):s==t.length?null:!1}}function O2(t,e,n){let r=t.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let s=e+1,o=!1;s=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,n){return this.text.slice(e-this.offset,n-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,n,r,i,s){return this.append(new dr(e,n,r,(i?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let n=this.parts[e];if(n instanceof dr&&(n.type==to||n.type==kh))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r=e;l--){let p=this.parts[l];if(p instanceof dr&&p.side&1&&p.type==i.type&&!(s&&(i.side&1||p.side&2)&&(p.to-p.from+o)%3==0&&((p.to-p.from)%3||o%3))){a=p;break}}if(!a)continue;let c=i.type.resolve,u=[],h=a.from,d=i.to;if(s){let p=Math.min(2,a.to-a.from,o);h=a.to-p,d=i.from+p,c=p==1?"Emphasis":"StrongEmphasis"}a.type.mark&&u.push(this.elt(a.type.mark,h,a.to));for(let p=l+1;p=0;n--){let r=this.parts[n];if(r instanceof dr&&r.type==e&&r.side&1)return n}return null}takeContent(e){let n=this.resolveMarkers(e);return this.parts.length=e,n}getDelimiterAt(e){let n=this.parts[e];return n instanceof dr?n:null}skipSpace(e){return Ql(this.text,e-this.offset)+this.offset}elt(e,n,r,i){return typeof e=="string"?vt(this.parser.getNodeType(e),n,r,i):new f2(e,n)}}XO.linkStart=to;XO.imageStart=kh;function ep(t,e){if(!e.length)return t;if(!t.length)return e;let n=t.slice(),r=0;for(let i of e){for(;r(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` `;)s--;this.fragmentEnd=s?s-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let i=e+this.fragment.offset;for(;r.to<=i;)if(!r.parent())return!1;for(;;){if(r.from>=i)return this.fragment.from<=n;if(!r.childAfter(i))return!1}}matches(e){let n=this.cursor.tree;return n&&n.prop(et.contextHash)==e}takeNodes(e){let n=this.cursor,r=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,l=o,c=a;for(;;){if(n.to-r>i){if(n.type.isAnonymous&&n.firstChild())continue;break}let u=b2(n.from-r,e.ranges);if(n.to-r<=e.ranges[e.rangeI].to)e.addNode(n.tree,u);else{let h=new mt(e.parser.nodeSet.types[Ee.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,n.tree),e.addNode(h,u)}if(n.type.is("Block")&&(cZ.indexOf(n.type.id)<0?(o=n.to-r,a=e.block.children.length):(o=l,a=c),l=n.to-r,c=e.block.children.length),!n.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-s}}function b2(t,e){let n=t;for(let r=1;rmu[t]),Object.keys(mu).map(t=>c2[t]),Object.keys(mu),sZ,e2,Object.keys($f).map(t=>$f[t]),Object.keys($f),[]);function fZ(t,e,n){let r=[];for(let i=t.firstChild,s=e;;i=i.nextSibling){let o=i?i.from:n;if(o>s&&r.push({from:s,to:o}),!i)break;s=i.to}return r}function mZ(t){let{codeParser:e,htmlParser:n}=t;return{wrap:lO((i,s)=>{let o=i.type.id;if(e&&(o==Ee.CodeBlock||o==Ee.FencedCode)){let a="";if(o==Ee.FencedCode){let c=i.node.getChild(Ee.CodeInfo);c&&(a=s.read(c.from,c.to))}let l=e(a);if(l)return{parser:l,overlay:c=>c.type.id==Ee.CodeText,bracketed:o==Ee.FencedCode}}else if(n&&(o==Ee.HTMLBlock||o==Ee.HTMLTag||o==Ee.CommentBlock))return{parser:n,overlay:fZ(i.node,i.from,i.to)};return null})}}const gZ={resolve:"Strikethrough",mark:"StrikethroughMark"},pZ={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":E.strikethrough}},{name:"StrikethroughMark",style:E.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,n){if(e!=126||t.char(n+1)!=126||t.char(n+2)==126)return-1;let r=t.slice(n-1,n),i=t.slice(n+2,n+3),s=/\s|^$/.test(r),o=/\s|^$/.test(i),a=Kl.test(r),l=Kl.test(i);return t.addDelimiter(gZ,n,n+2,!o&&(!l||s||a),!s&&(!a||o||l))},after:"Emphasis"}]};function Cl(t,e,n=0,r,i=0){let s=0,o=!0,a=-1,l=-1,c=!1,u=()=>{r.push(t.elt("TableCell",i+a,i+l,t.parser.parseInline(e.slice(a,l),i+a)))};for(let h=n;h-1)&&s++,o=!1,r&&(a>-1&&u(),r.push(t.elt("TableDelimiter",h+i,h+i+1))),a=l=-1):(c||d!=32&&d!=9)&&(a<0&&(a=h),l=h+1),c=!c&&d==92}return a>-1&&(s++,r&&u()),s}function Ky(t,e){for(let n=e;ni instanceof Jy)||!Ky(e.text,e.basePos))return!1;let r=t.peekLine();return y2.test(r)&&Cl(t,e.text,e.basePos)==Cl(t,r,e.basePos)},before:"SetextHeading"}]};class vZ{nextLine(){return!1}finish(e,n){return e.addLeafElement(n,e.elt("Task",n.start,n.start+n.content.length,[e.elt("TaskMarker",n.start,n.start+3),...e.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const bZ={defineNodes:[{name:"Task",block:!0,style:E.list},{name:"TaskMarker",style:E.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new vZ:null},after:"SetextHeading"}]},e1=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,t1=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,yZ=/[\w-]+\.[\w-]+($|\/)/,n1=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,r1=/\/[a-zA-Z\d@.]+/gy;function i1(t,e,n,r){let i=0;for(let s=e;s-1)return-1;let r=e+n[0].length;for(;;){let i=t[r-1],s;if(/[?!.,:*_~]/.test(i)||i==")"&&i1(t,e,r,")")>i1(t,e,r,"("))r--;else if(i==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,r))))r=e+s.index;else break}return r}function s1(t,e){n1.lastIndex=e;let n=n1.exec(t);if(!n)return-1;let r=n[0][n[0].length-1];return r=="_"||r=="-"?-1:e+n[0].length-(r=="."?1:0)}const SZ={parseInline:[{name:"Autolink",parse(t,e,n){let r=n-t.offset;if(r&&/\w/.test(t.text[r-1]))return-1;e1.lastIndex=r;let i=e1.exec(t.text),s=-1;if(!i)return-1;if(i[1]||i[2]){if(s=xZ(t.text,r+i[0].length),s>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(r,s));s=r+o[0].length}}else i[3]?s=s1(t.text,r):(s=s1(t.text,r+i[0].length),s>-1&&i[0]=="xmpp:"&&(r1.lastIndex=s,i=r1.exec(t.text),i&&(s=i.index+i[0].length)));return s<0?-1:(t.addElement(t.elt("URL",n,s+t.offset)),s+t.offset)}}]},wZ=[OZ,bZ,pZ,SZ];function x2(t,e,n){return(r,i,s)=>{if(i!=t||r.char(s+1)==t)return-1;let o=[r.elt(n,s,s+1)];for(let a=s+1;a=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let c1=null,u1=null,h1=0;function np(t,e){let n=t.pos+e;if(h1==n&&u1==t)return c1;let r=t.peek(e),i="";for(;GZ(r);)i+=String.fromCharCode(r),r=t.peek(++e);return u1=t,h1=n,c1=i?i.toLowerCase():r==HZ||r==KZ?void 0:null}const T2=60,_h=62,NO=47,HZ=63,KZ=33,JZ=45;function d1(t,e){this.name=t,this.parent=e}const eN=[ZO,_2,S2,w2,k2],tN=new cO({start:null,shift(t,e,n,r){return eN.indexOf(e)>-1?new d1(np(r,1)||"",t):t},reduce(t,e){return e==P2&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==ZO||i==zZ?new d1(np(r,1)||"",t):t},strict:!1}),nN=new Pn((t,e)=>{if(t.next!=T2){t.next<0&&e.context&&t.acceptToken(Gf);return}t.advance();let n=t.next==NO;n&&t.advance();let r=np(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?ZZ:XZ);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(RZ);if(i&&$Z[i])return t.acceptToken(Gf,-2);if(e.dialectEnabled(YZ))return t.acceptToken(LZ);for(let s=e.context;s;s=s.parent)if(s.name==r)return;t.acceptToken(IZ)}else{if(r=="script")return t.acceptToken(S2);if(r=="style")return t.acceptToken(w2);if(r=="textarea")return t.acceptToken(k2);if(qZ.hasOwnProperty(r))return t.acceptToken(_2);i&&l1[i]&&l1[i][r]?t.acceptToken(Gf,-1):t.acceptToken(ZO)}},{contextual:!0}),rN=new Pn(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(a1);break}if(t.next==JZ)e++;else if(t.next==_h&&e>=2){n>=3&&t.acceptToken(a1,-2);break}else e=0;t.advance()}});function iN(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const sN=new Pn((t,e)=>{if(t.next==NO&&t.peek(1)==_h){let n=e.dialectEnabled(UZ)||iN(e.context);t.acceptToken(n?MZ:o1,2)}else t.next==_h&&t.acceptToken(o1,1)});function VO(t,e,n){let r=2+t.length;return new Pn(i=>{for(let s=0,o=0,a=0;;a++){if(i.next<0){a&&i.acceptToken(e);break}if(s==0&&i.next==T2||s==1&&i.next==NO||s>=2&&so?i.acceptToken(e,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&a){i.acceptToken(e,1);break}else s=o=0;i.advance()}})}const oN=VO("script",QZ,CZ),aN=VO("style",TZ,AZ),lN=VO("textarea",EZ,DZ),cN=js({"Text RawText IncompleteTag IncompleteCloseTag":E.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":E.angleBracket,TagName:E.tagName,"MismatchedCloseTag/TagName":[E.tagName,E.invalid],AttributeName:E.attributeName,"AttributeValue UnquotedAttributeValue":E.attributeValue,Is:E.definitionOperator,"EntityReference CharacterReference":E.character,Comment:E.blockComment,ProcessingInst:E.processingInstruction,DoctypeDecl:E.documentMeta}),uN=Qs.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:tN,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[cN],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=a.type.id;if(c==FZ)return Hf(a,l,n);if(c==jZ)return Hf(a,l,r);if(c==BZ)return Hf(a,l,i);if(c==P2&&s.length){let u=a.node,h=u.firstChild,d=h&&f1(h,l),m;if(d){for(let g of s)if(g.tag==d&&(!g.attrs||g.attrs(m||(m=A2(h,l))))){let p=u.lastChild,O=p.type.id==WZ?p.from:u.to;if(O>h.to)return{parser:g.parser,overlay:[{from:h.to,to:O}]}}}}if(o&&c==Q2){let u=a.node,h;if(h=u.firstChild){let d=o[l.read(h.from,h.to)];if(d)for(let m of d){if(m.tagName&&m.tagName!=f1(u.parent,l))continue;let g=u.lastChild;if(g.type.id==tp){let p=g.from+1,O=g.lastChild,v=g.to-(O&&O.isError?0:1);if(v>p)return{parser:m.parser,overlay:[{from:p,to:v}],bracketed:!0}}else if(g.type.id==C2)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const hN=135,m1=1,dN=136,fN=137,D2=2,mN=138,gN=3,pN=4,M2=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],ON=58,vN=40,R2=95,bN=91,Vu=45,yN=46,xN=35,SN=37,wN=38,kN=92,_N=10,PN=42;function Jl(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function FO(t){return t>=48&&t<=57}function g1(t){return FO(t)||t>=97&&t<=102||t>=65&&t<=70}const L2=(t,e,n)=>(r,i)=>{for(let s=!1,o=0,a=0;;a++){let{next:l}=r;if(Jl(l)||l==Vu||l==R2||s&&FO(l))!s&&(l!=Vu||a>0)&&(s=!0),o===a&&l==Vu&&o++,r.advance();else if(l==kN&&r.peek(1)!=_N){if(r.advance(),g1(r.next)){do r.advance();while(g1(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();s=!0}else{s&&r.acceptToken(o==2&&i.canShift(D2)?e:l==vN?n:t);break}}},QN=new Pn(L2(dN,D2,fN),{contextual:!0}),CN=new Pn(L2(mN,gN,pN),{contextual:!0}),TN=new Pn(t=>{if(M2.includes(t.peek(-1))){let{next:e}=t;(Jl(e)||e==R2||e==xN||e==yN||e==PN||e==bN||e==ON&&Jl(t.peek(1))||e==Vu||e==wN)&&t.acceptToken(hN)}}),AN=new Pn(t=>{if(!M2.includes(t.peek(-1))){let{next:e}=t;if(e==SN&&(t.advance(),t.acceptToken(m1)),Jl(e)){do t.advance();while(Jl(t.next)||FO(t.next));t.acceptToken(m1)}}}),EN=js({"AtKeyword import charset namespace keyframes media supports font-feature-values":E.definitionKeyword,"from to selector scope MatchFlag":E.keyword,NamespaceName:E.namespace,KeyframeName:E.labelName,KeyframeRangeName:E.operatorKeyword,TagName:E.tagName,ClassName:E.className,PseudoClassName:E.constant(E.className),IdName:E.labelName,"FeatureName PropertyName":E.propertyName,AttributeName:E.attributeName,NumberLiteral:E.number,KeywordQuery:E.keyword,UnaryQueryOp:E.operatorKeyword,"CallTag ValueName FontName":E.atom,VariableName:E.variableName,Callee:E.operatorKeyword,Unit:E.unit,"UniversalSelector NestingSelector":E.definitionOperator,"MatchOp CompareOp":E.compareOperator,"ChildOp SiblingOp, LogicOp":E.logicOperator,BinOp:E.arithmeticOperator,Important:E.modifier,Comment:E.blockComment,ColorLiteral:E.color,"ParenthesizedContent StringLiteral":E.string,":":E.punctuation,"PseudoOp #":E.derefOperator,"; , |":E.separator,"( )":E.paren,"[ ]":E.squareBracket,"{ }":E.brace}),DN={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},MN={__proto__:null,or:104,and:104,not:112,only:112,layer:186},RN={__proto__:null,selector:118,layer:182},LN={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},IN={__proto__:null,to:223},XN=Qs.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#DoOOQ['#Fg'#FgO6rQhO'#FqO7QQ`O,5:xO7VQ!bO,5:zOOQS'#Ed'#EdO7_Q`O,5:|O7dQdO,5:|OOQO'#Eg'#EgO7lQ`O,5;PO7qQhO,5;VO'oQdO'#DjOOQS,5;X,5;XO0aQ`O,5;XO7yQdO,5;XOOQS'#FU'#FUO8RQdO'#ErO7QQ`O,5;[O8ZQdO,5:oO8kQdO'#FPO8xQ`O,5QQhO'#DlOOQW,5:V,5:VOOQW,5:Y,5:YOOQW,5:S,5:SO>[Q!fO'#FhOOQS'#Fh'#FhOOQS'#Ex'#ExO?lQdO,59cOOQ[,59c,59cO@SQdO,59iOOQ[,59i,59iO@jQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)VQdO,59pOAQQhO'#EYOOQW'#EY'#EYOAlQ`O1G0^O4^QhO1G0^OOQ[,59r,59rO)zQhO'#D[OOQ[,59t,59tOAqQ#tO,5:ZOA|QhO'#FROBZQ`O,5<]OOQS1G0d1G0dOOQS1G0f1G0fOOQS1G0h1G0hOBfQ`O1G0hOBkQdO'#EhOOQS1G0k1G0kOOQS1G0q1G0qOBvQaO,5:UO7QQ`O1G0sOOQS1G0s1G0sO0aQ`O1G0sOOQS-E9S-E9SOOQS1G0v1G0vOB}Q!fO1G0ZOCeQ`O'#EVOOQO1G0Z1G0ZOOQO,5;k,5;kOCjQdO,5;kOOQO-E8}-E8}OCwQ`O1G1tPOOO-E8s-E8sPOOO1G.g1G.gOOQP7+$`7+$`OOQP7+%h7+%hO)VQdO7+%hOOQS1G0Y1G0YODSQaO'#FmOD^Q`O,5:_ODcQ!fO'#EwOEaQdO'#FfOEkQ`O,59aOOQO1G0O1G0OOEpQ!bO7+%hO)VQdO1G/eOE{QhO1G/iOOQW1G/m1G/mOOQW1G/g1G/gOF^QhO,5;qOOQW-E9T-E9TOOQS7+&e7+&eOGRQhO'#D^OGaQhO'#FlOGlQ`O'#FlOGqQ`O,5:WOOQS-E8v-E8vOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OGvQdO,5:tOOQS7+%x7+%xOG{Q`O7+%xOHQQhO'#D]OHYQ`O,59vO)zQhO,59vOOQ[1G/u1G/uOHbQ`O1G/uOHgQhO,5;mOOQO-E9P-E9POOQS7+&S7+&SOHuQbO'#DSOOQO'#Ej'#EjOITQ`O'#EiOOQO'#Ei'#EiOI`Q`O'#FSOIhQdO,5;SOOQS,5;S,5;SOOQ[1G/p1G/pOOQS7+&_7+&_O7QQ`O7+&_OIsQ!fO'#FOO)VQdO'#FOOJzQdO7+%uOOQO7+%u7+%uOOQO,5:q,5:qOOQO1G1V1G1VOK_Q!bO<nAN>nO! bQ`OAN>nO! gQaO,5;hOOQO-E8z-E8zO! qQdO,5;gOOQO-E8y-E8yOOQW<ZO)VQdO1G1QO!#nQ`O7+'^OOQO,5;l,5;lOOQO-E9O-E9OOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$dYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!e`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!e`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!e`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!e`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!e`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!e`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!e`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!e`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!oS!e`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW!uQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!e`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!e`$]YOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!e`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!e`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!e`$]YOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!e`$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!aYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!e`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!e`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!oSOy%jz;'S%j;'S;=`%{<%lO%jj@uV!rQ!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!rQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!e`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!e`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[TN,AN,QN,CN,1,2,3,4,new hh("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:t=>DN[t]||-1},{term:138,get:t=>MN[t]||-1},{term:4,get:t=>RN[t]||-1},{term:28,get:t=>LN[t]||-1},{term:136,get:t=>IN[t]||-1}],tokenPrec:2256});let Kf=null;function Jf(){if(!Kf&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));Kf=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return Kf||[]}const p1=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),O1=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),ZN=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),NN=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),Mi=/^(\w[\w-]*|-\w[\w-]*|)$/,VN=/^-(-[\w-]*)?$/;function FN(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return r?.name!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const v1=new Uw,jN=["Declaration"];function BN(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function I2(t,e,n){if(e.to-e.from>4096){let r=v1.get(e);if(r)return r;let i=[],s=new Set,o=e.cursor(St.IncludeAnonymous);if(o.firstChild())do for(let a of I2(t,o.node,n))s.has(a.label)||(s.add(a.label),i.push(a));while(o.nextSibling());return v1.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(s=>{var o;if(n(s)&&s.matchContext(jN)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let a=t.sliceString(s.from,s.to);i.has(a)||(i.add(a),r.push({label:a,type:"variable"}))}}),r}}const X2=t=>e=>{let{state:n,pos:r}=e,i=Et(n).resolveInner(r,-1),s=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:Jf(),validFor:Mi};if(i.name=="ValueName")return{from:i.from,options:O1,validFor:Mi};if(i.name=="PseudoClassName")return{from:i.from,options:p1,validFor:Mi};if(t(i)||(e.explicit||s)&&FN(i,n.doc))return{from:t(i)||s?i.from:r,options:I2(n.doc,BN(i),t),validFor:VN};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:Jf(),validFor:Mi};return{from:i.from,options:ZN,validFor:Mi}}if(i.name=="AtKeyword")return{from:i.from,options:NN,validFor:Mi};if(!e.explicit)return null;let o=i.resolve(r),a=o.childBefore(r);return a&&a.name==":"&&o.name=="PseudoClassSelector"?{from:r,options:p1,validFor:Mi}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:r,options:O1,validFor:Mi}:o.name=="Block"||o.name=="Styles"?{from:r,options:Jf(),validFor:Mi}:null},Z2=X2(t=>t.name=="VariableName"),ec=Cs.define({name:"css",parser:XN.configure({props:[Xo.add({Declaration:Zu()}),Zo.add({"Block KeyframeList":gO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function N2(){return new Yi(ec,ec.data.of({autocomplete:Z2}))}const zN=Object.freeze(Object.defineProperty({__proto__:null,css:N2,cssCompletionSource:Z2,cssLanguage:ec,defineCSSCompletionSource:X2},Symbol.toStringTag,{value:"Module"})),WN=316,YN=317,b1=1,UN=2,qN=3,$N=4,GN=318,HN=320,KN=321,JN=5,eV=6,tV=0,rp=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],V2=125,nV=59,ip=47,rV=42,iV=43,sV=45,oV=60,aV=44,lV=63,cV=46,uV=91,hV=new cO({start:!1,shift(t,e){return e==JN||e==eV||e==HN?t:e==KN},strict:!1}),dV=new Pn((t,e)=>{let{next:n}=t;(n==V2||n==-1||e.context)&&t.acceptToken(GN)},{contextual:!0,fallback:!0}),fV=new Pn((t,e)=>{let{next:n}=t,r;rp.indexOf(n)>-1||n==ip&&((r=t.peek(1))==ip||r==rV)||n!=V2&&n!=nV&&n!=-1&&!e.context&&t.acceptToken(WN)},{contextual:!0}),mV=new Pn((t,e)=>{t.next==uV&&!e.context&&t.acceptToken(YN)},{contextual:!0}),gV=new Pn((t,e)=>{let{next:n}=t;if(n==iV||n==sV){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(b1);t.acceptToken(r?b1:UN)}}else n==lV&&t.peek(1)==cV&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(qN))},{contextual:!0});function em(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const pV=new Pn((t,e)=>{if(t.next!=oV||!e.dialectEnabled(tV)||(t.advance(),t.next==ip))return;let n=0;for(;rp.indexOf(t.next)>-1;)t.advance(),n++;if(em(t.next,!0)){for(t.advance(),n++;em(t.next,!1);)t.advance(),n++;for(;rp.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==aV)return;for(let r=0;;r++){if(r==7){if(!em(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken($N,-n)}),OV=js({"get set async static":E.modifier,"for while do if else switch try catch finally return throw break continue default case defer":E.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":E.operatorKeyword,"let var const using function class extends":E.definitionKeyword,"import export from":E.moduleKeyword,"with debugger new":E.keyword,TemplateString:E.special(E.string),super:E.atom,BooleanLiteral:E.bool,this:E.self,null:E.null,Star:E.modifier,VariableName:E.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":E.function(E.variableName),VariableDefinition:E.definition(E.variableName),Label:E.labelName,PropertyName:E.propertyName,PrivatePropertyName:E.special(E.propertyName),"CallExpression/MemberExpression/PropertyName":E.function(E.propertyName),"FunctionDeclaration/VariableDefinition":E.function(E.definition(E.variableName)),"ClassDeclaration/VariableDefinition":E.definition(E.className),"NewExpression/VariableName":E.className,PropertyDefinition:E.definition(E.propertyName),PrivatePropertyDefinition:E.definition(E.special(E.propertyName)),UpdateOp:E.updateOperator,"LineComment Hashbang":E.lineComment,BlockComment:E.blockComment,Number:E.number,String:E.string,Escape:E.escape,ArithOp:E.arithmeticOperator,LogicOp:E.logicOperator,BitOp:E.bitwiseOperator,CompareOp:E.compareOperator,RegExp:E.regexp,Equals:E.definitionOperator,Arrow:E.function(E.punctuation),": Spread":E.punctuation,"( )":E.paren,"[ ]":E.squareBracket,"{ }":E.brace,"InterpolationStart InterpolationEnd":E.special(E.brace),".":E.derefOperator,", ;":E.separator,"@":E.meta,TypeName:E.typeName,TypeDefinition:E.definition(E.typeName),"type enum interface implements namespace module declare":E.definitionKeyword,"abstract global Privacy readonly override":E.modifier,"is keyof unique infer asserts":E.operatorKeyword,JSXAttributeValue:E.attributeValue,JSXText:E.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":E.angleBracket,"JSXIdentifier JSXNameSpacedName":E.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":E.attributeName,"JSXBuiltin/JSXIdentifier":E.standard(E.tagName)}),vV={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},bV={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},yV={__proto__:null,"<":193},xV=Qs.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:hV,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[OV],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[fV,mV,gV,pV,2,3,4,5,6,7,8,9,10,11,12,13,14,dV,new hh("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new hh("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>vV[t]||-1},{term:343,get:t=>bV[t]||-1},{term:95,get:t=>yV[t]||-1}],tokenPrec:15201}),jO=[Yn("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Yn("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Yn("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Yn("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Yn("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Yn(`try { \${} } catch (\${error}) { \${} }`,{label:"try",detail:"/ catch block",type:"keyword"}),Yn("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Yn(`if (\${}) { \${} } else { \${} }`,{label:"if",detail:"/ else block",type:"keyword"}),Yn(`class \${name} { constructor(\${params}) { \${} } }`,{label:"class",detail:"definition",type:"keyword"}),Yn('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Yn('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],F2=jO.concat([Yn("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Yn("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Yn("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),y1=new Uw,j2=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function ol(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const SV=["FunctionDeclaration"],wV={FunctionDeclaration:ol("function"),ClassDeclaration:ol("class"),ClassExpression:()=>!0,EnumDeclaration:ol("constant"),TypeAliasDeclaration:ol("type"),NamespaceDeclaration:ol("namespace"),VariableDefinition(t,e){t.matchContext(SV)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function B2(t,e){let n=y1.get(e);if(n)return n;let r=[],i=!0;function s(o,a){let l=t.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(St.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=wV[o.name];if(a&&a(o,s)||j2.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of B2(t,o.node))r.push(a);return!1}}),y1.set(e,r),r}const Ph=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,BO=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function z2(t){let e=Et(t.state).resolveInner(t.pos,-1);if(BO.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&Ph.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)j2.has(i.name)&&(r=r.concat(B2(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:Ph}}function tm(t,e,n){var r;let i=[];for(;;){let s=e.firstChild,o;if(s?.name=="VariableName")return i.push(t(s)),{path:i.reverse(),name:n};if(s?.name=="MemberExpression"&&((r=o=s.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")i.push(t(o)),e=s;else return null}}function W2(t){let e=r=>t.state.doc.sliceString(r.from,r.to),n=Et(t.state).resolveInner(t.pos,-1);return n.name=="PropertyName"?tm(e,n.parent,e(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?tm(e,n.parent,""):BO.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&Ph.test(e(n))?{path:[],name:e(n)}:n.name=="MemberExpression"?tm(e,n,""):t.explicit?{path:[],name:""}:null}function kV(t,e){let n=t,r=[],i=new Set;for(let s=0;;s++){for(let a of(Object.getOwnPropertyNames||Object.keys)(t)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(a)||i.has(a))continue;i.add(a);let l;try{l=n[a]}catch{continue}r.push({label:a,type:typeof l=="function"?/^[A-Z]/.test(a)?"class":e?"function":"method":e?"variable":"property",boost:-s})}let o=Object.getPrototypeOf(t);if(!o)return r;t=o}}function _V(t){let e=new Map;return n=>{let r=W2(n);if(!r)return null;let i=t;for(let o of r.path)if(i=i[o],!i)return null;let s=e.get(i);return s||e.set(i,s=kV(i,!r.path.length)),{from:n.pos-r.name.length,options:s,validFor:Ph}}}const Qr=Cs.define({name:"javascript",parser:xV.configure({props:[Xo.add({IfStatement:Zu({except:/^\s*({|else\b)/}),TryStatement:Zu({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:KR,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:Xg({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Zu({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Zo.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":gO,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let n=t.lastChild;return{from:e.to,to:n.type.isError?t.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let n=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,r=t.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?t.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Y2={test:t=>/^JSX/.test(t.name),facet:pd({commentTokens:{block:{open:"{/*",close:"*/}"}}})},zO=Qr.configure({dialect:"ts"},"typescript"),WO=Qr.configure({dialect:"jsx",props:[dO.add(t=>t.isTop?[Y2]:void 0)]}),YO=Qr.configure({dialect:"jsx ts",props:[dO.add(t=>t.isTop?[Y2]:void 0)]},"typescript");let U2=t=>({label:t,type:"keyword"});const q2="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(U2),PV=q2.concat(["declare","implements","private","protected","public"].map(U2));function $2(t={}){let e=t.jsx?t.typescript?YO:WO:t.typescript?zO:Qr,n=t.typescript?F2.concat(PV):jO.concat(q2);return new Yi(e,[Qr.data.of({autocomplete:E4(BO,A4(n))}),Qr.data.of({autocomplete:z2}),t.jsx?G2:[]])}function QV(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function x1(t,e,n=t.length){for(let r=e?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const CV=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),G2=Ae.inputHandler.of((t,e,n,r,i)=>{if((CV?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!Qr.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c;let{head:u}=l,h=Et(o).resolveInner(u-1,-1),d;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(u-1,u)!=r||h.name=="JSXAttributeValue"&&h.to>u)){if(r==">"&&h.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:""}};if(r=="/"&&h.name=="JSXStartCloseTag"){let m=h.parent,g=m.parent;if(g&&m.from==u-2&&((d=x1(o.doc,g.firstChild,u))||((c=g.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let p=`${d}>`;return{range:Oe.cursor(u+p.length,-1),changes:{from:u,insert:p}}}}else if(r==">"){let m=QV(h);if(m&&m.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(d=x1(o.doc,m,u)))return{range:l,changes:{from:u,insert:``}}}}return{range:l}});return a.changes.empty?!1:(t.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function TV(t,e){return e||(e={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},t.getRules().forEach((n,r)=>{var i;!((i=n.meta.docs)===null||i===void 0)&&i.recommended&&(e.rules[r]=2)})),n=>{let{state:r}=n,i=[];for(let{from:s,to:o}of Qr.findRegions(r)){let a=r.doc.lineAt(s),l={line:a.number-1,col:s-a.from,pos:s};for(let c of t.verify(r.sliceDoc(s,o),e))i.push(AV(c,r.doc,l))}return i}}function S1(t,e,n,r){return n.line(t+r.line).from+e+(t==1?r.col-1:-1)}function AV(t,e,n){let r=S1(t.line,t.column,e,n),i={from:r,to:t.endLine!=null&&t.endColumn!=1?S1(t.endLine,t.endColumn,e,n):r,message:t.message,source:t.ruleId?"eslint:"+t.ruleId:"eslint",severity:t.severity==1?"warning":"error"};if(t.fix){let{range:s,text:o}=t.fix,a=s[0]+n.pos-r,l=s[1]+n.pos-r;i.actions=[{name:"fix",apply(c,u){c.dispatch({changes:{from:u+a,to:u+l,insert:o},scrollIntoView:!0})}}]}return i}const pu=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:G2,completionPath:W2,esLint:TV,javascript:$2,javascriptLanguage:Qr,jsxLanguage:WO,localCompletionSource:z2,scopeCompletionSource:_V,snippets:jO,tsxLanguage:YO,typescriptLanguage:zO,typescriptSnippets:F2},Symbol.toStringTag,{value:"Module"})),al=["_blank","_self","_top","_parent"],nm=["ascii","utf-8","utf-16","latin1","latin1"],rm=["get","post","put","delete"],im=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ir=["true","false"],je={},EV={a:{attrs:{href:null,ping:null,type:null,media:null,target:al,hreflang:null}},abbr:je,address:je,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:je,aside:je,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:je,base:{attrs:{href:null,target:al}},bdi:je,bdo:je,blockquote:{attrs:{cite:null}},body:je,br:je,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:im,formmethod:rm,formnovalidate:["novalidate"],formtarget:al,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:je,center:je,cite:je,code:je,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:je,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:je,div:je,dl:je,dt:je,em:je,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:je,figure:je,footer:je,form:{attrs:{action:null,name:null,"accept-charset":nm,autocomplete:["on","off"],enctype:im,method:rm,novalidate:["novalidate"],target:al}},h1:je,h2:je,h3:je,h4:je,h5:je,h6:je,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:je,hgroup:je,hr:je,html:{attrs:{manifest:null}},i:je,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:im,formmethod:rm,formnovalidate:["novalidate"],formtarget:al,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:je,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:je,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:je,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:nm,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:je,noscript:je,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:je,param:{attrs:{name:null,value:null}},pre:je,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:je,rt:je,ruby:je,samp:je,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:nm}},section:je,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:je,source:{attrs:{src:null,type:null,media:null}},span:je,strong:je,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:je,summary:je,sup:je,table:je,tbody:je,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:je,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:je,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:je,time:{attrs:{datetime:null}},title:je,tr:je,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:je,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:je},H2={accesskey:null,class:null,contenteditable:ir,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:ir,autocorrect:ir,autocapitalize:ir,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":ir,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ir,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ir,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ir,"aria-hidden":ir,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ir,"aria-multiselectable":ir,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ir,"aria-relevant":null,"aria-required":ir,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},K2="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of K2)H2[t]=null;let tc=class{constructor(e,n){this.tags={...EV,...e},this.globalAttrs={...H2,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};tc.default=new tc;function Sa(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function wa(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function J2(t,e,n){let r=n.tags[Sa(t,wa(e))];return r?.children||n.allTags}function UO(t,e){let n=[];for(let r=wa(e);r&&!r.type.isTop;r=wa(r.parent)){let i=Sa(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const eP=/^[:\-\.\w\u00b7-\uffff]*$/;function w1(t,e,n,r,i){let s=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",o=wa(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:J2(t.doc,o,e).map(a=>({label:a,type:"type"})).concat(UO(t.doc,n).map((a,l)=>({label:"/"+a,apply:"/"+a+s,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function k1(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:UO(t.doc,e).map((s,o)=>({label:s,apply:s+i,type:"type",boost:99-o})),validFor:eP}}function DV(t,e,n,r){let i=[],s=0;for(let o of J2(t.doc,n,e))i.push({label:"<"+o,type:"type"});for(let o of UO(t.doc,n))i.push({label:"",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function MV(t,e,n,r,i){let s=wa(n),o=s?e.tags[Sa(t.doc,s)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:l.map(c=>({label:c,type:"property"})),validFor:eP}}function RV(t,e,n,r,i){var s;let o=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),a=[],l;if(o){let c=t.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let h=wa(n),d=h?e.tags[Sa(t.doc,h)]:null;u=d?.attrs&&d.attrs[c]}if(u){let h=t.sliceDoc(r,i).toLowerCase(),d='"',m='"';/^['"]/.test(h)?(l=h[0]=='"'?/^[^"]*$/:/^[^']*$/,d="",m=t.sliceDoc(i,i+1)==h[0]?"":h[0],h=h.slice(1),r++):l=/^[^\s<>='"]*$/;for(let g of u)a.push({label:g,apply:d+g+m,type:"constant"})}}return{from:r,to:i,options:a,validFor:l}}function tP(t,e){let{state:n,pos:r}=e,i=Et(n).resolveInner(r,-1),s=i.resolve(r);for(let o=r,a;s==i&&(a=i.childBefore(o));){let l=a.lastChild;if(!l||!l.type.isError||l.fromtP(r,i)}const LV=Qr.parser.configure({top:"SingleExpression"}),iP=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:zO.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:WO.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:YO.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:LV},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:Qr.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:ec.parser}],sP=[{name:"style",parser:ec.parser.configure({top:"Styles"})}].concat(K2.map(t=>({name:t,parser:Qr.parser}))),oP=Cs.define({name:"html",parser:uN.configure({props:[Xo.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Tl=oP.configure({wrap:E2(iP,sP)});function aP(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=E2((t.nestedLanguages||[]).concat(iP),(t.nestedAttributes||[]).concat(sP)));let r=n?oP.configure({wrap:n,dialect:e}):e?Tl.configure({dialect:e}):Tl;return new Yi(r,[Tl.data.of({autocomplete:rP(t)}),t.autoCloseTags!==!1?lP:[],$2().support,N2().support])}const _1=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),lP=Ae.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!Tl.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c,u,h;let d=o.doc.sliceString(l.from-1,l.to)==r,{head:m}=l,g=Et(o).resolveInner(m,-1),p;if(d&&r==">"&&g.name=="EndTag"){let O=g.parent;if(((u=(c=O.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(p=Sa(o.doc,O.parent,m))&&!_1.has(p)){let v=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=``;return{range:l,changes:{from:m,to:v,insert:w}}}}else if(d&&r=="/"&&g.name=="IncompleteCloseTag"){let O=g.parent;if(g.from==m-2&&((h=O.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(p=Sa(o.doc,O,m))&&!_1.has(p)){let v=m+(o.doc.sliceString(m,m+1)===">"?1:0),w=`${p}>`;return{range:Oe.cursor(m+w.length,-1),changes:{from:m,to:v,insert:w}}}}return{range:l}});return a.changes.empty?!1:(t.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),IV=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:lP,html:aP,htmlCompletionSource:nP,htmlCompletionSourceWith:rP,htmlLanguage:Tl},Symbol.toStringTag,{value:"Module"})),cP=pd({commentTokens:{block:{open:""}}}),uP=new et,hP=dZ.configure({props:[Zo.add(t=>!t.is("Block")||t.is("Document")||sp(t)!=null||XV(t)?void 0:(e,n)=>({from:n.doc.lineAt(e.from).to,to:e.to})),uP.add(sp),Xo.add({Document:()=>null}),fs.add({Document:cP})]});function sp(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function XV(t){return t.name=="OrderedList"||t.name=="BulletList"}function ZV(t,e){let n=t;for(;;){let r=n.nextSibling,i;if(!r||(i=sp(r.type))!=null&&i<=e)break;n=r}return n.to}const NV=ak.of((t,e,n)=>{for(let r=Et(t).resolveInner(n,-1);r&&!(r.fromn)return{from:n,to:s}}return null});function qO(t){return new gr(cP,t,[],"markdown")}const dP=qO(hP),VV=hP.configure([wZ,_Z,kZ,PZ,{props:[Zo.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),ka=qO(VV);function FV(t,e){return n=>{if(n&&t){let r=null;if(n=/\S*/.exec(n)[0],typeof t=="function"?r=t(n):r=le.matchLanguageName(t,n,!0),r instanceof le)return r.support?r.support.language.parser:So.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}let sm=class{constructor(e,n,r,i,s,o,a){this.node=e,this.from=n,this.to=r,this.spaceBefore=i,this.spaceAfter=s,this.type=o,this.item=a}blank(e,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length0;i--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(e,n){let r=this.node.name=="OrderedList"?String(+mP(this.item,e)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}};function fP(t,e){let n=[],r=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return r;(i.name=="ListItem"||i.name=="Blockquote")&&n.push(i)}for(let i=n.length-1;i>=0;i--){let s=n[i],o,a=e.lineAt(s.from),l=s.from-a.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(l))))r.push(new sm(s,l,l+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(l)))){let c=o[3],u=o[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),r.push(new sm(s.parent,l,l+u,o[1],c,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(l)))){let c=o[4],u=o[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let h=o[2];o[3]&&(h+=o[3].replace(/[xX]/," ")),r.push(new sm(s.parent,l,l+u,o[1],c,h,s))}}return r}function mP(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function om(t,e,n,r=0){for(let i=-1,s=t;;){if(s.name=="ListItem"){let a=mP(s,e),l=+a[2];if(i>=0){if(l!=i+1)return;n.push({from:s.from+a[1].length,to:s.from+a[0].length,insert:String(i+2+r)})}i=l}let o=s.nextSibling;if(!o)break;s=o}}function $O(t,e){let n=/^[ \t]*/.exec(t)[0].length;if(!n||e.facet(Qc)!=" ")return t;let r=Pi(t,4,n),i="";for(let s=r;s>0;)s>=4?(i+=" ",s-=4):(i+=" ",s--);return i+t.slice(n)}const gP=(t={})=>({state:e,dispatch:n})=>{let r=Et(e),{doc:i}=e,s=null,o=e.changeByRange(a=>{if(!a.empty||!ka.isActiveAt(e,a.from,-1)&&!ka.isActiveAt(e,a.from,1))return s={range:a};let l=a.from,c=i.lineAt(l),u=fP(r.resolveInner(l,-1),i);for(;u.length&&u[u.length-1].from>l-c.from;)u.pop();if(!u.length)return s={range:a};let h=u[u.length-1];if(h.to-h.spaceAfter.length>l-c.from)return s={range:a};let d=l>=h.to-h.spaceAfter.length&&!/\S/.test(c.text.slice(h.to));if(h.item&&d){let v=h.node.firstChild,w=h.node.getChild("ListItem","ListItem");if(v.to>=l||w&&w.to0&&!/[^\s>]/.test(i.lineAt(c.from-1).text)||t.nonTightLists===!1){let _=u.length>1?u[u.length-2]:null,C,T="";_&&_.item?(C=c.from+_.from,T=_.marker(i,1)):C=c.from+(_?_.to:0);let S=[{from:C,to:l,insert:T}];return h.node.name=="OrderedList"&&om(h.item,i,S,-2),_&&_.node.name=="OrderedList"&&om(_.item,i,S),{range:Oe.cursor(C+T.length),changes:S}}else{let _=Q1(u,e,c);return{range:Oe.cursor(l+_.length+1),changes:{from:c.from,insert:_+e.lineBreak}}}}if(h.node.name=="Blockquote"&&d&&c.from){let v=i.lineAt(c.from-1),w=/>\s*$/.exec(v.text);if(w&&w.index==h.from){let _=e.changes([{from:v.from+w.index,to:v.to},{from:c.from+h.from,to:c.to}]);return{range:a.map(_),changes:_}}}let m=[];h.node.name=="OrderedList"&&om(h.item,i,m);let g=h.item&&h.item.from]*/.exec(c.text)[0].length>=h.to)for(let v=0,w=u.length-1;v<=w;v++)p+=v==w&&!g?u[v].marker(i,1):u[v].blank(vc.from&&/\s/.test(c.text.charAt(O-c.from-1));)O--;return p=$O(p,e),jV(h.node,e.doc)&&(p=Q1(u,e,c)+e.lineBreak+p),m.push({from:O,to:l,insert:e.lineBreak+p}),{range:Oe.cursor(O+p.length+1),changes:m}});return s?!1:(n(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},pP=gP();function P1(t){return t.name=="QuoteMark"||t.name=="ListMark"}function jV(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let n=t.firstChild,r=t.getChild("ListItem","ListItem");if(!r)return!1;let i=e.lineAt(n.to),s=e.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1){let n=Et(t),r=null,i=t.changeByRange(s=>{let o=s.from,{doc:a}=t;if(s.empty&&ka.isActiveAt(t,s.from)){let l=a.lineAt(o),c=fP(BV(n,o),a);if(c.length){let u=c[c.length-1],h=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-l.from>h&&!/\S/.test(l.text.slice(h,o-l.from)))return{range:Oe.cursor(l.from+h),changes:{from:l.from+h,to:o}};if(o-l.from==h&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let d=l.from+u.from;if(u.item&&u.node.from{var n;let{main:r}=e.state.selection;if(r.empty)return!1;let i=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!ka.isActiveAt(e.state,r.from,1)))return!1;let s=Et(e.state),o=!1;return s.iterate({from:r.from,to:r.to,enter:a=>{(a.from>r.from||YV.test(a.name))&&(o=!0)},leave:a=>{a.toimport("./FNdY1ENS.js"),[],import.meta.url).then(e=>e.sql({dialect:e[t]}))}const qV=[le.of({name:"C",extensions:["c","h","ino"],load(){return de(()=>import("./CNB-yzqG.js"),[],import.meta.url).then(t=>t.cpp())}}),le.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return de(()=>import("./CNB-yzqG.js"),[],import.meta.url).then(t=>t.cpp())}}),le.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return ss("Cassandra")}}),le.of({name:"CSS",extensions:["css"],load(){return de(()=>Promise.resolve().then(()=>zN),void 0,import.meta.url).then(t=>t.css())}}),le.of({name:"Go",extensions:["go"],load(){return de(()=>import("./CrFMcmK5.js"),[],import.meta.url).then(t=>t.go())}}),le.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return de(()=>Promise.resolve().then(()=>IV),void 0,import.meta.url).then(t=>t.html())}}),le.of({name:"Java",extensions:["java"],load(){return de(()=>import("./nfnsoNcR.js"),[],import.meta.url).then(t=>t.java())}}),le.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return de(()=>Promise.resolve().then(()=>pu),void 0,import.meta.url).then(t=>t.javascript())}}),le.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return de(()=>import("./DG8tzr2Z.js"),[],import.meta.url).then(t=>t.jinja())}}),le.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return de(()=>import("./BoOPFhOt.js"),[],import.meta.url).then(t=>t.json())}}),le.of({name:"JSX",extensions:["jsx"],load(){return de(()=>Promise.resolve().then(()=>pu),void 0,import.meta.url).then(t=>t.javascript({jsx:!0}))}}),le.of({name:"LESS",extensions:["less"],load(){return de(()=>import("./DiedxyGN.js"),[],import.meta.url).then(t=>t.less())}}),le.of({name:"Liquid",extensions:["liquid"],load(){return de(()=>import("./qv_DZjQJ.js"),[],import.meta.url).then(t=>t.liquid())}}),le.of({name:"MariaDB SQL",load(){return ss("MariaSQL")}}),le.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return de(()=>Promise.resolve().then(()=>UV),void 0,import.meta.url).then(t=>t.markdown())}}),le.of({name:"MS SQL",load(){return ss("MSSQL")}}),le.of({name:"MySQL",load(){return ss("MySQL")}}),le.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return de(()=>import("./iTa2RlRP.js"),[],import.meta.url).then(t=>t.php())}}),le.of({name:"PLSQL",extensions:["pls"],load(){return ss("PLSQL")}}),le.of({name:"PostgreSQL",load(){return ss("PostgreSQL")}}),le.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return de(()=>import("./q90EjAvT.js"),[],import.meta.url).then(t=>t.python())}}),le.of({name:"Rust",extensions:["rs"],load(){return de(()=>import("./BE2Uo66i.js"),[],import.meta.url).then(t=>t.rust())}}),le.of({name:"Sass",extensions:["sass"],load(){return de(()=>import("./DtUKm3W9.js"),[],import.meta.url).then(t=>t.sass({indented:!0}))}}),le.of({name:"SCSS",extensions:["scss"],load(){return de(()=>import("./DtUKm3W9.js"),[],import.meta.url).then(t=>t.sass())}}),le.of({name:"SQL",extensions:["sql"],load(){return ss("StandardSQL")}}),le.of({name:"SQLite",load(){return ss("SQLite")}}),le.of({name:"TSX",extensions:["tsx"],load(){return de(()=>Promise.resolve().then(()=>pu),void 0,import.meta.url).then(t=>t.javascript({jsx:!0,typescript:!0}))}}),le.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return de(()=>Promise.resolve().then(()=>pu),void 0,import.meta.url).then(t=>t.javascript({typescript:!0}))}}),le.of({name:"WebAssembly",extensions:["wat","wast"],load(){return de(()=>import("./CNFyFANU.js"),[],import.meta.url).then(t=>t.wast())}}),le.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return de(()=>import("./IBpquvr4.js"),[],import.meta.url).then(t=>t.xml())}}),le.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return de(()=>Promise.resolve().then(()=>ML),void 0,import.meta.url).then(t=>t.yaml())}}),le.of({name:"APL",extensions:["dyalog","apl"],load(){return de(()=>import("./B4CMkyY2.js"),[],import.meta.url).then(t=>ke(t.apl))}}),le.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return de(()=>import("./Df11BRmG.js"),[],import.meta.url).then(t=>ke(t.asciiArmor))}}),le.of({name:"ASN.1",extensions:["asn","asn1"],load(){return de(()=>import("./EdZsLKOL.js"),[],import.meta.url).then(t=>ke(t.asn1({})))}}),le.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return de(()=>import("./B-8jnY81.js"),[],import.meta.url).then(t=>ke(t.asterisk))}}),le.of({name:"Brainfuck",extensions:["b","bf"],load(){return de(()=>import("./C4LP7Hcl.js"),[],import.meta.url).then(t=>ke(t.brainfuck))}}),le.of({name:"Cobol",extensions:["cob","cpy"],load(){return de(()=>import("./CWcv1MsR.js"),[],import.meta.url).then(t=>ke(t.cobol))}}),le.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return de(()=>import("./B9uivgTg.js"),[],import.meta.url).then(t=>ke(t.csharp))}}),le.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return de(()=>import("./BMjYHr_A.js"),[],import.meta.url).then(t=>ke(t.clojure))}}),le.of({name:"ClojureScript",extensions:["cljs"],load(){return de(()=>import("./BMjYHr_A.js"),[],import.meta.url).then(t=>ke(t.clojure))}}),le.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return de(()=>import("./BnMrqG3P.js"),[],import.meta.url).then(t=>ke(t.gss))}}),le.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return de(()=>import("./BQqOBYOt.js"),[],import.meta.url).then(t=>ke(t.cmake))}}),le.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return de(()=>import("./S37ZYGWr.js"),[],import.meta.url).then(t=>ke(t.coffeeScript))}}),le.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return de(()=>import("./DBKNyK5s.js"),[],import.meta.url).then(t=>ke(t.commonLisp))}}),le.of({name:"Cypher",extensions:["cyp","cypher"],load(){return de(()=>import("./C_CwsFkJ.js"),[],import.meta.url).then(t=>ke(t.cypher))}}),le.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return de(()=>import("./BuPzkPfP.js"),[],import.meta.url).then(t=>ke(t.cython))}}),le.of({name:"Crystal",extensions:["cr"],load(){return de(()=>import("./SjHAIU92.js"),[],import.meta.url).then(t=>ke(t.crystal))}}),le.of({name:"D",extensions:["d"],load(){return de(()=>import("./pRatUO7H.js"),[],import.meta.url).then(t=>ke(t.d))}}),le.of({name:"Dart",extensions:["dart"],load(){return de(()=>import("./B9uivgTg.js"),[],import.meta.url).then(t=>ke(t.dart))}}),le.of({name:"diff",extensions:["diff","patch"],load(){return de(()=>import("./DbItnlRl.js"),[],import.meta.url).then(t=>ke(t.diff))}}),le.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return de(()=>import("./fCUp34qd.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>ke(t.dockerFile))}}),le.of({name:"DTD",extensions:["dtd"],load(){return de(()=>import("./DF_7sFjM.js"),[],import.meta.url).then(t=>ke(t.dtd))}}),le.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return de(()=>import("./DwRh75JA.js"),[],import.meta.url).then(t=>ke(t.dylan))}}),le.of({name:"EBNF",load(){return de(()=>import("./CDyGwa7X.js"),[],import.meta.url).then(t=>ke(t.ebnf))}}),le.of({name:"ECL",extensions:["ecl"],load(){return de(()=>import("./Cabwm37j.js"),[],import.meta.url).then(t=>ke(t.ecl))}}),le.of({name:"edn",extensions:["edn"],load(){return de(()=>import("./BMjYHr_A.js"),[],import.meta.url).then(t=>ke(t.clojure))}}),le.of({name:"Eiffel",extensions:["e"],load(){return de(()=>import("./CnydiIhH.js"),[],import.meta.url).then(t=>ke(t.eiffel))}}),le.of({name:"Elm",extensions:["elm"],load(){return de(()=>import("./vLlmbW-K.js"),[],import.meta.url).then(t=>ke(t.elm))}}),le.of({name:"Erlang",extensions:["erl"],load(){return de(()=>import("./BNw1qcRV.js"),[],import.meta.url).then(t=>ke(t.erlang))}}),le.of({name:"Esper",load(){return de(()=>import("./D0XecflT.js"),[],import.meta.url).then(t=>ke(t.esper))}}),le.of({name:"Factor",extensions:["factor"],load(){return de(()=>import("./4D5F-n5U.js"),__vite__mapDeps([2,1]),import.meta.url).then(t=>ke(t.factor))}}),le.of({name:"FCL",load(){return de(()=>import("./Kvtd6kyn.js"),[],import.meta.url).then(t=>ke(t.fcl))}}),le.of({name:"Forth",extensions:["forth","fth","4th"],load(){return de(()=>import("./Ffai-XNe.js"),[],import.meta.url).then(t=>ke(t.forth))}}),le.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return de(()=>import("./DYz_wnZ1.js"),[],import.meta.url).then(t=>ke(t.fortran))}}),le.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return de(()=>import("./CXdrOF99.js"),[],import.meta.url).then(t=>ke(t.fSharp))}}),le.of({name:"Gas",extensions:["s"],load(){return de(()=>import("./Bneqetm1.js"),[],import.meta.url).then(t=>ke(t.gas))}}),le.of({name:"Gherkin",extensions:["feature"],load(){return de(()=>import("./heZmZLOM.js"),[],import.meta.url).then(t=>ke(t.gherkin))}}),le.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return de(()=>import("./D9Dt4D0W.js"),[],import.meta.url).then(t=>ke(t.groovy))}}),le.of({name:"Haskell",extensions:["hs"],load(){return de(()=>import("./Cw1EW3IL.js"),[],import.meta.url).then(t=>ke(t.haskell))}}),le.of({name:"Haxe",extensions:["hx"],load(){return de(()=>import("./H-WmDvRZ.js"),[],import.meta.url).then(t=>ke(t.haxe))}}),le.of({name:"HXML",extensions:["hxml"],load(){return de(()=>import("./H-WmDvRZ.js"),[],import.meta.url).then(t=>ke(t.hxml))}}),le.of({name:"HTTP",load(){return de(()=>import("./DBlCnlav.js"),[],import.meta.url).then(t=>ke(t.http))}}),le.of({name:"IDL",extensions:["pro"],load(){return de(()=>import("./BEugSyMb.js"),[],import.meta.url).then(t=>ke(t.idl))}}),le.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return de(()=>import("./iXu5QeM3.js"),[],import.meta.url).then(t=>ke(t.jsonld))}}),le.of({name:"Julia",extensions:["jl"],load(){return de(()=>import("./DuME0IfC.js"),[],import.meta.url).then(t=>ke(t.julia))}}),le.of({name:"Kotlin",extensions:["kt","kts"],load(){return de(()=>import("./B9uivgTg.js"),[],import.meta.url).then(t=>ke(t.kotlin))}}),le.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return de(()=>import("./BwQOo05w.js"),[],import.meta.url).then(t=>ke(t.liveScript))}}),le.of({name:"Lua",extensions:["lua"],load(){return de(()=>import("./BgMRiT3U.js"),[],import.meta.url).then(t=>ke(t.lua))}}),le.of({name:"mIRC",extensions:["mrc"],load(){return de(()=>import("./CjQqDB4T.js"),[],import.meta.url).then(t=>ke(t.mirc))}}),le.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return de(()=>import("./DTrFuWx2.js"),[],import.meta.url).then(t=>ke(t.mathematica))}}),le.of({name:"Modelica",extensions:["mo"],load(){return de(()=>import("./Dc1JOy9r.js"),[],import.meta.url).then(t=>ke(t.modelica))}}),le.of({name:"MUMPS",extensions:["mps"],load(){return de(()=>import("./BT43cFF4.js"),[],import.meta.url).then(t=>ke(t.mumps))}}),le.of({name:"Mbox",extensions:["mbox"],load(){return de(()=>import("./CNhZ1qSd.js"),[],import.meta.url).then(t=>ke(t.mbox))}}),le.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return de(()=>import("./DdIZxoE0.js"),[],import.meta.url).then(t=>ke(t.nginx))}}),le.of({name:"NSIS",extensions:["nsh","nsi"],load(){return de(()=>import("./BEk9thJj.js"),__vite__mapDeps([3,1]),import.meta.url).then(t=>ke(t.nsis))}}),le.of({name:"NTriples",extensions:["nt","nq"],load(){return de(()=>import("./BfvgReVJ.js"),[],import.meta.url).then(t=>ke(t.ntriples))}}),le.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return de(()=>import("./B9uivgTg.js"),[],import.meta.url).then(t=>ke(t.objectiveC))}}),le.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return de(()=>import("./B9uivgTg.js"),[],import.meta.url).then(t=>ke(t.objectiveCpp))}}),le.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return de(()=>import("./CXdrOF99.js"),[],import.meta.url).then(t=>ke(t.oCaml))}}),le.of({name:"Octave",extensions:["m"],load(){return de(()=>import("./Ck1zUtKM.js"),[],import.meta.url).then(t=>ke(t.octave))}}),le.of({name:"Oz",extensions:["oz"],load(){return de(()=>import("./BzwKVEFT.js"),[],import.meta.url).then(t=>ke(t.oz))}}),le.of({name:"Pascal",extensions:["p","pas"],load(){return de(()=>import("./-L3eBynH.js"),[],import.meta.url).then(t=>ke(t.pascal))}}),le.of({name:"Perl",extensions:["pl","pm"],load(){return de(()=>import("./CdXCOZ3F.js"),[],import.meta.url).then(t=>ke(t.perl))}}),le.of({name:"Pig",extensions:["pig"],load(){return de(()=>import("./CevX1Tat.js"),[],import.meta.url).then(t=>ke(t.pig))}}),le.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return de(()=>import("./CFHJl5sT.js"),[],import.meta.url).then(t=>ke(t.powerShell))}}),le.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return de(()=>import("./C78fOPTZ.js"),[],import.meta.url).then(t=>ke(t.properties))}}),le.of({name:"ProtoBuf",extensions:["proto"],load(){return de(()=>import("./ChK-085T.js"),[],import.meta.url).then(t=>ke(t.protobuf))}}),le.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return de(()=>import("./DZPZEOli.js"),__vite__mapDeps([4,5]),import.meta.url).then(t=>ke(t.pug))}}),le.of({name:"Puppet",extensions:["pp"],load(){return de(()=>import("./DMA9R1ak.js"),[],import.meta.url).then(t=>ke(t.puppet))}}),le.of({name:"Q",extensions:["q"],load(){return de(()=>import("./pXgVlZs6.js"),[],import.meta.url).then(t=>ke(t.q))}}),le.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return de(()=>import("./B6wPVr8A.js"),[],import.meta.url).then(t=>ke(t.r))}}),le.of({name:"RPM Changes",load(){return de(()=>import("./CTu-6PCP.js"),[],import.meta.url).then(t=>ke(t.rpmChanges))}}),le.of({name:"RPM Spec",extensions:["spec"],load(){return de(()=>import("./CTu-6PCP.js"),[],import.meta.url).then(t=>ke(t.rpmSpec))}}),le.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return de(()=>import("./B2Rjki9n.js"),[],import.meta.url).then(t=>ke(t.ruby))}}),le.of({name:"SAS",extensions:["sas"],load(){return de(()=>import("./B4kiWyti.js"),[],import.meta.url).then(t=>ke(t.sas))}}),le.of({name:"Scala",extensions:["scala"],load(){return de(()=>import("./B9uivgTg.js"),[],import.meta.url).then(t=>ke(t.scala))}}),le.of({name:"Scheme",extensions:["scm","ss"],load(){return de(()=>import("./C41bIUwD.js"),[],import.meta.url).then(t=>ke(t.scheme))}}),le.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return de(()=>import("./CjFT_Tl9.js"),[],import.meta.url).then(t=>ke(t.shell))}}),le.of({name:"Sieve",extensions:["siv","sieve"],load(){return de(()=>import("./C3Gn_uJK.js"),[],import.meta.url).then(t=>ke(t.sieve))}}),le.of({name:"Smalltalk",extensions:["st"],load(){return de(()=>import("./CnHTOXQT.js"),[],import.meta.url).then(t=>ke(t.smalltalk))}}),le.of({name:"Solr",load(){return de(()=>import("./DehyRSwq.js"),[],import.meta.url).then(t=>ke(t.solr))}}),le.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return de(()=>import("./CXdrOF99.js"),[],import.meta.url).then(t=>ke(t.sml))}}),le.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return de(()=>import("./DkYu6x3z.js"),[],import.meta.url).then(t=>ke(t.sparql))}}),le.of({name:"Spreadsheet",alias:["excel","formula"],load(){return de(()=>import("./BCZA_wO0.js"),[],import.meta.url).then(t=>ke(t.spreadsheet))}}),le.of({name:"Squirrel",extensions:["nut"],load(){return de(()=>import("./B9uivgTg.js"),[],import.meta.url).then(t=>ke(t.squirrel))}}),le.of({name:"Stylus",extensions:["styl"],load(){return de(()=>import("./B533Al4x.js"),[],import.meta.url).then(t=>ke(t.stylus))}}),le.of({name:"Swift",extensions:["swift"],load(){return de(()=>import("./BzpIVaGY.js"),[],import.meta.url).then(t=>ke(t.swift))}}),le.of({name:"sTeX",load(){return de(()=>import("./C3f8Ysf7.js"),[],import.meta.url).then(t=>ke(t.stex))}}),le.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return de(()=>import("./C3f8Ysf7.js"),[],import.meta.url).then(t=>ke(t.stex))}}),le.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return de(()=>import("./C6RDOZhf.js"),[],import.meta.url).then(t=>ke(t.verilog))}}),le.of({name:"Tcl",extensions:["tcl"],load(){return de(()=>import("./DVfN8rqt.js"),[],import.meta.url).then(t=>ke(t.tcl))}}),le.of({name:"Textile",extensions:["textile"],load(){return de(()=>import("./CnDTJFAw.js"),[],import.meta.url).then(t=>ke(t.textile))}}),le.of({name:"TiddlyWiki",load(){return de(()=>import("./DO-Gjzrf.js"),[],import.meta.url).then(t=>ke(t.tiddlyWiki))}}),le.of({name:"Tiki wiki",load(){return de(()=>import("./DGYXhP31.js"),[],import.meta.url).then(t=>ke(t.tiki))}}),le.of({name:"TOML",extensions:["toml"],load(){return de(()=>import("./Bm5Em-hy.js"),[],import.meta.url).then(t=>ke(t.toml))}}),le.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return de(()=>import("./wAsdV37c.js"),[],import.meta.url).then(t=>ke(t.troff))}}),le.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return de(()=>import("./CfJYG6tj.js"),[],import.meta.url).then(t=>ke(t.ttcn))}}),le.of({name:"TTCN_CFG",extensions:["cfg"],load(){return de(()=>import("./B9xdYoR4.js"),[],import.meta.url).then(t=>ke(t.ttcnCfg))}}),le.of({name:"Turtle",extensions:["ttl"],load(){return de(()=>import("./B1tBg_DP.js"),[],import.meta.url).then(t=>ke(t.turtle))}}),le.of({name:"Web IDL",extensions:["webidl"],load(){return de(()=>import("./ZXfAyPTL.js"),[],import.meta.url).then(t=>ke(t.webIDL))}}),le.of({name:"VB.NET",extensions:["vb"],load(){return de(()=>import("./CmGdzxic.js"),[],import.meta.url).then(t=>ke(t.vb))}}),le.of({name:"VBScript",extensions:["vbs"],load(){return de(()=>import("./BuJXcnF6.js"),[],import.meta.url).then(t=>ke(t.vbScript))}}),le.of({name:"Velocity",extensions:["vtl"],load(){return de(()=>import("./D8B20fx6.js"),[],import.meta.url).then(t=>ke(t.velocity))}}),le.of({name:"Verilog",extensions:["v"],load(){return de(()=>import("./C6RDOZhf.js"),[],import.meta.url).then(t=>ke(t.verilog))}}),le.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return de(()=>import("./lSbBsy5d.js"),[],import.meta.url).then(t=>ke(t.vhdl))}}),le.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return de(()=>import("./DzFWVndE.js"),[],import.meta.url).then(t=>ke(t.xQuery))}}),le.of({name:"Yacas",extensions:["ys"],load(){return de(()=>import("./BJ4BC0dw.js"),[],import.meta.url).then(t=>ke(t.yacas))}}),le.of({name:"Z80",extensions:["z80"],load(){return de(()=>import("./Hz9HOZM7.js"),[],import.meta.url).then(t=>ke(t.z80))}}),le.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return de(()=>import("./BA5vi2Kp.js"),[],import.meta.url).then(t=>ke(t.mscgen))}}),le.of({name:"Xù",extensions:["xu"],load(){return de(()=>import("./BA5vi2Kp.js"),[],import.meta.url).then(t=>ke(t.xu))}}),le.of({name:"MsGenny",extensions:["msgenny"],load(){return de(()=>import("./BA5vi2Kp.js"),[],import.meta.url).then(t=>ke(t.msgenny))}}),le.of({name:"Vue",extensions:["vue"],load(){return de(()=>import("./BoGxFuAf.js"),[],import.meta.url).then(t=>t.vue())}}),le.of({name:"Angular Template",load(){return de(()=>import("./Xn8Z70Pe.js"),[],import.meta.url).then(t=>t.angular())}})],mn=()=>new Map,op=t=>{const e=mn();return t.forEach((n,r)=>{e.set(r,n)}),e},qn=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},$V=(t,e)=>{const n=[];for(const[r,i]of t)n.push(e(i,r));return n},GV=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},_o=()=>new Set,lm=t=>t[t.length-1],HV=(t,e)=>{for(let n=0;n{for(let n=0;n{for(let n=0;n{const n=new Array(t);for(let r=0;r{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return qi((this._observers.get(e)||mn()).values()).forEach(r=>r(...n))}destroy(){this._observers=mn()}}class Nee{constructor(){this._observers=mn()}on(e,n){qn(this._observers,e,_o).add(n)}once(e,n){const r=(...i)=>{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return qi((this._observers.get(e)||mn()).values()).forEach(r=>r(...n))}destroy(){this._observers=mn()}}const Qi=Math.floor,Fu=Math.abs,JO=(t,e)=>tt>e?t:e,SP=t=>t!==0?t<0:1/t<0,C1=1,T1=2,cm=4,um=8,nc=32,Ni=64,Or=128,Rd=31,ap=63,fo=127,JV=2147483647,Qh=Number.MAX_SAFE_INTEGER,A1=Number.MIN_SAFE_INTEGER,e7=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&Qi(t)===t),t7=String.fromCharCode,n7=t=>t.toLowerCase(),r7=/^\s*/g,i7=t=>t.replace(r7,""),s7=/([A-Z])/g,E1=(t,e)=>i7(t.replace(s7,n=>`${e}${n7(n)}`)),o7=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let i=0;irc.encode(t),l7=rc?a7:o7;let Al=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Al&&Al.decode(new Uint8Array).length===1&&(Al=null);const wP=(t,e)=>KV(e,()=>t).join("");class Mc{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Za=()=>new Mc,c7=t=>{let e=t.cpos;for(let n=0;n{const e=new Uint8Array(c7(t));let n=0;for(let r=0;r{const n=t.cbuf.length;n-t.cpos{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},ic=hn,Ke=(t,e)=>{for(;e>fo;)hn(t,Or|fo&e),e=Qi(e/128);hn(t,fo&e)},Ld=(t,e)=>{const n=SP(e);for(n&&(e=-e),hn(t,(e>ap?Or:0)|(n?Ni:0)|ap&e),e=Qi(e/64);e>0;)hn(t,(e>fo?Or:0)|fo&e),e=Qi(e/128)},lp=new Uint8Array(3e4),h7=lp.length/3,d7=(t,e)=>{if(e.length{const n=unescape(encodeURIComponent(e)),r=n.length;Ke(t,r);for(let i=0;iRc(t,Pr(e)),Rc=(t,e)=>{const n=t.cbuf.length,r=t.cpos,i=JO(n-r,e.length),s=e.length-i;t.cbuf.set(e.subarray(0,i),r),t.cpos+=i,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(zs(n*2,s)),t.cbuf.set(e.subarray(i)),t.cpos=s)},or=(t,e)=>{Ke(t,e.byteLength),Rc(t,e)},ev=(t,e)=>{u7(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},g7=(t,e)=>ev(t,4).setFloat32(0,e,!1),p7=(t,e)=>ev(t,8).setFloat64(0,e,!1),O7=(t,e)=>ev(t,8).setBigInt64(0,e,!1),D1=new DataView(new ArrayBuffer(4)),v7=t=>(D1.setFloat32(0,t),D1.getFloat32(0)===t),sc=(t,e)=>{switch(typeof e){case"string":hn(t,119),mo(t,e);break;case"number":e7(e)&&Fu(e)<=JV?(hn(t,125),Ld(t,e)):v7(e)?(hn(t,124),g7(t,e)):(hn(t,123),p7(t,e));break;case"bigint":hn(t,122),O7(t,e);break;case"object":if(e===null)hn(t,126);else if(_a(e)){hn(t,117),Ke(t,e.length);for(let n=0;n0&&Ke(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const R1=t=>{t.count>0&&(Ld(t.encoder,t.count===1?t.s:-t.s),t.count>1&&Ke(t.encoder,t.count-2))};class ju{constructor(){this.encoder=new Mc,this.s=0,this.count=0}write(e){this.s===e?this.count++:(R1(this),this.count=1,this.s=e)}toUint8Array(){return R1(this),Pr(this.encoder)}}const L1=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);Ld(t.encoder,e),t.count>1&&Ke(t.encoder,t.count-2)}};class hm{constructor(){this.encoder=new Mc,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(L1(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return L1(this),Pr(this.encoder)}}class b7{constructor(){this.sarr=[],this.s="",this.lensE=new ju}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Mc;return this.sarr.push(this.s),this.s="",mo(e,this.sarr.join("")),Rc(e,this.lensE.toUint8Array()),Pr(e)}}const Ci=t=>new Error(t),Fr=()=>{throw Ci("Method unimplemented")},Mn=()=>{throw Ci("Unexpected case")},kP=Ci("Unexpected end of array"),_P=Ci("Integer out of Range");class Id{constructor(e){this.arr=e,this.pos=0}}const Rn=t=>new Id(t),PP=t=>t.pos!==t.arr.length,y7=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},ar=t=>y7(t,at(t)),Pa=t=>t.arr[t.pos++],at=t=>{let e=0,n=1;const r=t.arr.length;for(;t.posQh)throw _P}throw kP},Xd=t=>{let e=t.arr[t.pos++],n=e&ap,r=64;const i=(e&Ni)>0?-1:1;if((e&Or)===0)return i*n;const s=t.arr.length;for(;t.posQh)throw _P}throw kP},x7=t=>{let e=at(t);if(e===0)return"";{let n=String.fromCodePoint(Pa(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(Pa(t));else for(;e>0;){const r=e<1e4?e:1e4,i=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,n+=String.fromCodePoint.apply(null,i),e-=r}return decodeURIComponent(escape(n))}},S7=t=>Al.decode(ar(t)),go=Al?S7:x7,tv=(t,e)=>{const n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,n},w7=t=>tv(t,4).getFloat32(0,!1),k7=t=>tv(t,8).getFloat64(0,!1),_7=t=>tv(t,8).getBigInt64(0,!1),P7=[t=>{},t=>null,Xd,w7,k7,_7,t=>!1,t=>!0,go,t=>{const e=at(t),n={};for(let r=0;r{const e=at(t),n=[];for(let r=0;rP7[127-Pa(t)](t);class I1 extends Id{constructor(e,n){super(e),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),PP(this)?this.count=at(this)+1:this.count=-1),this.count--,this.s}}class Bu extends Id{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Xd(this);const e=SP(this.s);this.count=1,e&&(this.s=-this.s,this.count=at(this)+2)}return this.count--,this.s}}class dm extends Id{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const e=Xd(this),n=e&1;this.diff=Qi(e/2),this.count=1,n&&(this.count=at(this)+2)}return this.s+=this.diff,this.count--,this.s}}class Q7{constructor(e){this.decoder=new Bu(e),this.str=go(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),n=this.str.slice(this.spos,e);return this.spos=e,n}}const C7=crypto.getRandomValues.bind(crypto),QP=()=>C7(new Uint32Array(1))[0],T7="10000000-1000-4000-8000"+-1e11,A7=()=>T7.replace(/[018]/g,t=>(t^QP()&15>>t/4).toString(16)),E7=Date.now,X1=t=>new Promise(t);Promise.all.bind(Promise);const Z1=t=>t===void 0?null:t;class D7{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let CP=new D7,M7=!0;try{typeof localStorage<"u"&&localStorage&&(CP=localStorage,M7=!1)}catch{}const R7=CP,ac=Symbol("Equality"),TP=(t,e)=>t===e||!!t?.[ac]?.(e)||!1,L7=t=>typeof t=="object",I7=Object.assign,X7=Object.keys,Z7=(t,e)=>{for(const n in t)e(t[n],n)},Ch=t=>X7(t).length,N7=t=>{for(const e in t)return!1;return!0},Lc=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},nv=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),V7=(t,e)=>t===e||Ch(t)===Ch(e)&&Lc(t,(n,r)=>(n!==void 0||nv(e,r))&&TP(e[r],n)),F7=Object.freeze,AP=t=>{for(const e in t){const n=t[e];(typeof n=="object"||typeof n=="function")&&AP(t[e])}return F7(t)},rv=(t,e,n=0)=>{try{for(;nt,zu=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor&&(t.constructor||Object)!==(e.constructor||Object))return!1;if(t[ac]!=null)return t[ac](e);switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let n=0;ne.includes(t);var DP={};const lc=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let si;const B7=()=>{if(si===void 0)if(lc){si=mn();const t=process.argv;let e=null;for(let n=0;n{if(t.length!==0){const[e,n]=t.split("=");si.set(`--${E1(e,"-")}`,n),si.set(`-${E1(e,"-")}`,n)}})):si=mn();return si},cp=t=>B7().has(t),Th=t=>Z1(lc?DP[t.toUpperCase().replaceAll("-","_")]:R7.getItem(t)),MP=t=>cp("--"+t)||Th(t)!==null,z7=MP("production"),W7=lc&&j7(DP.FORCE_COLOR,["true","1","2"]),Y7=W7||!cp("--no-colors")&&!MP("no-color")&&(!lc||process.stdout.isTTY)&&(!lc||cp("--color")||Th("COLORTERM")!==null||(Th("TERM")||"").includes("color")),U7=t=>new Uint8Array(t),q7=t=>{const e=U7(t.byteLength);return e.set(t),e};class $7{constructor(e,n){this.left=e,this.right=n}}const ur=(t,e)=>new $7(t,e),G7=(t,e)=>t.forEach(n=>e(n.left,n.right)),N1=t=>t.next()>=.5,fm=(t,e,n)=>Qi(t.next()*(n+1-e)+e),RP=(t,e,n)=>Qi(t.next()*(n+1-e)+e),iv=(t,e,n)=>RP(t,e,n),H7=t=>t7(iv(t,97,122)),K7=(t,e=0,n=20)=>{const r=iv(t,e,n);let i="";for(let s=0;se[iv(t,0,e.length-1)],J7=Symbol("0schema");class e9{constructor(){this._rerrs=[]}extend(e,n,r,i=null){this._rerrs.push({path:e,expected:n,has:r,message:i})}toString(){const e=[];for(let n=this._rerrs.length-1;n>0;n--){const r=this._rerrs[n];e.push(wP(" ",(this._rerrs.length-n)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return e.join(` `)}}const up=(t,e)=>t===e?!0:t==null||e==null||t.constructor!==e.constructor?!1:t[ac]?TP(t,e):_a(t)?GO(t,n=>HO(e,r=>up(n,r))):L7(t)?Lc(t,(n,r)=>up(n,e[r])):!1;class Wn{static _dilutes=!1;extends(e){let[n,r]=[this.shape,e.shape];return this.constructor._dilutes&&([r,n]=[n,r]),up(n,r)}equals(e){return this.constructor===e.constructor&&zu(this.shape,e.shape)}[J7](){return!0}[ac](e){return this.equals(e)}validate(e){return this.check(e)}check(e,n){Fr()}get nullable(){return Na(this,jd)}get optional(){return new XP(this)}cast(e){return V1(e,this),e}expect(e){return V1(e,this),e}}class sv extends Wn{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n=void 0){const r=e?.constructor===this.shape&&(this._c==null||this._c(e));return!r&&n?.extend(null,this.shape.name,e?.constructor.name,e?.constructor!==this.shape?"Constructor match failed":"Check failed"),r}}const sn=(t,e=null)=>new sv(t,e);sn(sv);class ov extends Wn{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape(e);return!r&&n?.extend(null,"custom prop",e?.constructor.name,"failed to check custom prop"),r}}const On=t=>new ov(t);sn(ov);class Zd extends Wn{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape.some(i=>i===e);return!r&&n?.extend(null,this.shape.join(" | "),e.toString()),r}}const Nd=(...t)=>new Zd(t),LP=sn(Zd),t9=RegExp.escape||(t=>t.replace(/[().|&,$^[\]]/g,e=>"\\"+e)),IP=t=>{if(Qa.check(t))return[t9(t)];if(LP.check(t))return t.shape.map(e=>e+"");if(YP.check(t))return["[+-]?\\d+.?\\d*"];if(UP.check(t))return[".*"];if(Ah.check(t))return t.shape.map(IP).flat(1);Mn()};class n9 extends Wn{constructor(e){super(),this.shape=e,this._r=new RegExp("^"+e.map(IP).map(n=>`(${n.join("|")})`).join("")+"$")}check(e,n){const r=this._r.exec(e)!=null;return!r&&n?.extend(null,this._r.toString(),e.toString(),"String doesn't match string template."),r}}sn(n9);const r9=Symbol("optional");class XP extends Wn{constructor(e){super(),this.shape=e}check(e,n){const r=e===void 0||this.shape.check(e);return!r&&n?.extend(null,"undefined (optional)","()"),r}get[r9](){return!0}}const i9=sn(XP);class s9 extends Wn{check(e,n){return n?.extend(null,"never",typeof e),!1}}sn(s9);class Vd extends Wn{constructor(e,n=!1){super(),this.shape=e,this._isPartial=n}static _dilutes=!0;get partial(){return new Vd(this.shape,!0)}check(e,n){return e==null?(n?.extend(null,"object","null"),!1):Lc(this.shape,(r,i)=>{const s=this._isPartial&&!nv(e,i)||r.check(e[i],n);return!s&&n?.extend(i.toString(),r.toString(),typeof e[i],"Object property does not match"),s})}}const o9=t=>new Vd(t),a9=sn(Vd),l9=On(t=>t!=null&&(t.constructor===Object||t.constructor==null));class ZP extends Wn{constructor(e,n){super(),this.shape={keys:e,values:n}}check(e,n){return e!=null&&Lc(e,(r,i)=>{const s=this.shape.keys.check(i,n);return!s&&n?.extend(i+"","Record",typeof e,s?"Key doesn't match schema":"Value doesn't match value"),s&&this.shape.values.check(r,n)})}}const NP=(t,e)=>new ZP(t,e),c9=sn(ZP);class VP extends Wn{constructor(e){super(),this.shape=e}check(e,n){return e!=null&&Lc(this.shape,(r,i)=>{const s=r.check(e[i],n);return!s&&n?.extend(i.toString(),"Tuple",typeof r),s})}}const u9=(...t)=>new VP(t);sn(VP);class FP extends Wn{constructor(e){super(),this.shape=e.length===1?e[0]:new av(e)}check(e,n){const r=_a(e)&&GO(e,i=>this.shape.check(i));return!r&&n?.extend(null,"Array",""),r}}const jP=(...t)=>new FP(t),h9=sn(FP),d9=On(t=>_a(t));class BP extends Wn{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n){const r=e instanceof this.shape&&(this._c==null||this._c(e));return!r&&n?.extend(null,this.shape.name,e?.constructor.name),r}}const f9=(t,e=null)=>new BP(t,e);sn(BP);const m9=f9(Wn);class g9 extends Wn{constructor(e){super(),this.len=e.length-1,this.args=u9(...e.slice(-1)),this.res=e[this.len]}check(e,n){const r=e.constructor===Function&&e.length<=this.len;return!r&&n?.extend(null,"function",typeof e),r}}const p9=sn(g9),O9=On(t=>typeof t=="function");class v9 extends Wn{constructor(e){super(),this.shape=e}check(e,n){const r=GO(this.shape,i=>i.check(e,n));return!r&&n?.extend(null,"Intersectinon",typeof e),r}}sn(v9,t=>t.shape.length>0);class av extends Wn{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,n){const r=HO(this.shape,i=>i.check(e,n));return n?.extend(null,"Union",typeof e),r}}const Na=(...t)=>t.findIndex(e=>Ah.check(e))>=0?Na(...t.map(e=>cc(e)).map(e=>Ah.check(e)?e.shape:[e]).flat(1)):t.length===1?t[0]:new av(t),Ah=sn(av),zP=()=>!0,Eh=On(zP),b9=sn(ov,t=>t.shape===zP),lv=On(t=>typeof t=="bigint"),y9=On(t=>t===lv),WP=On(t=>typeof t=="symbol");On(t=>t===WP);const ca=On(t=>typeof t=="number"),YP=On(t=>t===ca),Qa=On(t=>typeof t=="string"),UP=On(t=>t===Qa),Fd=On(t=>typeof t=="boolean"),x9=On(t=>t===Fd),qP=Nd(void 0);sn(Zd,t=>t.shape.length===1&&t.shape[0]===void 0);Nd(void 0);const jd=Nd(null),S9=sn(Zd,t=>t.shape.length===1&&t.shape[0]===null);sn(Uint8Array);sn(sv,t=>t.shape===Uint8Array);const w9=Na(ca,Qa,jd,qP,lv,Fd,WP);(()=>{const t=jP(Eh),e=NP(Qa,Eh),n=Na(ca,Qa,jd,Fd,t,e);return t.shape=n,e.shape.values=n,n})();const cc=t=>{if(m9.check(t))return t;if(l9.check(t)){const e={};for(const n in t)e[n]=cc(t[n]);return o9(e)}else{if(d9.check(t))return Na(...t.map(cc));if(w9.check(t))return Nd(t);if(O9.check(t))return sn(t)}Mn()},V1=z7?()=>{}:(t,e)=>{const n=new e9;if(!e.check(t,n))throw Ci(`Expected value to be of type ${e.constructor.name}. ${n.toString()}`)};class k9{constructor(e){this.patterns=[],this.$state=e}if(e,n){return this.patterns.push({if:cc(e),h:n}),this}else(e){return this.if(Eh,e)}done(){return(e,n)=>{for(let r=0;rnew k9(t),$P=_9(Eh).if(YP,(t,e)=>fm(e,A1,Qh)).if(UP,(t,e)=>K7(e)).if(x9,(t,e)=>N1(e)).if(y9,(t,e)=>BigInt(fm(e,A1,Qh))).if(Ah,(t,e)=>zo(e,mm(e,t.shape))).if(a9,(t,e)=>{const n={};for(const r in t.shape){let i=t.shape[r];if(i9.check(i)){if(N1(e))continue;i=i.shape}n[r]=$P(i,e)}return n}).if(h9,(t,e)=>{const n=[],r=RP(e,0,42);for(let i=0;imm(e,t.shape)).if(S9,(t,e)=>null).if(p9,(t,e)=>{const n=zo(e,t.res);return()=>n}).if(b9,(t,e)=>zo(e,mm(e,[ca,Qa,jd,qP,lv,Fd,jP(ca),NP(Na("a","b","c"),ca)]))).if(c9,(t,e)=>{const n={},r=fm(e,0,3);for(let i=0;i$P(cc(e),t),Ei=typeof document<"u"?document:{},P9=t=>Ei.createElement(t),Q9=()=>Ei.createDocumentFragment();On(t=>t.nodeType===I9);const C9=t=>Ei.createTextNode(t);typeof DOMParser<"u"&&new DOMParser;const T9=(t,e)=>(G7(e,(n,r)=>{r===!1?t.removeAttribute(n):r===!0?t.setAttribute(n,""):t.setAttribute(n,r)}),t),A9=t=>{const e=Q9();for(let n=0;n(GP(t,A9(e)),t),gm=(t,e=[],n=[])=>E9(T9(P9(t),e),n);On(t=>t.nodeType===M9);const Ou=C9;On(t=>t.nodeType===R9);const D9=t=>$V(t,(e,n)=>`${n}:${e};`).join(""),GP=(t,e)=>t.appendChild(e),M9=Ei.ELEMENT_NODE,R9=Ei.TEXT_NODE;Ei.CDATA_SECTION_NODE;Ei.COMMENT_NODE;const L9=Ei.DOCUMENT_NODE;Ei.DOCUMENT_TYPE_NODE;const I9=Ei.DOCUMENT_FRAGMENT_NODE;On(t=>t.nodeType===L9);const Ji=Symbol,HP=Ji(),KP=Ji(),X9=Ji(),Z9=Ji(),N9=Ji(),JP=Ji(),V9=Ji(),cv=Ji(),F9=Ji(),j9=t=>{t.length===1&&t[0]?.constructor===Function&&(t=t[0]());const e=[],n=[];let r=0;for(;r0&&n.push(e.join(""));r{t.length===1&&t[0]?.constructor===Function&&(t=t[0]());const e=[],n=[],r=mn();let i=[],s=0;for(;s0||l.length>0?(e.push("%c"+o),n.push(l)):e.push(o)}else break}}for(s>0&&(i=n,i.unshift(e.join("")));s{console.log(...eQ(t)),nQ.forEach(e=>e.print(t))},tQ=(...t)=>{console.warn(...eQ(t)),t.unshift(cv),nQ.forEach(e=>e.print(t))},nQ=_o(),rQ=t=>({[Symbol.iterator](){return this},next:t}),W9=(t,e)=>rQ(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),pm=(t,e)=>rQ(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class Y9 extends KO{constructor(e,n){super(),this.doc=e,this.awareness=n}}class Bd{constructor(e,n){this.clock=e,this.len=n}}class Va{constructor(){this.clients=new Map}}const Po=(t,e,n)=>e.clients.forEach((r,i)=>{const s=t.doc.store.clients.get(i);if(s!=null){const o=s[s.length-1],a=o.id.clock+o.length;for(let l=0,c=r[l];l{let n=0,r=t.length-1;for(;n<=r;){const i=Qi((n+r)/2),s=t[i],o=s.clock;if(o<=e){if(e{const n=t.clients.get(e.client);return n!==void 0&&U9(n,e.clock)!==null},uv=t=>{t.clients.forEach(e=>{e.sort((i,s)=>i.clock-s.clock);let n,r;for(n=1,r=1;n=s.clock?e[r-1]=new Bd(i.clock,zs(i.len,s.clock+s.len-i.clock)):(r{const e=new Va;for(let n=0;n{if(!e.clients.has(i)){const s=r.slice();for(let o=n+1;o{qn(t.clients,e,()=>[]).push(new Bd(n,r))},zd=()=>new Va,hv=t=>{const e=zd();return t.clients.forEach((n,r)=>{const i=[];for(let s=0;s0&&e.clients.set(r,i)}),e},Ti=(t,e)=>{Ke(t.restEncoder,e.clients.size),qi(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),Ke(t.restEncoder,n);const i=r.length;Ke(t.restEncoder,i);for(let s=0;s{const e=new Va,n=at(t.restDecoder);for(let r=0;r0){const o=qn(e.clients,i,()=>[]);for(let a=0;a{const r=new Va,i=at(t.restDecoder);for(let s=0;s0){const s=new zr;return Ke(s.restEncoder,0),Ti(s,r),s.toUint8Array()}return null},iQ=(t,e)=>{if(t.clients.size!==e.clients.size)return!1;for(const[n,r]of t.clients.entries()){const i=e.clients.get(n);if(i===void 0||r.length!==i.length)return!1;for(let s=0;s!0,meta:s=null,autoLoad:o=!1,shouldLoad:a=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=sQ(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new fQ,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=X1(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const l=()=>X1(c=>{const u=h=>{(h===void 0||h===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const e=this._item;e!==null&&!this.shouldLoad&&At(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(qi(this.subdocs).map(e=>e.guid))}transact(e,n=null){return At(this,e,n)}get(e,n=ln){const r=qn(this.share,e,()=>{const s=new n;return s._integrate(this,null),s}),i=r.constructor;if(n!==ln&&i!==n)if(i===ln){const s=new n;s._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=r._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=r._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Vi)}getText(e=""){return this.get(e,Co)}getMap(e=""){return this.get(e,Es)}getXmlElement(e=""){return this.get(e,Ms)}getXmlFragment(e=""){return this.get(e,Ds)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){this.isDestroyed=!0,qi(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new Ws({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,At(e.parent.doc,r=>{const i=n.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class hc{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return at(this.restDecoder)}readDsLen(){return at(this.restDecoder)}}class Rr extends hc{readLeftID(){return it(at(this.restDecoder),at(this.restDecoder))}readRightID(){return it(at(this.restDecoder),at(this.restDecoder))}readClient(){return at(this.restDecoder)}readInfo(){return Pa(this.restDecoder)}readString(){return go(this.restDecoder)}readParentInfo(){return at(this.restDecoder)===1}readTypeRef(){return at(this.restDecoder)}readLen(){return at(this.restDecoder)}readAny(){return oc(this.restDecoder)}readBuf(){return q7(ar(this.restDecoder))}readJSON(){return JSON.parse(go(this.restDecoder))}readKey(){return go(this.restDecoder)}}class oQ{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=at(this.restDecoder),this.dsCurrVal}readDsLen(){const e=at(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class br extends oQ{constructor(e){super(e),this.keys=[],at(e),this.keyClockDecoder=new dm(ar(e)),this.clientDecoder=new Bu(ar(e)),this.leftClockDecoder=new dm(ar(e)),this.rightClockDecoder=new dm(ar(e)),this.infoDecoder=new I1(ar(e),Pa),this.stringDecoder=new Q7(ar(e)),this.parentInfoDecoder=new I1(ar(e),Pa),this.typeRefDecoder=new Bu(ar(e)),this.lenDecoder=new Bu(ar(e))}readLeftID(){return new po(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new po(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return oc(this.restDecoder)}readBuf(){return ar(this.restDecoder)}readJSON(){return oc(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e{r=zs(r,e[0].id.clock);const i=Tr(e,r);Ke(t.restEncoder,e.length-i),t.writeClient(n),Ke(t.restEncoder,r);const s=e[i];s.write(t,r-s.id.clock);for(let o=i+1;o{const r=new Map;n.forEach((i,s)=>{jt(e,s)>i&&r.set(s,i)}),Ic(e).forEach((i,s)=>{n.has(s)||r.set(s,0)}),Ke(t.restEncoder,r.size),qi(r.entries()).sort((i,s)=>s[0]-i[0]).forEach(([i,s])=>{q9(t,e.clients.get(i),i,s)})},$9=(t,e)=>{const n=mn(),r=at(t.restDecoder);for(let i=0;i{const r=[];let i=qi(n.keys()).sort((m,g)=>m-g);if(i.length===0)return null;const s=()=>{if(i.length===0)return null;let m=n.get(i[i.length-1]);for(;m.refs.length===m.i;)if(i.pop(),i.length>0)m=n.get(i[i.length-1]);else return null;return m};let o=s();if(o===null)return null;const a=new fQ,l=new Map,c=(m,g)=>{const p=l.get(m);(p==null||p>g)&&l.set(m,g)};let u=o.refs[o.i++];const h=new Map,d=()=>{for(const m of r){const g=m.id.client,p=n.get(g);p?(p.i--,a.clients.set(g,p.refs.slice(p.i)),n.delete(g),p.i=0,p.refs=[]):a.clients.set(g,[m]),i=i.filter(O=>O!==g)}r.length=0};for(;;){if(u.constructor!==jn){const g=qn(h,u.id.client,()=>jt(e,u.id.client))-u.id.clock;if(g<0)r.push(u),c(u.id.client,u.id.clock-1),d();else{const p=u.getMissing(t,e);if(p!==null){r.push(u);const O=n.get(p)||{refs:[],i:0};if(O.refs.length===O.i)c(p,jt(e,p)),d();else{u=O.refs[O.i++];continue}}else(g===0||g0)u=r.pop();else if(o!==null&&o.i0){const m=new zr;return dv(m,a,new Map),Ke(m.restEncoder,0),{missing:l,update:m.toUint8Array()}}return null},H9=(t,e)=>dv(t,e.doc.store,e.beforeState),fv=(t,e,n,r=new br(t))=>At(e,i=>{i.local=!1;let s=!1;const o=i.doc,a=o.store,l=$9(r,o),c=G9(i,a,l),u=a.pendingStructs;if(u){for(const[d,m]of u.missing)if(mm)&&u.missing.set(d,m)}u.update=fc([u.update,c.update])}}else a.pendingStructs=c;const h=F1(r,i,a);if(a.pendingDs){const d=new br(Rn(a.pendingDs));at(d.restDecoder);const m=F1(d,i,a);h&&m?a.pendingDs=fc([h,m]):a.pendingDs=h||m}else a.pendingDs=h;if(s){const d=a.pendingStructs.update;a.pendingStructs=null,Yd(i.doc,d)}},n,!1),K9=(t,e,n)=>fv(t,e,n,new Rr(t)),Yd=(t,e,n,r=br)=>{const i=Rn(e);fv(i,t,n,new r(i))},J9=(t,e,n)=>Yd(t,e,n,Rr),e6=(t,e,n=new Map)=>{dv(t,e.store,n),Ti(t,hv(e.store))},aQ=(t,e=new Uint8Array([0]),n=new zr)=>{const r=mv(e);e6(n,t,r);const i=[n.toUint8Array()];if(t.store.pendingDs&&i.push(t.store.pendingDs),t.store.pendingStructs&&i.push(yv(t.store.pendingStructs.update,e)),i.length>1){if(n.constructor===Ys)return SQ(i.map((s,o)=>o===0?s:QQ(s)));if(n.constructor===zr)return fc(i)}return i[0]},t6=(t,e)=>aQ(t,e,new Ys),lQ=t=>{const e=new Map,n=at(t.restDecoder);for(let r=0;rlQ(new hc(Rn(t))),gv=(t,e)=>(Ke(t.restEncoder,e.size),qi(e.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{Ke(t.restEncoder,n),Ke(t.restEncoder,r)}),t),n6=(t,e)=>gv(t,Ic(e.store)),r6=(t,e=new Wd)=>(t instanceof Map?gv(e,t):n6(e,t),e.toUint8Array()),i6=t=>r6(t,new Ca);class s6{constructor(){this.l=[]}}const j1=()=>new s6,B1=(t,e)=>t.l.push(e),z1=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(i=>e!==i),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},cQ=(t,e,n)=>rv(t.l,[e,n]);class po{constructor(e,n){this.client=e,this.clock=n}}const lo=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,it=(t,e)=>new po(t,e),W1=(t,e)=>{Ke(t,e.client),Ke(t,e.clock)},Y1=t=>it(at(t),at(t)),pv=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw Mn()},dc=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1},o6=t=>{const e=[];let n=t._start;for(;n;)e.push(n),n=n.right;console.log("Children: ",e),console.log("Children content: ",e.filter(r=>!r.deleted).map(r=>r.content))};class a6{constructor(e,n=e.getMap("users")){const r=new Map;this.yusers=n,this.doc=e,this.clients=new Map,this.dss=r;const i=(s,o)=>{const a=s.get("ds"),l=s.get("ids"),c=u=>this.clients.set(u,o);a.observe(u=>{u.changes.added.forEach(h=>{h.content.getContent().forEach(d=>{d instanceof Uint8Array&&this.dss.set(o,Qo([this.dss.get(o)||zd(),$i(new hc(Rn(d)))]))})})}),this.dss.set(o,Qo(a.map(u=>$i(new hc(Rn(u)))))),l.observe(u=>u.changes.added.forEach(h=>h.content.getContent().forEach(c))),l.forEach(c)};n.observe(s=>{s.keysChanged.forEach(o=>i(n.get(o),o))}),n.forEach(i)}setUserMapping(e,n,r,{filter:i=()=>!0}={}){const s=this.yusers;let o=s.get(r);o||(o=new Es,o.set("ids",new Vi),o.set("ds",new Vi),s.set(r,o)),o.get("ids").push([n]),s.observe(a=>{setTimeout(()=>{const l=s.get(r);if(l!==o){o=l,this.clients.forEach((h,d)=>{r===h&&o.get("ids").push([d])});const c=new Ca,u=this.dss.get(r);u&&(Ti(c,u),o.get("ds").push([c.toUint8Array()]))}},0)}),e.on("afterTransaction",a=>{setTimeout(()=>{const l=o.get("ds"),c=a.deleteSet;if(a.local&&c.clients.size>0&&i(a,c)){const u=new Ca;Ti(u,c),l.push([u.toUint8Array()])}})})}getUserByClientId(e){return this.clients.get(e)||null}getUserByDeletedId(e){for(const[n,r]of this.dss.entries())if(No(r,e))return n;return null}}class Ud{constructor(e,n,r,i=0){this.type=e,this.tname=n,this.item=r,this.assoc=i}}const dp=t=>{const e={};return t.type&&(e.type=t.type),t.tname&&(e.tname=t.tname),t.item&&(e.item=t.item),t.assoc!=null&&(e.assoc=t.assoc),e},Ta=t=>new Ud(t.type==null?null:it(t.type.client,t.type.clock),t.tname??null,t.item==null?null:it(t.item.client,t.item.clock),t.assoc==null?0:t.assoc);class uQ{constructor(e,n,r=0){this.type=e,this.index=n,this.assoc=r}}const l6=(t,e,n=0)=>new uQ(t,e,n),vu=(t,e,n)=>{let r=null,i=null;return t._item===null?i=pv(t):r=it(t._item.id.client,t._item.id.clock),new Ud(r,i,e,n)},Dh=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return vu(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return vu(t,it(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return vu(t,r.lastId,n);r=r.right}return vu(t,null,n)},c6=(t,e)=>{const{type:n,tname:r,item:i,assoc:s}=e;if(i!==null)Ke(t,0),W1(t,i);else if(r!==null)ic(t,1),mo(t,r);else if(n!==null)ic(t,2),W1(t,n);else throw Mn();return Ld(t,s),t},u6=t=>{const e=Za();return c6(e,t),Pr(e)},h6=t=>{let e=null,n=null,r=null;switch(at(t)){case 0:r=Y1(t);break;case 1:n=go(t);break;case 2:e=Y1(t)}const i=PP(t)?Xd(t):0;return new Ud(e,n,r,i)},d6=t=>h6(Rn(t)),f6=(t,e)=>{const n=Oo(t,e),r=e.clock-n.id.clock;return{item:n,diff:r}},Mh=(t,e,n=!0)=>{const r=e.store,i=t.item,s=t.type,o=t.tname,a=t.assoc;let l=null,c=0;if(i!==null){if(jt(r,i.client)<=i.clock)return null;const u=n?vp(r,i):f6(r,i),h=u.item;if(!(h instanceof Ct))return null;if(l=h.parent,l._item===null||!l._item.deleted){c=h.deleted||!h.countable?0:u.diff+(a>=0?0:1);let d=h.left;for(;d!==null;)!d.deleted&&d.countable&&(c+=d.length),d=d.left}}else{if(o!==null)l=e.get(o);else if(s!==null){if(jt(r,s.client)<=s.clock)return null;const{item:u}=n?vp(r,s):{item:Oo(r,s)};if(u instanceof Ct&&u.content instanceof Lr)l=u.content.type;else return null}else throw Mn();a>=0?c=l._length:c=0}return l6(l,c,t.assoc)},fp=(t,e)=>t===e||t!==null&&e!==null&&t.tname===e.tname&&lo(t.item,e.item)&&lo(t.type,e.type)&&t.assoc===e.assoc;class Ov{constructor(e,n){this.ds=e,this.sv=n}}const m6=(t,e)=>{const n=t.ds.clients,r=e.ds.clients,i=t.sv,s=e.sv;if(i.size!==s.size||n.size!==r.size)return!1;for(const[o,a]of i.entries())if(s.get(o)!==a)return!1;for(const[o,a]of n.entries()){const l=r.get(o)||[];if(a.length!==l.length)return!1;for(let c=0;c(Ti(e,t.ds),gv(e,t.sv),e.toUint8Array()),g6=t=>hQ(t,new Ca),dQ=(t,e=new oQ(Rn(t)))=>new Ov($i(e),lQ(e)),p6=t=>dQ(t,new hc(Rn(t))),vv=(t,e)=>new Ov(t,e),O6=vv(zd(),new Map),v6=t=>vv(hv(t.store),Ic(t.store)),cs=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!No(e.ds,t.id),mp=(t,e)=>{const n=qn(t.meta,mp,_o),r=t.doc.store;n.has(e)||(e.sv.forEach((i,s)=>{i{}),n.add(e))},b6=(t,e,n=new Ws)=>{if(t.gc)throw new Error("Garbage-collection must be disabled in `originDoc`!");const{sv:r,ds:i}=e,s=new zr;return t.transact(o=>{let a=0;r.forEach(l=>{l>0&&a++}),Ke(s.restEncoder,a);for(const[l,c]of r){if(c===0)continue;c{const r=new n(Rn(e)),i=new Us(r,!1);for(let o=i.curr;o!==null;o=i.next())if((t.sv.get(o.id.client)||0)y6(t,e,Rr);class fQ{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Ic=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const i=n[n.length-1];e.set(r,i.id.clock+i.length)}),e},jt=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},mQ=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw Mn()}n.push(e)},Tr=(t,e)=>{let n=0,r=t.length-1,i=t[r],s=i.id.clock;if(s===e)return r;let o=Qi(e/(s+i.length-1)*r);for(;n<=r;){if(i=t[o],s=i.id.clock,s<=e){if(e{const n=t.clients.get(e.client);return n[Tr(n,e.clock)]},Oo=S6,gp=(t,e,n)=>{const r=Tr(e,n),i=e[r];return i.id.clock{const n=t.doc.store.clients.get(e.client);return n[gp(t,n,e.clock)]},pp=(t,e,n)=>{const r=e.clients.get(n.client),i=Tr(r,n.clock),s=r[i];return n.clock!==s.id.clock+s.length-1&&s.constructor!==$n&&r.splice(i+1,0,Ih(t,s,n.clock-s.id.clock+1)),s},w6=(t,e,n)=>{const r=t.clients.get(e.id.client);r[Tr(r,e.id.clock)]=n},gQ=(t,e,n,r,i)=>{if(r===0)return;const s=n+r;let o=gp(t,e,n),a;do a=e[o++],se.deleteSet.clients.size===0&&!GV(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(uv(e.deleteSet),H9(t,e),Ti(t,e.deleteSet),!0),q1=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&qn(t.changed,e,_o).add(n)},Wu=(t,e)=>{let n=t[e],r=t[e-1],i=e;for(;i>0;n=r,r=t[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof Ct&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const s=e-i;return s&&t.splice(e+1-s,s),s},OQ=(t,e,n)=>{for(const[r,i]of t.clients.entries()){const s=e.clients.get(r);for(let o=i.length-1;o>=0;o--){const a=i[o],l=a.clock+a.len;for(let c=Tr(s,a.clock),u=s[c];c{t.clients.forEach((n,r)=>{const i=e.clients.get(r);for(let s=n.length-1;s>=0;s--){const o=n[s],a=JO(i.length-1,1+Tr(i,o.clock+o.len-1));for(let l=a,c=i[l];l>0&&c.id.clock>=o.clock;c=i[l])l-=1+Wu(i,l)}})},k6=(t,e,n)=>{OQ(t,e,n),vQ(t,e)},bQ=(t,e)=>{if(ea.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(n,l)})),a.push(()=>{n.changedParentTypes.forEach((l,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(u=>u.target._item===null||!u.target._item.deleted),l.forEach(u=>{u.currentTarget=c,u._path=null}),l.sort((u,h)=>u.path.length-h.path.length),a.push(()=>{cQ(c._dEH,l,n)}))}),a.push(()=>r.emit("afterTransaction",[n,r])),a.push(()=>{n._needFormattingCleanup&&q6(n)})}),rv(a,[])}finally{r.gc&&OQ(s,i,r.gcFilter),vQ(s,i),n.afterState.forEach((u,h)=>{const d=n.beforeState.get(h)||0;if(d!==u){const m=i.clients.get(h),g=zs(Tr(m,d),1);for(let p=m.length-1;p>=g;)p-=1+Wu(m,p)}});for(let u=o.length-1;u>=0;u--){const{client:h,clock:d}=o[u].id,m=i.clients.get(h),g=Tr(m,d);g+11||g>0&&Wu(m,g)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(hp(cv,HP,"[yjs] ",KP,JP,"Changed the client-id because another client seems to be using it."),r.clientID=sQ()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const u=new Ys;U1(u,n)&&r.emit("update",[u.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const u=new zr;U1(u,n)&&r.emit("updateV2",[u.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach(u=>{u.clientID=r.clientID,u.collectionid==null&&(u.collectionid=r.collectionid),r.subdocs.add(u)}),c.forEach(u=>r.subdocs.delete(u)),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach(u=>u.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):bQ(t,e+1)}}},At=(t,e,n=null,r=!0)=>{const i=t._transactionCleanups;let s=!1,o=null;t._transaction===null&&(s=!0,t._transaction=new pQ(t,n,r),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{o=e(t._transaction)}finally{if(s){const a=t._transaction===i[0];t._transaction=null,a&&bQ(i,0)}}return o};class _6{constructor(e,n){this.insertions=n,this.deletions=e,this.meta=new Map}}const $1=(t,e,n)=>{Po(t,n.deletions,r=>{r instanceof Ct&&e.scope.some(i=>i===t.doc||dc(i,r))&&_v(r,!1)})},G1=(t,e,n)=>{let r=null;const i=t.doc,s=t.scope;At(i,a=>{for(;e.length>0&&t.currStackItem===null;){const l=i.store,c=e.pop(),u=new Set,h=[];let d=!1;Po(a,c.insertions,m=>{if(m instanceof Ct){if(m.redone!==null){let{item:g,diff:p}=vp(l,m.id);p>0&&(g=An(a,it(g.id.client,g.id.clock+p))),m=g}!m.deleted&&s.some(g=>g===a.doc||dc(g,m))&&h.push(m)}}),Po(a,c.deletions,m=>{m instanceof Ct&&s.some(g=>g===a.doc||dc(g,m))&&!No(c.insertions,m.id)&&u.add(m)}),u.forEach(m=>{d=GQ(a,m,u,c.insertions,t.ignoreRemoteMapChanges,t)!==null||d});for(let m=h.length-1;m>=0;m--){const g=h[m];t.deleteFilter(g)&&(g.delete(a),d=!0)}t.currStackItem=d?c:null}a.changed.forEach((l,c)=>{l.has(null)&&c._searchMarker&&(c._searchMarker.length=0)}),r=a},t);const o=t.currStackItem;if(o!=null){const a=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:o,type:n,changedParentTypes:a,origin:t},t]),t.currStackItem=null}return o};class qd extends KO{constructor(e,{captureTimeout:n=500,captureTransaction:r=l=>!0,deleteFilter:i=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:a=_a(e)?e[0].doc:e instanceof Ws?e:e.doc}={}){super(),this.scope=[],this.doc=a,this.addToScope(e),this.deleteFilter=i,s.add(this),this.trackedOrigins=s,this.captureTransaction=r,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=n,this.afterTransactionHandler=l=>{if(!this.captureTransaction(l)||!this.scope.some(O=>l.changedParentTypes.has(O)||O===this.doc)||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor)))return;const c=this.undoing,u=this.redoing,h=c?this.redoStack:this.undoStack;c?this.stopCapturing():u||this.clear(!1,!0);const d=new Va;l.afterState.forEach((O,v)=>{const w=l.beforeState.get(v)||0,_=O-w;_>0&&uc(d,v,w,_)});const m=E7();let g=!1;if(this.lastChange>0&&m-this.lastChange0&&!c&&!u){const O=h[h.length-1];O.deletions=Qo([O.deletions,l.deleteSet]),O.insertions=Qo([O.insertions,d])}else h.push(new _6(l.deleteSet,d)),g=!0;!c&&!u&&(this.lastChange=m),Po(l,l.deleteSet,O=>{O instanceof Ct&&this.scope.some(v=>v===l.doc||dc(v,O))&&_v(O,!0)});const p=[{stackItem:h[h.length-1],origin:l.origin,type:c?"redo":"undo",changedParentTypes:l.changedParentTypes},this];g?this.emit("stack-item-added",p):this.emit("stack-item-updated",p)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){const n=new Set(this.scope);e=_a(e)?e:[e],e.forEach(r=>{n.has(r)||(n.add(r),(r instanceof ln?r.doc!==this.doc:r!==this.doc)&&tQ("[yjs#509] Not same Y.Doc"),this.scope.push(r))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,n=!0){(e&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(r=>{e&&(this.undoStack.forEach(i=>$1(r,this,i)),this.undoStack=[]),n&&(this.redoStack.forEach(i=>$1(r,this,i)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=G1(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=G1(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*P6(t){const e=at(t.restDecoder);for(let n=0;nyQ(t,Rr),yQ=(t,e=br)=>{const n=[],r=new e(Rn(t)),i=new Us(r,!1);for(let o=i.curr;o!==null;o=i.next())n.push(o);hp("Structs: ",n);const s=$i(r);hp("DeleteSet: ",s)},C6=t=>xQ(t,Rr),xQ=(t,e=br)=>{const n=[],r=new e(Rn(t)),i=new Us(r,!1);for(let s=i.curr;s!==null;s=i.next())n.push(s);return{structs:n,ds:$i(r)}};class bv{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const SQ=t=>fc(t,Rr,Ys),wQ=(t,e=Wd,n=br)=>{const r=new e,i=new Us(new n(Rn(t)),!1);let s=i.curr;if(s!==null){let o=0,a=s.id.client,l=s.id.clock!==0,c=l?0:s.id.clock+s.length;for(;s!==null;s=i.next())a!==s.id.client&&(c!==0&&(o++,Ke(r.restEncoder,a),Ke(r.restEncoder,c)),a=s.id.client,c=0,l=s.id.clock!==0),s.constructor===jn&&(l=!0),l||(c=s.id.clock+s.length);c!==0&&(o++,Ke(r.restEncoder,a),Ke(r.restEncoder,c));const u=Za();return Ke(u,o),m7(u,r.restEncoder),r.restEncoder=u,r.toUint8Array()}else return Ke(r.restEncoder,0),r.toUint8Array()},T6=t=>wQ(t,Ca,Rr),kQ=(t,e=br)=>{const n=new Map,r=new Map,i=new Us(new e(Rn(t)),!1);let s=i.curr;if(s!==null){let o=s.id.client,a=s.id.clock;for(n.set(o,a);s!==null;s=i.next())o!==s.id.client&&(r.set(o,a),n.set(s.id.client,s.id.clock),o=s.id.client),a=s.id.clock+s.length;r.set(o,a)}return{from:n,to:r}},A6=t=>kQ(t,Rr),E6=(t,e)=>{if(t.constructor===$n){const{client:n,clock:r}=t.id;return new $n(it(n,r+e),t.length-e)}else if(t.constructor===jn){const{client:n,clock:r}=t.id;return new jn(it(n,r+e),t.length-e)}else{const n=t,{client:r,clock:i}=n.id;return new Ct(it(r,i+e),null,it(r,i+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},fc=(t,e=br,n=zr)=>{if(t.length===1)return t[0];const r=t.map(u=>new e(Rn(u)));let i=r.map(u=>new Us(u,!0)),s=null;const o=new n,a=new bv(o);for(;i=i.filter(d=>d.curr!==null),i.sort((d,m)=>{if(d.curr.id.client===m.curr.id.client){const g=d.curr.id.clock-m.curr.id.clock;return g===0?d.curr.constructor===m.curr.constructor?0:d.curr.constructor===jn?1:-1:g}else return m.curr.id.client-d.curr.id.client}),i.length!==0;){const u=i[0],h=u.curr.id.client;if(s!==null){let d=u.curr,m=!1;for(;d!==null&&d.id.clock+d.length<=s.struct.id.clock+s.struct.length&&d.id.client>=s.struct.id.client;)d=u.next(),m=!0;if(d===null||d.id.client!==h||m&&d.id.clock>s.struct.id.clock+s.struct.length)continue;if(h!==s.struct.id.client)us(a,s.struct,s.offset),s={struct:d,offset:0},u.next();else if(s.struct.id.clock+s.struct.length0&&(s.struct.constructor===jn?s.struct.length-=g:d=E6(d,g)),s.struct.mergeWith(d)||(us(a,s.struct,s.offset),s={struct:d,offset:0},u.next())}}else s={struct:u.curr,offset:0},u.next();for(let d=u.curr;d!==null&&d.id.client===h&&d.id.clock===s.struct.id.clock+s.struct.length&&d.constructor!==jn;d=u.next())us(a,s.struct,s.offset),s={struct:d,offset:0}}s!==null&&(us(a,s.struct,s.offset),s=null),xv(a);const l=r.map(u=>$i(u)),c=Qo(l);return Ti(o,c),o.toUint8Array()},yv=(t,e,n=br,r=zr)=>{const i=mv(e),s=new r,o=new bv(s),a=new n(Rn(t)),l=new Us(a,!1);for(;l.curr;){const u=l.curr,h=u.id.client,d=i.get(h)||0;if(l.curr.constructor===jn){l.next();continue}if(u.id.clock+u.length>d)for(us(o,u,zs(d-u.id.clock,0)),l.next();l.curr&&l.curr.id.client===h;)us(o,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===h&&l.curr.id.clock+l.curr.length<=d;)l.next()}xv(o);const c=$i(a);return Ti(s,c),s.toUint8Array()},D6=(t,e)=>yv(t,e,Rr,Ys),_Q=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:Pr(t.encoder.restEncoder)}),t.encoder.restEncoder=Za(),t.written=0)},us=(t,e,n)=>{t.written>0&&t.currClient!==e.id.client&&_Q(t),t.written===0&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),Ke(t.encoder.restEncoder,e.id.clock+n)),e.write(t.encoder,n),t.written++},xv=t=>{_Q(t);const e=t.encoder.restEncoder;Ke(e,t.clientStructs.length);for(let n=0;n{const i=new n(Rn(t)),s=new Us(i,!1),o=new r,a=new bv(o);for(let c=s.curr;c!==null;c=s.next())us(a,e(c),0);xv(a);const l=$i(i);return Ti(o,l),o.toUint8Array()},PQ=({formatting:t=!0,subdocs:e=!0,yxml:n=!0}={})=>{let r=0;const i=mn(),s=mn(),o=mn(),a=mn();return a.set(null,null),l=>{switch(l.constructor){case $n:case jn:return l;case Ct:{const c=l,u=c.content;switch(u.constructor){case To:break;case Lr:{if(n){const h=u.type;h instanceof Ms&&(h.nodeName=qn(s,h.nodeName,()=>"node-"+r)),h instanceof Aa&&(h.hookName=qn(s,h.hookName,()=>"hook-"+r))}break}case Gi:{const h=u;h.arr=h.arr.map(()=>r);break}case Vo:{const h=u;h.content=new Uint8Array([r]);break}case Fo:{const h=u;e&&(h.opts={},h.doc.guid=r+"");break}case es:{const h=u;h.embed={};break}case Kt:{const h=u;t&&(h.key=qn(o,h.key,()=>r+""),h.value=qn(a,h.value,()=>({i:r})));break}case Ea:{const h=u;h.arr=h.arr.map(()=>r);break}case Ar:{const h=u;h.str=wP(r%10+"",h.str.length);break}default:Mn()}return c.parentSub&&(c.parentSub=qn(i,c.parentSub,()=>r+"")),r++,l}default:Mn()}}},M6=(t,e)=>$d(t,PQ(e),Rr,Ys),R6=(t,e)=>$d(t,PQ(e),br,zr),L6=t=>$d(t,EP,Rr,zr),QQ=t=>$d(t,EP,br,Ys),H1="You must not compute changes after the event-handler fired.";class Xc{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=I6(this.currentTarget,this.target))}deletes(e){return No(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Ci(H1);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const s=n._map.get(i);let o,a;if(this.adds(s)){let l=s.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(s))if(l!==null&&this.deletes(l))o="delete",a=lm(l.content.getContent());else return;else l!==null&&this.deletes(l)?(o="update",a=lm(l.content.getContent())):(o="add",a=void 0)}else if(this.deletes(s))o="delete",a=lm(s.content.getContent());else return;e.set(i,{action:o,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Ci(H1);const n=this.target,r=_o(),i=_o(),s=[];if(e={added:r,deleted:i,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let a=null;const l=()=>{a&&s.push(a)};for(let c=n._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=c.length,i.add(c)):this.adds(c)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(c.content.getContent()),r.add(c)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=c.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}}const I6=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)!i.deleted&&i.countable&&(r+=i.length),i=i.right;n.unshift(r)}e=e._item.parent}return n},kn=()=>{tQ("Invalid access: Add Yjs type to a document before reading data.")},CQ=80;let Sv=0;class X6{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=Sv++}}const Z6=t=>{t.timestamp=Sv++},TQ=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=Sv++},N6=(t,e,n)=>{if(t.length>=CQ){const r=t.reduce((i,s)=>i.timestamp{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((s,o)=>Fu(e-s.index)e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&Fu(n.index-i){for(let r=t.length-1;r>=0;r--){const i=t[r];if(n>0){let s=i.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(i.index-=s.length);if(s===null||s.marker===!0){t.splice(r,1);continue}i.p=s,s.marker=!0}(e0&&e===i.index)&&(i.index=zs(e,i.index+n))}},V6=t=>{t.doc??kn();let e=t._start;const n=[];for(;e;)n.push(e),e=e.right;return n},Hd=(t,e,n)=>{const r=t,i=e.changedParentTypes;for(;qn(i,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;cQ(r._eH,n,e)};class ln{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=j1(),this._dEH=j1(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw Fr()}clone(){throw Fr()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){B1(this._eH,e)}observeDeep(e){B1(this._dEH,e)}unobserve(e){z1(this._eH,e)}unobserveDeep(e){z1(this._dEH,e)}toJSON(){}}const AQ=(t,e,n)=>{t.doc??kn(),e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const i=[];let s=t._start;for(;s!==null&&r>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let a=e;a0;a++)i.push(o[a]),r--;e=0}}s=s.right}return i},EQ=t=>{t.doc??kn();const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i{const n=[];let r=t._start;for(;r!==null;){if(r.countable&&cs(r,e)){const i=r.content.getContent();for(let s=0;s{let n=0,r=t._start;for(t.doc??kn();r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let s=0;s{const n=[];return gc(t,(r,i)=>{n.push(e(r,i,t))}),n},j6=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const i=n[r++];return n.length<=r&&(n=null),{done:!1,value:i}}}},MQ=(t,e)=>{t.doc??kn();const n=Gd(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e{let i=n;const s=t.doc,o=s.clientID,a=s.store,l=n===null?e._start:n.right;let c=[];const u=()=>{c.length>0&&(i=new Ct(it(o,jt(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Gi(c)),i.integrate(t,0),c=[])};r.forEach(h=>{if(h===null)c.push(h);else switch(h.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(h);break;default:switch(u(),h.constructor){case Uint8Array:case ArrayBuffer:i=new Ct(it(o,jt(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Vo(new Uint8Array(h))),i.integrate(t,0);break;case Ws:i=new Ct(it(o,jt(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Fo(h)),i.integrate(t,0);break;default:if(h instanceof ln)i=new Ct(it(o,jt(a,o)),i,i&&i.lastId,l,l&&l.id,e,null,new Lr(h)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},RQ=()=>Ci("Length exceeded!"),LQ=(t,e,n,r)=>{if(n>e._length)throw RQ();if(n===0)return e._searchMarker&&mc(e._searchMarker,n,r.length),Rh(t,e,null,r);const i=n,s=Gd(e,n);let o=e._start;for(s!==null&&(o=s.p,n-=s.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n{let i=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return Rh(t,e,i,n)},IQ=(t,e,n,r)=>{if(r===0)return;const i=n,s=r,o=Gd(e,n);let a=e._start;for(o!==null&&(a=o.p,n-=o.index);a!==null&&n>0;a=a.right)!a.deleted&&a.countable&&(n0&&a!==null;)a.deleted||(r0)throw RQ();e._searchMarker&&mc(e._searchMarker,i,-s+r)},Lh=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},wv=(t,e,n,r)=>{const i=e._map.get(n)||null,s=t.doc,o=s.clientID;let a;if(r==null)a=new Gi([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:a=new Gi([r]);break;case Uint8Array:a=new Vo(r);break;case Ws:a=new Fo(r);break;default:if(r instanceof ln)a=new Lr(r);else throw new Error("Unexpected content type")}new Ct(it(o,jt(s.store,o)),i,i&&i.lastId,null,null,e,n,a).integrate(t,0)},kv=(t,e)=>{t.doc??kn();const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},XQ=t=>{const e={};return t.doc??kn(),t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},ZQ=(t,e)=>{t.doc??kn();const n=t._map.get(e);return n!==void 0&&!n.deleted},z6=(t,e,n)=>{let r=t._map.get(e)||null;for(;r!==null&&(!n.sv.has(r.id.client)||r.id.clock>=(n.sv.get(r.id.client)||0));)r=r.left;return r!==null&&cs(r,n)?r.content.getContent()[r.length-1]:void 0},NQ=(t,e)=>{const n={};return t._map.forEach((r,i)=>{let s=r;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&cs(s,e)&&(n[i]=s.content.getContent()[s.length-1])}),n},bu=t=>(t.doc??kn(),W9(t._map.entries(),e=>!e[1].deleted));class VQ extends Xc{}class Vi extends ln{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new Vi;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Vi}clone(){const e=new Vi;return e.insert(0,this.toArray().map(n=>n instanceof ln?n.clone():n)),e}get length(){return this.doc??kn(),this._length}_callObserver(e,n){super._callObserver(e,n),Hd(this,e,new VQ(this,e))}insert(e,n){this.doc!==null?At(this.doc,r=>{LQ(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?At(this.doc,n=>{B6(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?At(this.doc,r=>{IQ(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return MQ(this,e)}toArray(){return EQ(this)}slice(e=0,n=this.length){return AQ(this,e,n)}toJSON(){return this.map(e=>e instanceof ln?e.toJSON():e)}map(e){return DQ(this,e)}forEach(e){gc(this,e)}[Symbol.iterator](){return j6(this)}_write(e){e.writeTypeRef(hF)}}const W6=t=>new Vi;class FQ extends Xc{constructor(e,n,r){super(e,n),this.keysChanged=r}}class Es extends ln{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new Es}clone(){const e=new Es;return this.forEach((n,r)=>{e.set(r,n instanceof ln?n.clone():n)}),e}_callObserver(e,n){Hd(this,e,new FQ(this,e,n))}toJSON(){this.doc??kn();const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];e[r]=i instanceof ln?i.toJSON():i}}),e}get size(){return[...bu(this)].length}keys(){return pm(bu(this),e=>e[0])}values(){return pm(bu(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return pm(bu(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??kn(),this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?At(this.doc,n=>{Lh(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?At(this.doc,r=>{wv(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return kv(this,e)}has(e){return ZQ(this,e)}clear(){this.doc!==null?At(this.doc,e=>{this.forEach(function(n,r,i){Lh(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(dF)}}const Y6=t=>new Es,ms=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&V7(t,e);class Op{constructor(e,n,r,i){this.left=e,this.right=n,this.index=r,this.currentAttributes=i}forward(){this.right===null&&Mn(),this.right.content.constructor===Kt?this.right.deleted||Fa(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const K1=(t,e,n)=>{for(;e.right!==null&&n>0;)e.right.content.constructor===Kt?e.right.deleted||Fa(e.currentAttributes,e.right.content):e.right.deleted||(n{const i=new Map,s=r?Gd(e,n):null;if(s){const o=new Op(s.p.left,s.p,s.index,i);return K1(t,o,n-s.index)}else{const o=new Op(null,e._start,0,i);return K1(t,o,n)}},jQ=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Kt&&ms(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=t.doc,s=i.clientID;r.forEach((o,a)=>{const l=n.left,c=n.right,u=new Ct(it(s,jt(i.store,s)),l,l&&l.lastId,c,c&&c.id,e,null,new Kt(a,o));u.integrate(t,0),n.right=u,n.forward()})},Fa=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},BQ=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===Kt&&ms(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},zQ=(t,e,n,r)=>{const i=t.doc,s=i.clientID,o=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)??null;if(!ms(c,l)){o.set(a,c);const{left:u,right:h}=n;n.right=new Ct(it(s,jt(i.store,s)),u,u&&u.lastId,h,h&&h.id,e,null,new Kt(a,l)),n.right.integrate(t,0),n.forward()}}return o},Om=(t,e,n,r,i)=>{n.currentAttributes.forEach((d,m)=>{i[m]===void 0&&(i[m]=null)});const s=t.doc,o=s.clientID;BQ(n,i);const a=zQ(t,e,n,i),l=r.constructor===String?new Ar(r):r instanceof ln?new Lr(r):new es(r);let{left:c,right:u,index:h}=n;e._searchMarker&&mc(e._searchMarker,n.index,l.getLength()),u=new Ct(it(o,jt(s.store,o)),c,c&&c.lastId,u,u&&u.id,e,null,l),u.integrate(t,0),n.right=u,n.index=h,n.forward(),jQ(t,e,n,a)},J1=(t,e,n,r,i)=>{const s=t.doc,o=s.clientID;BQ(n,i);const a=zQ(t,e,n,i);e:for(;n.right!==null&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===Kt));){if(!n.right.deleted)switch(n.right.content.constructor){case Kt:{const{key:l,value:c}=n.right.content,u=i[l];if(u!==void 0){if(ms(u,c))a.delete(l);else{if(r===0)break e;a.set(l,c)}n.right.delete(t)}else n.currentAttributes.set(l,c);break}default:r0){let l="";for(;r>0;r--)l+=` `;n.right=new Ct(it(o,jt(s.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new Ar(l)),n.right.integrate(t,0),n.forward()}jQ(t,e,n,a)},WQ=(t,e,n,r,i)=>{let s=e;const o=mn();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===Kt){const c=s.content;o.set(c.key,c)}s=s.right}let a=0,l=!1;for(;e!==s;){if(n===e&&(l=!0),!e.deleted){const c=e.content;if(c.constructor===Kt){const{key:u,value:h}=c,d=r.get(u)??null;(o.get(u)!==c||d===h)&&(e.delete(t),a++,!l&&(i.get(u)??null)===h&&d!==h&&(d===null?i.delete(u):i.set(u,d))),!l&&!e.deleted&&Fa(i,c)}}e=e.right}return a},U6=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Kt){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},YQ=t=>{let e=0;return At(t.doc,n=>{let r=t._start,i=t._start,s=mn();const o=op(s);for(;i;)i.deleted===!1&&(i.content.constructor===Kt?Fa(o,i.content):(e+=WQ(n,r,i,s,o),s=op(o),r=i)),i=i.right}),e},q6=t=>{const e=new Set,n=t.doc;for(const[r,i]of t.afterState.entries()){const s=t.beforeState.get(r)||0;i!==s&&gQ(t,n.store.clients.get(r),s,i,o=>{!o.deleted&&o.content.constructor===Kt&&o.constructor!==$n&&e.add(o.parent)})}At(n,r=>{Po(t,t.deleteSet,i=>{if(i instanceof $n||!i.parent._hasFormatting||e.has(i.parent))return;const s=i.parent;i.content.constructor===Kt?e.add(s):U6(r,i)});for(const i of e)YQ(i)})},ex=(t,e,n)=>{const r=n,i=op(e.currentAttributes),s=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Lr:case es:case Ar:n{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];At(e,r=>{const i=new Map,s=new Map;let o=this.target._start,a=null;const l={};let c="",u=0,h=0;const d=()=>{if(a!==null){let m=null;switch(a){case"delete":h>0&&(m={delete:h}),h=0;break;case"insert":(typeof c=="object"||c.length>0)&&(m={insert:c},i.size>0&&(m.attributes={},i.forEach((g,p)=>{g!==null&&(m.attributes[p]=g)}))),c="";break;case"retain":u>0&&(m={retain:u},N7(l)||(m.attributes=I7({},l))),u=0;break}m&&n.push(m),a=null}};for(;o!==null;){switch(o.content.constructor){case Lr:case es:this.adds(o)?this.deletes(o)||(d(),a="insert",c=o.content.getContent()[0],d()):this.deletes(o)?(a!=="delete"&&(d(),a="delete"),h+=1):o.deleted||(a!=="retain"&&(d(),a="retain"),u+=1);break;case Ar:this.adds(o)?this.deletes(o)||(a!=="insert"&&(d(),a="insert"),c+=o.content.str):this.deletes(o)?(a!=="delete"&&(d(),a="delete"),h+=o.length):o.deleted||(a!=="retain"&&(d(),a="retain"),u+=o.length);break;case Kt:{const{key:m,value:g}=o.content;if(this.adds(o)){if(!this.deletes(o)){const p=i.get(m)??null;ms(p,g)?g!==null&&o.delete(r):(a==="retain"&&d(),ms(g,s.get(m)??null)?delete l[m]:l[m]=g)}}else if(this.deletes(o)){s.set(m,g);const p=i.get(m)??null;ms(p,g)||(a==="retain"&&d(),l[m]=p)}else if(!o.deleted){s.set(m,g);const p=l[m];p!==void 0&&(ms(p,g)?p!==null&&o.delete(r):(a==="retain"&&d(),g===null?delete l[m]:l[m]=g))}o.deleted||(a==="insert"&&d(),Fa(i,o.content));break}}o=o.right}for(d();n.length>0;){const m=n[n.length-1];if(m.retain!==void 0&&m.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class Co extends ln{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??kn(),this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new Co}clone(){const e=new Co;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new UQ(this,e,n);Hd(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??kn();let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===Ar&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?At(this.doc,r=>{const i=new Op(null,this._start,0,new Map);for(let s=0;s0)&&Om(r,this,i,a,o.attributes||{})}else o.retain!==void 0?J1(r,this,i,o.retain,o.attributes||{}):o.delete!==void 0&&ex(r,i,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){this.doc??kn();const i=[],s=new Map,o=this.doc;let a="",l=this._start;function c(){if(a.length>0){const h={};let d=!1;s.forEach((g,p)=>{d=!0,h[p]=g});const m={insert:a};d&&(m.attributes=h),i.push(m),a=""}}const u=()=>{for(;l!==null;){if(cs(l,e)||n!==void 0&&cs(l,n))switch(l.content.constructor){case Ar:{const h=s.get("ychange");e!==void 0&&!cs(l,e)?(h===void 0||h.user!==l.id.client||h.type!=="removed")&&(c(),s.set("ychange",r?r("removed",l.id):{type:"removed"})):n!==void 0&&!cs(l,n)?(h===void 0||h.user!==l.id.client||h.type!=="added")&&(c(),s.set("ychange",r?r("added",l.id):{type:"added"})):h!==void 0&&(c(),s.delete("ychange")),a+=l.content.str;break}case Lr:case es:{c();const h={insert:l.content.getContent()[0]};if(s.size>0){const d={};h.attributes=d,s.forEach((m,g)=>{d[g]=m})}i.push(h);break}case Kt:cs(l,e)&&(c(),Fa(s,l.content));break}l=l.right}c()};return e||n?At(o,h=>{e&&mp(h,e),n&&mp(h,n),u()},"cleanup"):u(),i}insert(e,n,r){if(n.length<=0)return;const i=this.doc;i!==null?At(i,s=>{const o=yu(s,this,e,!r);r||(r={},o.currentAttributes.forEach((a,l)=>{r[l]=a})),Om(s,this,o,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const i=this.doc;i!==null?At(i,s=>{const o=yu(s,this,e,!r);Om(s,this,o,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?At(r,i=>{ex(i,yu(i,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const i=this.doc;i!==null?At(i,s=>{const o=yu(s,this,e,!1);o.right!==null&&J1(s,this,o,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?At(this.doc,n=>{Lh(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?At(this.doc,r=>{wv(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return kv(this,e)}getAttributes(){return XQ(this)}_write(e){e.writeTypeRef(fF)}}const $6=t=>new Co;class vm{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??kn()}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===Ms||n.constructor===Ds)&&n._start!==null)e=n._start;else for(;e!==null;){const r=e.next;if(r!==null){e=r;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class Ds extends ln{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Ds}clone(){const e=new Ds;return e.insert(0,this.toArray().map(n=>n instanceof ln?n.clone():n)),e}get length(){return this.doc??kn(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new vm(this,e)}querySelector(e){e=e.toUpperCase();const r=new vm(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),qi(new vm(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Hd(this,e,new qQ(this,n,e))}toString(){return DQ(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const i=e.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),gc(this,s=>{i.insertBefore(s.toDOM(e,n,r),null)}),i}insert(e,n){this.doc!==null?At(this.doc,r=>{LQ(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)At(this.doc,r=>{const i=e&&e instanceof ln?e._item:e;Rh(r,this,i,n)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(s=>s===e)+1;if(i===0&&e!==null)throw Ci("Reference item not found");r.splice(i,0,...n)}}delete(e,n=1){this.doc!==null?At(this.doc,r=>{IQ(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return EQ(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return MQ(this,e)}slice(e=0,n=this.length){return AQ(this,e,n)}forEach(e){gc(this,e)}_write(e){e.writeTypeRef(gF)}}const G6=t=>new Ds;class Ms extends Ds{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new Ms(this.nodeName)}clone(){const e=new Ms(this.nodeName),n=this.getAttributes();return Z7(n,(r,i)=>{e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof ln?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const a in e)r.push(a);r.sort();const i=r.length;for(let a=0;a0?" "+n.join(" "):"";return`<${s}${o}>${super.toString()}`}removeAttribute(e){this.doc!==null?At(this.doc,n=>{Lh(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?At(this.doc,r=>{wv(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return kv(this,e)}hasAttribute(e){return ZQ(this,e)}getAttributes(e){return e?NQ(this,e):XQ(this)}toDOM(e=document,n={},r){const i=e.createElement(this.nodeName),s=this.getAttributes();for(const o in s){const a=s[o];typeof a=="string"&&i.setAttribute(o,a)}return gc(this,o=>{i.appendChild(o.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(mF),e.writeKey(this.nodeName)}}const H6=t=>new Ms(t.readKey());class qQ extends Xc{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class Aa extends Es{constructor(e){super(),this.hookName=e}_copy(){return new Aa(this.hookName)}clone(){const e=new Aa(this.hookName);return this.forEach((n,r)=>{e.set(r,n)}),e}toDOM(e=document,n={},r){const i=n[this.hookName];let s;return i!==void 0?s=i.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),r!==void 0&&r._createAssociation(s,this),s}_write(e){e.writeTypeRef(pF),e.writeKey(this.hookName)}}const K6=t=>new Aa(t.readKey());class pc extends Co{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new pc}clone(){const e=new pc;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const i=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const n=[];for(const i in e.attributes){const s=[];for(const o in e.attributes[i])s.push({key:o,value:e.attributes[i][o]});s.sort((o,a)=>o.keyi.nodeName=0;i--)r+=``;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(OF)}}const J6=t=>new pc;class Kd{constructor(e,n){this.id=e,this.length=n}get deleted(){throw Fr()}mergeWith(e){return!1}write(e,n,r){throw Fr()}integrate(e,n){throw Fr()}}const eF=0;class $n extends Kd{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),mQ(e.doc.store,this)}write(e,n){e.writeInfo(eF),e.writeLen(this.length-n)}getMissing(e,n){return null}}class Vo{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Vo(this.content)}splice(e){throw Fr()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}const tF=t=>new Vo(t.readBuf());class To{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new To(this.len)}splice(e){const n=new To(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){uc(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const nF=t=>new To(t.readLen()),$Q=(t,e)=>new Ws({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Fo{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Fo($Q(this.doc.guid,this.opts))}splice(e){throw Fr()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const rF=t=>new Fo($Q(t.readString(),t.readAny()));class es{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new es(this.embed)}splice(e){throw Fr()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}const iF=t=>new es(t.readJSON());class Kt{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Kt(this.key,this.value)}splice(e){throw Fr()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const sF=t=>new Kt(t.readKey(),t.readJSON());class Ea{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Ea(this.arr)}splice(e){const n=new Ea(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let i=n;i{const e=t.readLen(),n=[];for(let r=0;r{const e=t.readLen(),n=[];for(let r=0;r=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const cF=t=>new Ar(t.readString()),uF=[W6,Y6,$6,H6,G6,K6,J6],hF=0,dF=1,fF=2,mF=3,gF=4,pF=5,OF=6;class Lr{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Lr(this.type._copy())}splice(e){throw Fr()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const vF=t=>new Lr(uF[t.readTypeRef()](t)),vp=(t,e)=>{let n=e,r=0,i;do r>0&&(n=it(n.client,n.clock+r)),i=Oo(t,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof Ct);return{item:i,diff:r}},_v=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},Ih=(t,e,n)=>{const{client:r,clock:i}=e.id,s=new Ct(it(r,i+n),e,it(r,i+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=it(e.redone.client,e.redone.clock+n)),e.right=s,s.right!==null&&(s.right.left=s),t._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=n,s},tx=(t,e)=>HO(t,n=>No(n.deletions,e)),GQ=(t,e,n,r,i,s)=>{const o=t.doc,a=o.store,l=o.clientID,c=e.redone;if(c!==null)return An(t,c);let u=e.parent._item,h=null,d;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!n.has(u)||GQ(t,u,n,r,i,s)===null))return null;for(;u.redone!==null;)u=An(t,u.redone)}const m=u===null?e.parent:u.content.type;if(e.parentSub===null){for(h=e.left,d=e;h!==null;){let v=h;for(;v!==null&&v.parent._item!==u;)v=v.redone===null?null:An(t,v.redone);if(v!==null&&v.parent._item===u){h=v;break}h=h.left}for(;d!==null;){let v=d;for(;v!==null&&v.parent._item!==u;)v=v.redone===null?null:An(t,v.redone);if(v!==null&&v.parent._item===u){d=v;break}d=d.right}}else if(d=null,e.right&&!i){for(h=e;h!==null&&h.right!==null&&(h.right.redone||No(r,h.right.id)||tx(s.undoStack,h.right.id)||tx(s.redoStack,h.right.id));)for(h=h.right;h.redone;)h=An(t,h.redone);if(h&&h.right!==null)return null}else h=m._map.get(e.parentSub)||null;const g=jt(a,l),p=it(l,g),O=new Ct(p,h,h&&h.lastId,d,d&&d.id,m,e.parentSub,e.content.copy());return e.redone=p,_v(O,!0),O.integrate(t,0),O};class Ct extends Kd{constructor(e,n,r,i,s,o,a,l){super(e,l.getLength()),this.origin=r,this.left=n,this.right=i,this.rightOrigin=s,this.parent=o,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?T1:0}set marker(e){(this.info&um)>0!==e&&(this.info^=um)}get marker(){return(this.info&um)>0}get keep(){return(this.info&C1)>0}set keep(e){this.keep!==e&&(this.info^=C1)}get countable(){return(this.info&T1)>0}get deleted(){return(this.info&cm)>0}set deleted(e){this.deleted!==e&&(this.info^=cm)}markDeleted(){this.info|=cm}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=jt(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=jt(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===po&&this.id.client!==this.parent.client&&this.parent.clock>=jt(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=pp(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=An(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===$n||this.right&&this.right.constructor===$n)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Ct?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===Ct&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===po){const r=Oo(n,this.parent);r.constructor===$n?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=pp(e,e.doc.store,it(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const s=new Set,o=new Set;for(;i!==null&&i!==this.right;){if(o.add(i),s.add(i),lo(this.origin,i.origin)){if(i.id.client{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),uc(e.deleteSet,this.id.client,this.id.clock,this.length),q1(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw Mn();this.content.gc(e),n?w6(e,this,new $n(this.id,this.length)):this.content=new To(this.length)}write(e,n){const r=n>0?it(this.id.client,this.id.clock+n-1):this.origin,i=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&Rd|(r===null?0:Or)|(i===null?0:Ni)|(s===null?0:nc);if(e.writeInfo(o),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const a=this.parent;if(a._item!==void 0){const l=a._item;if(l===null){const c=pv(a);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(l.id)}else a.constructor===String?(e.writeParentInfo(!0),e.writeString(a)):a.constructor===po?(e.writeParentInfo(!1),e.writeLeftID(a)):Mn();s!==null&&e.writeString(s)}this.content.write(e,n)}}const HQ=(t,e)=>bF[e&Rd](t),bF=[()=>{Mn()},nF,oF,tF,cF,iF,sF,vF,lF,rF,()=>{Mn()}],yF=10;class jn extends Kd{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){Mn()}write(e,n){e.writeInfo(yF),Ke(e.restEncoder,this.length-n)}getMissing(e,n){return null}}const KQ=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},JQ="__ $YJS$ __";KQ[JQ]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");KQ[JQ]=!0;const Vee=Object.freeze(Object.defineProperty({__proto__:null,AbsolutePosition:uQ,AbstractConnector:Y9,AbstractStruct:Kd,AbstractType:ln,Array:Vi,ContentAny:Gi,ContentBinary:Vo,ContentDeleted:To,ContentDoc:Fo,ContentEmbed:es,ContentFormat:Kt,ContentJSON:Ea,ContentString:Ar,ContentType:Lr,Doc:Ws,GC:$n,ID:po,Item:Ct,Map:Es,PermanentUserData:a6,RelativePosition:Ud,Skip:jn,Snapshot:Ov,Text:Co,Transaction:pQ,UndoManager:qd,UpdateDecoderV1:Rr,UpdateDecoderV2:br,UpdateEncoderV1:Ys,UpdateEncoderV2:zr,XmlElement:Ms,XmlFragment:Ds,XmlHook:Aa,XmlText:pc,YArrayEvent:VQ,YEvent:Xc,YMapEvent:FQ,YTextEvent:UQ,YXmlEvent:qQ,applyUpdate:J9,applyUpdateV2:Yd,cleanupYTextFormatting:YQ,compareIDs:lo,compareRelativePositions:fp,convertUpdateFormatV1ToV2:L6,convertUpdateFormatV2ToV1:QQ,createAbsolutePositionFromRelativePosition:Mh,createDeleteSet:zd,createDeleteSetFromStructStore:hv,createDocFromSnapshot:b6,createID:it,createRelativePositionFromJSON:Ta,createRelativePositionFromTypeIndex:Dh,createSnapshot:vv,decodeRelativePosition:d6,decodeSnapshot:p6,decodeSnapshotV2:dQ,decodeStateVector:mv,decodeUpdate:C6,decodeUpdateV2:xQ,diffUpdate:D6,diffUpdateV2:yv,emptySnapshot:O6,encodeRelativePosition:u6,encodeSnapshot:g6,encodeSnapshotV2:hQ,encodeStateAsUpdate:t6,encodeStateAsUpdateV2:aQ,encodeStateVector:i6,encodeStateVectorFromUpdate:T6,encodeStateVectorFromUpdateV2:wQ,equalDeleteSets:iQ,equalSnapshots:m6,findIndexSS:Tr,findRootTypeKey:pv,getItem:Oo,getItemCleanEnd:pp,getItemCleanStart:An,getState:jt,getTypeChildren:V6,isDeleted:No,isParentOf:dc,iterateDeletedStructs:Po,logType:o6,logUpdate:Q6,logUpdateV2:yQ,mergeDeleteSets:Qo,mergeUpdates:SQ,mergeUpdatesV2:fc,obfuscateUpdate:M6,obfuscateUpdateV2:R6,parseUpdateMeta:A6,parseUpdateMetaV2:kQ,readUpdate:K9,readUpdateV2:fv,relativePositionToJSON:dp,snapshot:v6,snapshotContainsUpdate:x6,transact:At,tryGc:k6,typeListToArraySnapshot:F6,typeMapGetAllSnapshot:NQ,typeMapGetSnapshot:z6},Symbol.toStringTag,{value:"Module"})),nx=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Da{constructor(e,n,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?a=>s(nx(a)):nx,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Vs(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=kS(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=wc(e);let i=this.normalize(n);if(i.length)for(let s=0,o=r;;s++){let a=i.charCodeAt(s),l=this.match(a,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(l)return this.value=l,this;break}o==r&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=Xh(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(rthis.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=r||i.to<=n){let a=new ua(n,e.sliceString(n,r));return bm.set(e,a),a}if(i.from==n&&i.to==r)return i;let{text:s,from:o}=i;return o>n&&(s=e.sliceString(n,o)+s,o=n),i.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=Xh(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=ua.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(tC.prototype[Symbol.iterator]=nC.prototype[Symbol.iterator]=function(){return this});function xF(t){try{return new RegExp(t,Pv),!0}catch{return!1}}function Xh(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}const SF=t=>{let{state:e}=t,n=String(e.doc.lineAt(t.state.selection.main.head).number),{close:r,result:i}=_M(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:e.phrase("go")});return i.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){t.dispatch({effects:r});return}let a=e.doc.lineAt(e.selection.main.head),[,l,c,u,h]=o,d=u?+u.slice(1):0,m=c?+c:a.number;if(c&&h){let O=m/100;l&&(O=O*(l=="-"?-1:1)+a.number/e.doc.lines),m=Math.round(e.doc.lines*O)}else c&&l&&(m=m*(l=="-"?-1:1)+a.number);let g=e.doc.line(Math.max(1,Math.min(e.doc.lines,m))),p=Oe.cursor(g.from+Math.max(0,Math.min(d,g.length)));t.dispatch({effects:[r,Ae.scrollIntoView(p.from,{y:"center"})],selection:p})}),!0},wF={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},kF=Ze.define({combine(t){return Fs(t,wF,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function rC(t){return[TF,CF]}const _F=ze.mark({class:"cm-selectionMatch"}),PF=ze.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function rx(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Zt.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Zt.Word)}function QF(t,e,n,r){return t(e.sliceDoc(n,n+1))==Zt.Word&&t(e.sliceDoc(r-1,r))==Zt.Word}const CF=nn.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(kF),{state:n}=t,r=n.selection;if(r.ranges.length>1)return ze.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return ze.none;let l=n.wordAt(i.head);if(!l)return ze.none;o=n.charCategorizer(i.head),s=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l200)return ze.none;if(e.wholeWords){if(s=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(rx(o,n,i.from,i.to)&&QF(o,n,i.from,i.to)))return ze.none}else if(s=n.sliceDoc(i.from,i.to),!s)return ze.none}let a=[];for(let l of t.visibleRanges){let c=new Da(n.doc,s,l.from,l.to);for(;!c.next().done;){let{from:u,to:h}=c.value;if((!o||rx(o,n,u,h))&&(i.empty&&u<=i.from&&h>=i.to?a.push(PF.range(u,h)):(u>=i.to||h<=i.from)&&a.push(_F.range(u,h)),a.length>e.maxMatches))return ze.none}}return ze.set(a)}},{decorations:t=>t.decorations}),TF=Ae.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),AF=({state:t,dispatch:e})=>{let{selection:n}=t,r=Oe.create(n.ranges.map(i=>t.wordAt(i.head)||Oe.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function EF(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),s=i&&i.from==n.from&&i.to==n.to;for(let o=!1,a=new Da(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new Da(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(l=>l.from==a.value.from))continue;if(s){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const DF=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(s=>s.from===s.to))return AF({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=r))return!1;let i=EF(t,r);return i?(e(t.update({selection:t.selection.addRange(Oe.range(i.from,i.to),!1),effects:Ae.scrollIntoView(i.to)})),!0):!1},ja=Ze.define({combine(t){return Fs(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new WF(e),scrollToMatch:e=>Ae.scrollIntoView(e)})}});class iC{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||xF(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?` `:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new ZF(this):new LF(this)}getCursor(e,n=0,r){let i=e.doc?e:ot.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Go(this,i,n,r):$o(this,i,n,r)}}class sC{constructor(e){this.spec=e}}function MF(t,e,n){return(r,i,s,o)=>{if(n&&!n(r,i,s,o))return!1;let a=r>=o&&i<=o+s.length?s.slice(r-o,i-o):e.doc.sliceString(r,i);return t(a,e,r,i)}}function $o(t,e,n,r){let i;return t.wholeWord&&(i=RF(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=MF(t.test,e,i)),new Da(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:s=>s.toLowerCase(),i)}function RF(t,e){return(n,r,i,s)=>((s>n||s+i.length=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=$o(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function IF(t,e,n){return(r,i,s)=>(!n||n(r,i,s))&&t(s[0],e,r,i)}function Go(t,e,n,r){let i;return t.wholeWord&&(i=XF(e.charCategorizer(e.selection.main.head))),t.test&&(i=IF(t.test,e,i)),new tC(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},n,r)}function Zh(t,e){return t.slice(fn(t,e,!1),e)}function Nh(t,e){return t.slice(e,fn(t,e))}function XF(t){return(e,n,r)=>!r[0].length||(t(Zh(r.input,r.index))!=Zt.Word||t(Nh(r.input,r.index))!=Zt.Word)&&(t(Nh(r.input,r.index+r[0].length))!=Zt.Word||t(Zh(r.input,r.index+r[0].length))!=Zt.Word)}class ZF extends sC{nextMatch(e,n,r){let i=Go(this.spec,e,r,e.doc.length).next();return i.done&&(i=Go(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let s=Math.max(n,r-i*1e4),o=Go(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==n||a.from>s+10))return a;if(s==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=Go(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const Oc=yt.define(),Qv=yt.define(),ys=yr.define({create(t){return new ym(bp(t).create(),null)},update(t,e){for(let n of e.effects)n.is(Oc)?t=new ym(n.value.create(),t.panel):n.is(Qv)&&(t=new ym(t.query,n.value?Cv:null));return t},provide:t=>ah.from(t,e=>e.panel)});class ym{constructor(e,n){this.query=e,this.panel=n}}const NF=ze.mark({class:"cm-searchMatch"}),VF=ze.mark({class:"cm-searchMatch cm-searchMatch-selected"}),FF=nn.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(ys))}update(t){let e=t.state.field(ys);(e!=t.startState.field(ys)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return ze.none;let{view:n}=this,r=new Ss;for(let i=0,s=n.visibleRanges,o=s.length;is[i+1].from-500;)l=s[++i].to;t.highlight(n.state,a,l,(c,u)=>{let h=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,h?VF:NF)})}return r.finish()}},{decorations:t=>t.decorations});function Zc(t){return e=>{let n=e.state.field(ys,!1);return n&&n.query.spec.valid?t(e,n):lC(e)}}const Vh=Zc((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=Oe.single(r.from,r.to),s=t.state.facet(ja);return t.dispatch({selection:i,effects:[Tv(t,r),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),aC(t),!0}),Fh=Zc((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let s=Oe.single(i.from,i.to),o=t.state.facet(ja);return t.dispatch({selection:s,effects:[Tv(t,i),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),aC(t),!0}),jF=Zc((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:Oe.create(n.map(r=>Oe.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),BF=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,s=[],o=0;for(let a=new Da(t.doc,t.sliceDoc(r,i));!a.next().done;){if(s.length>1e3)return!1;a.value.from==r&&(o=s.length),s.push(Oe.range(a.value.from,a.value.to))}return e(t.update({selection:Oe.create(s,o),userEvent:"select.search.matches"})),!0},ix=Zc((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let s=e.nextMatch(n,r,r);if(!s)return!1;let o=s,a=[],l,c,u=[];o.from==r&&o.to==i&&(c=n.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(n,o.from,o.to),u.push(Ae.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let h=t.state.changes(a);return o&&(l=Oe.single(o.from,o.to).map(h),u.push(Tv(t,o)),u.push(n.facet(ja).scrollToMatch(l.main,t))),t.dispatch({changes:h,selection:l,effects:u,userEvent:"input.replace"}),!0}),zF=Zc((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:Ae.announce.of(r),userEvent:"input.replace.all"}),!0});function Cv(t){return t.state.facet(ja).createPanel(t)}function bp(t,e){var n,r,i,s,o;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(ja);return new iC({search:((n=e?.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function oC(t){let e=Xw(t,Cv);return e&&e.dom.querySelector("[main-field]")}function aC(t){let e=oC(t);e&&e==t.root.activeElement&&e.select()}const lC=t=>{let e=t.state.field(ys,!1);if(e&&e.panel){let n=oC(t);if(n&&n!=t.root.activeElement){let r=bp(t.state,e.query.spec);r.valid&&t.dispatch({effects:Oc.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[Qv.of(!0),e?Oc.of(bp(t.state,e.query.spec)):yt.appendConfig.of(UF)]});return!0},cC=t=>{let e=t.state.field(ys,!1);if(!e||!e.panel)return!1;let n=Xw(t,Cv);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Qv.of(!1)}),!0},uC=[{key:"Mod-f",run:lC,scope:"editor search-panel"},{key:"F3",run:Vh,shift:Fh,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Vh,shift:Fh,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:cC,scope:"editor search-panel"},{key:"Mod-Shift-l",run:BF},{key:"Mod-Alt-g",run:SF},{key:"Mod-d",run:DF,preventDefault:!0}];class WF{constructor(e){this.view=e;let n=this.query=e.state.field(ys).query.spec;this.commit=this.commit.bind(this),this.searchField=un("input",{value:n.search,placeholder:sr(e,"Find"),"aria-label":sr(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=un("input",{value:n.replace,placeholder:sr(e,"Replace"),"aria-label":sr(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=un("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=un("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=un("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,s,o){return un("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=un("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Vh(e),[sr(e,"next")]),r("prev",()=>Fh(e),[sr(e,"previous")]),r("select",()=>jF(e),[sr(e,"all")]),un("label",null,[this.caseField,sr(e,"match case")]),un("label",null,[this.reField,sr(e,"regexp")]),un("label",null,[this.wordField,sr(e,"by word")]),...e.state.readOnly?[]:[un("br"),this.replaceField,r("replace",()=>ix(e),[sr(e,"replace")]),r("replaceAll",()=>zF(e),[sr(e,"replace all")])],un("button",{name:"close",onclick:()=>cC(e),"aria-label":sr(e,"close"),type:"button"},["×"])])}commit(){let e=new iC({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Oc.of(e)}))}keydown(e){tM(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Fh:Vh)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ix(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(Oc)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ja).top}}function sr(t,e){return t.state.phrase(e)}const xu=30,Su=/[\s\.,:;?!]/;function Tv(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,s=Math.max(r.from,e-xu),o=Math.min(i,n+xu),a=t.state.sliceDoc(s,o);if(s!=r.from){for(let l=0;la.length-xu;l--)if(!Su.test(a[l-1])&&Su.test(a[l])){a=a.slice(0,l);break}}return Ae.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const YF=Ae.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),UF=[ys,Lo.low(FF),YF];var qF=P("
");function $F(t,e){Me(e,!0);let n=ee(e,"orientation",3,"horizontal"),r=Tt(e,["$$slots","$$events","$$legacy","orientation","class"]);var i=qF();Qt(i,s=>({role:"separator","aria-orientation":n(),class:s,...r}),[()=>hl("shrink-0 bg-border",n()==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e.class)]),y(t,i),Re()}class Av{constructor(e,n){this.yanchor=e,this.yhead=n}toJSON(){return{yanchor:dp(this.yanchor),yhead:dp(this.yhead)}}static fromJSON(e){return new Av(Ta(e.yanchor),Ta(e.yhead))}}class GF{constructor(e,n){this.ytext=e,this.awareness=n,this.undoManager=new qd(e)}toYPos(e,n=0){return Dh(this.ytext,e,n)}fromYPos(e){const n=Mh(Ta(e),this.ytext.doc);if(n==null||n.type!==this.ytext)throw new Error("[y-codemirror] The position you want to retrieve was created by a different document");return{pos:n.index,assoc:n.assoc}}toYRange(e){const n=e.assoc,r=this.toYPos(e.anchor,n),i=this.toYPos(e.head,n);return new Av(r,i)}fromYRange(e){const n=this.fromYPos(e.yanchor),r=this.fromYPos(e.yhead);return n.pos===r.pos?Oe.cursor(r.pos,r.assoc):Oe.range(n.pos,r.pos)}}const Jd=Ze.define({combine(t){return t[t.length-1]}}),yp=$r.define();class HF{constructor(e){this.view=e,this.conf=e.state.facet(Jd),this._observer=(n,r)=>{if(r.origin!==this.conf){const i=n.delta,s=[];let o=0;for(let a=0;a0&&e.transactions[0].annotation(yp)===this.conf)return;const n=this.conf.ytext;n.doc.transact(()=>{let r=0;e.changes.iterChanges((i,s,o,a,l)=>{const c=l.sliceString(0,l.length,` `);i!==s&&n.delete(i+r,s-i),c.length>0&&n.insert(i+r,c),r+=c.length-(s-i)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}}const KF=nn.fromClass(HF),JF=Ae.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:"0px 2px 0px 4px"},".cm-ySelectionCaret":{position:"relative",borderLeft:"1px solid black",borderRight:"1px solid black",marginLeft:"-1px",marginRight:"-1px",boxSizing:"border-box",display:"inline"},".cm-ySelectionCaretDot":{borderRadius:"50%",position:"absolute",width:".4em",height:".4em",top:"-.2em",left:"-.2em",backgroundColor:"inherit",transition:"transform .3s ease-in-out",boxSizing:"border-box"},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:"bottom center",transform:"scale(0)"},".cm-ySelectionInfo":{position:"absolute",top:"-1.05em",left:"-1px",fontSize:".75em",fontFamily:"serif",fontStyle:"normal",fontWeight:"normal",lineHeight:"normal",userSelect:"none",color:"white",paddingLeft:"2px",paddingRight:"2px",zIndex:101,transition:"opacity .3s ease-in-out",backgroundColor:"inherit",opacity:0,transitionDelay:"0s",whiteSpace:"nowrap"},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:"0s"}}),ej=$r.define();class tj extends Gr{constructor(e,n){super(),this.color=e,this.name=n}toDOM(){return gm("span",[ur("class","cm-ySelectionCaret"),ur("style",`background-color: ${this.color}; border-color: ${this.color}`)],[Ou("⁠"),gm("div",[ur("class","cm-ySelectionCaretDot")]),Ou("⁠"),gm("div",[ur("class","cm-ySelectionInfo")],[Ou(this.name)]),Ou("⁠")])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}}class nj{constructor(e){this.conf=e.state.facet(Jd),this._listener=({added:n,updated:r,removed:i},s,o)=>{n.concat(r).concat(i).findIndex(l=>l!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[ej.of([])]})},this._awareness=this.conf.awareness,this._awareness.on("change",this._listener),this.decorations=ft.of([])}destroy(){this._awareness.off("change",this._listener)}update(e){const n=this.conf.ytext,r=n.doc,i=this.conf.awareness,s=[],o=this.conf.awareness.getLocalState();if(o!=null){const a=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),l=a?e.state.selection.main:null,c=o.cursor==null?null:Ta(o.cursor.anchor),u=o.cursor==null?null:Ta(o.cursor.head);if(l!=null){const h=Dh(n,l.anchor),d=Dh(n,l.head);(o.cursor==null||!fp(c,h)||!fp(u,d))&&i.setLocalStateField("cursor",{anchor:h,head:d})}else o.cursor!=null&&a&&i.setLocalStateField("cursor",null)}i.getStates().forEach((a,l)=>{if(l===i.doc.clientID)return;const c=a.cursor;if(c==null||c.anchor==null||c.head==null)return;const u=Mh(c.anchor,r),h=Mh(c.head,r);if(u==null||h==null||u.type!==n||h.type!==n)return;const{color:d="#30bced",name:m="Anonymous"}=a.user||{},g=a.user&&a.user.colorLight||d+"33",p=JO(u.index,h.index),O=zs(u.index,h.index),v=e.view.state.doc.lineAt(p),w=e.view.state.doc.lineAt(O);if(v.number===w.number)s.push({from:p,to:O,value:ze.mark({attributes:{style:`background-color: ${g}`},class:"cm-ySelection"})});else{s.push({from:p,to:v.from+v.length,value:ze.mark({attributes:{style:`background-color: ${g}`},class:"cm-ySelection"})}),s.push({from:w.from,to:O,value:ze.mark({attributes:{style:`background-color: ${g}`},class:"cm-ySelection"})});for(let _=v.number+1;_0?-1:1,block:!1,widget:new tj(d,m)})})}),this.decorations=ze.set(s,!0)}}const rj=nn.fromClass(nj,{decorations:t=>t.decorations}),ij=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}};class sj{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}}const ef=Ze.define({combine(t){return t[t.length-1]}});class oj{constructor(e){this.view=e,this.conf=e.state.facet(ef),this._undoManager=this.conf.undoManager,this.syncConf=e.state.facet(Jd),this._beforeChangeSelection=null,this._mux=ij(),this._onStackItemAdded=({stackItem:n,changedParentTypes:r})=>{r.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!n.meta.has(this)&&n.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:n})=>{const r=n.meta.get(this);if(r){const i=this.syncConf.fromYRange(r);e.dispatch(e.state.update({selection:i,effects:[Ae.scrollIntoView(i)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on("stack-item-added",this._onStackItemAdded),this._undoManager.on("stack-item-popped",this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(yp)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off("stack-item-added",this._onStackItemAdded),this._undoManager.off("stack-item-popped",this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}}const aj=nn.fromClass(oj),hC=({state:t,dispatch:e})=>t.facet(ef).undo()||!0,xp=({state:t,dispatch:e})=>t.facet(ef).redo()||!0,lj=[{key:"Mod-z",run:hC,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:xp,preventDefault:!0},{key:"Mod-Shift-z",run:xp,preventDefault:!0}],cj=(t,e,{undoManager:n=new qd(t)}={})=>{const r=new GF(t,e),i=[Jd.of(r),KF];return e&&i.push(JF,rj),n!==!1&&i.push(ef.of(new sj(n)),aj,Ae.domEventHandlers({beforeinput(s,o){return s.inputType==="historyUndo"?hC(o):s.inputType==="historyRedo"?xp(o):!1}})),i};var uj=P(''),hj=P('

'),dj=P('
');function fj(t,e){Me(e,!0);let n=ee(e,"value",3,""),r=ee(e,"placeholder",3,""),i=ee(e,"minHeight",3,"300px"),s=ee(e,"maxHeight",3,""),o=ee(e,"disabled",3,!1),a=ee(e,"readonly",3,!1),l=ee(e,"yText",3,null),c=ee(e,"yAwareness",3,null),u=ge(!1);const h=A(()=>s()||(Of.editorFixedHeight>0?`${Of.editorFixedHeight}px`:"")),d=A(()=>Of.editorStickyToolbar&&!f(h)),m=Wt("pageRoute");function g(se){const pe=_t.serverUrl||"",ae=m?.()||"";return ae.startsWith("/")&&ae.slice(1),se.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(G,K,H)=>{let ue=H;return H.startsWith("media://")?ue=`${pe}/user/media/${H.slice(8)}`:H.startsWith("image://")?ue=`${pe}/user/images/${H.slice(8)}`:H.startsWith("user://")?ue=`${pe}/user/${H.slice(7)}`:H.startsWith("theme://")?ue=H:!H.startsWith("http")&&!H.startsWith("/")&&!H.startsWith("data:")&&ae&&(ue=`${pe}${ae}/${H}`),`![${K}](${ue})`})}const p=A(()=>f(u)?Ro.parse(g(n()||""),{async:!1}):"");let O,v,w=ge(!1),_=null;function C(){k(w,document.documentElement.classList.contains("dark"),!0)}const T=Ae.theme({"&":{fontSize:"14px",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',color:"hsl(240 10% 3.9%)"},".cm-content":{caretColor:"hsl(221 83% 53%)",padding:"12px 0",lineHeight:"1.6",color:"hsl(240 10% 3.9%)"},".cm-cursor":{borderLeftColor:"hsl(221 83% 53%)",borderLeftWidth:"2px"},"&.cm-focused .cm-cursor":{borderLeftColor:"hsl(221 83% 53%)"},".cm-scroller":{overflow:"auto"},".cm-gutters":{backgroundColor:"transparent",borderRight:"none",color:"hsl(240 3.8% 46.1%)",paddingRight:"8px"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"hsl(240 10% 3.9%)"},".cm-activeLine":{backgroundColor:"hsl(240 4.8% 95.9% / 0.5)"},".cm-selectionBackground":{backgroundColor:"hsl(221 83% 53% / 0.15) !important"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"hsl(221 83% 53% / 0.2) !important"},".cm-line":{padding:"0 16px"},".cm-foldPlaceholder":{backgroundColor:"hsl(240 4.8% 95.9%)",border:"1px solid hsl(240 5.9% 90%)",color:"hsl(240 3.8% 46.1%)",borderRadius:"4px",padding:"0 6px"},".cm-tooltip":{backgroundColor:"hsl(0 0% 100%)",border:"1px solid hsl(240 5.9% 90%)",borderRadius:"6px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"}}),S=Ae.theme({"&":{fontSize:"14px",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace'},".cm-content":{caretColor:"hsl(217 91% 60%)",padding:"12px 0",lineHeight:"1.6"},".cm-cursor":{borderLeftColor:"hsl(217 91% 60%)",borderLeftWidth:"2px"},"&.cm-focused .cm-cursor":{borderLeftColor:"hsl(217 91% 60%)"},".cm-scroller":{overflow:"auto"},".cm-gutters":{backgroundColor:"transparent",borderRight:"none",color:"hsl(240 5% 64.9%)",paddingRight:"8px"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"hsl(0 0% 98%)"},".cm-activeLine":{backgroundColor:"hsl(240 3.7% 15.9% / 0.5)"},".cm-selectionBackground":{backgroundColor:"hsl(217 91% 60% / 0.2) !important"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"hsl(217 91% 60% / 0.25) !important"},".cm-line":{padding:"0 16px"},".cm-foldPlaceholder":{backgroundColor:"hsl(240 3.7% 15.9%)",border:"1px solid hsl(240 3.7% 15.9%)",color:"hsl(240 5% 64.9%)",borderRadius:"4px",padding:"0 6px"},".cm-tooltip":{backgroundColor:"hsl(240 10% 3.9%)",border:"1px solid hsl(240 3.7% 15.9%)",borderRadius:"6px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.3)"}}),Q=Ac(yd,{fallback:!0});function D(se){_=null;const pe=l()?[]:[Sd()],ae=l()?lj:kd,G=[...pe,Lw(),vd(),bk(),$_(),rC(),yP({base:ka,codeLanguages:qV}),Q,se?S:T,se?Ad:[],Io.of([...K_,...Cd,...uC,...ae,Td]),Ae.updateListener.of(K=>{K.docChanged&&e.onchange?.(K.state.doc.toString())}),Ae.lineWrapping,Ae.editable.of(!o()&&!a()),ot.readOnly.of(a())];return r()&&G.push(iO(r())),G.push(Ae.domEventHandlers({dragover(K){return K.dataTransfer?.types.includes("application/x-grav-media")||K.dataTransfer?.types.includes("Files")?(K.preventDefault(),K.dataTransfer.dropEffect="copy",!0):!1},dragenter(K){return K.dataTransfer?.types.includes("application/x-grav-media")||K.dataTransfer?.types.includes("Files")?(K.preventDefault(),!0):!1},drop(K){const H=K.dataTransfer?.getData("application/x-grav-media")?K.dataTransfer?.getData("text/plain"):null;if(H){K.preventDefault();const ce=v?.posAtCoords({x:K.clientX,y:K.clientY})??v?.state.doc.length??0;return v?.dispatch({changes:{from:ce,insert:H}}),!0}const ue=K.dataTransfer?.files;if(!ue||ue.length===0)return!1;const ye=Array.from(ue).filter(ce=>ce.type.startsWith("image/"));if(ye.length===0)return!1;K.preventDefault();const De=v?.posAtCoords({x:K.clientX,y:K.clientY})??v?.state.doc.length??0,W=ye.map(ce=>`![${ce.name}](${ce.name})`).join(` `);return v?.dispatch({changes:{from:De,insert:W}}),!0},paste(K){const H=K.clipboardData?.files;if(!H||H.length===0)return!1;const ue=Array.from(H).filter(W=>W.type.startsWith("image/"));if(ue.length===0)return!1;K.preventDefault();const ye=v?.state.selection.main.head??0,De=ue.map(W=>`![${W.name||"image"}](${W.name||"pasted-image"})`).join(` `);return v?.dispatch({changes:{from:ye,insert:De}}),!0}})),l()&&(_=new qd(l()),G.push(cj(l(),c()??null,{undoManager:_}))),G}function I(){O&&(v=new Ae({state:ot.create({doc:n()??"",extensions:D(f(w))}),parent:O}),v.dom.__cmView=v)}function X(se,pe){if(!v)return;const{from:ae,to:G}=v.state.selection.main,K=v.state.sliceDoc(ae,G),ue=`${se}${K}${se}`;v.dispatch({changes:{from:ae,to:G,insert:ue},selection:{anchor:ae+se.length,head:ae+se.length+K.length}}),v.focus()}function L(se){if(!v)return;const{from:pe}=v.state.selection.main,ae=v.state.doc.lineAt(pe);ae.text.startsWith(se)?v.dispatch({changes:{from:ae.from,to:ae.from+se.length,insert:""}}):v.dispatch({changes:{from:ae.from,insert:se}}),v.focus()}function R(se){if(!v)return;const{from:pe}=v.state.selection.main,ae=v.state.doc.lineAt(pe),K=ae.text.match(/^(#{1,6})\s/),H="#".repeat(se)+" ";if(K){const ue=K[0];ue===H?v.dispatch({changes:{from:ae.from,to:ae.from+ue.length,insert:""}}):v.dispatch({changes:{from:ae.from,to:ae.from+ue.length,insert:H}})}else v.dispatch({changes:{from:ae.from,insert:H}});v.focus()}function F(){if(!v)return;const{from:se,to:pe}=v.state.selection.main,ae=v.state.sliceDoc(se,pe);if(ae){const G=`[${ae}](url)`;v.dispatch({changes:{from:se,to:pe,insert:G},selection:{anchor:se+ae.length+3,head:se+ae.length+6}})}else v.dispatch({changes:{from:se,insert:"[link text](url)"},selection:{anchor:se+1,head:se+10}});v.focus()}function U(){if(!v)return;const{from:se,to:pe}=v.state.selection.main,ae=v.state.sliceDoc(se,pe);if(ae){const G=`![${ae}](image-url)`;v.dispatch({changes:{from:se,to:pe,insert:G},selection:{anchor:se+ae.length+4,head:se+ae.length+13}})}else v.dispatch({changes:{from:se,insert:"![alt text](image-url)"},selection:{anchor:se+2,head:se+10}});v.focus()}function j(){if(!v)return;const{from:se}=v.state.selection.main,pe=v.state.doc.lineAt(se),ae=pe.text.length>0?` --- `:`--- `;v.dispatch({changes:{from:pe.to,insert:ae}}),v.focus()}function Y(){v&&(_?_.undo():SO(v),v.focus())}function ie(){v&&(_?_.redo():ph(v),v.focus())}We(()=>{l()||v&&n()!==v.state.doc.toString()&&v.dispatch({changes:{from:0,to:v.state.doc.length,insert:n()??""}})}),We(()=>{f(w),mr(()=>{if(v&&O){const se=v.state.doc.toString();v.destroy(),v=new Ae({state:ot.create({doc:se,extensions:D(f(w))}),parent:O}),v.dom.__cmView=v}})}),tr(()=>{C();const se=new MutationObserver(()=>C());se.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),I();function pe(ae){if(!v||!ae.detail?.content)return;const{content:G,mode:K}=ae.detail;if(K==="replace")v.dispatch({changes:{from:0,to:v.state.doc.length,insert:G}});else if(K==="append"){const H=v.state.doc.length;v.dispatch({changes:{from:H,insert:` `+G}})}else if(K==="insert-at-cursor"){const H=v.state.selection.main.head;v.dispatch({changes:{from:H,insert:G}})}}return window.addEventListener("grav:editor:insert-content",pe),()=>{se.disconnect(),v?.destroy(),window.removeEventListener("grav:editor:insert-content",pe)}});const N=[[{icon:oA,label:"Undo",action:Y,shortcut:"Mod+Z"},{icon:aA,label:"Redo",action:ie,shortcut:"Mod+Shift+Z"}],"separator",[{icon:lA,label:"Heading 1",action:()=>R(1)},{icon:cA,label:"Heading 2",action:()=>R(2)},{icon:uA,label:"Heading 3",action:()=>R(3)}],"separator",[{icon:hA,label:"Bold",action:()=>X("**"),shortcut:"Mod+B"},{icon:dA,label:"Italic",action:()=>X("_"),shortcut:"Mod+I"},{icon:fA,label:"Strikethrough",action:()=>X("~~")},{icon:PA,label:"Inline Code",action:()=>X("`")}],"separator",[{icon:QA,label:"Bullet List",action:()=>L("- ")},{icon:mA,label:"Ordered List",action:()=>L("1. ")},{icon:gA,label:"Blockquote",action:()=>L("> ")}],"separator",[{icon:pA,label:"Link",action:F},{icon:CA,label:"Image",action:U},{icon:TA,label:"Horizontal Rule",action:j}],"separator",[{icon:AA,label:"Toggle Preview",action:()=>k(u,!f(u))}]];var z=dj(),he=x(z);let te;Ue(he,21,()=>N,dn,(se,pe)=>{var ae=_e(),G=me(ae);{var K=ue=>{$F(ue,{orientation:"vertical",class:"mx-1 !h-5"})},H=ue=>{var ye=_e(),De=me(ye);Ue(De,17,()=>f(pe),dn,(W,ce)=>{var we=uj(),xe=x(we);{var fe=Qe=>{var Be=_e(),$e=me(Be);{var Ne=wt=>{EA(wt,{size:15,strokeWidth:2})},Ge=wt=>{var qt=_e(),tt=me(qt);Gt(tt,()=>f(ce).icon,(ct,Ot)=>{Ot(ct,{size:15,strokeWidth:2})}),y(wt,qt)};Z($e,wt=>{f(u)?wt(Ne):wt(Ge,-1)})}y(Qe,Be)},Te=Qe=>{var Be=_e(),$e=me(Be);Gt($e,()=>f(ce).icon,(Ne,Ge)=>{Ge(Ne,{size:15,strokeWidth:2})}),y(Qe,Be)};Z(xe,Qe=>{f(ce).label==="Toggle Preview"?Qe(fe):Qe(Te,-1)})}b(we),B(()=>{Je(we,1,`inline-flex h-7 w-7 items-center justify-center rounded-sm transition-colors disabled:pointer-events-none disabled:opacity-50 ${f(ce).label==="Toggle Preview"&&f(u)?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-accent hover:text-foreground"}`),Ve(we,"title",`${f(ce).label??""}${f(ce).shortcut?` (${f(ce).shortcut})`:""}`),we.disabled=f(ce).label==="Toggle Preview"?!1:o()||a()}),Ce("click",we,function(...Qe){f(ce).action?.apply(this,Qe)}),y(W,we)}),y(ue,ye)};Z(G,ue=>{f(pe)==="separator"?ue(K):ue(H,-1)})}y(se,ae)}),b(he);var V=M(he,2);let J;var q=x(V);{var re=se=>{var pe=_e(),ae=me(pe);{var G=H=>{var ue=_e(),ye=me(ue);lt(ye,()=>f(p)),y(H,ue)},K=H=>{var ue=hj(),ye=x(ue,!0);b(ue),B(De=>$(ye,De),[()=>ve.t("ADMIN_NEXT.MARKDOWN_EDITOR.NOTHING_TO_PREVIEW")]),y(H,ue)};Z(ae,H=>{f(p)?H(G):H(K,-1)})}y(se,pe)};Z(q,se=>{f(u)&&se(re)})}b(V);var oe=M(V,2);let Se;gn(oe,se=>O=se,()=>O),b(z),B((se,pe,ae,G)=>{Je(z,1,se,"svelte-kp3nht"),Je(he,1,pe,"svelte-kp3nht"),te=yi(he,"",te,{top:f(d)?"var(--sticky-header-height, 0px)":void 0}),Je(V,1,ae,"svelte-kp3nht"),J=yi(V,"",J,{"min-height":i(),"max-height":f(h)||"none",display:f(u)?"":"none"}),Je(oe,1,G,"svelte-kp3nht"),Se=yi(oe,"",Se,{"min-height":f(h)||i(),"--cm-max-h":f(h)||"none",display:f(u)?"none":""}),oe.dir=oe.dir},[()=>ro(hl("rounded-md border border-input",f(d)?"":"overflow-hidden",e.class)),()=>ro(hl("flex flex-wrap items-center gap-0.5 border-b border-border px-1.5 py-1",f(d)?"sticky z-10 rounded-t-md bg-muted":"bg-muted/50")),()=>ro(hl("prose prose-sm dark:prose-invert max-w-none overflow-y-auto px-4 py-3",f(d)&&"rounded-b-md")),()=>ro(hl("markdown-editor-cm",f(d)&&"rounded-b-md"))]),y(t,z),Re()}It(["click"]);var mj=P('*'),gj=P(' '),pj=P('
'),Oj=P(''),vj=P('
');function sx(t,e){Me(e,!0);const n=ve.tMaybe,r=Wt("editorCollab"),i=A(()=>r?r(e.field.name):null),s=Wt("collabPending"),o=A(()=>s?s(e.field.name):!1);var a=vj(),l=x(a);{var c=p=>{var O=gj(),v=x(O),w=M(v);{var _=C=>{var T=mj();y(C,T)};Z(w,C=>{e.field.validate?.required&&C(_)})}b(O),B(C=>$(v,`${C??""} `),[()=>n(e.field.label)]),y(p,O)};Z(l,p=>{e.field.label&&p(c)})}var u=M(l,2);{var h=p=>{var O=pj(),v=x(O),w=x(v,!0);b(v),b(O),B(_=>$(w,_),[()=>ve.t("ADMIN_NEXT.PAGES.EDIT.CONNECTING_TO_COLLAB")]),y(p,O)},d=p=>{{let O=A(()=>typeof e.value=="string"?e.value:e.value!=null?String(e.value):typeof e.field.default=="string"?e.field.default:""),v=A(()=>n(e.field.placeholder)??""),w=A(()=>e.field.rows?`${e.field.rows*24}px`:"300px"),_=A(()=>f(i)?.yText??null),C=A(()=>f(i)?.awareness??null);fj(p,{get value(){return f(O)},onchange:T=>e.onchange(T),get placeholder(){return f(v)},get minHeight(){return f(w)},get disabled(){return e.field.disabled},get readonly(){return e.field.readonly},get yText(){return f(_)},get yAwareness(){return f(C)}})}};Z(u,p=>{f(o)?p(h):p(d,-1)})}var m=M(u,2);{var g=p=>{var O=Oj();lt(O,()=>n(e.field.help),!0),b(O),y(p,O)};Z(m,p=>{e.field.help&&p(g)})}b(a),y(t,a),Re()}const ox=new Map,bj=300*1e3;async function dC(t,e){const n=t+(e?"?"+new URLSearchParams(e).toString():""),r=ox.get(n);if(r&&Date.now()-r.timestamp*'),xj=P(''),Sj=P('

'),wj=P("
"),kj=P(""),_j=P('

'),Pj=P('
');function fC(t,e){Me(e,!0);const n=ve.tMaybe,r=Wt("pageType");let i=ge(Pt([]));We(()=>{if(e.field.data_options&&(!e.field.options||e.field.options.length===0)){const w={};e.field.data_options.includes("pageTypes")&&r&&(w.type=r()),dC(e.field.data_options,Object.keys(w).length>0?w:void 0).then(_=>{k(i,_,!0)})}});const s=A(()=>e.field.options&&e.field.options.length>0?e.field.options:f(i));function o(w){return w===!0?"1":w===!1?"0":w==null?"":String(w)}const a=A(()=>e.value!==void 0&&e.value!==null?o(e.value):o(e.field.default));var l=Pj(),c=x(l);{var u=w=>{var _=wj(),C=x(_);{var T=D=>{var I=xj(),X=x(I),L=M(X);{var R=F=>{var U=yj();y(F,U)};Z(L,F=>{e.field.validate?.required&&F(R)})}b(I),B(F=>$(X,`${F??""} `),[()=>n(e.field.label)]),y(D,I)};Z(C,D=>{e.field.label&&D(T)})}var S=M(C,2);{var Q=D=>{var I=Sj();lt(I,()=>n(e.field.help),!0),b(I),y(D,I)};Z(S,D=>{e.field.help&&D(Q)})}b(_),y(w,_)};Z(c,w=>{(e.field.label||e.field.help)&&w(u)})}var h=M(c,2),d=x(h);Ue(d,21,()=>f(s),w=>w.value,(w,_)=>{var C=kj(),T=x(C,!0);b(C);var S={};B(Q=>{ld(C,f(a)===f(_).value),$(T,Q),S!==(S=f(_).value)&&(C.value=(C.__value=f(_).value)??"")},[()=>n(f(_).label)]),y(w,C)}),b(d);var m;lr(d);var g=M(d,2),p=x(g);Sc(p,{size:14,class:"text-muted-foreground"}),b(g),b(h);var O=M(h,2);{var v=w=>{var _=_j(),C=x(_,!0);b(_),B(()=>$(C,e.error)),y(w,_)};Z(O,w=>{e.error&&w(v)})}b(l),B(w=>{Je(h,1,`relative ${w??""}`),Je(d,1,`flex h-10 w-full appearance-none rounded-lg border bg-muted/50 ps-3 pe-8 py-2 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring ${e.error?"border-destructive ring-1 ring-destructive":"border-input"}`),d.disabled=e.field.disabled,m!==(m=f(a))&&(d.value=(d.__value=f(a))??"",cr(d,f(a)))},[()=>Gu(e.field.size)]),Ce("change",d,w=>e.onchange(w.target.value)),y(t,l),Re()}It(["change"]);var Qj=P(' '),Cj=P('

'),Tj=P('

'),Aj=P('

'),Ej=P("
"),Dj=P(''),Mj=P('
');function Rj(t,e){Me(e,!0);const n=ve.tMaybe,r=e.field.validate?.type==="bool",i=A(()=>e.field.options?.length?e.field.options.map(S=>({value:S.value,label:n(S.label)})):r?[{value:"1",label:"Yes"},{value:"0",label:"No"}]:[{value:String(e.field.highlight??1),label:"Yes"},{value:"0",label:"No"}]),s=A(()=>e.field.highlight!==void 0&&e.field.highlight!==null?String(e.field.highlight):void 0);function o(S){return S===!0?"1":S===!1?"0":S==null?"":String(S)}const a=A(()=>e.value!==void 0&&e.value!==null?o(e.value):e.field.default!==void 0&&e.field.default!==null?o(e.field.default):""),l=A(()=>f(i).findIndex(S=>S.value===f(a))),c=A(()=>f(s)!==void 0?f(i).findIndex(S=>S.value===f(s)):-1),u=A(()=>f(l)>=0?f(l):f(c)>=0?f(c):0),h=A(()=>f(i).length);function d(S){if(r)e.onchange(S==="1"||S==="true");else{const Q=Number(S);e.onchange(isNaN(Q)||S===""?S:Q)}}function m(S){return f(s)===void 0?!0:S===f(s)}const g=A(()=>m(f(i)[f(u)]?.value??"")),p=A(()=>f(i)[f(u)]?.value??"");var O=Mj(),v=x(O);{var w=S=>{var Q=Ej(),D=x(Q);{var I=U=>{var j=Qj(),Y=x(j,!0);b(j),B(ie=>$(Y,ie),[()=>n(e.field.label)]),y(U,j)};Z(D,U=>{e.field.label&&U(I)})}var X=M(D,2);{var L=U=>{var j=Cj();lt(j,()=>n(e.field.help),!0),b(j),y(U,j)};Z(X,U=>{e.field.help&&U(L)})}var R=M(X,2);{var F=U=>{const j=A(()=>n(e.field.description));var Y=_e(),ie=me(Y);{var N=he=>{var te=Tj();lt(te,()=>Ro.parseInline(f(j)),!0),b(te),y(he,te)},z=he=>{var te=Aj(),V=x(te,!0);b(te),B(()=>$(V,f(j))),y(he,te)};Z(ie,he=>{e.field.markdown?he(N):he(z,-1)})}y(U,Y)};Z(R,U=>{e.field.description&&U(F)})}b(Q),y(S,Q)};Z(v,S=>{(e.field.label||e.field.help||e.field.description)&&S(w)})}var _=M(v,2),C=x(_),T=M(C,2);Ue(T,19,()=>f(i),S=>S.value,(S,Q)=>{var D=Dj(),I=x(D,!0);b(D),B(()=>{Je(D,1,`relative z-10 rounded-md px-4 py-2 text-sm font-medium transition-colors duration-200 ${f(Q).value===f(p)?"text-white":"text-muted-foreground hover:text-foreground"}`),D.disabled=e.field.disabled,$(I,f(Q).label)}),Ce("click",D,()=>d(f(Q).value)),y(S,D)}),b(_),b(O),B(()=>{yi(_,`grid-template-columns: repeat(${f(h)??""}, minmax(0, 1fr));`),Je(C,1,`absolute top-0.5 bottom-0.5 rounded-md shadow-sm transition-all duration-200 ease-out ${f(g)?"bg-primary":"bg-muted-foreground/70"}`),yi(C,`left: calc(${f(u)??""} * (100% / ${f(h)??""}) + 2px); width: calc(100% / ${f(h)??""} - 4px);`)}),y(t,O),Re()}It(["click"]);var Lj=P('');function Ij(t,e){Me(e,!0);const n=ve.tMaybe;let r=ge(Pt(typeof e.value=="string"?e.value:JSON.stringify(e.value??e.field.default??"",null,2)));function i(){try{e.onchange(JSON.parse(f(r)))}catch{e.onchange(f(r))}}var s=Lj(),o=x(s),a=x(o),l=M(a),c=x(l,!0);b(l),b(o);var u=M(o,2);tS(u),Ve(u,"rows",4),b(s),B(h=>{$(a,`${h??""} `),$(c,e.field.type)},[()=>n(e.field.label)||e.field.name]),Ce("input",u,i),Vp(u,()=>f(r),h=>k(r,h)),y(t,s),Re()}It(["input"]);var Xj=P(''),Zj=P(''),Nj=P(' '),Vj=P('
',1),Fj=P('*'),jj=P(''),Bj=P('

'),zj=P("
"),Wj=P(''),Yj=P('
'),Uj=P(''),qj=P('
'),$j=P(" ",1),Gj=P('
'),Hj=P('
');function Kj(t,e){Me(e,!0);const n=(te,V=xt,J=xt)=>{const q=A(()=>f(l).has(V().route)),re=A(()=>f(c).has(V().route)),oe=A(()=>f(p)===V().route),Se=A(()=>f(a)[V().route]),se=A(()=>f(Se)?I(f(Se)).filter(X):[]);var pe=Vj(),ae=me(pe),G=x(ae),K=x(G);{var H=Ne=>{var Ge=Xj(),wt=x(Ge);{var qt=Ot=>{qm(Ot,{size:12,class:"animate-spin"})},tt=Ot=>{da(Ot,{size:12})},ct=Ot=>{Dl(Ot,{name:"chevron-forward",size:12})};Z(wt,Ot=>{f(re)?Ot(qt):f(q)?Ot(tt,1):Ot(ct,-1)})}b(Ge),Ce("click",Ge,Ot=>C(V().route,Ot)),y(Ne,Ge)},ue=Ne=>{var Ge=Zj();y(Ne,Ge)};Z(K,Ne=>{V().has_children?Ne(H):Ne(ue,-1)})}var ye=M(K,2);{var De=Ne=>{var Ge=_e(),wt=me(Ge);{var qt=ct=>{DA(ct,{size:14,class:"shrink-0 text-muted-foreground"})},tt=ct=>{MA(ct,{size:14,class:"shrink-0 text-muted-foreground"})};Z(wt,ct=>{f(q)?ct(qt):ct(tt,-1)})}y(Ne,Ge)},W=Ne=>{F0(Ne,{size:14,class:"shrink-0 text-muted-foreground"})};Z(ye,Ne=>{V().has_children?Ne(De):Ne(W,-1)})}var ce=M(ye,2),we=x(ce);{var xe=Ne=>{var Ge=Nj(),wt=x(Ge);b(Ge),B(()=>$(wt,`(${V().slug??""})`)),y(Ne,Ge)};Z(we,Ne=>{g&&Ne(xe)})}var fe=M(we);b(ce);var Te=M(ce,2);{var Qe=Ne=>{$m(Ne,{size:14,class:"ms-auto shrink-0 text-primary"})};Z(Te,Ne=>{f(oe)&&Ne(Qe)})}b(G),b(ae);var Be=M(ae,2);{var $e=Ne=>{var Ge=_e(),wt=me(Ge);Ue(wt,17,()=>f(se),qt=>qt.route,(qt,tt)=>{n(qt,()=>f(tt),()=>J()+1)}),y(Ne,Ge)};Z(Be,Ne=>{f(q)&&f(Se)&&Ne($e)})}B(()=>{yi(ae,`padding-left: ${J()*16}px`),Je(G,1,`flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-start text-sm transition-colors ${f(oe)?"bg-primary/10 text-primary":"text-foreground hover:bg-accent"}`),$(fe,` ${V().title??""}`)}),Ce("click",G,()=>T(V().route)),y(te,pe)},r=ve.tMaybe;let i=ge(!1),s=ge(""),o=ge(Pt([])),a=ge(Pt({})),l=ge(Pt(new Set)),c=ge(Pt(new Set)),u=ge(!1),h=ge(null);const d=e.field.show_modular??!1,m=e.field.show_root??e.field.type==="parents",g=e.field.show_slug??!0,p=A(()=>typeof e.value=="string"?e.value:"");function O(te,V){for(const J of te){if(J.route===V)return J.title;const q=f(a)[J.route];if(q){const re=O(q,V);if(re)return re}}return null}const v=A(()=>()=>{if(!f(p))return"";const te=O(f(o),f(p));return te?g?`${f(p)} — ${te}`:te:f(p)});async function w(){if(!(f(o).length>0)){k(u,!0);try{k(o,await V0("/","title","asc"),!0),k(a,{"/":f(o)},!0)}catch{}finally{k(u,!1)}}}async function _(te){if(!f(a)[te]){k(c,new Set([...f(c),te]),!0);try{const V=await V0(te,"title","asc");k(a,{...f(a),[te]:V},!0)}catch{k(a,{...f(a),[te]:[]},!0)}finally{const V=new Set(f(c));V.delete(te),k(c,V,!0)}}}async function C(te,V){V.stopPropagation();const J=new Set(f(l));J.has(te)?J.delete(te):(J.add(te),await _(te)),k(l,J,!0)}function T(te){e.onchange(te),k(i,!1),k(s,"")}function S(){k(i,!f(i)),f(i)&&(w(),requestAnimationFrame(()=>f(h)?.focus()))}function Q(te){te.key==="Escape"&&(k(i,!1),k(s,""))}function D(te){te.target.closest(".pages-field-popover")||(k(i,!1),k(s,""))}function I(te){if(!f(s))return te;const V=f(s).toLowerCase();return te.filter(J=>J.title.toLowerCase().includes(V)||J.route.toLowerCase().includes(V)||J.slug.toLowerCase().includes(V))}function X(te){return!(!d&&te.template?.startsWith("modular/"))}We(()=>{if(f(i))return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)});var L=Hj(),R=x(L);{var F=te=>{var V=zj(),J=x(V);{var q=Se=>{var se=jj(),pe=x(se),ae=M(pe);{var G=K=>{var H=Fj();y(K,H)};Z(ae,K=>{e.field.validate?.required&&K(G)})}b(se),B(K=>$(pe,`${K??""} `),[()=>r(e.field.label)]),y(Se,se)};Z(J,Se=>{e.field.label&&Se(q)})}var re=M(J,2);{var oe=Se=>{var se=Bj();lt(se,()=>r(e.field.help),!0),b(se),y(Se,se)};Z(re,Se=>{e.field.help&&Se(oe)})}b(V),y(te,V)};Z(R,te=>{(e.field.label||e.field.help)&&te(F)})}var U=M(R,2),j=x(U),Y=x(j),ie=x(Y,!0);b(Y);var N=M(Y,2);Sc(N,{size:14,class:"shrink-0 text-muted-foreground"}),b(j);var z=M(j,2);{var he=te=>{var V=Gj(),J=x(V),q=x(J);cS(q,{size:14,class:"shrink-0 text-muted-foreground"});var re=M(q,2);En(re),gn(re,K=>k(h,K),()=>f(h));var oe=M(re,2);{var Se=K=>{var H=Wj(),ue=x(H);ji(ue,{size:14}),b(H),Ce("click",H,()=>{k(s,""),f(h)?.focus()}),y(K,H)};Z(oe,K=>{f(s)&&K(Se)})}b(J);var se=M(J,2),pe=x(se);{var ae=K=>{var H=Yj(),ue=x(H);qm(ue,{size:16,class:"me-2 animate-spin"});var ye=M(ue);b(H),B(De=>$(ye,` ${De??""}`),[()=>ve.t("ADMIN_NEXT.PAGES.LOADING")]),y(K,H)},G=K=>{var H=$j(),ue=me(H);{var ye=xe=>{var fe=Uj(),Te=x(fe);F0(Te,{size:14,class:"shrink-0 text-muted-foreground"});var Qe=M(Te,2),Be=x(Qe,!0);b(Qe);var $e=M(Qe,2);{var Ne=Ge=>{$m(Ge,{size:14,class:"ms-auto shrink-0 text-primary"})};Z($e,Ge=>{f(p)==="/"&&Ge(Ne)})}b(fe),B(Ge=>{Je(fe,1,`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-start text-sm transition-colors ${f(p)==="/"?"bg-primary/10 text-primary":"text-foreground hover:bg-accent"}`),$(Be,Ge)},[()=>ve.t("ADMIN_NEXT.FIELDS.PAGES.ROOT")]),Ce("click",fe,()=>T("/")),y(xe,fe)};Z(ue,xe=>{m&&xe(ye)})}var De=M(ue,2);Ue(De,17,()=>I(f(o)),xe=>xe.route,(xe,fe)=>{var Te=_e(),Qe=me(Te);{var Be=Ne=>{n(Ne,()=>f(fe),()=>0)},$e=A(()=>X(f(fe)));Z(Qe,Ne=>{f($e)&&Ne(Be)})}y(xe,Te)});var W=M(De,2);{var ce=xe=>{var fe=qj(),Te=x(fe,!0);b(fe),B(Qe=>$(Te,Qe),[()=>ve.t("ADMIN_NEXT.PAGES.NO_PAGES")]),y(xe,fe)},we=A(()=>!f(u)&&I(f(o)).length===0);Z(W,xe=>{f(we)&&xe(ce)})}y(K,H)};Z(pe,K=>{f(u)?K(ae):K(G,-1)})}b(se),b(V),B(K=>Ve(re,"placeholder",K),[()=>ve.t("ADMIN_NEXT.FIELDS.PAGES.FILTER_PAGES")]),Vp(re,()=>f(s),K=>k(s,K)),y(te,V)};Z(z,te=>{f(i)&&te(he)})}b(U),b(L),B(te=>{Je(Y,1,ro(f(p)?"text-foreground":"text-muted-foreground")),$(ie,te)},[()=>f(p)?f(v)():"Select a page..."]),Ce("keydown",U,Q),Ce("click",j,S),y(t,L),Re()}It(["click","keydown"]);var Jj=P(''),eB=P('

'),tB=P("
"),nB=P(""),rB=P(""),iB=P(" ",1),sB=P('
');function oB(t,e){Me(e,!0);const n=ve.tMaybe;let r=ge(Pt([])),i=ge(!0);async function s(){k(i,!0);try{k(r,await Ns.get("/gpm/themes"),!0)}catch{k(r,[],!0)}finally{k(i,!1)}}We(()=>{s()});var o=sB(),a=x(o);{var l=v=>{var w=tB(),_=x(w);{var C=Q=>{var D=Jj(),I=x(D,!0);b(D),B(X=>$(I,X),[()=>n(e.field.label)]),y(Q,D)};Z(_,Q=>{e.field.label&&Q(C)})}var T=M(_,2);{var S=Q=>{var D=eB();lt(D,()=>n(e.field.help),!0),b(D),y(Q,D)};Z(T,Q=>{e.field.help&&Q(S)})}b(w),y(v,w)};Z(a,v=>{(e.field.label||e.field.help)&&v(l)})}var c=M(a,2),u=x(c),h=x(u);{var d=v=>{var w=nB(),_=x(w,!0);b(w),w.value=w.__value="",B(C=>$(_,C),[()=>ve.t("ADMIN_NEXT.FIELDS.THEME_SELECT.LOADING_THEMES")]),y(v,w)},m=v=>{var w=iB(),_=me(w),C=x(_,!0);b(_),_.value=_.__value="";var T=M(_,2);Ue(T,17,()=>f(r),S=>S.slug,(S,Q)=>{var D=rB(),I=x(D,!0);b(D);var X={};B(L=>{ld(D,L),$(I,f(Q).name),X!==(X=f(Q).slug)&&(D.value=(D.__value=f(Q).slug)??"")},[()=>String(e.value)===f(Q).slug]),y(S,D)}),B(S=>$(C,S),[()=>ve.t("ADMIN_NEXT.FIELDS.THEME_SELECT.SELECT_THEME")]),y(v,w)};Z(h,v=>{f(i)?v(d):v(m,-1)})}b(u);var g;lr(u);var p=M(u,2),O=x(p);Sc(O,{size:14,class:"text-muted-foreground"}),b(p),b(c),b(o),B(()=>{u.disabled=e.field.disabled||f(i),g!==(g=e.value??e.field.default??"")&&(u.value=(u.__value=e.value??e.field.default??"")??"",cr(u,e.value??e.field.default??""))}),Ce("change",u,v=>e.onchange(v.target.value)),y(t,o),Re()}It(["change"]);var aB=P(''),lB=P('

'),cB=P("
"),uB=P(''),hB=P(""),dB=P('
'),fB=P(''),mB=P('
'),gB=P(''),pB=P('
');function OB(t,e){Me(e,!0);const n=ve.tMaybe,r=e.field.value_only??!1,i=e.field.placeholder_key?n(e.field.placeholder_key):"Key",s=e.field.placeholder_value?n(e.field.placeholder_value):"Value",o=e.field.create===!1;let a=ge(Pt([]));We(()=>{o&&e.field.data_options&&(!e.field.options||e.field.options.length===0)&&dC(e.field.data_options).then(j=>{k(a,j,!0)})});const l=A(()=>e.field.options&&e.field.options.length>0?e.field.options:f(a));We(()=>{if(!o||f(l).length===0)return;const j=new Set(f(l).map(ie=>ie.value)),Y=f(d).filter(ie=>ie.value===""||j.has(ie.value));Y.length!==f(d).length&&(k(d,Y,!0),g())});const c=A(()=>!o||f(l).length>0&&f(d).length({id:ta(u),key:"",value:String(ie??"")})):typeof j=="object"&&!Array.isArray(j)?Object.entries(j).map(([Y,ie])=>({id:ta(u),key:Y,value:String(ie??"")})):[]}let d=ge(Pt(h(e.value))),m=ge(Pt(JSON.stringify(e.value)));We(()=>{const j=JSON.stringify(e.value);j!==f(m)&&(k(m,j,!0),k(d,h(e.value),!0))});function g(){if(r){const j=f(d).map(Y=>Y.value);k(m,JSON.stringify(j),!0),e.onchange(j)}else{const j={};for(const Y of f(d))Y.key&&(j[Y.key]=Y.value);k(m,JSON.stringify(j),!0),e.onchange(j)}}function p(){k(d,[...f(d),{id:ta(u),key:"",value:""}],!0)}function O(j){k(d,f(d).filter(Y=>Y.id!==j),!0),g()}function v(j,Y){k(d,f(d).map(ie=>ie.id===j?{...ie,key:Y}:ie),!0),g()}function w(j,Y){k(d,f(d).map(ie=>ie.id===j?{...ie,value:Y}:ie),!0),g()}let _=ge(null),C=ge(null);function T(j){k(_,j,!0)}function S(j,Y){j.preventDefault(),k(C,Y,!0)}function Q(j){if(f(_)!==null&&f(_)!==j){const Y=[...f(d)],[ie]=Y.splice(f(_),1);Y.splice(j,0,ie),k(d,Y,!0),g()}k(_,null),k(C,null)}function D(){k(_,null),k(C,null)}var I=pB(),X=x(I);{var L=j=>{var Y=cB(),ie=x(Y);{var N=te=>{var V=aB(),J=x(V,!0);b(V),B(q=>$(J,q),[()=>n(e.field.label)]),y(te,V)};Z(ie,te=>{e.field.label&&te(N)})}var z=M(ie,2);{var he=te=>{var V=lB();lt(V,()=>n(e.field.help),!0),b(V),y(te,V)};Z(z,te=>{e.field.help&&te(he)})}b(Y),y(j,Y)};Z(X,j=>{(e.field.label||e.field.help)&&j(L)})}var R=M(X,2);Ue(R,23,()=>f(d),j=>j.id,(j,Y,ie)=>{var N=mB(),z=x(N),he=x(z);Fp(he,{size:14}),b(z);var te=M(z,2);{var V=se=>{var pe=uB();En(pe),B(()=>{Jn(pe,f(Y).key),Ve(pe,"placeholder",i)}),Ce("input",pe,ae=>v(f(Y).id,ae.target.value)),y(se,pe)};Z(te,se=>{r||se(V)})}var J=M(te,2);{var q=se=>{var pe=dB(),ae=x(pe),G=x(ae),K=x(G,!0);b(G),G.value=G.__value="";var H=M(G);Ue(H,17,()=>f(l),W=>W.value,(W,ce)=>{var we=hB(),xe=x(we,!0);b(we);var fe={};B(Te=>{ld(we,f(Y).value===f(ce).value),$(xe,Te),fe!==(fe=f(ce).value)&&(we.value=(we.__value=f(ce).value)??"")},[()=>n(f(ce).label)]),y(W,we)}),b(ae);var ue;lr(ae);var ye=M(ae,2),De=x(ye);Sc(De,{size:14,class:"text-muted-foreground"}),b(ye),b(pe),B(()=>{G.disabled=f(Y).value!=="",$(K,s),ue!==(ue=f(Y).value)&&(ae.value=(ae.__value=f(Y).value)??"",cr(ae,f(Y).value))}),Ce("change",ae,W=>w(f(Y).id,W.target.value)),y(se,pe)},re=se=>{var pe=fB();En(pe),B(()=>{Jn(pe,f(Y).value),Ve(pe,"placeholder",s)}),Ce("input",pe,ae=>w(f(Y).id,ae.target.value)),y(se,pe)};Z(J,se=>{o?se(q):se(re,-1)})}var oe=M(J,2),Se=x(oe);ji(Se,{size:14}),b(oe),b(N),B(se=>{Je(N,1,`group flex items-center gap-1.5 rounded-lg transition-colors ${f(C)===f(ie)&&f(_)!==f(ie)?"border-t-2 border-primary":""}`),Ve(oe,"title",se)},[()=>ve.t("ADMIN_NEXT.REMOVE")]),en("dragstart",N,()=>T(f(ie))),en("dragover",N,se=>S(se,f(ie))),en("drop",N,()=>Q(f(ie))),en("dragend",N,D),Ce("click",oe,()=>O(f(Y).id)),y(j,N)}),b(R);var F=M(R,2);{var U=j=>{var Y=gB(),ie=x(Y);uS(ie,{size:14});var N=M(ie);b(Y),B(()=>$(N,` Add ${r?"item":"entry"}`)),Ce("click",Y,p),y(j,Y)};Z(F,j=>{f(c)&&j(U)})}b(I),y(t,I),Re()}It(["input","change","click"]);var vB=P(''),bB=P('

'),yB=P("
"),xB=P(""),SB=P('

'),wB=P('
');function kB(t,e){Me(e,!0);const n=ve.tMaybe,r=new Date;function i(C,T){const S=j=>j.toString().padStart(2,"0"),Q=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],D=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],I=["January","February","March","April","May","June","July","August","September","October","November","December"],X=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function L(j){const Y=["th","st","nd","rd"],ie=j%100;return j+(Y[(ie-20)%10]||Y[ie]||Y[0])}const R={d:S(T.getDate()),D:D[T.getDay()],j:String(T.getDate()),jS:L(T.getDate()),l:Q[T.getDay()],N:String(T.getDay()||7),S:L(T.getDate()).slice(-2),w:String(T.getDay()),F:I[T.getMonth()],m:S(T.getMonth()+1),M:X[T.getMonth()],n:String(T.getMonth()+1),Y:String(T.getFullYear()),y:String(T.getFullYear()).slice(-2),a:T.getHours()<12?"am":"pm",A:T.getHours()<12?"AM":"PM",g:String(T.getHours()%12||12),G:String(T.getHours()),h:S(T.getHours()%12||12),H:S(T.getHours()),i:S(T.getMinutes()),s:S(T.getSeconds())};let F="",U=0;for(;Ue.field.options?.length?e.field.options.map(C=>({format:C.value,display:i(C.value,r)})):[]),o=A(()=>typeof e.value=="string"&&e.value?i(e.value,r):"");var a=wB(),l=x(a);{var c=C=>{var T=yB(),S=x(T);{var Q=X=>{var L=vB(),R=x(L,!0);b(L),B(F=>$(R,F),[()=>n(e.field.label)]),y(X,L)};Z(S,X=>{e.field.label&&X(Q)})}var D=M(S,2);{var I=X=>{var L=bB();lt(L,()=>n(e.field.help),!0),b(L),y(X,L)};Z(D,X=>{e.field.help&&X(I)})}b(T),y(C,T)};Z(l,C=>{(e.field.label||e.field.help)&&C(c)})}var u=M(l,2),h=x(u),d=x(h),m=x(d,!0);b(d),d.value=d.__value="";var g=M(d);Ue(g,17,()=>f(s),C=>C.format,(C,T)=>{var S=xB(),Q=x(S,!0);b(S);var D={};B(I=>{ld(S,I),$(Q,f(T).display),D!==(D=f(T).format)&&(S.value=(S.__value=f(T).format)??"")},[()=>String(e.value)===f(T).format]),y(C,S)}),b(h);var p;lr(h);var O=M(h,2),v=x(O);Sc(v,{size:14,class:"text-muted-foreground"}),b(O),b(u);var w=M(u,2);{var _=C=>{var T=SB(),S=x(T),Q=M(S),D=x(Q,!0);b(Q),b(T),B(I=>{$(S,`${I??""} `),$(D,e.value)},[()=>ve.t("ADMIN_NEXT.FIELDS.DATE_FORMAT.FORMAT_STRING")]),y(C,T)};Z(w,C=>{f(o)&&C(_)})}b(a),B(C=>{h.disabled=e.field.disabled,$(m,C),p!==(p=e.value??e.field.default??"")&&(h.value=(h.__value=e.value??e.field.default??"")??"",cr(h,e.value??e.field.default??""))},[()=>ve.t("ADMIN_NEXT.FIELDS.DATE_FORMAT.SELECT_FORMAT")]),Ce("change",h,C=>e.onchange(C.target.value)),y(t,a),Re()}It(["change"]);var _B=P(''),PB=P('

'),QB=P("
"),CB=P(' '),TB=P(''),AB=P('
'),EB=P('

'),DB=P('
');function Sp(t,e){Me(e,!0);const n=ve.tMaybe;function r(N){return Array.isArray(N)?N.map(String).filter(Boolean):typeof N=="string"&&N?N.split(",").map(z=>z.trim()).filter(Boolean):[]}const i=A(()=>r(e.value));let s=ge(""),o=ge(null),a=ge(!1),l=ge(-1),c=ge(-1);const u=A(()=>e.field.options?.map(N=>N.value)??[]),h=A(()=>new Map((e.field.options??[]).map(N=>[N.value,N.label]))),d=N=>n(f(h).get(N)??N),m=A(()=>{if(!f(a))return[];const N=f(u).filter(z=>!f(i).includes(z));if(f(s).length>0){const z=f(s).toLowerCase();return N.filter(he=>he.toLowerCase().includes(z)||d(he).toLowerCase().includes(z))}return N});function g(N){e.field.validate?.type==="commalist"?e.onchange(N.join(",")):e.onchange(N)}function p(N){const z=N.trim();!z||f(i).includes(z)||(g([...f(i),z]),k(s,""),k(l,-1),k(c,-1),k(a,f(u).length>0))}function O(N){g(f(i).filter((z,he)=>he!==N)),k(c,-1),f(o)?.focus()}function v(N){if(f(c)>=0){if(N.key==="Backspace"||N.key==="Delete"){N.preventDefault();const z=f(c),he=z>0?z-1:f(i).length>1?0:-1;O(z),k(c,he,!0);return}if(N.key==="ArrowLeft"){N.preventDefault(),k(c,Math.max(0,f(c)-1),!0);return}if(N.key==="ArrowRight"){N.preventDefault(),f(c)=0&&f(l)0&&f(s):N.key==="Backspace"?!f(s)&&f(i).length>0&&(N.preventDefault(),k(c,f(i).length-1)):N.key==="ArrowLeft"?!f(s)&&f(i).length>0&&(N.preventDefault(),k(c,f(i).length-1)):N.key==="Escape"?(k(a,!1),k(l,-1)):N.key==="ArrowDown"?(N.preventDefault(),f(m).length>0&&(k(l,Math.min(f(l)+1,f(m).length-1),!0),k(a,!0))):N.key==="ArrowUp"&&(N.preventDefault(),k(l,Math.max(f(l)-1,-1),!0))}function w(N){k(s,N.target.value,!0),k(a,!0),k(l,-1),k(c,-1)}function _(){k(a,!0),k(c,-1)}function C(){setTimeout(()=>{f(s).trim()&&p(f(s)),k(a,!1),k(l,-1),k(c,-1)},150)}function T(N){p(N),f(o)?.focus()}function S(){k(c,-1),f(o)?.focus()}var Q=DB(),D=x(Q);{var I=N=>{var z=QB(),he=x(z);{var te=q=>{var re=_B(),oe=x(re,!0);b(re),B(Se=>$(oe,Se),[()=>n(e.field.label)]),y(q,re)};Z(he,q=>{e.field.label&&q(te)})}var V=M(he,2);{var J=q=>{var re=PB();lt(re,()=>n(e.field.help),!0),b(re),y(q,re)};Z(V,q=>{e.field.help&&q(J)})}b(z),y(N,z)};Z(D,N=>{(e.field.label||e.field.help)&&N(I)})}var X=M(D,2),L=x(X),R=x(L);Ue(R,19,()=>f(i),(N,z)=>N+z,(N,z,he)=>{var te=CB(),V=x(te),J=M(V);Ve(J,"tabindex",-1);var q=x(J);ji(q,{size:12}),b(J),b(te),B(re=>{Je(te,1,`inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-xs font-medium transition-colors ${f(c)===f(he)?"bg-primary text-primary-foreground ring-1 ring-primary":"bg-primary/15 text-primary"}`),$(V,`${re??""} `),Je(J,1,`inline-flex items-center rounded-sm transition-colors ${f(c)===f(he)?"text-primary-foreground/70 hover:text-primary-foreground":"text-primary/60 hover:text-primary"}`)},[()=>d(f(z))]),Ce("click",J,re=>{re.stopPropagation(),O(f(he))}),y(N,te)});var F=M(R,2);En(F),gn(F,N=>k(o,N),()=>f(o)),b(L);var U=M(L,2);{var j=N=>{var z=AB(),he=x(z);Ue(he,22,()=>f(m),te=>te,(te,V,J)=>{var q=TB(),re=x(q,!0);b(q),B(oe=>{Je(q,1,`flex w-full rounded-md px-3 py-1.5 text-start text-sm transition-colors ${f(J)===f(l)?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent"}`),$(re,oe)},[()=>d(V)]),Ce("mousedown",q,oe=>{oe.preventDefault(),T(V)}),y(te,q)}),b(he),b(z),y(N,z)};Z(U,N=>{f(a)&&f(m).length>0&&N(j)})}b(X);var Y=M(X,2);{var ie=N=>{var z=EB(),he=x(z,!0);b(z),B(()=>$(he,e.error)),y(N,z)};Z(Y,N=>{e.error&&N(ie)})}b(Q),B(N=>{Je(L,1,`flex min-h-[40px] flex-wrap items-center gap-1.5 rounded-lg border bg-muted/50 px-2.5 py-1.5 shadow-sm transition-colors focus-within:ring-1 focus-within:ring-ring ${e.error?"border-destructive ring-1 ring-destructive":"border-input"}`),Jn(F,f(s)),Ve(F,"placeholder",N),F.disabled=e.field.disabled},[()=>f(i).length===0?n(e.field.placeholder)||"Type and press Enter...":""]),Ce("click",L,S),Ce("input",F,w),Ce("keydown",F,v),en("focus",F,_),en("blur",F,C),y(t,Q),Re()}It(["click","input","keydown","mousedown"]);var MB=P(''),RB=P('

'),LB=P("
"),IB=P(''),XB=P(''),ZB=P(' '),NB=P(''),VB=P(''),FB=P('
'),jB=P("
"),BB=P('
'),zB=P('
'),WB=P(' ',1),YB=P('
');function UB(t,e){Me(e,!0);let n=ee(e,"filter",3,"");const r=ve.tMaybe,i=A(()=>e.field.fields??[]),s=A(()=>f(i).length>1&&e.field.collapsible!==!1),o=A(()=>e.field.sort!==!1),a=A(()=>e.field.btnLabel?r(e.field.btnLabel):"Add item"),l=A(()=>(e.field.classes??"").includes("compact")),c=A(()=>f(i).find(G=>G.type==="key")),u=A(()=>f(i).filter(G=>G.type!=="key"));let h=0;function d(G){return G==null?[]:Array.isArray(G)?G.map(K=>({id:h++,key:"",data:typeof K=="object"&&K!==null&&!Array.isArray(K)?K:{value:K},collapsed:!!e.field.collapsed})):typeof G=="object"?Object.entries(G).map(([K,H])=>({id:h++,key:K,data:typeof H=="object"&&H!==null&&!Array.isArray(H)?H:{value:H},collapsed:!!e.field.collapsed})):[]}let m=ge(Pt(d(e.value))),g=ge(Pt(JSON.stringify(e.value)));We(()=>{const G=JSON.stringify(e.value);G!==f(g)&&(k(g,G,!0),k(m,d(e.value),!0))});function p(){let G;if(f(c)){const K={};for(const H of f(m)){const ue=H.key||String(H.id);K[ue]=f(u).length===1?O(H,f(u)[0]):H.data}G=K}else G=f(m).map(K=>f(u).length===1?O(K,f(u)[0]):{...K.data});k(g,JSON.stringify(G),!0),e.onchange(G)}function O(G,K){const H=K.name.split(".").pop()??K.name;return G.data[H]}function v(G,K,H){const ue=K.name.split(".").pop()??K.name;G.data={...G.data,[ue]:H}}function w(){const G={id:h++,key:"",data:{},collapsed:!1};k(m,[...f(m),G],!0),p()}function _(G){k(m,f(m).filter(K=>K.id!==G),!0),p()}function C(G){k(m,f(m).map(K=>K.id===G?{...K,collapsed:!K.collapsed}:K),!0)}function T(){k(m,f(m).map(G=>({...G,collapsed:!1})),!0)}function S(){k(m,f(m).map(G=>({...G,collapsed:!0})),!0)}function Q(G,K){k(m,f(m).map(H=>H.id===G.id?{...H,key:K}:H),!0),p()}function D(G,K,H){k(m,f(m).map(ue=>{if(ue.id!==G.id)return ue;const ye={...ue};return v(ye,K,H),ye}),!0),p()}let I=ge(null),X=ge(null);function L(G){k(I,G,!0)}function R(G,K){G.preventDefault(),k(X,K,!0)}function F(G){if(f(I)!==null&&f(I)!==G){const K=[...f(m)],[H]=K.splice(f(I),1);K.splice(G,0,H),k(m,K,!0),p()}k(I,null),k(X,null)}function U(){k(I,null),k(X,null)}function j(G){if(f(c)&&G.key)return G.key;const K=Object.values(G.data).filter(H=>typeof H=="string"&&H);return K.length>0?String(K[0]):"Item"}const Y=A(()=>n().trim().toLowerCase()),ie=A(()=>f(Y).length>0);function N(G,K){if(!K||G.key&&G.key.toLowerCase().includes(K))return!0;for(const H of Object.values(G.data))if(H!=null&&(typeof H=="string"||typeof H=="number"||typeof H=="boolean")&&String(H).toLowerCase().includes(K))return!0;return!1}const z=A(()=>f(ie)?f(m).filter(G=>N(G,f(Y))):f(m));var he=YB(),te=x(he);{var V=G=>{var K=LB(),H=x(K);{var ue=W=>{var ce=MB(),we=x(ce,!0);b(ce),B(xe=>$(we,xe),[()=>r(e.field.label)]),y(W,ce)};Z(H,W=>{e.field.label&&W(ue)})}var ye=M(H,2);{var De=W=>{var ce=RB();lt(ce,()=>r(e.field.help),!0),b(ce),y(W,ce)};Z(ye,W=>{e.field.help&&W(De)})}b(K),y(G,K)};Z(te,G=>{(e.field.label||e.field.help)&&G(V)})}var J=M(te,2);{var q=G=>{var K=zB();Ue(K,23,()=>f(z),H=>H.id,(H,ue,ye)=>{const De=A(()=>!f(ue).collapsed||f(ie));var W=BB(),ce=x(W),we=x(ce);{var xe=tt=>{var ct=IB(),Ot=x(ct);Fp(Ot,{size:14}),b(ct),y(tt,ct)};Z(we,tt=>{f(o)&&tt(xe)})}var fe=M(we,2);{var Te=tt=>{var ct=XB(),Ot=x(ct);{var Zn=kt=>{Dl(kt,{name:"chevron-forward",size:14})},Vt=kt=>{da(kt,{size:14})};Z(Ot,kt=>{f(ue).collapsed?kt(Zn):kt(Vt,-1)})}b(ct),Ce("click",ct,()=>C(f(ue).id)),y(tt,ct)};Z(fe,tt=>{f(s)&&tt(Te)})}var Qe=M(fe,2);{var Be=tt=>{var ct=ZB(),Ot=x(ct,!0);b(ct),B(Zn=>$(Ot,Zn),[()=>j(f(ue))]),y(tt,ct)},$e=tt=>{var ct=NB();y(tt,ct)};Z(Qe,tt=>{f(De)?tt($e,-1):tt(Be)})}var Ne=M(Qe,2),Ge=x(Ne);RA(Ge,{size:14}),b(Ne),b(ce);var wt=M(ce,2);{var qt=tt=>{var ct=jB(),Ot=x(ct);{var Zn=kt=>{var Xt=FB(),ei=x(Xt);{var ti=Qn=>{var qs=VB(),Ga=x(qs,!0);b(qs),B(Ha=>$(Ga,Ha),[()=>r(f(c).label)]),y(Qn,qs)};Z(ei,Qn=>{f(c).label&&Qn(ti)})}var nr=M(ei,2);En(nr),b(Xt),B(Qn=>{Je(Xt,1,`space-y-2 ${f(l)?"col-span-2":""}`),Jn(nr,f(ue).key),Ve(nr,"placeholder",Qn)},[()=>f(c).placeholder?r(f(c).placeholder):""]),Ce("input",nr,Qn=>Q(f(ue),Qn.target.value)),y(kt,Xt)};Z(Ot,kt=>{f(c)&&kt(Zn)})}var Vt=M(Ot,2);Ue(Vt,17,()=>f(u),kt=>kt.name,(kt,Xt)=>{{let ei=A(()=>O(f(ue),f(Xt))),ti=A(()=>e.onFieldCommit?(nr,Qn)=>e.onFieldCommit(f(Xt).name,nr,Qn):void 0);Cr(kt,{get field(){return f(Xt)},get value(){return f(ei)},onchange:nr=>D(f(ue),f(Xt),nr),get oncommit(){return f(ti)},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit}})}}),b(ct),B(()=>Je(ct,1,`${f(l)?"grid grid-cols-2 gap-x-4 gap-y-3":"space-y-4"} border-t border-border px-4 py-3`)),y(tt,ct)};Z(wt,tt=>{f(De)&&tt(qt)})}b(W),B(tt=>{Je(W,1,`rounded-lg border border-border bg-card transition-colors ${f(X)===f(ye)&&f(I)!==f(ye)?"border-primary":""}`),Ve(W,"draggable",f(o)&&!f(ie)),Ve(Ne,"title",tt)},[()=>ve.t("ADMIN_NEXT.REMOVE")]),en("dragstart",W,()=>L(f(ye))),en("dragover",W,tt=>R(tt,f(ye))),en("drop",W,()=>F(f(ye))),en("dragend",W,U),Ce("click",Ne,()=>_(f(ue).id)),y(H,W)}),b(K),y(G,K)};Z(J,G=>{f(z).length>0&&G(q)})}var re=M(J,2),oe=x(re);{var Se=G=>{var K=WB(),H=me(K),ue=x(H);da(ue,{size:12});var ye=M(ue);b(H);var De=M(H,2),W=x(De);Dl(W,{name:"chevron-forward",size:12});var ce=M(W);b(De),B((we,xe)=>{$(ye,` ${we??""}`),$(ce,` ${xe??""}`)},[()=>ve.t("ADMIN_NEXT.EXPAND_ALL"),()=>ve.t("ADMIN_NEXT.COLLAPSE_ALL")]),Ce("click",H,T),Ce("click",De,S),y(G,K)};Z(oe,G=>{f(s)&&f(m).length>1&&G(Se)})}var se=M(oe,2),pe=x(se);uS(pe,{size:14});var ae=M(pe);b(se),b(re),b(he),B(()=>$(ae,` ${f(a)??""}`)),Ce("click",se,w),y(t,he),Re()}It(["click","input"]);var qB=P(''),$B=P('

'),GB=P("
"),HB=P(''),KB=P(""),JB=P(' ',1),e8=P(""),t8=P(""),n8=P('At : ',1),r8=P(""),i8=P(""),s8=P(""),o8=P('On at : ',1),a8=P(""),l8=P(""),c8=P(""),u8=P(' at : ',1),h8=P('
'),d8=P('
');function ax(t,e){Me(e,!0);const n=ve.tMaybe,r=globalThis.__cronFieldOpenPanels??={};let i=ge(Pt(typeof e.value=="string"&&e.value?e.value:e.field.default??"* * * * *"));We(()=>{const N=typeof e.value=="string"&&e.value?e.value:e.field.default??"* * * * *";N!==f(i)&&k(i,N,!0)});const s=A(()=>f(i));function o(N){const z=N.trim().split(/\s+/);return[z[0]??"*",z[1]??"*",z[2]??"*",z[3]??"*",z[4]??"*"]}const a=A(()=>o(f(s)));let l=ge(Pt(r[e.field.name]??!1));function c(){k(l,!f(l)),r[e.field.name]=f(l)}function u(N){const[z,he,te,V,J]=N;return z==="*"&&he==="*"&&te==="*"&&V==="*"&&J==="*"?"every_minute":z!=="*"&&he==="*"&&te==="*"&&V==="*"&&J==="*"?"hourly":z!=="*"&&he!=="*"&&te==="*"&&V==="*"&&J==="*"?"daily":z!=="*"&&he!=="*"&&te==="*"&&V==="*"&&J!=="*"?"weekly":z!=="*"&&he!=="*"&&te!=="*"&&V==="*"&&J==="*"?"monthly":"custom"}const h=A(()=>u(f(a)));function d(N){const[z,he,te,V,J]=N,q=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],re=u(N),oe=z.padStart(2,"0"),Se=he.padStart(2,"0");switch(re){case"every_minute":return"Every minute";case"hourly":return`Every hour at :${oe}`;case"daily":return`Every day at ${Se}:${oe}`;case"weekly":return`Every ${q[parseInt(J)]??J} at ${Se}:${oe}`;case"monthly":return`Monthly on day ${te} at ${Se}:${oe}`;default:return`${z} ${he} ${te} ${V} ${J}`}}const m=A(()=>d(f(a)));function g(N){let z;switch(N){case"every_minute":z="* * * * *";break;case"hourly":z="0 * * * *";break;case"daily":z=`0 ${f(a)[1]!=="*"?f(a)[1]:"0"} * * *`;break;case"weekly":z=`0 ${f(a)[1]!=="*"?f(a)[1]:"0"} * * 1`;break;case"monthly":z=`0 ${f(a)[1]!=="*"?f(a)[1]:"0"} 1 * *`;break;default:return}k(i,z,!0),e.onchange(z)}function p(N,z){const he=[...f(a)];he[N]=z||"*";const te=he.join(" ");k(i,te,!0),e.onchange(te)}const O=[{value:"every_minute",label:"Every minute"},{value:"hourly",label:"Hourly"},{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"custom",label:"Custom"}],v=Array.from({length:24},(N,z)=>({value:String(z),label:String(z).padStart(2,"0")})),w=Array.from({length:60},(N,z)=>({value:String(z),label:String(z).padStart(2,"0")})),_=[{value:"0",label:"Sunday"},{value:"1",label:"Monday"},{value:"2",label:"Tuesday"},{value:"3",label:"Wednesday"},{value:"4",label:"Thursday"},{value:"5",label:"Friday"},{value:"6",label:"Saturday"}],C=Array.from({length:31},(N,z)=>({value:String(z+1),label:String(z+1)}));var T=d8(),S=x(T);{var Q=N=>{var z=GB(),he=x(z);{var te=q=>{var re=qB(),oe=x(re,!0);b(re),B(Se=>$(oe,Se),[()=>n(e.field.label)]),y(q,re)};Z(he,q=>{e.field.label&&q(te)})}var V=M(he,2);{var J=q=>{var re=$B();lt(re,()=>n(e.field.help),!0),b(re),y(q,re)};Z(V,q=>{e.field.help&&q(J)})}b(z),y(N,z)};Z(S,N=>{(e.field.label||e.field.help)&&N(Q)})}var D=M(S,2),I=x(D),X=x(I);LA(X,{size:14,class:"shrink-0 text-muted-foreground"});var L=M(X,2),R=x(L,!0);b(L);var F=M(L,2),U=x(F,!0);b(F);var j=M(F,2);{let N=A(()=>f(l)?"rotate-180":"");da(j,{size:14,get class(){return`shrink-0 text-muted-foreground transition-transform ${f(N)??""}`}})}b(I);var Y=M(I,2);{var ie=N=>{var z=h8(),he=x(z);Ue(he,21,()=>O,H=>H.value,(H,ue)=>{var ye=HB(),De=x(ye,!0);b(ye),B(()=>{Je(ye,1,`rounded-md px-2.5 py-1 text-xs font-medium transition-colors ${f(h)===f(ue).value?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`),$(De,f(ue).label)}),Ce("click",ye,()=>{f(ue).value!=="custom"&&g(f(ue).value)}),y(H,ye)}),b(he);var te=M(he,2),V=x(te);{var J=H=>{var ue=JB(),ye=me(ue),De=x(ye,!0);b(ye);var W=M(ye,2);Ue(W,21,()=>w,dn,(we,xe)=>{var fe=KB(),Te=x(fe,!0);b(fe);var Qe={};B(()=>{$(Te,f(xe).label),Qe!==(Qe=f(xe).value)&&(fe.value=(fe.__value=f(xe).value)??"")}),y(we,fe)}),b(W);var ce;lr(W),B(we=>{$(De,we),ce!==(ce=f(a)[0])&&(W.value=(W.__value=f(a)[0])??"",cr(W,f(a)[0]))},[()=>ve.t("ADMIN_NEXT.FIELDS.CRON.AT_MINUTE")]),Ce("change",W,we=>p(0,we.target.value)),y(H,ue)},q=H=>{var ue=n8(),ye=M(me(ue),2);Ue(ye,21,()=>v,dn,(we,xe)=>{var fe=e8(),Te=x(fe,!0);b(fe);var Qe={};B(()=>{$(Te,f(xe).label),Qe!==(Qe=f(xe).value)&&(fe.value=(fe.__value=f(xe).value)??"")}),y(we,fe)}),b(ye);var De;lr(ye);var W=M(ye,4);Ue(W,21,()=>w,dn,(we,xe)=>{var fe=t8(),Te=x(fe,!0);b(fe);var Qe={};B(()=>{$(Te,f(xe).label),Qe!==(Qe=f(xe).value)&&(fe.value=(fe.__value=f(xe).value)??"")}),y(we,fe)}),b(W);var ce;lr(W),B(()=>{De!==(De=f(a)[1])&&(ye.value=(ye.__value=f(a)[1])??"",cr(ye,f(a)[1])),ce!==(ce=f(a)[0])&&(W.value=(W.__value=f(a)[0])??"",cr(W,f(a)[0]))}),Ce("change",ye,we=>p(1,we.target.value)),Ce("change",W,we=>p(0,we.target.value)),y(H,ue)},re=H=>{var ue=o8(),ye=M(me(ue),2);Ue(ye,21,()=>_,dn,(fe,Te)=>{var Qe=r8(),Be=x(Qe,!0);b(Qe);var $e={};B(()=>{$(Be,f(Te).label),$e!==($e=f(Te).value)&&(Qe.value=(Qe.__value=f(Te).value)??"")}),y(fe,Qe)}),b(ye);var De;lr(ye);var W=M(ye,4);Ue(W,21,()=>v,dn,(fe,Te)=>{var Qe=i8(),Be=x(Qe,!0);b(Qe);var $e={};B(()=>{$(Be,f(Te).label),$e!==($e=f(Te).value)&&(Qe.value=(Qe.__value=f(Te).value)??"")}),y(fe,Qe)}),b(W);var ce;lr(W);var we=M(W,4);Ue(we,21,()=>w,dn,(fe,Te)=>{var Qe=s8(),Be=x(Qe,!0);b(Qe);var $e={};B(()=>{$(Be,f(Te).label),$e!==($e=f(Te).value)&&(Qe.value=(Qe.__value=f(Te).value)??"")}),y(fe,Qe)}),b(we);var xe;lr(we),B(()=>{De!==(De=f(a)[4])&&(ye.value=(ye.__value=f(a)[4])??"",cr(ye,f(a)[4])),ce!==(ce=f(a)[1])&&(W.value=(W.__value=f(a)[1])??"",cr(W,f(a)[1])),xe!==(xe=f(a)[0])&&(we.value=(we.__value=f(a)[0])??"",cr(we,f(a)[0]))}),Ce("change",ye,fe=>p(4,fe.target.value)),Ce("change",W,fe=>p(1,fe.target.value)),Ce("change",we,fe=>p(0,fe.target.value)),y(H,ue)},oe=H=>{var ue=u8(),ye=me(ue),De=x(ye,!0);b(ye);var W=M(ye,2);Ue(W,21,()=>C,dn,(Qe,Be)=>{var $e=a8(),Ne=x($e,!0);b($e);var Ge={};B(()=>{$(Ne,f(Be).label),Ge!==(Ge=f(Be).value)&&($e.value=($e.__value=f(Be).value)??"")}),y(Qe,$e)}),b(W);var ce;lr(W);var we=M(W,4);Ue(we,21,()=>v,dn,(Qe,Be)=>{var $e=l8(),Ne=x($e,!0);b($e);var Ge={};B(()=>{$(Ne,f(Be).label),Ge!==(Ge=f(Be).value)&&($e.value=($e.__value=f(Be).value)??"")}),y(Qe,$e)}),b(we);var xe;lr(we);var fe=M(we,4);Ue(fe,21,()=>w,dn,(Qe,Be)=>{var $e=c8(),Ne=x($e,!0);b($e);var Ge={};B(()=>{$(Ne,f(Be).label),Ge!==(Ge=f(Be).value)&&($e.value=($e.__value=f(Be).value)??"")}),y(Qe,$e)}),b(fe);var Te;lr(fe),B(Qe=>{$(De,Qe),ce!==(ce=f(a)[2])&&(W.value=(W.__value=f(a)[2])??"",cr(W,f(a)[2])),xe!==(xe=f(a)[1])&&(we.value=(we.__value=f(a)[1])??"",cr(we,f(a)[1])),Te!==(Te=f(a)[0])&&(fe.value=(fe.__value=f(a)[0])??"",cr(fe,f(a)[0]))},[()=>ve.t("ADMIN_NEXT.FIELDS.CRON.ON_DAY")]),Ce("change",W,Qe=>p(2,Qe.target.value)),Ce("change",we,Qe=>p(1,Qe.target.value)),Ce("change",fe,Qe=>p(0,Qe.target.value)),y(H,ue)};Z(V,H=>{f(h)==="hourly"?H(J):f(h)==="daily"?H(q,1):f(h)==="weekly"?H(re,2):f(h)==="monthly"&&H(oe,3)})}b(te);var Se=M(te,2),se=x(Se),pe=x(se,!0);b(se);var ae=M(se,2);En(ae);var G=M(ae,2),K=x(G,!0);b(G),b(Se),b(z),B((H,ue)=>{$(pe,H),Jn(ae,f(s)),$(K,ue)},[()=>ve.t("ADMIN_NEXT.FIELDS.CRON.CRON"),()=>ve.t("ADMIN_NEXT.FIELDS.CRON.MIN_HR_DOM_MON_DOW")]),Ce("input",ae,H=>e.onchange(H.target.value)),y(N,z)};Z(Y,N=>{f(l)&&N(ie)})}b(D),b(T),B(()=>{$(R,f(m)),$(U,f(s))}),Ce("click",I,c),y(t,T),Re()}It(["click","change","input"]);var f8=P(''),m8=P('

'),g8=P("
"),p8=P('
'),O8=P('
');function v8(t,e){Me(e,!0);const n=ve.tMaybe;let r,i,s=ge(!1),o=ge("");function a(){k(s,document.documentElement.classList.contains("dark"),!0)}const l=Ae.theme({"&":{fontSize:"13px",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'},".cm-content":{caretColor:"hsl(221 83% 53%)",padding:"8px 0",lineHeight:"1.5"},".cm-cursor":{borderLeftColor:"hsl(221 83% 53%)",borderLeftWidth:"2px"},".cm-scroller":{overflow:"auto"},".cm-gutters":{backgroundColor:"transparent",borderRight:"none",color:"hsl(240 3.8% 46.1%)",paddingRight:"4px"},".cm-activeLine":{backgroundColor:"hsl(240 4.8% 95.9% / 0.5)"},".cm-selectionBackground":{backgroundColor:"hsl(221 83% 53% / 0.15) !important"},".cm-line":{padding:"0 12px"}}),c=Ae.theme({"&":{fontSize:"13px",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'},".cm-content":{caretColor:"hsl(217 91% 60%)",padding:"8px 0",lineHeight:"1.5"},".cm-cursor":{borderLeftColor:"hsl(217 91% 60%)",borderLeftWidth:"2px"},".cm-scroller":{overflow:"auto"},".cm-gutters":{backgroundColor:"transparent",borderRight:"none",color:"hsl(240 5% 64.9%)",paddingRight:"4px"},".cm-activeLine":{backgroundColor:"hsl(240 3.7% 15.9% / 0.5)"},".cm-selectionBackground":{backgroundColor:"hsl(217 91% 60% / 0.2) !important"},".cm-line":{padding:"0 12px"}});function u(S){return S==null||typeof S=="object"&&Object.keys(S).length===0?"":Gg.dump(S,{indent:2,lineWidth:-1,noRefs:!0}).trimEnd()}function h(S){return S.trim()?Gg.load(S)??{}:{}}function d(){return[xd(),Sd(),vd(),Ac(yd,{fallback:!0}),Io.of([...Cd,...kd,Td]),f(s)?Ad:l,f(s)?c:l,iO(e.field.placeholder_key?`${n(e.field.placeholder_key)}: ${n(e.field.placeholder_value)}`:"key: value"),Ae.updateListener.of(S=>{if(S.docChanged){g=!0;const Q=S.state.doc.toString();try{const D=h(Q);k(o,""),e.onchange(D)}catch{k(o,"Invalid YAML")}}}),Ae.lineWrapping,ot.tabSize.of(2)]}function m(){i&&i.destroy();const S=ot.create({doc:u(e.value),extensions:d()});i=new Ae({state:S,parent:r})}tr(()=>{a(),m();const S=new MutationObserver(()=>{const Q=f(s);a(),Q!==f(s)&&m()});return S.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{S.disconnect(),i?.destroy()}});let g=!1,p=ge(Pt(JSON.stringify(e.value)));We(()=>{const S=JSON.stringify(e.value);if(S!==f(p)&&i)if(k(p,S,!0),g)g=!1;else{const Q=u(e.value);Q!==i.state.doc.toString()&&i.dispatch({changes:{from:0,to:i.state.doc.length,insert:Q}})}});var O=O8(),v=x(O);{var w=S=>{var Q=g8(),D=x(Q);{var I=R=>{var F=f8(),U=x(F,!0);b(F),B(j=>$(U,j),[()=>n(e.field.label)]),y(R,F)};Z(D,R=>{e.field.label&&R(I)})}var X=M(D,2);{var L=R=>{var F=m8();lt(F,()=>n(e.field.help),!0),b(F),y(R,F)};Z(X,R=>{e.field.help&&R(L)})}b(Q),y(S,Q)};Z(v,S=>{(e.field.label||e.field.help)&&S(w)})}var _=M(v,2);gn(_,S=>r=S,()=>r);var C=M(_,2);{var T=S=>{var Q=p8(),D=x(Q);aS(D,{size:12});var I=M(D);b(Q),B(()=>$(I,` ${f(o)??""}`)),y(S,Q)};Z(C,S=>{f(o)&&S(T)})}b(O),B(()=>Je(_,1,`overflow-hidden rounded-lg border border-input bg-muted/50 shadow-sm focus-within:ring-1 focus-within:ring-ring ${f(o)?"border-red-500/50":""}`)),y(t,O),Re()}var b8=P(' '),y8=P('
'),x8=P('
'),S8=P('
'),w8=P('
'),k8=P(''),_8=P('
'),P8=P('
'),Q8=P('
'),C8=P('

');function lx(t,e){Me(e,!0);let n=ee(e,"route",3,"/");const r=A(()=>e.apiBase!==void 0);let i=ge(Pt([]));We(()=>{e.externalItems&&e.externalItems.length>0&&k(i,e.externalItems,!0)});let s=ge(!0),o=ge(!1),a=ge(Pt(new Map)),l=ge(!1),c=ge(0),u=ge(null),h,d,m;const g=A(()=>f(r)?e.apiBase??null:n()===""||n()==="/"?null:`pages/${n().startsWith("/")?n().slice(1):n()}`),p=A(()=>f(g)!==null);function O(){return f(g)?`${_t.serverUrl}${_t.apiPrefix}/${f(g)}/media`:`${_t.serverUrl}${_t.apiPrefix}/pages/__unresolved__/media`}function v(){const W={};return _t.accessToken&&(W["X-API-Token"]=_t.accessToken),W["X-Grav-Environment"]=_t.gravEnvironment,W}function w(){h=new hS({id:"page-media",autoProceed:!0,restrictions:{maxFileSize:64*1024*1024}}),h.use(dS,{endpoint:O(),fieldName:"file",headers:v}),h.use(IA,{quality:.8,actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0}}),h.addPreProcessor(async()=>{await Ns.ensureAuth()}),h.on("upload-start",()=>{k(o,!0)}),h.on("upload-progress",(W,ce)=>{if(W){const we=ce.bytesTotal??0,xe=we>0?Math.round(ce.bytesUploaded/we*100):0;k(a,new Map(f(a).set(W.id,xe)),!0)}}),h.on("upload-success",W=>{W&&(f(a).delete(W.id),k(a,new Map(f(a)),!0))}),h.on("upload-error",(W,ce)=>{xi.error(`Failed to upload ${W?.name??"file"}: ${ce.message}`)}),h.on("complete",()=>{k(o,!1),k(a,new Map,!0),Um.emit(_()),C(),h?.cancelAll()}),h.on("file-editor:complete",()=>{k(u,null)}),h.on("file-editor:cancel",()=>{k(u,null)})}function _(){return f(r)?e.invalidationKeys??[]:[`media:update:pages/${n()}`,`pages:update:/${n()}`]}async function C(){if(f(g))try{k(i,f(r)?await XA(f(g)):await ZA(n()),!0),e.onMediaChange?.(f(i))}catch(W){console.error("[PageMedia] Failed to load media:",W)}finally{k(s,!1)}}We(()=>{if(f(p)){C();const W=h?.getPlugin("XHRUpload");W&&typeof W.setOptions=="function"&&W.setOptions({endpoint:O()})}});async function T(W){try{if(f(r)){if(!f(g))return;await NA(f(g),W.filename)}else await VA(n(),W.filename);k(i,f(i).filter(ce=>ce.filename!==W.filename),!0),e.onMediaChange?.(f(i)),xi.success(ve.t("ADMIN_NEXT.TOASTS.FILE_DELETED",{name:W.filename}))}catch{xi.error(ve.t("ADMIN_NEXT.TOASTS.FILE_DELETE_FAILED",{name:W.filename}))}}function S(W){W.preventDefault(),ta(c),W.dataTransfer?.types.includes("Files")&&k(l,!0)}function Q(){ta(c,-1),f(c)<=0&&(k(c,0),k(l,!1))}function D(W){W.preventDefault(),W.dataTransfer&&(W.dataTransfer.dropEffect="copy")}function I(W){W.preventDefault(),k(l,!1),k(c,0);const ce=W.dataTransfer?.files;!ce||ce.length===0||L(Array.from(ce))}function X(W){const ce=W.target;!ce.files||ce.files.length===0||(L(Array.from(ce.files)),ce.value="")}function L(W){if(h)for(const ce of W)try{h.addFile({name:ce.name,type:ce.type,data:ce,source:"local"})}catch(we){console.warn("Could not add file:",we)}}function R(W,ce){if(!W.dataTransfer)return;const xe=ce.type.startsWith("image/")?`![${ce.filename}](${ce.filename})`:`[${ce.filename}](${ce.filename})`;W.dataTransfer.setData("text/plain",xe),W.dataTransfer.setData("application/x-grav-media",JSON.stringify(ce)),W.dataTransfer.effectAllowed="copy"}function F(W){const ce=jp(W);return ce.startsWith("http")||ce.startsWith("/")?ce:`${_t.serverUrl}/${ce}`}function U(W){return W.startsWith("http")?W:`${_t.serverUrl}${W}`}function j(W){return W.thumbnail_url?U(W.thumbnail_url):F(W.url)}function Y(W){return W.type.startsWith("image/")}function ie(W){return W<1024?`${W}B`:W<1024*1024?`${(W/1024).toFixed(0)}KB`:`${(W/(1024*1024)).toFixed(1)}MB`}tr(()=>(w(),C(),()=>{h?.cancelAll()}));var N=C8(),z=x(N),he=x(z),te=x(he),V=M(te);{var J=W=>{var ce=b8(),we=x(ce);b(ce),B(()=>$(we,`(${f(i).length??""})`)),y(W,ce)};Z(V,W=>{f(i).length>0&&W(J)})}b(he);var q=M(he,2),re=x(q);OA(re,{size:13}),na(),b(q);var oe=M(q,2);gn(oe,W=>m=W,()=>m),b(z);var Se=M(z,2),se=x(Se);{var pe=W=>{var ce=x8();Ue(ce,21,()=>[...f(a)],dn,(we,xe)=>{var fe=A(()=>nS(f(xe),2));let Te=()=>f(fe)[0],Qe=()=>f(fe)[1];var Be=y8(),$e=x(Be),Ne=x($e),Ge=x(Ne,!0);b(Ne);var wt=M(Ne,2),qt=x(wt);b(wt),b($e);var tt=M($e,2),ct=x(tt);let Ot;b(tt),b(Be),B(Zn=>{$(Ge,Zn),$(qt,`${Qe()??""}%`),Ot=yi(ct,"",Ot,{width:`${Qe()??""}%`})},[()=>h?.getFile(Te())?.name??"Uploading..."]),y(we,Be)}),b(ce),y(W,ce)};Z(se,W=>{f(o)&&f(a).size>0&&W(pe)})}var ae=M(se,2);{var G=W=>{var ce=w8();Ue(ce,20,()=>[1,2,3],dn,(we,xe)=>{var fe=S8();y(we,fe)}),b(ce),y(W,ce)},K=W=>{var ce=Q8();Ue(ce,21,()=>f(i),we=>we.filename,(we,xe)=>{var fe=P8(),Te=x(fe);{var Qe=Vt=>{var kt=k8();B(Xt=>{Ve(kt,"src",Xt),Ve(kt,"alt",f(xe).filename)},[()=>j(f(xe))]),y(Vt,kt)},Be=A(()=>Y(f(xe))),$e=Vt=>{var kt=_8(),Xt=x(kt),ei=x(Xt,!0);b(Xt);var ti=M(Xt,2),nr=x(ti,!0);b(ti),b(kt),B(Qn=>{$(ei,Qn),$(nr,f(xe).filename)},[()=>f(xe).filename.split(".").pop()?.toUpperCase()]),y(Vt,kt)};Z(Te,Vt=>{f(Be)?Vt(Qe):Vt($e,-1)})}var Ne=M(Te,2),Ge=x(Ne),wt=x(Ge),qt=x(wt,!0);b(wt);var tt=M(wt,2),ct=x(tt);ji(ct,{size:12}),b(tt),b(Ge),b(Ne);var Ot=M(Ne,2),Zn=x(Ot);Fp(Zn,{size:10,class:"text-white/80"}),b(Ot),b(fe),B((Vt,kt,Xt)=>{Ve(fe,"title",`${f(xe).filename??""} (${Vt??""}) — ${kt??""}`),$(qt,f(xe).filename),Ve(tt,"title",Xt)},[()=>ie(f(xe).size),()=>ve.t("ADMIN_NEXT.MEDIA.PAGE_MEDIA.DRAG_INTO_EDITOR"),()=>ve.t("ADMIN_NEXT.DELETE")]),en("dragstart",fe,Vt=>R(Vt,f(xe))),Ce("click",tt,Vt=>{Vt.stopPropagation(),T(f(xe))}),y(we,fe)}),b(ce),y(W,ce)};Z(ae,W=>{f(s)?W(G):f(i).length>0&&W(K,1)})}var H=M(ae,2),ue=x(H);fS(ue,{size:14,class:"text-muted-foreground/60"});var ye=M(ue,2),De=x(ye,!0);b(ye),b(H),b(Se),gn(Se,W=>d=W,()=>d),b(N),B(W=>{$(te,`${W??""} `),Je(Se,1,`rounded-lg border-2 border-dashed transition-colors ${f(l)?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/40"}`),$(De,f(l)?"Drop files here":f(i).length>0?"Drop or click to add more":"Drop files or click to upload")},[()=>ve.t("ADMIN_NEXT.MEDIA.PAGE_MEDIA.PAGE_MEDIA")]),Ce("click",q,()=>m?.click()),Ce("change",oe,X),en("dragenter",Se,S),en("dragleave",Se,Q),en("dragover",Se,D),en("drop",Se,I),Ce("click",H,()=>m?.click()),y(t,N),Re()}It(["click","change"]);var T8=P('
');function A8(t,e){Me(e,!0);const n=Wt("pageRoute"),r=Wt("mediaSource"),i=Wt("pageMediaItems"),s=A(()=>n?.()??"/"),o=A(()=>r?.());var a=_e(),l=me(a);{var c=d=>{{let m=A(()=>i?.items);lx(d,{get apiBase(){return f(o).apiBase},get invalidationKeys(){return f(o).invalidationKeys},onMediaChange:g=>i?.update(g),get externalItems(){return f(m)}})}},u=d=>{{let m=A(()=>i?.items);lx(d,{get route(){return f(s)},onMediaChange:g=>i?.update(g),get externalItems(){return f(m)}})}},h=d=>{var m=T8(),g=x(m,!0);b(m),B(p=>$(g,p),[()=>ve.t("ADMIN_NEXT.FIELDS.PAGE_MEDIA.PAGE_MEDIA_UNAVAILABLE")]),y(d,m)};Z(l,d=>{f(o)?d(c):f(s)?d(u,1):d(h,-1)})}y(t,a),Re()}function E8(t){return typeof t=="function"}function Nc(t){return t!==null&&typeof t=="object"}const D8=["string","number","bigint","boolean"];function wp(t){return t==null||D8.includes(typeof t)?!0:Array.isArray(t)?t.every(e=>wp(e)):typeof t=="object"?Object.getPrototypeOf(t)===Object.prototype:!1}const jh=Symbol("box"),mC=Symbol("is-writable");function be(t,e){const n=A(t);return e?{[jh]:!0,[mC]:!0,get current(){return f(n)},set current(r){e(r)}}:{[jh]:!0,get current(){return t()}}}function gC(t){return Nc(t)&&jh in t}function M8(t){return gC(t)?t:E8(t)?be(t):Vr(t)}function Vr(t){let e=ge(Pt(t));return{[jh]:!0,[mC]:!0,get current(){return f(e)},set current(n){k(e,n,!0)}}}function pC(...t){return function(e){for(const n of t)if(n){if(e.defaultPrevented)return;typeof n=="function"?n.call(this,e):n.current?.call(this,e)}}}var cx=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,R8=/\n/g,L8=/^\s*/,I8=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,X8=/^:\s*/,Z8=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,N8=/^[;\s]*/,V8=/^\s+|\s+$/g,F8=` `,ux="/",hx="*",no="",j8="comment",B8="declaration";function z8(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var n=1,r=1;function i(g){var p=g.match(R8);p&&(n+=p.length);var O=g.lastIndexOf(F8);r=~O?g.length-O:r+g.length}function s(){var g={line:n,column:r};return function(p){return p.position=new o(g),c(),p}}function o(g){this.start=g,this.end={line:n,column:r},this.source=e.source}o.prototype.content=t;function a(g){var p=new Error(e.source+":"+n+":"+r+": "+g);if(p.reason=g,p.filename=e.source,p.line=n,p.column=r,p.source=t,!e.silent)throw p}function l(g){var p=g.exec(t);if(p){var O=p[0];return i(O),t=t.slice(O.length),p}}function c(){l(L8)}function u(g){var p;for(g=g||[];p=h();)p!==!1&&g.push(p);return g}function h(){var g=s();if(!(ux!=t.charAt(0)||hx!=t.charAt(1))){for(var p=2;no!=t.charAt(p)&&(hx!=t.charAt(p)||ux!=t.charAt(p+1));)++p;if(p+=2,no===t.charAt(p-1))return a("End of comment missing");var O=t.slice(2,p-2);return r+=2,i(O),t=t.slice(p),r+=2,g({type:j8,comment:O})}}function d(){var g=s(),p=l(I8);if(p){if(h(),!l(X8))return a("property missing ':'");var O=l(Z8),v=g({type:B8,property:dx(p[0].replace(cx,no)),value:O?dx(O[0].replace(cx,no)):no});return l(N8),v}}function m(){var g=[];u(g);for(var p;p=d();)p!==!1&&(g.push(p),u(g));return g}return c(),m()}function dx(t){return t?t.replace(V8,no):no}function W8(t,e){let n=null;if(!t||typeof t!="string")return n;const r=z8(t),i=typeof e=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?e(o,a,s):a&&(n=n||{},n[o]=a)}),n}const Y8=/\d/,U8=["-","_","/","."];function q8(t=""){if(!Y8.test(t))return t!==t.toLowerCase()}function $8(t){const e=[];let n="",r,i;for(const s of t){const o=U8.includes(s);if(o===!0){e.push(n),n="",r=void 0;continue}const a=q8(s);if(i===!1){if(r===!1&&a===!0){e.push(n),n=s,r=a;continue}if(r===!0&&a===!1&&n.length>1){const l=n.at(-1);e.push(n.slice(0,Math.max(0,n.length-1))),n=l+s,r=a;continue}}n+=s,r=a,i=o}return e.push(n),e}function OC(t){return t?$8(t).map(e=>H8(e)).join(""):""}function G8(t){return K8(OC(t||""))}function H8(t){return t?t[0].toUpperCase()+t.slice(1):""}function K8(t){return t?t[0].toLowerCase()+t.slice(1):""}function Ol(t){if(!t)return{};const e={};function n(r,i){if(r.startsWith("-moz-")||r.startsWith("-webkit-")||r.startsWith("-ms-")||r.startsWith("-o-")){e[OC(r)]=i;return}if(r.startsWith("--")){e[r]=i;return}e[G8(r)]=i}return W8(t,n),e}function El(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}function J8(t,e){const n=RegExp(t,"g");return r=>{if(typeof r!="string")throw new TypeError(`expected an argument of type string, but got ${typeof r}`);return r.match(n)?r.replace(n,e):r}}const ez=J8(/[A-Z]/,t=>`-${t.toLowerCase()}`);function tz(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected an argument of type object, but got ${typeof t}`);return Object.keys(t).map(e=>`${ez(e)}: ${t[e]};`).join(` `)}function Vc(t={}){return tz(t).replace(` `," ")}const nz=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],rz=new Set(nz);function iz(t){return rz.has(t)}function Bt(...t){const e={...t[0]};for(let n=1;n{const s=xn(n,"focusin",i),o=xn(n,"focusout",i);return()=>{s(),o()}}))}get current(){return this.#t?.(),this.#e?oz(this.#e):null}}new az;function lz(t){return typeof t=="function"}class ts{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return JT(this.#t)}get(){const e=Wt(this.#t);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const n=Wt(this.#t);return n===void 0?e:n}set(e){return ad(this.#t,e)}}function cz(t,e){switch(t){case"post":We(e);break;case"pre":rS(e);break}}function yC(t,e,n,r={}){const{lazy:i=!1}=r;let s=!i,o=Array.isArray(t)?[]:void 0;cz(e,()=>{const a=Array.isArray(t)?t.map(c=>c()):t();if(!s){s=!0,o=a;return}const l=mr(()=>n(a,o));return o=a,l})}function pn(t,e,n){yC(t,"post",e,n)}function uz(t,e,n){yC(t,"pre",e,n)}pn.pre=uz;function fx(t){return lz(t)?t():t}class hz{#e={width:0,height:0};#t=!1;#n;#r;#i;#o=A(()=>(f(this.#s)?.(),this.getSize().width));#l=A(()=>(f(this.#s)?.(),this.getSize().height));#s=A(()=>{const e=fx(this.#r);if(e)return oS(n=>{if(!this.#i)return;const r=new this.#i.ResizeObserver(i=>{this.#t=!0;for(const s of i){const o=this.#n.box==="content-box"?s.contentBoxSize:s.borderBoxSize,a=Array.isArray(o)?o:[o];this.#e.width=a.reduce((l,c)=>Math.max(l,c.inlineSize),0),this.#e.height=a.reduce((l,c)=>Math.max(l,c.blockSize),0)}n()});return r.observe(e),()=>{this.#t=!1,r.disconnect()}})});constructor(e,n={box:"border-box"}){this.#i=n.window??bC,this.#n=n,this.#r=e,this.#e={width:0,height:0}}calculateSize(){const e=fx(this.#r);if(!e||!this.#i)return;const n=e.offsetWidth,r=e.offsetHeight;if(this.#n.box==="border-box")return{width:n,height:r};const i=this.#i.getComputedStyle(e),s=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),o=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),a=parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth),l=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),c=n-s-a,u=r-o-l;return{width:c,height:u}}getSize(){return this.#t?this.#e:this.calculateSize()??this.#e}get current(){return f(this.#s)?.(),this.getSize()}get width(){return f(this.#o)}get height(){return f(this.#l)}}function Ba(t){We(()=>()=>{t()})}function dz(t,e){return setTimeout(e,t)}function vc(t){eA().then(t)}const fz=1,mz=9,gz=11;function kp(t){return Nc(t)&&t.nodeType===fz&&typeof t.nodeName=="string"}function xC(t){return Nc(t)&&t.nodeType===mz}function pz(t){return Nc(t)&&t.constructor?.name==="VisualViewport"}function Oz(t){return Nc(t)&&t.nodeType!==void 0}function SC(t){return Oz(t)&&t.nodeType===gz&&"host"in t}function vz(t,e){if(!t||!e||!kp(t)||!kp(e))return!1;const n=e.getRootNode?.();if(t===e||t.contains(e))return!0;if(n&&SC(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function tf(t){return xC(t)?t:pz(t)?t.document:t?.ownerDocument??document}function wC(t){return SC(t)?wC(t.host):xC(t)?t.defaultView??window:kp(t)?t.ownerDocument?.defaultView??window:window}function bz(t){let e=t.activeElement;for(;e?.shadowRoot;){const n=e.shadowRoot.activeElement;if(n===e)break;e=n}return e}class za{element;#e=A(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return f(this.#e)}set root(e){k(this.#e,e)}constructor(e){typeof e=="function"?this.element=be(e):this.element=e}getDocument=()=>tf(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>bz(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,n)=>this.getWindow().setTimeout(e,n);clearTimeout=e=>this.getWindow().clearTimeout(e)}function Ut(t,e){return{[GA()]:n=>gC(t)?(t.current=n,mr(()=>e?.(n)),()=>{"isConnected"in n&&n.isConnected||(t.current=null,e?.(null))}):(t(n),mr(()=>e?.(n)),()=>{"isConnected"in n&&n.isConnected||(t(null),e?.(null))})}}function Wr(t){return t?"true":"false"}function Ev(t){return t?"true":void 0}function Mt(t){return t?"":void 0}function kC(t){return t?"open":"closed"}class yz{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(n=>[n,this.getAttr(n)]))}getAttr(e,n){return n?`data-${n}-${e}`:`${this.#t}${e}`}selector(e,n){return`[${this.getAttr(e,n)}]`}}function nf(t){const e=new yz(t);return{...e.attrs,selector:e.selector,getAttr:e.getAttr}}const rf="ArrowDown",Fc="ArrowLeft",jc="ArrowRight",sf="ArrowUp",_C="Backspace",Dv="Enter",xz="Escape",Mv=" ",of="Tab",_p="a",PC="P",Pp="A",Sz="p",ns=typeof document<"u",mx=wz();function wz(){return ns&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function jr(t){return t instanceof HTMLElement}function co(t){return t instanceof Element}function kz(t){return t instanceof Element||t instanceof SVGElement}function af(t){return!Number.isNaN(Number(t))&&!Number.isNaN(Number.parseFloat(t))}function gs(t){return t===null}function Bh(t){return t.pointerType==="touch"}function _z(t){return t!==null}class Pz{#e;#t=null;constructor(e){this.#e=e,Ba(()=>this.#n())}#n(){this.#t&&(window.cancelAnimationFrame(this.#t),this.#t=null)}run(e){this.#n();const n=this.#e.ref.current;if(n){if(typeof n.getAnimations!="function"){this.#r(e);return}this.#t=window.requestAnimationFrame(()=>{const r=n.getAnimations();if(r.length===0){this.#r(e);return}Promise.allSettled(r.map(i=>i.finished)).then(()=>{this.#r(e)})})}}#r(e){const n=()=>{e()};this.#e.afterTick?vc(n):n()}}class gx{#e;#t;#n;#r=ge(!1);constructor(e){this.#e=e,k(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new Pz({ref:this.#e.ref,afterTick:this.#e.open}),pn(()=>this.#e.open.current,n=>{n&&k(this.#r,!0),this.#t&&this.#n.run(()=>{n===this.#e.open.current&&(this.#e.open.current||k(this.#r,!1),this.#e.onComplete?.())})})}get shouldRender(){return f(this.#r)}}function Ft(){}function Xn(t,e){return`bits-${t}`}const Qz=new ts("BitsConfig");function Cz(){const t=new Tz(null,{});return Qz.getOr(t).opts}class Tz{opts;constructor(e,n){const r=Az(e,n);this.opts={defaultPortalTo:r(i=>i.defaultPortalTo),defaultLocale:r(i=>i.defaultLocale)}}}function Az(t,e){return n=>be(()=>{const i=n(e)?.current;if(i!==void 0)return i;if(t!==null)return n(t.opts)?.current})}function Ez(t,e){return n=>{const r=Cz();return be(()=>{const i=n();if(i!==void 0)return i;const s=t(r).current;return s!==void 0?s:e})}}const Dz=Ez(t=>t.defaultLocale,"en");function px(t,e=500){let n=null;const r=(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function QC(t,e){return t===e||t.contains(e)}function CC(t){return t?.ownerDocument??document}function Mz(t,e){const{clientX:n,clientY:r}=t,i=e.getBoundingClientRect();return ni.right||ri.bottom}var TC=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],zh=TC.join(","),AC=typeof Element>"u",Ao=AC?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Wh=!AC&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},Yh=function(e,n){var r;n===void 0&&(n=!0);var i=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=i===""||i==="true",o=s||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):Yh(e.parentNode));return o},Rz=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},EC=function(e,n,r){if(Yh(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(zh));return n&&Ao.call(e,zh)&&i.unshift(e),i=i.filter(r),i},Uh=function(e,n,r){for(var i=[],s=Array.from(e);s.length;){var o=s.shift();if(!Yh(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=Uh(l,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{var u=Ao.call(o,zh);u&&r.filter(o)&&(n||!e.includes(o))&&i.push(o);var h=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),d=!Yh(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(h&&d){var m=Uh(h===!0?o.children:h.children,!0,r);r.flatten?i.push.apply(i,m):i.push({scopeParent:o,candidates:m})}else s.unshift.apply(s,o.children)}}return i},DC=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},MC=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Rz(e))&&!DC(e)?0:e.tabIndex},Lz=function(e,n){var r=MC(e);return r<0&&n&&!DC(e)?0:r},Iz=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},RC=function(e){return e.tagName==="INPUT"},Xz=function(e){return RC(e)&&e.type==="hidden"},Zz=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},Nz=function(e,n){for(var r=0;rsummary:first-of-type"),a=o?e.parentElement:e;if(Ao.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=e;e;){var c=e.parentElement,u=Wh(e);if(c&&!c.shadowRoot&&i(c)===!0)return Ox(e);e.assignedSlot?e=e.assignedSlot:!c&&u!==e.ownerDocument?e=u.host:e=c}e=l}if(Bz(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ox(e);return!1},Wz=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},LC=function(e){var n=[],r=[];return e.forEach(function(i,s){var o=!!i.scopeParent,a=o?i.scopeParent:i,l=Lz(a,o),c=o?LC(i.candidates):a;l===0?o?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:c})}),r.sort(Iz).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Uz=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Uh([e],n.includeContainer,{filter:Qp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Yz}):r=EC(e,n.includeContainer,Qp.bind(null,n)),LC(r)},qz=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Uh([e],n.includeContainer,{filter:qh.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=EC(e,n.includeContainer,qh.bind(null,n)),r},$z=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Ao.call(e,zh)===!1?!1:Qp(n,e)},Gz=TC.concat("iframe:not([inert]):not([inert] *)").join(","),Hz=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Ao.call(e,Gz)===!1?!1:qh(n,e)};function Kz(t,e){const n=[];for(let r=0;r=0&&t{this.#o=CC(this.opts.ref.current)});let n=Ft;const r=()=>{this.#p(),globalThis.bitsDismissableLayers.delete(this),this.#u.destroy(),n()};pn([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return dz(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),n(),n=this.#c())}),r}),Ba(()=>{this.#p.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#u.destroy(),this.#s(),n()})}#a=e=>{e.defaultPrevented||this.opts.ref.current&&vc(()=>{!this.opts.ref.current||this.#g(e.target)||e.target&&!this.#i&&this.#l.current?.(e)})};#c(){return El(xn(this.#o,"pointerdown",El(this.#f,this.#d),{capture:!0}),xn(this.#o,"pointerdown",El(this.#m,this.#u)),xn(this.#o,"focusin",this.#a))}#h=e=>{let n=e;n.defaultPrevented&&(n=vx(e)),this.#e.current(e)};#u=px(e=>{if(!this.opts.ref.current){this.#s();return}const n=this.opts.isValidEvent.current(e,this.opts.ref.current)||rW(e,this.opts.ref.current);if(!this.#r||this.#O()||!n){this.#s();return}let r=e;if(r.defaultPrevented&&(r=vx(r)),this.#t.current!=="close"&&this.#t.current!=="defer-otherwise-close"){this.#s();return}e.pointerType==="touch"?(this.#s(),this.#s=xn(this.#o,"click",this.#h,{once:!0})):this.#e.current(r)},10);#f=e=>{this.#n[e.type]=!0};#m=e=>{this.#n[e.type]=!1};#d=()=>{this.opts.ref.current&&(this.#r=nW(this.opts.ref.current))};#g=e=>this.opts.ref.current?QC(this.opts.ref.current,e):!1;#p=px(()=>{for(const e in this.#n)this.#n[e]=!1;this.#r=!1},20);#O(){return Object.values(this.#n).some(Boolean)}#v=()=>{this.#i=!0};#b=()=>{this.#i=!1};props={onfocuscapture:this.#v,onblurcapture:this.#b}}function tW(t=[...globalThis.bitsDismissableLayers]){return t.findLast(([e,{current:n}])=>n==="close"||n==="ignore")}function nW(t){const e=[...globalThis.bitsDismissableLayers],n=tW(e);if(n)return n[0].opts.ref.current===t;const[r]=e[0];return r.opts.ref.current===t}function rW(t,e){const n=t.target;if(!kz(n))return!1;const r=!!n.closest(`[${Jz}]`);if("button"in t&&t.button>0&&!r)return!1;if("button"in t&&t.button===0&&r)return!0;const i=!!e.closest(`[${eW}]`);return r&&i?!1:CC(n).documentElement.contains(n)&&!QC(e,n)&&Mz(t,e)}function vx(t){const e=t.currentTarget,n=t.target;let r;t instanceof PointerEvent?r=new PointerEvent(t.type,t):r=new PointerEvent("pointerdown",t);let i=!1;return new Proxy(r,{get:(o,a)=>a==="currentTarget"?e:a==="target"?n:a==="preventDefault"?()=>{i=!0,typeof o.preventDefault=="function"&&o.preventDefault()}:a==="defaultPrevented"?i:a in o?o[a]:t[a]})}function iW(t,e){Me(e,!0);let n=ee(e,"interactOutsideBehavior",3,"close"),r=ee(e,"onInteractOutside",3,Ft),i=ee(e,"onFocusOutside",3,Ft),s=ee(e,"isValidEvent",3,()=>!1);const o=Rv.create({id:be(()=>e.id),interactOutsideBehavior:be(()=>n()),onInteractOutside:be(()=>r()),enabled:be(()=>e.enabled),onFocusOutside:be(()=>i()),isValidEvent:be(()=>s()),ref:e.ref});var a=_e(),l=me(a);nt(l,()=>e.children??xt,()=>({props:o.props})),y(t,a),Re()}globalThis.bitsEscapeLayers??=new Map;class Lv{static create(e){return new Lv(e)}opts;domContext;constructor(e){this.opts=e,this.domContext=new za(this.opts.ref);let n=Ft;pn(()=>e.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),n=this.#e()),()=>{n(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>xn(this.domContext.getDocument(),"keydown",this.#t,{passive:!1});#t=e=>{if(e.key!==xz||!sW(this))return;const n=new KeyboardEvent(e.type,e);e.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(n)}}function sW(t){const e=[...globalThis.bitsEscapeLayers],n=e.findLast(([i,{current:s}])=>s==="close"||s==="ignore");if(n)return n[0]===t;const[r]=e[0];return r===t}function oW(t,e){Me(e,!0);let n=ee(e,"escapeKeydownBehavior",3,"close"),r=ee(e,"onEscapeKeydown",3,Ft);Lv.create({escapeKeydownBehavior:be(()=>n()),onEscapeKeydown:be(()=>r()),enabled:be(()=>e.enabled),ref:e.ref});var i=_e(),s=me(i);nt(s,()=>e.children??xt),y(t,i),Re()}class Iv{static instance;#e=Vr([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||(this.instance=new Iv),this.instance}register(e){const n=this.getActive();n&&n!==e&&n.pause();const r=document.activeElement;r&&r!==document.body&&this.#n.set(e,r),this.#e.current=this.#e.current.filter(i=>i!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(r=>r!==e);const n=this.getActive();n&&n.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,n){this.#t.set(e,n)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,n){this.#n.set(e,n)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}}class Xv{#e=!1;#t=null;#n=Iv.getInstance();#r=[];#i;constructor(e){this.#i=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#o(){for(const e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#a(),this.#l()}unmount(){this.#t&&(this.#o(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),this.#t=null)}#l(){if(!this.#t)return;const e=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;const n=this.#h();n?(n.focus(),this.#n.setFocusMemory(this,n)):this.#t.focus()})}#s(){const e=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(e),!e.defaultPrevented){const n=this.#n.getPreFocusMemory(this);if(n&&document.contains(n))try{n.focus()}catch{document.body.focus()}}}#a(){if(!this.#t||!this.#i.trap.current)return;const e=this.#t,n=e.ownerDocument,r=o=>{if(this.#e||!this.#n.isActiveScope(this))return;const a=o.target;if(!a)return;if(e.contains(a))this.#n.setFocusMemory(this,a);else{const c=this.#n.getFocusMemory(this);if(c&&e.contains(c)&&Hz(c))o.preventDefault(),c.focus();else{const u=this.#h(),h=this.#u()[0];(u||h||e).focus()}}},i=o=>{if(!this.#i.loop||this.#e||o.key!=="Tab"||!this.#n.isActiveScope(this))return;const a=this.#c();if(a.length===0)return;const l=a[0],c=a[a.length-1];!o.shiftKey&&n.activeElement===c?(o.preventDefault(),l.focus()):o.shiftKey&&n.activeElement===l&&(o.preventDefault(),c.focus())};this.#r.push(xn(n,"focusin",r,{capture:!0}),xn(e,"keydown",i));const s=new MutationObserver(()=>{const o=this.#n.getFocusMemory(this);if(o&&!e.contains(o)){const a=this.#h(),l=this.#u()[0],c=a||l;c?(c.focus(),this.#n.setFocusMemory(this,c)):e.focus()}});s.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>s.disconnect())}#c(){return this.#t?Uz(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#h(){return this.#c()[0]||null}#u(){return this.#t?qz(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(e){let n=null;return pn([()=>e.ref.current,()=>e.enabled.current],([r,i])=>{r&&i?(n||(n=new Xv(e)),n.mount(r)):n&&(n.unmount(),n=null)}),Ba(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}}function aW(t,e){Me(e,!0);let n=ee(e,"enabled",3,!1),r=ee(e,"trapFocus",3,!1),i=ee(e,"loop",3,!1),s=ee(e,"onCloseAutoFocus",3,Ft),o=ee(e,"onOpenAutoFocus",3,Ft);const a=Xv.use({enabled:be(()=>n()),trap:be(()=>r()),loop:i(),onCloseAutoFocus:be(()=>s()),onOpenAutoFocus:be(()=>o()),ref:e.ref});var l=_e(),c=me(l);nt(c,()=>e.focusScope??xt,()=>({props:a.props})),y(t,l),Re()}globalThis.bitsTextSelectionLayers??=new Map;class Zv{static create(e){return new Zv(e)}opts;domContext;#e=Ft;constructor(e){this.opts=e,this.domContext=new za(e.ref);let n=Ft;pn(()=>this.opts.enabled.current,r=>(r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),n(),n=this.#t()),()=>{n(),this.#r(),globalThis.bitsTextSelectionLayers.delete(this)}))}#t(){return El(xn(this.domContext.getDocument(),"pointerdown",this.#n),xn(this.domContext.getDocument(),"pointerup",pC(this.#r,this.opts.onPointerUp.current)))}#n=e=>{const n=this.opts.ref.current,r=e.target;!jr(n)||!jr(r)||!this.opts.enabled.current||!cW(this)||!vz(n,r)||(this.opts.onPointerDown.current(e),!e.defaultPrevented&&(this.#e=lW(n,this.domContext.getDocument().body)))};#r=()=>{this.#e(),this.#e=Ft}}const bx=t=>t.style.userSelect||t.style.webkitUserSelect;function lW(t,e){const n=bx(e),r=bx(t);return wu(e,"none"),wu(t,"text"),()=>{wu(e,n),wu(t,r)}}function wu(t,e){t.style.userSelect=e,t.style.webkitUserSelect=e}function cW(t){const e=[...globalThis.bitsTextSelectionLayers];if(!e.length)return!1;const n=e.at(-1);return n?n[0]===t:!1}function uW(t,e){Me(e,!0);let n=ee(e,"preventOverflowTextSelection",3,!0),r=ee(e,"onPointerDown",3,Ft),i=ee(e,"onPointerUp",3,Ft);Zv.create({id:be(()=>e.id),onPointerDown:be(()=>r()),onPointerUp:be(()=>i()),enabled:be(()=>e.enabled&&n()),ref:e.ref});var s=_e(),o=me(s);nt(o,()=>e.children??xt),y(t,s),Re()}globalThis.bitsIdCounter??={current:0};function Bc(t="bits"){return globalThis.bitsIdCounter.current++,`${t}-${globalThis.bitsIdCounter.current}`}class hW{#e;#t=0;#n=ge();#r;constructor(e){this.#e=e}#i(){this.#t-=1,this.#r&&this.#t<=0&&(this.#r(),k(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,f(this.#n)===void 0&&(this.#r=iS(()=>{k(this.#n,this.#e(...e),!0)})),We(()=>()=>{this.#i()}),f(this.#n)}}const Yu=new HA;let ku=ge(null),Sm=null,ll=null,cl=!1;const yx=be(()=>{for(const t of Yu.values())if(t)return!0;return!1});let wm=null;const dW=new hW(()=>{function t(){document.body.setAttribute("style",f(ku)??""),document.body.style.removeProperty("--scrollbar-width"),mx&&Sm?.(),k(ku,null)}function e(){ll!==null&&(window.clearTimeout(ll),ll=null)}function n(i,s){e(),cl=!0,wm=Date.now();const o=wm,a=()=>{ll=null,wm===o&&(IC(Yu)?cl=!1:(cl=!1,s()))},l=i===null?24:i;ll=window.setTimeout(a,l)}function r(){f(ku)===null&&Yu.size===0&&!cl&&k(ku,document.body.getAttribute("style"),!0)}return pn(()=>yx.current,()=>{if(!yx.current)return;r(),cl=!1;const i=getComputedStyle(document.documentElement),s=getComputedStyle(document.body),o=i.scrollbarGutter?.includes("stable")||s.scrollbarGutter?.includes("stable"),a=window.innerWidth-document.documentElement.clientWidth,c={padding:Number.parseInt(s.paddingRight??"0",10)+a,margin:Number.parseInt(s.marginRight??"0",10)};a>0&&!o&&(document.body.style.paddingRight=`${c.padding}px`,document.body.style.marginRight=`${c.margin}px`,document.body.style.setProperty("--scrollbar-width",`${a}px`)),document.body.style.overflow="hidden",mx&&(Sm=xn(document,"touchmove",u=>{u.target===document.documentElement&&(u.touches.length>1||u.preventDefault())},{passive:!1})),vc(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),Ba(()=>()=>{Sm?.()}),{get lockMap(){return Yu},resetBodyStyle:t,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:e,ensureInitialStyleCaptured:r}});class fW{#e=Bc();#t;#n=()=>null;#r;locked;constructor(e,n=()=>null){this.#t=e,this.#n=n,this.#r=dW.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=be(()=>this.#r.lockMap.get(this.#e)??!1,r=>this.#r.lockMap.set(this.#e,r)),Ba(()=>{if(this.#r.lockMap.delete(this.#e),IC(this.#r.lockMap))return;const r=this.#n();this.#r.scheduleCleanupIfNoNewLocks(r,()=>{this.#r.resetBodyStyle()})}))}}function IC(t){for(const[e,n]of t)if(n)return!0;return!1}function xx(t,e){Me(e,!0);let n=ee(e,"preventScroll",3,!0),r=ee(e,"restoreScrollDelay",3,null);n()&&new fW(n(),()=>r()),Re()}function km(t,e){return t-e*Math.floor(t/e)}const XC=1721426;function _u(t,e,n,r){e=Nv(t,e);let i=e-1,s=-2;return n<=2?s=0:Uu(e)&&(s=-1),XC-1+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*n-362)/12+s+r)}function Uu(t){return t%4===0&&(t%100!==0||t%400===0)}function Nv(t,e){return t==="BC"?1-e:e}function mW(t){let e="AD";return t<=0&&(e="BC",t=1-t),[e,t]}const gW={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Ma{fromJulianDay(e){let n=e,r=n-XC,i=Math.floor(r/146097),s=km(r,146097),o=Math.floor(s/36524),a=km(s,36524),l=Math.floor(a/1461),c=km(a,1461),u=Math.floor(c/365),h=i*400+o*100+l*4+u+(o!==4&&u!==4?1:0),[d,m]=mW(h),g=n-_u(d,m,1,1),p=2;n<_u(d,m,3,1)?p=0:Uu(m)&&(p=1);let O=Math.floor(((g+p)*12+373)/367),v=n-_u(d,m,O,1)+1;return new Is(d,m,O,v)}toJulianDay(e){return _u(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return gW[Uu(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return Uu(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return e.era==="BC"}balanceDate(e){e.year<=0&&(e.era=e.era==="BC"?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}}const pW={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function hs(t,e){return e=pr(e,t.calendar),t.era===e.era&&t.year===e.year&&t.month===e.month&&t.day===e.day}function Vv(t,e){return e=pr(e,t.calendar),t=Cp(t),e=Cp(e),t.era===e.era&&t.year===e.year&&t.month===e.month}function OW(t,e){var n,r,i,s;return(s=(i=(n=t.isEqual)===null||n===void 0?void 0:n.call(t,e))!==null&&i!==void 0?i:(r=e.isEqual)===null||r===void 0?void 0:r.call(e,t))!==null&&s!==void 0?s:t.identifier===e.identifier}function vW(t,e){return hs(t,yW(e))}function ZC(t,e,n){let r=t.calendar.toJulianDay(t),i=_W(e),s=Math.ceil(r+1-i)%7;return s<0&&(s+=7),s}function bW(t){return vi(Date.now(),t)}function yW(t){return CW(bW(t))}function NC(t,e){return t.calendar.toJulianDay(t)-e.calendar.toJulianDay(e)}function xW(t,e){return Sx(t)-Sx(e)}function Sx(t){return t.hour*36e5+t.minute*6e4+t.second*1e3+t.millisecond}let _m=null,SW=!1;function ps(){return _m==null&&(_m=new Intl.DateTimeFormat().resolvedOptions().timeZone),_m}function VC(){return SW}function Cp(t){return t.subtract({days:t.day-1})}function wW(t){return t.add({days:t.calendar.getDaysInMonth(t)-t.day})}const wx=new Map,Pm=new Map;function kW(t){if(Intl.Locale){let n=wx.get(t);return n||(n=new Intl.Locale(t).maximize().region,n&&wx.set(t,n)),n}let e=t.split("-")[1];return e==="u"?void 0:e}function _W(t){let e=Pm.get(t);if(!e){if(Intl.Locale){let r=new Intl.Locale(t);if("getWeekInfo"in r&&(e=r.getWeekInfo(),e))return Pm.set(t,e),e.firstDay}let n=kW(t);if(t.includes("-fw-")){let r=t.split("-fw-")[1].split("-")[0];r==="mon"?e={firstDay:1}:r==="tue"?e={firstDay:2}:r==="wed"?e={firstDay:3}:r==="thu"?e={firstDay:4}:r==="fri"?e={firstDay:5}:r==="sat"?e={firstDay:6}:e={firstDay:0}}else t.includes("-ca-iso8601")?e={firstDay:1}:e={firstDay:n&&pW[n]||0};Pm.set(t,e)}return e.firstDay}function Rs(t){t=pr(t,new Ma);let e=Nv(t.era,t.year);return FC(e,t.month,t.day,t.hour,t.minute,t.second,t.millisecond)}function FC(t,e,n,r,i,s,o){let a=new Date;return a.setUTCHours(r,i,s,o),a.setUTCFullYear(t,e-1,n),a.getTime()}function bc(t,e){if(e==="UTC")return 0;if(t>0&&e===ps()&&!VC())return new Date(t).getTimezoneOffset()*-6e4;let{year:n,month:r,day:i,hour:s,minute:o,second:a}=jC(t,e);return FC(n,r,i,s,o,a,0)-Math.floor(t/1e3)*1e3}const kx=new Map;function jC(t,e){let n=kx.get(e);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),kx.set(e,n));let r=n.formatToParts(new Date(t)),i={};for(let s of r)s.type!=="literal"&&(i[s.type]=s.value);return{year:i.era==="BC"||i.era==="B"?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:i.hour==="24"?0:+i.hour,minute:+i.minute,second:+i.second}}const $h=864e5;function PW(t,e){let n=Rs(t),r=n-bc(n-$h,e),i=n-bc(n+$h,e);return BC(t,e,r,i)}function BC(t,e,n,r){return(n===r?[n]:[n,r]).filter(s=>QW(t,e,s))}function QW(t,e,n){let r=jC(n,e);return t.year===r.year&&t.month===r.month&&t.day===r.day&&t.hour===r.hour&&t.minute===r.minute&&t.second===r.second}function di(t,e,n="compatible"){let r=Ls(t);if(e==="UTC")return Rs(r);if(e===ps()&&n==="compatible"&&!VC()){r=pr(r,new Ma);let l=new Date,c=Nv(r.era,r.year);return l.setFullYear(c,r.month-1,r.day),l.setHours(r.hour,r.minute,r.second,r.millisecond),l.getTime()}let i=Rs(r),s=bc(i-$h,e),o=bc(i+$h,e),a=BC(r,e,i-s,i-o);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(i-s,i-o);case"compatible":case"later":return Math.max(i-s,i-o);case"reject":throw new RangeError("No such absolute time found")}}function zC(t,e,n="compatible"){return new Date(di(t,e,n))}function vi(t,e){let n=bc(t,e),r=new Date(t+n),i=r.getUTCFullYear(),s=r.getUTCMonth()+1,o=r.getUTCDate(),a=r.getUTCHours(),l=r.getUTCMinutes(),c=r.getUTCSeconds(),u=r.getUTCMilliseconds();return new Ai(i<1?"BC":"AD",i<1?-i+1:i,s,o,e,n,a,l,c,u)}function CW(t){return new Is(t.calendar,t.era,t.year,t.month,t.day)}function Ls(t,e){let n=0,r=0,i=0,s=0;if("timeZone"in t)({hour:n,minute:r,second:i,millisecond:s}=t);else if("hour"in t&&!e)return t;return e&&({hour:n,minute:r,second:i,millisecond:s}=e),new Yr(t.calendar,t.era,t.year,t.month,t.day,n,r,i,s)}function pr(t,e){if(OW(t.calendar,e))return t;let n=e.fromJulianDay(t.calendar.toJulianDay(t)),r=t.copy();return r.calendar=e,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,Eo(r),r}function TW(t,e,n){if(t instanceof Ai)return t.timeZone===e?t:EW(t,e);let r=di(t,e,n);return vi(r,e)}function AW(t){let e=Rs(t)-t.offset;return new Date(e)}function EW(t,e){let n=Rs(t)-t.offset;return pr(vi(n,e),t.calendar)}const ul=36e5;function lf(t,e){let n=t.copy(),r="hour"in n?LW(n,e):0;Tp(n,e.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,t),n.month+=e.months||0,Ap(n),WC(n),n.day+=(e.weeks||0)*7,n.day+=e.days||0,n.day+=r,DW(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let i=n.calendar.getYearsInEra(n);if(n.year>i){var s,o;let l=(s=(o=n.calendar).isInverseEra)===null||s===void 0?void 0:s.call(o,n);n.year=i,n.month=l?1:n.calendar.getMonthsInYear(n),n.day=l?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let a=n.calendar.getMonthsInYear(n);return n.month>a&&(n.month=a,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Tp(t,e){var n,r;!((n=(r=t.calendar).isInverseEra)===null||n===void 0)&&n.call(r,t)&&(e=-e),t.year+=e}function Ap(t){for(;t.month<1;)Tp(t,-1),t.month+=t.calendar.getMonthsInYear(t);let e=0;for(;t.month>(e=t.calendar.getMonthsInYear(t));)t.month-=e,Tp(t,1)}function DW(t){for(;t.day<1;)t.month--,Ap(t),t.day+=t.calendar.getDaysInMonth(t);for(;t.day>t.calendar.getDaysInMonth(t);)t.day-=t.calendar.getDaysInMonth(t),t.month++,Ap(t)}function WC(t){t.month=Math.max(1,Math.min(t.calendar.getMonthsInYear(t),t.month)),t.day=Math.max(1,Math.min(t.calendar.getDaysInMonth(t),t.day))}function Eo(t){t.calendar.constrainDate&&t.calendar.constrainDate(t),t.year=Math.max(1,Math.min(t.calendar.getYearsInEra(t),t.year)),WC(t)}function YC(t){let e={};for(let n in t)typeof t[n]=="number"&&(e[n]=-t[n]);return e}function UC(t,e){return lf(t,YC(e))}function Fv(t,e){let n=t.copy();return e.era!=null&&(n.era=e.era),e.year!=null&&(n.year=e.year),e.month!=null&&(n.month=e.month),e.day!=null&&(n.day=e.day),Eo(n),n}function Gh(t,e){let n=t.copy();return e.hour!=null&&(n.hour=e.hour),e.minute!=null&&(n.minute=e.minute),e.second!=null&&(n.second=e.second),e.millisecond!=null&&(n.millisecond=e.millisecond),RW(n),n}function MW(t){t.second+=Math.floor(t.millisecond/1e3),t.millisecond=Pu(t.millisecond,1e3),t.minute+=Math.floor(t.second/60),t.second=Pu(t.second,60),t.hour+=Math.floor(t.minute/60),t.minute=Pu(t.minute,60);let e=Math.floor(t.hour/24);return t.hour=Pu(t.hour,24),e}function RW(t){t.millisecond=Math.max(0,Math.min(t.millisecond,1e3)),t.second=Math.max(0,Math.min(t.second,59)),t.minute=Math.max(0,Math.min(t.minute,59)),t.hour=Math.max(0,Math.min(t.hour,23))}function Pu(t,e){let n=t%e;return n<0&&(n+=e),n}function LW(t,e){return t.hour+=e.hours||0,t.minute+=e.minutes||0,t.second+=e.seconds||0,t.millisecond+=e.milliseconds||0,MW(t)}function jv(t,e,n,r){let i=t.copy();switch(e){case"era":{let a=t.calendar.getEras(),l=a.indexOf(t.era);if(l<0)throw new Error("Invalid era: "+t.era);l=Ii(l,n,0,a.length-1,r?.round),i.era=a[l],Eo(i);break}case"year":var s,o;!((s=(o=i.calendar).isInverseEra)===null||s===void 0)&&s.call(o,i)&&(n=-n),i.year=Ii(t.year,n,-1/0,9999,r?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,t);break;case"month":i.month=Ii(t.month,n,1,t.calendar.getMonthsInYear(t),r?.round);break;case"day":i.day=Ii(t.day,n,1,t.calendar.getDaysInMonth(t),r?.round);break;default:throw new Error("Unsupported field "+e)}return t.calendar.balanceDate&&t.calendar.balanceDate(i),Eo(i),i}function qC(t,e,n,r){let i=t.copy();switch(e){case"hour":{let s=t.hour,o=0,a=23;if(r?.hourCycle===12){let l=s>=12;o=l?12:0,a=l?23:11}i.hour=Ii(s,n,o,a,r?.round);break}case"minute":i.minute=Ii(t.minute,n,0,59,r?.round);break;case"second":i.second=Ii(t.second,n,0,59,r?.round);break;case"millisecond":i.millisecond=Ii(t.millisecond,n,0,999,r?.round);break;default:throw new Error("Unsupported field "+e)}return i}function Ii(t,e,n,r,i=!1){if(i){t+=Math.sign(e),t0?t=Math.ceil(t/s)*s:t=Math.floor(t/s)*s,t>r&&(t=n)}else t+=e,tr&&(t=n+(t-r-1));return t}function $C(t,e){let n;if(e.years!=null&&e.years!==0||e.months!=null&&e.months!==0||e.weeks!=null&&e.weeks!==0||e.days!=null&&e.days!==0){let i=lf(Ls(t),{years:e.years,months:e.months,weeks:e.weeks,days:e.days});n=di(i,t.timeZone)}else n=Rs(t)-t.offset;n+=e.milliseconds||0,n+=(e.seconds||0)*1e3,n+=(e.minutes||0)*6e4,n+=(e.hours||0)*36e5;let r=vi(n,t.timeZone);return pr(r,t.calendar)}function IW(t,e){return $C(t,YC(e))}function XW(t,e,n,r){switch(e){case"hour":{let i=0,s=23;if(r?.hourCycle===12){let g=t.hour>=12;i=g?12:0,s=g?23:11}let o=Ls(t),a=pr(Gh(o,{hour:i}),new Ma),l=[di(a,t.timeZone,"earlier"),di(a,t.timeZone,"later")].filter(g=>vi(g,t.timeZone).day===a.day)[0],c=pr(Gh(o,{hour:s}),new Ma),u=[di(c,t.timeZone,"earlier"),di(c,t.timeZone,"later")].filter(g=>vi(g,t.timeZone).day===c.day).pop(),h=Rs(t)-t.offset,d=Math.floor(h/ul),m=h%ul;return h=Ii(d,n,Math.floor(l/ul),Math.floor(u/ul),r?.round)*ul+m,pr(vi(h,t.timeZone),t.calendar)}case"minute":case"second":case"millisecond":return qC(t,e,n,r);case"era":case"year":case"month":case"day":{let i=jv(Ls(t),e,n,r),s=di(i,t.timeZone);return pr(vi(s,t.timeZone),t.calendar)}default:throw new Error("Unsupported field "+e)}}function ZW(t,e,n){let r=Ls(t),i=Gh(Fv(r,e),e);if(i.compare(r)===0)return t;let s=di(i,t.timeZone,n);return pr(vi(s,t.timeZone),t.calendar)}const NW=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,VW=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,FW=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:([+-]\d{2})(?::?(\d{2}))?(?::?(\d{2}))?)?\[(.*?)\]$/,GC=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function HC(t){let e=t.match(NW);if(!e)throw GC.test(t)?new Error(`Invalid ISO 8601 date string: ${t}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+t);let n=new Is(Jt(e[1],0,9999),Jt(e[2],1,12),1);return n.day=Jt(e[3],1,n.calendar.getDaysInMonth(n)),n}function KC(t){let e=t.match(VW);if(!e)throw GC.test(t)?new Error(`Invalid ISO 8601 date time string: ${t}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date time string: "+t);let n=Jt(e[1],-9999,9999),r=n<1?"BC":"AD",i=new Yr(r,n<1?-n+1:n,Jt(e[2],1,12),1,e[4]?Jt(e[4],0,23):0,e[5]?Jt(e[5],0,59):0,e[6]?Jt(e[6],0,59):0,e[7]?Jt(e[7],0,1/0)*1e3:0);return i.day=Jt(e[3],0,i.calendar.getDaysInMonth(i)),i}function JC(t,e){let n=t.match(FW);if(!n)throw new Error("Invalid ISO 8601 date time string: "+t);let r=Jt(n[1],-9999,9999),i=r<1?"BC":"AD",s=new Ai(i,r<1?-r+1:r,Jt(n[2],1,12),1,n[11],0,n[4]?Jt(n[4],0,23):0,n[5]?Jt(n[5],0,59):0,n[6]?Jt(n[6],0,59):0,n[7]?Jt(n[7],0,1/0)*1e3:0);s.day=Jt(n[3],0,s.calendar.getDaysInMonth(s));let o=Ls(s),a;if(n[8]){let u=Jt(n[8],-23,23);var l,c;if(s.offset=Math.sign(u)*(Math.abs(u)*36e5+Jt((l=n[9])!==null&&l!==void 0?l:"0",0,59)*6e4+Jt((c=n[10])!==null&&c!==void 0?c:"0",0,59)*1e3),a=Rs(s)-s.offset,!PW(o,s.timeZone).includes(a))throw new Error(`Offset ${tT(s.offset)} is invalid for ${Bv(s)} in ${s.timeZone}`)}else a=di(Ls(o),s.timeZone,e);return vi(a,s.timeZone)}function Jt(t,e,n){let r=Number(t);if(rn)throw new RangeError(`Value out of range: ${e} <= ${r} <= ${n}`);return r}function jW(t){return`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}${t.millisecond?String(t.millisecond/1e3).slice(1):""}`}function eT(t){let e=pr(t,new Ma),n;return e.era==="BC"?n=e.year===1?"0000":"-"+String(Math.abs(1-e.year)).padStart(6,"00"):n=String(e.year).padStart(4,"0"),`${n}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")}`}function Bv(t){return`${eT(t)}T${jW(t)}`}function tT(t){let e=Math.sign(t)<0?"-":"+";t=Math.abs(t);let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),i=Math.floor(t%36e5%6e4/1e3),s=`${e}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`;return i!==0&&(s+=`:${String(i).padStart(2,"0")}`),s}function BW(t){return`${Bv(t)}${tT(t.offset)}[${t.timeZone}]`}function zW(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zv(t,e,n){zW(t,e),e.set(t,n)}function Wv(t){let e=typeof t[0]=="object"?t.shift():new Ma,n;if(typeof t[0]=="string")n=t.shift();else{let o=e.getEras();n=o[o.length-1]}let r=t.shift(),i=t.shift(),s=t.shift();return[e,n,r,i,s]}var WW=new WeakMap;class Is{copy(){return this.era?new Is(this.calendar,this.era,this.year,this.month,this.day):new Is(this.calendar,this.year,this.month,this.day)}add(e){return lf(this,e)}subtract(e){return UC(this,e)}set(e){return Fv(this,e)}cycle(e,n,r){return jv(this,e,n,r)}toDate(e){return zC(this,e)}toString(){return eT(this)}compare(e){return NC(this,e)}constructor(...e){zv(this,WW,{writable:!0,value:void 0});let[n,r,i,s,o]=Wv(e);this.calendar=n,this.era=r,this.year=i,this.month=s,this.day=o,Eo(this)}}var YW=new WeakMap;class Yr{copy(){return this.era?new Yr(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new Yr(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return lf(this,e)}subtract(e){return UC(this,e)}set(e){return Fv(Gh(this,e),e)}cycle(e,n,r){switch(e){case"era":case"year":case"month":case"day":return jv(this,e,n,r);default:return qC(this,e,n,r)}}toDate(e,n){return zC(this,e,n)}toString(){return Bv(this)}compare(e){let n=NC(this,e);return n===0?xW(this,Ls(e)):n}constructor(...e){zv(this,YW,{writable:!0,value:void 0});let[n,r,i,s,o]=Wv(e);this.calendar=n,this.era=r,this.year=i,this.month=s,this.day=o,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Eo(this)}}var UW=new WeakMap;class Ai{copy(){return this.era?new Ai(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Ai(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return $C(this,e)}subtract(e){return IW(this,e)}set(e,n){return ZW(this,e,n)}cycle(e,n,r){return XW(this,e,n,r)}toDate(){return AW(this)}toString(){return BW(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-TW(e,this.timeZone).toDate().getTime()}constructor(...e){zv(this,UW,{writable:!0,value:void 0});let[n,r,i,s,o]=Wv(e),a=e.shift(),l=e.shift();this.calendar=n,this.era=r,this.year=i,this.month=s,this.day=o,this.timeZone=a,this.offset=l,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,Eo(this)}}let Qm=new Map;class oi{format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(e,n);if(n= start date");return`${this.formatter.format(e)} – ${this.formatter.format(n)}`}formatRangeToParts(e,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(e,n);if(n= start date");let r=this.formatter.formatToParts(e),i=this.formatter.formatToParts(n);return[...r.map(s=>({...s,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return GW()&&(this.resolvedHourCycle||(this.resolvedHourCycle=HW(e.locale,this.options)),e.hourCycle=this.resolvedHourCycle,e.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),e.calendar==="ethiopic-amete-alem"&&(e.calendar="ethioaa"),e}constructor(e,n={}){this.formatter=nT(e,n),this.options=n}}const qW={true:{ja:"h11"},false:{}};function nT(t,e={}){if(typeof e.hour12=="boolean"&&$W()){e={...e};let i=qW[String(e.hour12)][t.split("-")[0]],s=e.hour12?"h12":"h23";e.hourCycle=i??s,delete e.hour12}let n=t+(e?Object.entries(e).sort((i,s)=>i[0]s.type==="hour").value,10),i=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(s=>s.type==="hour").value,10);if(r===0&&i===23)return"h23";if(r===24&&i===23)return"h24";if(r===0&&i===11)return"h11";if(r===12&&i===11)return"h12";throw new Error("Unexpected hour cycle result")}function KW(t){if(!ns||!t)return null;let e=t.querySelector("[data-bits-announcer]");const n=i=>{const s=t.createElement("div");return s.role="log",s.ariaLive=i,s.setAttribute("aria-relevant","additions"),s};if(!jr(e)){const i=t.createElement("div");i.style.cssText=vC,i.setAttribute("data-bits-announcer",""),i.appendChild(n("assertive")),i.appendChild(n("polite")),e=i,t.body.insertBefore(e,t.body.firstChild)}return{getLog:i=>{if(!jr(e))return null;const s=e.querySelector(`[aria-live="${i}"]`);return jr(s)?s:null}}}function Hh(t){const e=KW(t);function n(r,i="assertive",s=7500){if(!e||!ns||!t)return;const o=e.getLog(i),a=t.createElement("div");return typeof r=="number"?r=r.toString():r===null?r="Empty":r=r.trim(),a.innerText=r,i==="assertive"?o?.replaceChildren(a):o?.appendChild(a),setTimeout(()=>{a.remove()},s)}return{announce:n}}const JW={defaultValue:void 0,granularity:"day"};function eY(t){const e={...JW,...t},{defaultValue:n,granularity:r,minValue:i,maxValue:s}=e;if(Array.isArray(n)&&n.length)return n[n.length-1];if(n&&!Array.isArray(n))return n;{let o=new Date;i&&os.toDate(ps())&&(o=s.toDate(ps()));const a=o.getFullYear(),l=o.getMonth()+1,c=o.getDate();return["hour","minute","second"].includes(r??"day")?new Yr(a,l,c,0,0,0):new Is(a,l,c)}}function rT(t,e){let n;return e instanceof Ai?n=JC(t):e instanceof Yr?n=KC(t):n=HC(t),n.calendar!==e.calendar?pr(n,e.calendar):n}function Kn(t,e=ps()){return t instanceof Ai?t.toDate():t.toDate(e)}function tY(t){if(t instanceof Is)return"date";if(t instanceof Yr)return"datetime";if(t instanceof Ai)return"zoneddatetime";throw new Error("Unknown date type")}function nY(t,e){switch(e){case"date":return HC(t);case"datetime":return KC(t);case"zoneddatetime":return JC(t);default:throw new Error(`Unknown date type: ${e}`)}}function rY(t){return t instanceof Yr}function Yv(t){return t instanceof Ai}function Kh(t){return rY(t)||Yv(t)}function yc(t){if(t instanceof Date){const e=t.getFullYear(),n=t.getMonth()+1;return new Date(e,n,0).getDate()}else return t.set({day:100}).day}function Do(t,e){return t.compare(e)<0}function iY(t,e){return t.compare(e)>0}function _x(t,e,n){const r=ZC(t,n);return e>r?t.subtract({days:r+7-e}):e===r?t:t.subtract({days:r-e})}function Px(t,e,n){const r=ZC(t,n),i=e===0?6:e-1;return r===i?t:r>i?t.add({days:7-r+i}):t.add({days:i-r})}const cf=["day","month","year"],Uv=["hour","minute","second","dayPeriod"],sY=["literal","timeZoneName"],zc=[...cf,...Uv],oY=[...zc,...sY],aY=["ach","af","am","an","ar","ast","az","be","bg","bn","br","bs","ca","cak","ckb","cs","cy","da","de","dsb","el","en","eo","es","et","eu","fa","ff","fi","fr","fy","ga","gd","gl","he","hr","hsb","hu","ia","id","it","ja","ka","kk","kn","ko","lb","lo","lt","lv","meh","ml","ms","nl","nn","no","oc","pl","pt","rm","ro","ru","sc","scn","sk","sl","sr","sv","szl","tg","th","tr","uk","zh-CN","zh-TW"],lY=["year","month","day"],Am={ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"ዓዓዓዓ",month:"ሚሜ",day:"ቀቀ"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"سنة",month:"شهر",day:"يوم"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"гггг",month:"мм",day:"дд"},bg:{year:"гггг",month:"мм",day:"дд"},bn:{year:"yyyy",month:"মিমি",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"ساڵ",month:"مانگ",day:"ڕۆژ"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"åååå",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"źź"},el:{year:"εεεε",month:"μμ",day:"ηη"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"سال",month:"ماه",day:"روز"},ff:{year:"hhhh",month:"ll",day:"ññ"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"שנה",month:"חודש",day:"יום"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"éééé",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:" 年 ",month:"月",day:"日"},ka:{year:"წწწწ",month:"თთ",day:"რრ"},kk:{year:"жжжж",month:"аа",day:"кк"},kn:{year:"ವವವವ",month:"ಮಿಮೀ",day:"ದಿದಿ"},ko:{year:"연도",month:"월",day:"일"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"ປປປປ",month:"ດດ",day:"ວວ"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"വർഷം",month:"മാസം",day:"തീയതി"},ms:{year:"tttt",month:"mm",day:"hh"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"åååå",month:"mm",day:"dd"},no:{year:"åååå",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"гггг",month:"мм",day:"дд"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"гггг",month:"мм",day:"дд"},sv:{year:"åååå",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"сссс",month:"мм",day:"рр"},th:{year:"ปปปป",month:"ดด",day:"วว"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"рррр",month:"мм",day:"дд"},"zh-CN":{year:"年",month:"月",day:"日"},"zh-TW":{year:"年",month:"月",day:"日"}};function cY(t){if(Qx(t))return Am[t];{const e=fY(t);return Qx(e)?Am[e]:Am.en}}function Em(t,e,n){return uY(t)?cY(n)[t]:dY(t)?e:hY(t)?"––":""}function Qx(t){return aY.includes(t)}function uY(t){return lY.includes(t)}function hY(t){return t==="hour"||t==="minute"||t==="second"}function dY(t){return t==="era"||t==="dayPeriod"}function fY(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}function Dm(t){const e=["hour","minute","second"],n=zc.map(r=>r==="dayPeriod"?[r,"AM"]:[r,null]).filter(([r])=>r==="literal"||r===null?!1:t==="day"?!e.includes(r):!0);return Object.fromEntries(n)}function mY(t){const{segmentValues:e,formatter:n,locale:r,dateRef:i}=t,s=Object.keys(e).reduce((a,l)=>{if(!iT(l))return a;if("hour"in e&&l==="dayPeriod"){const c=e[l];gs(c)?a[l]=Em(l,"AM",r):a[l]=c}else a[l]=o(l);return a},{});function o(a){if("hour"in e){const l=e[a],c=typeof l=="string"&&l?.startsWith("0"),u=l!==null?Number.parseInt(l):null;if(l==="0"&&a!=="year")return"0";if(!gs(l)&&!gs(u)){const h=n.part(i.set({[a]:l}),a,{hourCycle:t.hourCycle===24?"h23":void 0}),d=t.hourCycle===12||t.hourCycle===void 0&&oT(r)===12;if(a==="hour"&&d){if(u>12){const m=u-12;return m===0?"12":m<10?`0${m}`:`${m}`}return u===0?"12":u<10?`0${u}`:`${u}`}return a==="year"?`${l}`:c&&h.length===1?`0${h}`:h}else return Em(a,"",r)}else{if(uf(a)){const l=e[a],c=typeof l=="string"&&l?.startsWith("0");if(l==="0")return"0";if(gs(l))return Em(a,"",r);{const u=n.part(i.set({[a]:l}),a);return a==="year"?`${l}`:c&&u.length===1?`0${u}`:u}}return""}}return s}function gY(t){const{granularity:e,dateRef:n,formatter:r,contentObj:i,hideTimeZone:s,hourCycle:o}=t;return r.toParts(n,OY(e,o)).map(c=>["literal","dayPeriod","timeZoneName",null].includes(c.type)||!iT(c.type)?{part:c.type,value:c.value}:{part:c.type,value:i[c.type]}).filter(c=>!(gs(c.part)||gs(c.value)||c.part==="timeZoneName"&&(!Yv(n)||s)))}function pY(t){const e=mY(t),n=gY({contentObj:e,...t});return{obj:e,arr:n}}function OY(t,e){const n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short",hourCycle:e===24?"h23":void 0,hour12:e===24?!1:void 0};return t==="day"&&(delete n.second,delete n.hour,delete n.minute,delete n.timeZoneName),t==="hour"&&delete n.minute,t==="minute"&&delete n.second,n}function Cx(){return zc.reduce((t,e)=>(t[e]={lastKeyZero:!1,hasLeftFocus:!0,updating:null},t),{})}function uf(t){return cf.includes(t)}function iT(t){return zc.includes(t)}function vY(t){return oY.includes(t)}function sT(t){return!ns||!t?[]:Gv(t).map(n=>n.dataset.segment).filter(n=>zc.includes(n))}function bY(t){const{segmentObj:e,fieldNode:n,dateRef:r}=t,i=sT(n);let s=r;for(const o of i)if("hour"in e){const a=e[o];if(gs(a))continue;s=s.set({[o]:e[o]})}else if(uf(o)){const a=e[o];if(gs(a))continue;s=s.set({[o]:e[o]})}return s}function yY(t,e){const n=sT(e);for(const r of n)if("hour"in t){if(t[r]===null)return!1}else if(uf(r)&&t[r]===null)return!1;return!0}function xY(t){return typeof t!="object"||t===null?!1:Object.entries(t).every(([e,n])=>(Uv.includes(e)||cf.includes(e))&&(e==="dayPeriod"?n==="AM"||n==="PM"||n===null:typeof n=="string"||typeof n=="number"||n===null))}function SY(t,e){return e||(Kh(t)?"minute":"day")}function qv(t){return!!([Dv,sf,rf,Fc,jc,_C,Mv].includes(t)||af(t))}function wY(t,e){if(!ns)return!1;const n=Gv(e);return n.length?n[0].id===t:!1}function kY(t){const{id:e,formatter:n,value:r,doc:i}=t;if(!ns)return;const s=n.selectedDate(r),o=i.getElementById(e);if(o)o.innerText=`Selected Date: ${s}`;else{const a=i.createElement("div");a.style.cssText=Vc({display:"none"}),a.id=e,a.innerText=`Selected Date: ${s}`,i.body.appendChild(a)}}function _Y(t,e){if(!ns)return;const n=e.getElementById(t);n&&e.body.removeChild(n)}function oT(t){return new Intl.DateTimeFormat(t,{hour:"numeric"}).formatToParts(new Date("2023-01-01T13:00:00")).find(i=>i.type==="hour")?.value==="1"?12:24}function Wc(t,e){const n=t.currentTarget;if(!jr(n))return;const{prev:r,next:i}=$v(n,e);if(t.key===Fc){if(!r)return;r.focus()}else if(t.key===jc){if(!i)return;i.focus()}}function PY(t,e){const n=e.indexOf(t);if(n===e.length-1||n===-1)return null;const r=n+1;return e[r]}function QY(t,e){const n=e.indexOf(t);if(n===0||n===-1)return null;const r=n-1;return e[r]}function $v(t,e){const n=Gv(e);return n.length?{next:PY(t,n),prev:QY(t,n)}:{next:null,prev:null}}function aT(t,e){const n=t.currentTarget;if(!jr(n))return;const{next:r}=$v(n,e);r&&r.focus()}function lT(t,e){const n=t.currentTarget;if(!jr(n))return;const{prev:r}=$v(n,e);r&&r.focus()}function Yc(t){return t===jc||t===Fc}function Gv(t){return t?Array.from(t.querySelectorAll("[data-segment]")).filter(n=>{if(!jr(n))return!1;const r=n.dataset.segment;return r==="trigger"?!0:!(!vY(r)||r==="literal")}):[]}const CY={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};function cT(t){let e=t.initialLocale;function n(m){e=m}function r(){return e}function i(m,g){return new oi(e,g).format(m)}function s(m,g=!0){return Kh(m)&&g?i(Kn(m),{dateStyle:"long",timeStyle:"long"}):i(Kn(m),{dateStyle:"long"})}function o(m){if(typeof t.monthFormat.current!="function"&&typeof t.yearFormat.current!="function")return new oi(e,{month:t.monthFormat.current,year:t.yearFormat.current}).format(m);const g=typeof t.monthFormat.current=="function"?t.monthFormat.current(m.getMonth()+1):new oi(e,{month:t.monthFormat.current}).format(m),p=typeof t.yearFormat.current=="function"?t.yearFormat.current(m.getFullYear()):new oi(e,{year:t.yearFormat.current}).format(m);return`${g} ${p}`}function a(m){return new oi(e,{month:"long"}).format(m)}function l(m){return new oi(e,{year:"numeric"}).format(m)}function c(m,g){return Yv(m)?new oi(e,{...g,timeZone:m.timeZone}).formatToParts(Kn(m)):new oi(e,g).formatToParts(Kn(m))}function u(m,g="narrow"){return new oi(e,{weekday:g}).format(m)}function h(m,g=void 0){return new oi(e,{hour:"numeric",minute:"numeric",hourCycle:g===24?"h23":void 0}).formatToParts(m).find(v=>v.type==="dayPeriod")?.value==="PM"?"PM":"AM"}function d(m,g,p={}){const O={...CY,...p},w=c(m,O).find(_=>_.type===g);return w?w.value:""}return{setLocale:n,getLocale:r,fullMonth:a,fullYear:l,fullMonthAndYear:o,toParts:c,custom:i,part:d,dayPeriod:h,selectedDate:s,dayOfWeek:u}}function TY(t){return!(!jr(t)||!t.hasAttribute("data-bits-day"))}function Tx(t,e){const n=[];let r=t.add({days:1});const i=e;for(;r.compare(i)<0;)n.push(r),r=r.add({days:1});return n}function Mm(t){const{dateObj:e,weekStartsOn:n,fixedWeeks:r,locale:i}=t,s=yc(e),o=Array.from({length:s},(O,v)=>e.set({day:v+1})),a=Cp(e),l=wW(e),c=n!==void 0?_x(a,n,"en-US"):_x(a,0,i),u=n!==void 0?Px(l,n,"en-US"):Px(l,0,i),h=Tx(c.subtract({days:1}),a),d=Tx(l,u.add({days:1})),m=h.length+o.length+d.length;if(r&&m<42){const O=42-m;let v=d[d.length-1];v||(v=e.add({months:1}).set({day:1}));let w=O;d.length===0&&(w=O-1,d.push(v));const _=Array.from({length:w},(C,T)=>{const S=T+1;return v.add({days:S})});d.push(..._)}const g=h.concat(o,d),p=Kz(g,7);return{value:e,dates:g,weeks:p}}function Uc(t){const{numberOfMonths:e,dateObj:n,...r}=t,i=[];if(!e||e===1)return i.push(Mm({...r,dateObj:n})),i;i.push(Mm({...r,dateObj:n}));for(let s=1;sjr(n)):[]}function Ax(t,e){const n=t.getAttribute("data-value");n&&(e.current=rT(n,e.current))}function AY({node:t,add:e,placeholder:n,calendarNode:r,isPrevButtonDisabled:i,isNextButtonDisabled:s,months:o,numberOfMonths:a}){const l=Rm(r);if(!l.length)return;const u=l.indexOf(t)+e;if(xm(u,l)){const h=l[u];return Ax(h,n),h.focus()}if(u<0){if(i)return;const h=o[0]?.value;if(!h)return;n.current=h.subtract({months:a}),vc(()=>{const d=Rm(r);if(!d.length)return;const m=d.length-Math.abs(u);if(xm(m,d)){const g=d[m];return Ax(g,n),g.focus()}})}if(u>=l.length){if(s)return;const h=o[0]?.value;if(!h)return;n.current=h.add({months:a}),vc(()=>{const d=Rm(r);if(!d.length)return;const m=u-l.length;if(xm(m,d))return d[m].focus()})}}const Ex=[rf,sf,Fc,jc],Dx=[Dv,Mv];function EY({event:t,handleCellClick:e,shiftFocus:n,placeholderValue:r}){const i=t.target;if(!TY(i)||!Ex.includes(t.key)&&!Dx.includes(t.key))return;t.preventDefault();const s={[rf]:7,[sf]:-7,[Fc]:-1,[jc]:1};if(Ex.includes(t.key)){const o=s[t.key];o!==void 0&&n(i,o)}if(Dx.includes(t.key)){const o=i.getAttribute("data-value");if(!o)return;e(t,rT(o,r))}}function DY({months:t,setMonths:e,numberOfMonths:n,pagedNavigation:r,weekStartsOn:i,locale:s,fixedWeeks:o,setPlaceholder:a}){const l=t[0]?.value;if(l)if(r)a(l.add({months:n}));else{const c=l.add({months:1}),u=Uc({dateObj:c,weekStartsOn:i,locale:s,fixedWeeks:o,numberOfMonths:n});a(c),e(u)}}function MY({months:t,setMonths:e,numberOfMonths:n,pagedNavigation:r,weekStartsOn:i,locale:s,fixedWeeks:o,setPlaceholder:a}){const l=t[0]?.value;if(l)if(r)a(l.subtract({months:n}));else{const c=l.subtract({months:1}),u=Uc({dateObj:c,weekStartsOn:i,locale:s,fixedWeeks:o,numberOfMonths:n});a(c),e(u)}}function RY({months:t,formatter:e,weekdayFormat:n}){if(!t.length)return[];const i=t[0].weeks[0];return i?i.map(s=>e.dayOfWeek(Kn(s),n)):[]}function LY(t){We(()=>{const e=t.weekStartsOn.current,n=t.locale.current,r=t.fixedWeeks.current,i=t.numberOfMonths.current;mr(()=>{const s=t.placeholder.current;if(!s)return;const o={weekStartsOn:e,locale:n,fixedWeeks:r,numberOfMonths:i};t.setMonths(Uc({...o,dateObj:s}))})})}function IY({calendarNode:t,label:e,accessibleHeadingId:n}){const r=tf(t),i=r.createElement("div");i.style.cssText=Vc({border:"0px",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"});const s=r.createElement("div");return s.textContent=e,s.id=n,s.role="heading",s.ariaLevel="2",t.insertBefore(i,t.firstChild),i.appendChild(s),()=>{const o=r.getElementById(n);o&&(i.parentElement?.removeChild(i),o.remove())}}function XY({placeholder:t,getVisibleMonths:e,weekStartsOn:n,locale:r,fixedWeeks:i,numberOfMonths:s,setMonths:o}){We(()=>{t.current,mr(()=>{if(e().some(l=>Vv(l,t.current)))return;const a={weekStartsOn:n.current,locale:r.current,fixedWeeks:i.current,numberOfMonths:s.current};o(Uc({...a,dateObj:t.current}))})})}function ZY({maxValue:t,months:e,disabled:n}){if(!t||!e.length)return!1;if(n)return!0;const r=e[e.length-1]?.value;if(!r)return!1;const i=r.add({months:1}).set({day:1});return iY(i,t)}function NY({minValue:t,months:e,disabled:n}){if(!t||!e.length)return!1;if(n)return!0;const r=e[0]?.value;if(!r)return!1;const i=r.subtract({months:1}).set({day:35});return Do(i,t)}function VY({months:t,locale:e,formatter:n}){if(!t.length)return"";if(e!==n.getLocale()&&n.setLocale(e),t.length===1){const u=Kn(t[0].value);return`${n.fullMonthAndYear(u)}`}const r=Kn(t[0].value),i=Kn(t[t.length-1].value),s=n.fullMonth(r),o=n.fullMonth(i),a=n.fullYear(r),l=n.fullYear(i);return a===l?`${s} - ${o} ${l}`:`${s} ${a} - ${o} ${l}`}function FY({fullCalendarLabel:t,id:e,isInvalid:n,disabled:r,readonly:i}){return{id:e,role:"application","aria-label":t,"data-invalid":Mt(n),"data-disabled":Mt(r),"data-readonly":Mt(i)}}function jY(t){const n=tf(t.target).querySelector("[data-bits-day][data-focused]");n&&(t.preventDefault(),n?.focus())}function BY(t){if(!ns)return;const e=Array.from(t.querySelectorAll("[data-bits-day]:not([aria-disabled=true])"));if(e.length===0)return;const n=e[0],r=n?.getAttribute("data-value"),i=n?.getAttribute("data-type");if(!(!r||!i))return nY(r,i)}function zY({ref:t,placeholder:e,defaultPlaceholder:n,minValue:r,maxValue:i,isDateDisabled:s}){function o(a){return!!(s.current(a)||r.current&&Do(a,r.current)||i.current&&Do(i.current,a))}pn(()=>t.current,()=>{t.current&&e.current&&hs(e.current,n)&&o(n)&&(e.current=BY(t.current)??n)})}function WY(t,e){return!t||!e?t:Kh(t)&&Kh(e)?t.set({hour:e.hour,minute:e.minute,millisecond:e.millisecond,second:e.second}):t}const YY=nf({component:"calendar",parts:["root","grid","cell","next-button","prev-button","day","grid-body","grid-head","grid-row","head-cell","header","heading","month-select","year-select"]});function UY(t){const e=new Date().getFullYear(),n=Math.max(t.placeholderYear,e);let r,i;if(t.minValue)r=t.minValue.year;else{const o=n-100;r=t.placeholderYeari&&(r=i);const s=i-r+1;return Array.from({length:s},(o,a)=>r+a)}const Jr=new ts("Calendar.Root | RangeCalender.Root");class Hv{static create(e){return Jr.set(new Hv(e))}opts;#e=A(()=>this.months.map(e=>e.value));get visibleMonths(){return f(this.#e)}set visibleMonths(e){k(this.#e,e)}formatter;accessibleHeadingId=Bc();domContext;attachment;#t=ge(Pt([]));get months(){return f(this.#t)}set months(e){k(this.#t,e,!0)}announcer;constructor(e){this.opts=e,this.attachment=Ut(this.opts.ref),this.domContext=new za(e.ref),this.announcer=Hh(null),this.formatter=cT({initialLocale:this.opts.locale.current,monthFormat:this.opts.monthFormat,yearFormat:this.opts.yearFormat}),this.setMonths=this.setMonths.bind(this),this.nextPage=this.nextPage.bind(this),this.prevPage=this.prevPage.bind(this),this.prevYear=this.prevYear.bind(this),this.nextYear=this.nextYear.bind(this),this.setYear=this.setYear.bind(this),this.setMonth=this.setMonth.bind(this),this.isOutsideVisibleMonths=this.isOutsideVisibleMonths.bind(this),this.isDateDisabled=this.isDateDisabled.bind(this),this.isDateSelected=this.isDateSelected.bind(this),this.shiftFocus=this.shiftFocus.bind(this),this.handleCellClick=this.handleCellClick.bind(this),this.handleMultipleUpdate=this.handleMultipleUpdate.bind(this),this.handleSingleUpdate=this.handleSingleUpdate.bind(this),this.onkeydown=this.onkeydown.bind(this),this.getBitsAttr=this.getBitsAttr.bind(this),tr(()=>{this.announcer=Hh(this.domContext.getDocument())}),this.months=Uc({dateObj:this.opts.placeholder.current,weekStartsOn:this.opts.weekStartsOn.current,locale:this.opts.locale.current,fixedWeeks:this.opts.fixedWeeks.current,numberOfMonths:this.opts.numberOfMonths.current}),this.#o(),this.#l(),this.#s(),XY({placeholder:this.opts.placeholder,getVisibleMonths:()=>this.visibleMonths,weekStartsOn:this.opts.weekStartsOn,locale:this.opts.locale,fixedWeeks:this.opts.fixedWeeks,numberOfMonths:this.opts.numberOfMonths,setMonths:n=>this.months=n}),LY({fixedWeeks:this.opts.fixedWeeks,locale:this.opts.locale,numberOfMonths:this.opts.numberOfMonths,placeholder:this.opts.placeholder,setMonths:this.setMonths,weekStartsOn:this.opts.weekStartsOn}),pn(()=>this.fullCalendarLabel,n=>{const r=this.domContext.getElementById(this.accessibleHeadingId);r&&(r.textContent=n)}),pn(()=>this.opts.value.current,()=>{const n=this.opts.value.current;if(Array.isArray(n)&&n.length){const r=n[n.length-1];r&&this.opts.placeholder.current!==r&&(this.opts.placeholder.current=r)}else!Array.isArray(n)&&n&&this.opts.placeholder.current!==n&&(this.opts.placeholder.current=n)}),zY({placeholder:e.placeholder,defaultPlaceholder:e.defaultPlaceholder,isDateDisabled:e.isDateDisabled,maxValue:e.maxValue,minValue:e.minValue,ref:e.ref})}setMonths(e){this.months=e}#n=A(()=>RY({months:this.months,formatter:this.formatter,weekdayFormat:this.opts.weekdayFormat.current}));get weekdays(){return f(this.#n)}set weekdays(e){k(this.#n,e)}#r=A(()=>mr(()=>this.opts.placeholder.current.year));get initialPlaceholderYear(){return f(this.#r)}set initialPlaceholderYear(e){k(this.#r,e)}#i=A(()=>UY({minValue:this.opts.minValue.current,maxValue:this.opts.maxValue.current,placeholderYear:this.initialPlaceholderYear}));get defaultYears(){return f(this.#i)}set defaultYears(e){k(this.#i,e)}#o(){We(()=>{if(mr(()=>this.opts.initialFocus.current)){const n=this.opts.ref.current?.querySelector("[data-focused]");n&&n.focus()}})}#l(){We(()=>this.opts.ref.current?IY({calendarNode:this.opts.ref.current,label:this.fullCalendarLabel,accessibleHeadingId:this.accessibleHeadingId}):void 0)}#s(){rS(()=>{this.formatter.getLocale()!==this.opts.locale.current&&this.formatter.setLocale(this.opts.locale.current)})}nextPage(){DY({fixedWeeks:this.opts.fixedWeeks.current,locale:this.opts.locale.current,numberOfMonths:this.opts.numberOfMonths.current,pagedNavigation:this.opts.pagedNavigation.current,setMonths:this.setMonths,setPlaceholder:e=>this.opts.placeholder.current=e,weekStartsOn:this.opts.weekStartsOn.current,months:this.months})}prevPage(){MY({fixedWeeks:this.opts.fixedWeeks.current,locale:this.opts.locale.current,numberOfMonths:this.opts.numberOfMonths.current,pagedNavigation:this.opts.pagedNavigation.current,setMonths:this.setMonths,setPlaceholder:e=>this.opts.placeholder.current=e,weekStartsOn:this.opts.weekStartsOn.current,months:this.months})}nextYear(){this.opts.placeholder.current=this.opts.placeholder.current.add({years:1})}prevYear(){this.opts.placeholder.current=this.opts.placeholder.current.subtract({years:1})}setYear(e){this.opts.placeholder.current=this.opts.placeholder.current.set({year:e})}setMonth(e){this.opts.placeholder.current=this.opts.placeholder.current.set({month:e})}#a=A(()=>ZY({maxValue:this.opts.maxValue.current,months:this.months,disabled:this.opts.disabled.current}));get isNextButtonDisabled(){return f(this.#a)}set isNextButtonDisabled(e){k(this.#a,e)}#c=A(()=>NY({minValue:this.opts.minValue.current,months:this.months,disabled:this.opts.disabled.current}));get isPrevButtonDisabled(){return f(this.#c)}set isPrevButtonDisabled(e){k(this.#c,e)}#h=A(()=>{const e=this.opts.value.current,n=this.opts.isDateDisabled.current,r=this.opts.isDateUnavailable.current;if(Array.isArray(e)){if(!e.length)return!1;for(const i of e)if(n(i)||r(i))return!0}else{if(!e)return!1;if(n(e)||r(e))return!0}return!1});get isInvalid(){return f(this.#h)}set isInvalid(e){k(this.#h,e)}#u=A(()=>(this.opts.monthFormat.current,this.opts.yearFormat.current,VY({months:this.months,formatter:this.formatter,locale:this.opts.locale.current})));get headingValue(){return f(this.#u)}set headingValue(e){k(this.#u,e)}#f=A(()=>`${this.opts.calendarLabel.current} ${this.headingValue}`);get fullCalendarLabel(){return f(this.#f)}set fullCalendarLabel(e){k(this.#f,e)}isOutsideVisibleMonths(e){return!this.visibleMonths.some(n=>Vv(e,n))}isDateDisabled(e){if(this.opts.isDateDisabled.current(e)||this.opts.disabled.current)return!0;const n=this.opts.minValue.current,r=this.opts.maxValue.current;return!!(n&&Do(e,n)||r&&Do(r,e))}isDateSelected(e){const n=this.opts.value.current;return Array.isArray(n)?n.some(r=>hs(r,e)):n?hs(n,e):!1}shiftFocus(e,n){return AY({node:e,add:n,placeholder:this.opts.placeholder,calendarNode:this.opts.ref.current,isPrevButtonDisabled:this.isPrevButtonDisabled,isNextButtonDisabled:this.isNextButtonDisabled,months:this.months,numberOfMonths:this.opts.numberOfMonths.current})}#m(e){if(this.opts.type.current!=="multiple"||!this.opts.maxDays.current)return!0;const n=e.length;return!(this.opts.maxDays.current&&n>this.opts.maxDays.current)}handleCellClick(e,n){if(this.opts.readonly.current||this.opts.isDateDisabled.current?.(n)||this.opts.isDateUnavailable.current?.(n))return;const r=this.opts.value.current;if(this.opts.type.current==="multiple")(Array.isArray(r)||r===void 0)&&(this.opts.value.current=this.handleMultipleUpdate(r,n));else if(!Array.isArray(r)){const s=this.handleSingleUpdate(r,n);s?this.announcer.announce(`Selected Date: ${this.formatter.selectedDate(s,!1)}`,"polite"):this.announcer.announce("Selected date is now empty.","polite",5e3),this.opts.value.current=WY(s,r),s!==void 0&&this.opts.onDateSelect?.current?.()}}handleMultipleUpdate(e,n){if(!e){const s=[n];return this.#m(s)?s:[n]}if(!Array.isArray(e))return;const r=e.findIndex(s=>hs(s,n)),i=this.opts.preventDeselect.current;if(r===-1){const s=[...e,n];return this.#m(s)?s:[n]}else{if(i)return e;{const s=e.filter(o=>!hs(o,n));if(!s.length){this.opts.placeholder.current=n;return}return s}}}handleSingleUpdate(e,n){if(!e)return n;if(!this.opts.preventDeselect.current&&hs(e,n)){this.opts.placeholder.current=n;return}return n}onkeydown(e){EY({event:e,handleCellClick:this.handleCellClick,shiftFocus:this.shiftFocus,placeholderValue:this.opts.placeholder.current})}#d=A(()=>({months:this.months,weekdays:this.weekdays}));get snippetProps(){return f(this.#d)}set snippetProps(e){k(this.#d,e)}getBitsAttr=e=>YY.getAttr(e);#g=A(()=>({...FY({fullCalendarLabel:this.fullCalendarLabel,id:this.opts.id.current,isInvalid:this.isInvalid,disabled:this.opts.disabled.current,readonly:this.opts.readonly.current}),[this.getBitsAttr("root")]:"",onkeydown:this.onkeydown,...this.attachment}));get props(){return f(this.#g)}set props(e){k(this.#g,e)}}class Kv{static create(e){return new Kv(e,Jr.get())}opts;root;attachment;constructor(e,n){this.opts=e,this.root=n,this.attachment=Ut(this.opts.ref)}#e=A(()=>({id:this.opts.id.current,"aria-hidden":Ev(!0),"data-disabled":Mt(this.root.opts.disabled.current),"data-readonly":Mt(this.root.opts.readonly.current),[this.root.getBitsAttr("heading")]:"",...this.attachment}));get props(){return f(this.#e)}set props(e){k(this.#e,e)}}const uT=new ts("Calendar.Cell | RangeCalendar.Cell");class Jv{static create(e){return uT.set(new Jv(e,Jr.get()))}opts;root;#e=A(()=>Kn(this.opts.date.current));get cellDate(){return f(this.#e)}set cellDate(e){k(this.#e,e)}#t=A(()=>this.root.opts.isDateUnavailable.current(this.opts.date.current));get isUnavailable(){return f(this.#t)}set isUnavailable(e){k(this.#t,e)}#n=A(()=>vW(this.opts.date.current,ps()));get isDateToday(){return f(this.#n)}set isDateToday(e){k(this.#n,e)}#r=A(()=>!Vv(this.opts.date.current,this.opts.month.current));get isOutsideMonth(){return f(this.#r)}set isOutsideMonth(e){k(this.#r,e)}#i=A(()=>this.root.isOutsideVisibleMonths(this.opts.date.current));get isOutsideVisibleMonths(){return f(this.#i)}set isOutsideVisibleMonths(e){k(this.#i,e)}#o=A(()=>this.root.isDateDisabled(this.opts.date.current)||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current);get isDisabled(){return f(this.#o)}set isDisabled(e){k(this.#o,e)}#l=A(()=>hs(this.opts.date.current,this.root.opts.placeholder.current));get isFocusedDate(){return f(this.#l)}set isFocusedDate(e){k(this.#l,e)}#s=A(()=>this.root.isDateSelected(this.opts.date.current));get isSelectedDate(){return f(this.#s)}set isSelectedDate(e){k(this.#s,e)}#a=A(()=>this.root.formatter.custom(this.cellDate,{weekday:"long",month:"long",day:"numeric",year:"numeric"}));get labelText(){return f(this.#a)}set labelText(e){k(this.#a,e)}attachment;constructor(e,n){this.opts=e,this.root=n,this.attachment=Ut(this.opts.ref)}#c=A(()=>({disabled:this.isDisabled,unavailable:this.isUnavailable,selected:this.isSelectedDate,day:`${this.opts.date.current.day}`}));get snippetProps(){return f(this.#c)}set snippetProps(e){k(this.#c,e)}#h=A(()=>this.isDisabled||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current||this.isUnavailable);get ariaDisabled(){return f(this.#h)}set ariaDisabled(e){k(this.#h,e)}#u=A(()=>({"data-unavailable":Mt(this.isUnavailable),"data-today":this.isDateToday?"":void 0,"data-outside-month":this.isOutsideMonth?"":void 0,"data-outside-visible-months":this.isOutsideVisibleMonths?"":void 0,"data-focused":this.isFocusedDate?"":void 0,"data-selected":Mt(this.isSelectedDate),"data-value":this.opts.date.current.toString(),"data-type":tY(this.opts.date.current),"data-disabled":Mt(this.isDisabled||this.isOutsideMonth&&this.root.opts.disableDaysOutsideMonth.current)}));get sharedDataAttrs(){return f(this.#u)}set sharedDataAttrs(e){k(this.#u,e)}#f=A(()=>({id:this.opts.id.current,role:"gridcell","aria-selected":Wr(this.isSelectedDate),"aria-disabled":Wr(this.ariaDisabled),...this.sharedDataAttrs,[this.root.getBitsAttr("cell")]:"",...this.attachment}));get props(){return f(this.#f)}set props(e){k(this.#f,e)}}class e0{static create(e){return new e0(e,uT.get())}opts;cell;attachment;constructor(e,n){this.opts=e,this.cell=n,this.onclick=this.onclick.bind(this),this.attachment=Ut(this.opts.ref)}#e=A(()=>this.cell.isOutsideMonth&&this.cell.root.opts.disableDaysOutsideMonth.current||this.cell.isDisabled?void 0:this.cell.isFocusedDate?0:-1);onclick(e){this.cell.isDisabled||this.cell.root.handleCellClick(e,this.cell.opts.date.current)}#t=A(()=>({disabled:this.cell.isDisabled,unavailable:this.cell.isUnavailable,selected:this.cell.isSelectedDate,day:`${this.cell.opts.date.current.day}`}));get snippetProps(){return f(this.#t)}set snippetProps(e){k(this.#t,e)}#n=A(()=>({id:this.opts.id.current,role:"button","aria-label":this.cell.labelText,"aria-disabled":Wr(this.cell.ariaDisabled),...this.cell.sharedDataAttrs,tabindex:f(this.#e),[this.cell.root.getBitsAttr("day")]:"","data-bits-day":"",onclick:this.onclick,...this.attachment}));get props(){return f(this.#n)}set props(e){k(this.#n,e)}}class t0{static create(e){return new t0(e,Jr.get())}opts;root;#e=A(()=>this.root.isNextButtonDisabled);get isDisabled(){return f(this.#e)}set isDisabled(e){k(this.#e,e)}attachment;constructor(e,n){this.opts=e,this.root=n,this.onclick=this.onclick.bind(this),this.attachment=Ut(this.opts.ref)}onclick(e){this.isDisabled||this.root.nextPage()}#t=A(()=>({id:this.opts.id.current,role:"button",type:"button","aria-label":"Next","aria-disabled":Wr(this.isDisabled),"data-disabled":Mt(this.isDisabled),disabled:this.isDisabled,[this.root.getBitsAttr("next-button")]:"",onclick:this.onclick,...this.attachment}));get props(){return f(this.#t)}set props(e){k(this.#t,e)}}class n0{static create(e){return new n0(e,Jr.get())}opts;root;#e=A(()=>this.root.isPrevButtonDisabled);get isDisabled(){return f(this.#e)}set isDisabled(e){k(this.#e,e)}attachment;constructor(e,n){this.opts=e,this.root=n,this.onclick=this.onclick.bind(this),this.attachment=Ut(this.opts.ref)}onclick(e){this.isDisabled||this.root.prevPage()}#t=A(()=>({id:this.opts.id.current,role:"button",type:"button","aria-label":"Previous","aria-disabled":Wr(this.isDisabled),"data-disabled":Mt(this.isDisabled),disabled:this.isDisabled,[this.root.getBitsAttr("prev-button")]:"",onclick:this.onclick,...this.attachment}));get props(){return f(this.#t)}set props(e){k(this.#t,e)}}class r0{static create(e){return new r0(e,Jr.get())}opts;root;attachment;constructor(e,n){this.opts=e,this.root=n,this.attachment=Ut(this.opts.ref)}#e=A(()=>({id:this.opts.id.current,tabindex:-1,role:"grid","aria-readonly":Wr(this.root.opts.readonly.current),"aria-disabled":Wr(this.root.opts.disabled.current),"data-readonly":Mt(this.root.opts.readonly.current),"data-disabled":Mt(this.root.opts.disabled.current),[this.root.getBitsAttr("grid")]:"",...this.attachment}));get props(){return f(this.#e)}set props(e){k(this.#e,e)}}class i0{static create(e){return new i0(e,Jr.get())}opts;root;attachment;constructor(e,n){this.opts=e,this.root=n,this.attachment=Ut(this.opts.ref)}#e=A(()=>({id:this.opts.id.current,"data-disabled":Mt(this.root.opts.disabled.current),"data-readonly":Mt(this.root.opts.readonly.current),[this.root.getBitsAttr("grid-body")]:"",...this.attachment}));get props(){return f(this.#e)}set props(e){k(this.#e,e)}}class s0{static create(e){return new s0(e,Jr.get())}opts;root;attachment;constructor(e,n){this.opts=e,this.root=n,this.attachment=Ut(this.opts.ref)}#e=A(()=>({id:this.opts.id.current,"data-disabled":Mt(this.root.opts.disabled.current),"data-readonly":Mt(this.root.opts.readonly.current),[this.root.getBitsAttr("grid-head")]:"",...this.attachment}));get props(){return f(this.#e)}set props(e){k(this.#e,e)}}class o0{static create(e){return new o0(e,Jr.get())}opts;root;attachment;constructor(e,n){this.opts=e,this.root=n,this.attachment=Ut(this.opts.ref)}#e=A(()=>({id:this.opts.id.current,"data-disabled":Mt(this.root.opts.disabled.current),"data-readonly":Mt(this.root.opts.readonly.current),[this.root.getBitsAttr("grid-row")]:"",...this.attachment}));get props(){return f(this.#e)}set props(e){k(this.#e,e)}}class a0{static create(e){return new a0(e,Jr.get())}opts;root;attachment;constructor(e,n){this.opts=e,this.root=n,this.attachment=Ut(this.opts.ref)}#e=A(()=>({id:this.opts.id.current,"data-disabled":Mt(this.root.opts.disabled.current),"data-readonly":Mt(this.root.opts.readonly.current),[this.root.getBitsAttr("head-cell")]:"",...this.attachment}));get props(){return f(this.#e)}set props(e){k(this.#e,e)}}class l0{static create(e){return new l0(e,Jr.get())}opts;root;attachment;constructor(e,n){this.opts=e,this.root=n,this.attachment=Ut(this.opts.ref)}#e=A(()=>({id:this.opts.id.current,"data-disabled":Mt(this.root.opts.disabled.current),"data-readonly":Mt(this.root.opts.readonly.current),[this.root.getBitsAttr("header")]:"",...this.attachment}));get props(){return f(this.#e)}set props(e){k(this.#e,e)}}var qY=P("
");function $Y(t,e){const n=_n();Me(e,!0);let r=ee(e,"ref",15,null),i=ee(e,"id",19,()=>Xn(n)),s=Tt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const o=e0.create({id:be(()=>i()),ref:be(()=>r(),d=>r(d))}),a=A(()=>Bt(s,o.props));var l=_e(),c=me(l);{var u=d=>{var m=_e(),g=me(m);{let p=A(()=>({props:f(a),...o.snippetProps}));nt(g,()=>e.child,()=>f(p))}y(d,m)},h=d=>{var m=qY();Qt(m,()=>({...f(a)}));var g=x(m);{var p=v=>{var w=_e(),_=me(w);nt(_,()=>e.children??xt,()=>o.snippetProps),y(v,w)},O=v=>{var w=vs();B(()=>$(w,o.cell.opts.date.current.day)),y(v,w)};Z(g,v=>{e.children?v(p):v(O,-1)})}b(m),y(d,m)};Z(c,d=>{e.child?d(u):d(h,-1)})}y(t,l),Re()}var GY=P("
");function HY(t,e){const n=_n();Me(e,!0);let r=ee(e,"ref",15,null),i=ee(e,"id",19,()=>Xn(n)),s=Tt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const o=r0.create({id:be(()=>i()),ref:be(()=>r(),d=>r(d))}),a=A(()=>Bt(s,o.props));var l=_e(),c=me(l);{var u=d=>{var m=_e(),g=me(m);nt(g,()=>e.child,()=>({props:f(a)})),y(d,m)},h=d=>{var m=GY();Qt(m,()=>({...f(a)}));var g=x(m);nt(g,()=>e.children??xt),b(m),y(d,m)};Z(c,d=>{e.child?d(u):d(h,-1)})}y(t,l),Re()}var KY=P("");function JY(t,e){const n=_n();Me(e,!0);let r=ee(e,"ref",15,null),i=ee(e,"id",19,()=>Xn(n)),s=Tt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const o=i0.create({id:be(()=>i()),ref:be(()=>r(),d=>r(d))}),a=A(()=>Bt(s,o.props));var l=_e(),c=me(l);{var u=d=>{var m=_e(),g=me(m);nt(g,()=>e.child,()=>({props:f(a)})),y(d,m)},h=d=>{var m=KY();Qt(m,()=>({...f(a)}));var g=x(m);nt(g,()=>e.children??xt),b(m),y(d,m)};Z(c,d=>{e.child?d(u):d(h,-1)})}y(t,l),Re()}var eU=P("");function tU(t,e){const n=_n();Me(e,!0);let r=ee(e,"ref",15,null),i=ee(e,"id",19,()=>Xn(n)),s=Tt(e,["$$slots","$$events","$$legacy","children","child","ref","id","date","month"]);const o=Jv.create({id:be(()=>i()),ref:be(()=>r(),d=>r(d)),date:be(()=>e.date),month:be(()=>e.month)}),a=A(()=>Bt(s,o.props));var l=_e(),c=me(l);{var u=d=>{var m=_e(),g=me(m);{let p=A(()=>({props:f(a),...o.snippetProps}));nt(g,()=>e.child,()=>f(p))}y(d,m)},h=d=>{var m=eU();Qt(m,()=>({...f(a)}));var g=x(m);nt(g,()=>e.children??xt,()=>o.snippetProps),b(m),y(d,m)};Z(c,d=>{e.child?d(u):d(h,-1)})}y(t,l),Re()}var nU=P("");function rU(t,e){const n=_n();Me(e,!0);let r=ee(e,"ref",15,null),i=ee(e,"id",19,()=>Xn(n)),s=Tt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const o=s0.create({id:be(()=>i()),ref:be(()=>r(),d=>r(d))}),a=A(()=>Bt(s,o.props));var l=_e(),c=me(l);{var u=d=>{var m=_e(),g=me(m);nt(g,()=>e.child,()=>({props:f(a)})),y(d,m)},h=d=>{var m=nU();Qt(m,()=>({...f(a)}));var g=x(m);nt(g,()=>e.children??xt),b(m),y(d,m)};Z(c,d=>{e.child?d(u):d(h,-1)})}y(t,l),Re()}var iU=P("");function sU(t,e){const n=_n();Me(e,!0);let r=ee(e,"ref",15,null),i=ee(e,"id",19,()=>Xn(n)),s=Tt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const o=a0.create({id:be(()=>i()),ref:be(()=>r(),d=>r(d))}),a=A(()=>Bt(s,o.props));var l=_e(),c=me(l);{var u=d=>{var m=_e(),g=me(m);nt(g,()=>e.child,()=>({props:f(a)})),y(d,m)},h=d=>{var m=iU();Qt(m,()=>({...f(a)}));var g=x(m);nt(g,()=>e.children??xt),b(m),y(d,m)};Z(c,d=>{e.child?d(u):d(h,-1)})}y(t,l),Re()}var oU=P("");function Mx(t,e){const n=_n();Me(e,!0);let r=ee(e,"ref",15,null),i=ee(e,"id",19,()=>Xn(n)),s=Tt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const o=o0.create({id:be(()=>i()),ref:be(()=>r(),d=>r(d))}),a=A(()=>Bt(s,o.props));var l=_e(),c=me(l);{var u=d=>{var m=_e(),g=me(m);nt(g,()=>e.child,()=>({props:f(a)})),y(d,m)},h=d=>{var m=oU();Qt(m,()=>({...f(a)}));var g=x(m);nt(g,()=>e.children??xt),b(m),y(d,m)};Z(c,d=>{e.child?d(u):d(h,-1)})}y(t,l),Re()}var aU=P("
");function lU(t,e){const n=_n();Me(e,!0);let r=ee(e,"ref",15,null),i=ee(e,"id",19,()=>Xn(n)),s=Tt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const o=l0.create({id:be(()=>i()),ref:be(()=>r(),d=>r(d))}),a=A(()=>Bt(s,o.props));var l=_e(),c=me(l);{var u=d=>{var m=_e(),g=me(m);nt(g,()=>e.child,()=>({props:f(a)})),y(d,m)},h=d=>{var m=aU();Qt(m,()=>({...f(a)}));var g=x(m);nt(g,()=>e.children??xt),b(m),y(d,m)};Z(c,d=>{e.child?d(u):d(h,-1)})}y(t,l),Re()}var cU=P("
");function uU(t,e){const n=_n();Me(e,!0);let r=ee(e,"ref",15,null),i=ee(e,"id",19,()=>Xn(n)),s=Tt(e,["$$slots","$$events","$$legacy","children","child","ref","id"]);const o=Kv.create({id:be(()=>i()),ref:be(()=>r(),d=>r(d))}),a=A(()=>Bt(s,o.props));var l=_e(),c=me(l);{var u=d=>{var m=_e(),g=me(m);nt(g,()=>e.child,()=>({props:f(a),headingValue:o.root.headingValue})),y(d,m)},h=d=>{var m=cU();Qt(m,()=>({...f(a)}));var g=x(m);{var p=v=>{var w=_e(),_=me(w);nt(_,()=>e.children??xt,()=>({headingValue:o.root.headingValue})),y(v,w)},O=v=>{var w=vs();B(()=>$(w,o.root.headingValue)),y(v,w)};Z(g,v=>{e.children?v(p):v(O,-1)})}b(m),y(d,m)};Z(c,d=>{e.child?d(u):d(h,-1)})}y(t,l),Re()}var hU=P("");function dU(t,e){const n=_n();Me(e,!0);let r=ee(e,"id",19,()=>Xn(n)),i=ee(e,"ref",15,null),s=ee(e,"tabindex",3,0),o=Tt(e,["$$slots","$$events","$$legacy","children","child","id","ref","tabindex"]);const a=t0.create({id:be(()=>r()),ref:be(()=>i(),m=>i(m))}),l=A(()=>Bt(o,a.props,{tabindex:s()}));var c=_e(),u=me(c);{var h=m=>{var g=_e(),p=me(g);nt(p,()=>e.child,()=>({props:f(l)})),y(m,g)},d=m=>{var g=hU();Qt(g,()=>({...f(l)}));var p=x(g);nt(p,()=>e.children??xt),b(g),y(m,g)};Z(u,m=>{e.child?m(h):m(d,-1)})}y(t,c),Re()}var fU=P("");function mU(t,e){const n=_n();Me(e,!0);let r=ee(e,"id",19,()=>Xn(n)),i=ee(e,"ref",15,null),s=ee(e,"tabindex",3,0),o=Tt(e,["$$slots","$$events","$$legacy","children","child","id","ref","tabindex"]);const a=n0.create({id:be(()=>r()),ref:be(()=>i(),m=>i(m))}),l=A(()=>Bt(o,a.props,{tabindex:s()}));var c=_e(),u=me(c);{var h=m=>{var g=_e(),p=me(g);nt(p,()=>e.child,()=>({props:f(l)})),y(m,g)},d=m=>{var g=fU();Qt(g,()=>({...f(l)}));var p=x(g);nt(p,()=>e.children??xt),b(g),y(m,g)};Z(u,m=>{e.child?m(h):m(d,-1)})}y(t,c),Re()}var gU=P(""),pU=P("");function OU(t,e){Me(e,!0);let n=ee(e,"value",15),r=Tt(e,["$$slots","$$events","$$legacy","value"]);const i=A(()=>Bt(r,{"aria-hidden":"true",tabindex:-1,style:vC}));var s=_e(),o=me(s);{var a=c=>{var u=gU();Qt(u,()=>({...f(i),value:n()}),void 0,void 0,void 0,void 0,!0),y(c,u)},l=c=>{var u=pU();Qt(u,()=>({...f(i)}),void 0,void 0,void 0,void 0,!0),Vp(u,n),y(c,u)};Z(o,c=>{f(i).type==="checkbox"?c(a):c(l,-1)})}y(t,s),Re()}const vU=["top","right","bottom","left"],Xs=Math.min,fr=Math.max,Jh=Math.round,Qu=Math.floor,ki=t=>({x:t,y:t}),bU={left:"right",right:"left",bottom:"top",top:"bottom"};function Ep(t,e,n){return fr(t,Xs(e,n))}function Hi(t,e){return typeof t=="function"?t(e):t}function Ki(t){return t.split("-")[0]}function Wa(t){return t.split("-")[1]}function c0(t){return t==="x"?"y":"x"}function u0(t){return t==="y"?"height":"width"}function bi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function h0(t){return c0(bi(t))}function yU(t,e,n){n===void 0&&(n=!1);const r=Wa(t),i=h0(t),s=u0(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=ed(o)),[o,ed(o)]}function xU(t){const e=ed(t);return[Dp(t),e,Dp(e)]}function Dp(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Rx=["left","right"],Lx=["right","left"],SU=["top","bottom"],wU=["bottom","top"];function kU(t,e,n){switch(t){case"top":case"bottom":return n?e?Lx:Rx:e?Rx:Lx;case"left":case"right":return e?SU:wU;default:return[]}}function _U(t,e,n,r){const i=Wa(t);let s=kU(Ki(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Dp)))),s}function ed(t){const e=Ki(t);return bU[e]+t.slice(e.length)}function PU(t){return{top:0,right:0,bottom:0,left:0,...t}}function hT(t){return typeof t!="number"?PU(t):{top:t,right:t,bottom:t,left:t}}function td(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Ix(t,e,n){let{reference:r,floating:i}=t;const s=bi(e),o=h0(e),a=u0(o),l=Ki(e),c=s==="y",u=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:u,y:r.y-i.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-i.width,y:h};break;default:m={x:r.x,y:r.y}}switch(Wa(e)){case"start":m[o]-=d*(n&&c?-1:1);break;case"end":m[o]+=d*(n&&c?-1:1);break}return m}async function QU(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:m=0}=Hi(e,t),g=hT(m),O=a[d?h==="floating"?"reference":"floating":h],v=td(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(O)))==null||n?O:O.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=h==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(_))?await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1}:{x:1,y:1},T=td(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:_,strategy:l}):w);return{top:(v.top-T.top+g.top)/C.y,bottom:(T.bottom-v.bottom+g.bottom)/C.y,left:(v.left-T.left+g.left)/C.x,right:(T.right-v.right+g.right)/C.x}}const CU=50,TU=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:QU},l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:h}=Ix(c,r,l),d=r,m=0;const g={};for(let p=0;p({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=Hi(t,e)||{};if(c==null)return{};const h=hT(u),d={x:n,y:r},m=h0(i),g=u0(m),p=await o.getDimensions(c),O=m==="y",v=O?"top":"left",w=O?"bottom":"right",_=O?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[m]-d[m]-s.floating[g],T=d[m]-s.reference[m],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let Q=S?S[_]:0;(!Q||!await(o.isElement==null?void 0:o.isElement(S)))&&(Q=a.floating[_]||s.floating[g]);const D=C/2-T/2,I=Q/2-p[g]/2-1,X=Xs(h[v],I),L=Xs(h[w],I),R=X,F=Q-p[g]-L,U=Q/2-p[g]/2+D,j=Ep(R,U,F),Y=!l.arrow&&Wa(i)!=null&&U!==j&&s.reference[g]/2-(UU<=0)){var L,R;const U=(((L=s.flip)==null?void 0:L.index)||0)+1,j=Q[U];if(j&&(!(h==="alignment"?w!==bi(j):!1)||X.every(N=>bi(N.placement)===w?N.overflows[0]>0:!0)))return{data:{index:U,overflows:X},reset:{placement:j}};let Y=(R=X.filter(ie=>ie.overflows[0]<=0).sort((ie,N)=>ie.overflows[1]-N.overflows[1])[0])==null?void 0:R.placement;if(!Y)switch(m){case"bestFit":{var F;const ie=(F=X.filter(N=>{if(S){const z=bi(N.placement);return z===w||z==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(z=>z>0).reduce((z,he)=>z+he,0)]).sort((N,z)=>N[1]-z[1])[0])==null?void 0:F[0];ie&&(Y=ie);break}case"initialPlacement":Y=a;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};function Xx(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Zx(t){return vU.some(e=>t[e]>=0)}const DU=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...s}=Hi(t,e);switch(i){case"referenceHidden":{const o=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=Xx(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Zx(a)}}}case"escaped":{const o=await r.detectOverflow(e,{...s,altBoundary:!0}),a=Xx(o,n.floating);return{data:{escapedOffsets:a,escaped:Zx(a)}}}default:return{}}}}},dT=new Set(["left","top"]);async function MU(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ki(n),a=Wa(n),l=bi(n)==="y",c=dT.has(o)?-1:1,u=s&&l?-1:1,h=Hi(e,t);let{mainAxis:d,crossAxis:m,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),l?{x:m*u,y:d*c}:{x:d*c,y:m*u}}const RU=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await MU(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},LU=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:w,y:_}=v;return{x:w,y:_}}},...c}=Hi(t,e),u={x:n,y:r},h=await s.detectOverflow(e,c),d=bi(Ki(i)),m=c0(d);let g=u[m],p=u[d];if(o){const v=m==="y"?"top":"left",w=m==="y"?"bottom":"right",_=g+h[v],C=g-h[w];g=Ep(_,g,C)}if(a){const v=d==="y"?"top":"left",w=d==="y"?"bottom":"right",_=p+h[v],C=p-h[w];p=Ep(_,p,C)}const O=l.fn({...e,[m]:g,[d]:p});return{...O,data:{x:O.x-n,y:O.y-r,enabled:{[m]:o,[d]:a}}}}}},IU=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Hi(t,e),u={x:n,y:r},h=bi(i),d=c0(h);let m=u[d],g=u[h];const p=Hi(a,e),O=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const _=d==="y"?"height":"width",C=s.reference[d]-s.floating[_]+O.mainAxis,T=s.reference[d]+s.reference[_]-O.mainAxis;mT&&(m=T)}if(c){var v,w;const _=d==="y"?"width":"height",C=dT.has(Ki(i)),T=s.reference[h]-s.floating[_]+(C&&((v=o.offset)==null?void 0:v[h])||0)+(C?0:O.crossAxis),S=s.reference[h]+s.reference[_]+(C?0:((w=o.offset)==null?void 0:w[h])||0)-(C?O.crossAxis:0);gS&&(g=S)}return{[d]:m,[h]:g}}}},XU=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...c}=Hi(t,e),u=await o.detectOverflow(e,c),h=Ki(i),d=Wa(i),m=bi(i)==="y",{width:g,height:p}=s.floating;let O,v;h==="top"||h==="bottom"?(O=h,v=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(v=h,O=d==="end"?"top":"bottom");const w=p-u.top-u.bottom,_=g-u.left-u.right,C=Xs(p-u[O],w),T=Xs(g-u[v],_),S=!e.middlewareData.shift;let Q=C,D=T;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(D=_),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(Q=w),S&&!d){const X=fr(u.left,0),L=fr(u.right,0),R=fr(u.top,0),F=fr(u.bottom,0);m?D=g-2*(X!==0||L!==0?X+L:fr(u.left,u.right)):Q=p-2*(R!==0||F!==0?R+F:fr(u.top,u.bottom))}await l({...e,availableWidth:D,availableHeight:Q});const I=await o.getDimensions(a.floating);return g!==I.width||p!==I.height?{reset:{rects:!0}}:{}}}};function hf(){return typeof window<"u"}function Ya(t){return fT(t)?(t.nodeName||"").toLowerCase():"#document"}function vr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Di(t){var e;return(e=(fT(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fT(t){return hf()?t instanceof Node||t instanceof vr(t).Node:!1}function Ur(t){return hf()?t instanceof Element||t instanceof vr(t).Element:!1}function rs(t){return hf()?t instanceof HTMLElement||t instanceof vr(t).HTMLElement:!1}function Nx(t){return!hf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof vr(t).ShadowRoot}function qc(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=qr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function ZU(t){return/^(table|td|th)$/.test(Ya(t))}function df(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const NU=/transform|translate|scale|rotate|perspective|filter/,VU=/paint|layout|strict|content/,Gs=t=>!!t&&t!=="none";let Lm;function d0(t){const e=Ur(t)?qr(t):t;return Gs(e.transform)||Gs(e.translate)||Gs(e.scale)||Gs(e.rotate)||Gs(e.perspective)||!f0()&&(Gs(e.backdropFilter)||Gs(e.filter))||NU.test(e.willChange||"")||VU.test(e.contain||"")}function FU(t){let e=Zs(t);for(;rs(e)&&!Ra(e);){if(d0(e))return e;if(df(e))return null;e=Zs(e)}return null}function f0(){return Lm==null&&(Lm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Lm}function Ra(t){return/^(html|body|#document)$/.test(Ya(t))}function qr(t){return vr(t).getComputedStyle(t)}function ff(t){return Ur(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Zs(t){if(Ya(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Nx(t)&&t.host||Di(t);return Nx(e)?e.host:e}function mT(t){const e=Zs(t);return Ra(e)?t.ownerDocument?t.ownerDocument.body:t.body:rs(e)&&qc(e)?e:mT(e)}function xc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=mT(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=vr(i);if(s){const a=Mp(o);return e.concat(o,o.visualViewport||[],qc(i)?i:[],a&&n?xc(a):[])}else return e.concat(i,xc(i,[],n))}function Mp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function gT(t){const e=qr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=rs(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=Jh(n)!==s||Jh(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function m0(t){return Ur(t)?t:t.contextElement}function ha(t){const e=m0(t);if(!rs(e))return ki(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=gT(e);let o=(s?Jh(n.width):n.width)/r,a=(s?Jh(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const jU=ki(0);function pT(t){const e=vr(t);return!f0()||!e.visualViewport?jU:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function BU(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==vr(t)?!1:e}function Mo(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=m0(t);let o=ki(1);e&&(r?Ur(r)&&(o=ha(r)):o=ha(t));const a=BU(s,n,r)?pT(s):ki(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,h=i.height/o.y;if(s){const d=vr(s),m=r&&Ur(r)?vr(r):r;let g=d,p=Mp(g);for(;p&&r&&m!==g;){const O=ha(p),v=p.getBoundingClientRect(),w=qr(p),_=v.left+(p.clientLeft+parseFloat(w.paddingLeft))*O.x,C=v.top+(p.clientTop+parseFloat(w.paddingTop))*O.y;l*=O.x,c*=O.y,u*=O.x,h*=O.y,l+=_,c+=C,g=vr(p),p=Mp(g)}}return td({width:u,height:h,x:l,y:c})}function mf(t,e){const n=ff(t).scrollLeft;return e?e.left+n:Mo(Di(t)).left+n}function OT(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-mf(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function zU(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Di(r),a=e?df(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=ki(1);const u=ki(0),h=rs(r);if((h||!h&&!s)&&((Ya(r)!=="body"||qc(o))&&(l=ff(r)),h)){const m=Mo(r);c=ha(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}const d=o&&!h&&!s?OT(o,l):ki(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function WU(t){return Array.from(t.getClientRects())}function YU(t){const e=Di(t),n=ff(t),r=t.ownerDocument.body,i=fr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=fr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+mf(t);const a=-n.scrollTop;return qr(r).direction==="rtl"&&(o+=fr(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const Vx=25;function UU(t,e){const n=vr(t),r=Di(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=f0();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=mf(r);if(c<=0){const u=r.ownerDocument,h=u.body,d=getComputedStyle(h),m=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(r.clientWidth-h.clientWidth-m);g<=Vx&&(s-=g)}else c<=Vx&&(s+=c);return{width:s,height:o,x:a,y:l}}function qU(t,e){const n=Mo(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=rs(t)?ha(t):ki(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function Fx(t,e,n){let r;if(e==="viewport")r=UU(t,n);else if(e==="document")r=YU(Di(t));else if(Ur(e))r=qU(e,n);else{const i=pT(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return td(r)}function vT(t,e){const n=Zs(t);return n===e||!Ur(n)||Ra(n)?!1:qr(n).position==="fixed"||vT(n,e)}function $U(t,e){const n=e.get(t);if(n)return n;let r=xc(t,[],!1).filter(a=>Ur(a)&&Ya(a)!=="body"),i=null;const s=qr(t).position==="fixed";let o=s?Zs(t):t;for(;Ur(o)&&!Ra(o);){const a=qr(o),l=d0(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||qc(o)&&!l&&vT(t,o))?r=r.filter(u=>u!==o):i=a,o=Zs(o)}return e.set(t,r),r}function GU(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?df(e)?[]:$U(e,this._c):[].concat(n),r],a=Fx(e,o[0],i);let l=a.top,c=a.right,u=a.bottom,h=a.left;for(let d=1;d{o(!1,1e-7)},1e3)}Q===1&&!yT(c,t.getBoundingClientRect())&&o(),C=!1}try{n=new IntersectionObserver(T,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,_)}n.observe(t)}return o(!0),s}function rq(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=m0(t),u=i||s?[...c?xc(c):[],...e?xc(e):[]]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const h=c&&a?nq(c,n):null;let d=-1,m=null;o&&(m=new ResizeObserver(v=>{let[w]=v;w&&w.target===c&&m&&e&&(m.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(e)})),n()}),c&&!l&&m.observe(c),e&&m.observe(e));let g,p=l?Mo(t):null;l&&O();function O(){const v=Mo(t);p&&!yT(p,v)&&n(),p=v,g=requestAnimationFrame(O)}return n(),()=>{var v;u.forEach(w=>{i&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),h?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(g)}}const iq=RU,sq=LU,oq=EU,aq=XU,lq=DU,cq=AU,uq=IU,hq=(t,e,n)=>{const r=new Map,i={platform:tq,...n},s={...i.platform,_c:r};return TU(t,e,{...i,platform:s})};function Hs(t){return typeof t=="function"?t():t}function xT(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Bx(t,e){const n=xT(t);return Math.round(e*n)/n}function zx(t){return{[`--bits-${t}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${t}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${t}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${t}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${t}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function dq(t){const e=t.whileElementsMounted,n=A(()=>Hs(t.open)??!0),r=A(()=>Hs(t.middleware)),i=A(()=>Hs(t.transform)??!0),s=A(()=>Hs(t.placement)??"bottom"),o=A(()=>Hs(t.strategy)??"absolute"),a=A(()=>Hs(t.sideOffset)??0),l=A(()=>Hs(t.alignOffset)??0),c=t.reference;let u=ge(0),h=ge(0);const d=Vr(null);let m=ge(Pt(f(o))),g=ge(Pt(f(s))),p=ge(Pt({})),O=ge(!1),v=!1;const w=A(()=>{const I=d.current?Bx(d.current,f(u)):f(u),X=d.current?Bx(d.current,f(h)):f(h);return f(i)?{position:f(m),left:"0",top:"0",transform:`translate(${I}px, ${X}px)`,...d.current&&xT(d.current)>=1.5&&{willChange:"transform"}}:{position:f(m),left:`${I}px`,top:`${X}px`}});let _;function C(){c.current===null||d.current===null||hq(c.current,d.current,{middleware:f(r),placement:f(s),strategy:f(o)}).then(I=>{const X=c.current;if(fq(X)){k(p,{...f(p),hide:{...f(p).hide,referenceHidden:!0}},!0);return}if(!f(n)&&f(u)!==0&&f(h)!==0){const R=Math.max(Math.abs(f(a)),Math.abs(f(l)),15);if(I.x<=R&&I.y<=R)return}k(u,I.x,!0),k(h,I.y,!0),k(m,I.strategy,!0),k(g,I.placement,!0),k(p,I.middlewareData,!0),k(O,!0)})}function T(){typeof _=="function"&&(_(),_=void 0)}function S(){if(T(),e===void 0){C();return}f(n)&&(c.current===null||d.current===null||(_=e(c.current,d.current,C)))}function Q(){!f(n)&&d.current===null&&k(O,!1)}function D(){return[f(r),f(s),f(o),f(a),f(l),f(n)]}return We(()=>{e===void 0&&f(n)&&C()}),We(S),We(()=>{if(e!==void 0){if(D(),!f(n)){v=!1;return}if(!f(O)){v=!1;return}if(!v){v=!0;return}C()}}),We(Q),We(()=>T),{floating:d,reference:c,get strategy(){return f(m)},get placement(){return f(g)},get middlewareData(){return f(p)},get isPositioned(){return f(O)},get floatingStyles(){return f(w)},get update(){return C}}}function fq(t){return t instanceof Element?!t.isConnected||t instanceof HTMLElement&&t.hidden?!0:t.getClientRects().length===0:!1}const mq={top:"bottom",right:"left",bottom:"top",left:"right"},g0=new ts("Floating.Root"),Wx=new ts("Floating.Content"),p0=new ts("Floating.Root");class nd{static create(e=!1){return e?p0.set(new nd):g0.set(new nd)}anchorNode=Vr(null);customAnchorNode=Vr(null);triggerNode=Vr(null);constructor(){We(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class rd{static create(e,n=!1){return n?Wx.set(new rd(e,p0.get())):Wx.set(new rd(e,g0.get()))}opts;root;contentRef=Vr(null);wrapperRef=Vr(null);arrowRef=Vr(null);contentAttachment=Ut(this.contentRef);wrapperAttachment=Ut(this.wrapperRef);arrowAttachment=Ut(this.arrowRef);arrowId=Vr(Bc());#e=A(()=>{if(typeof this.opts.style=="string")return Ol(this.opts.style);if(!this.opts.style)return{}});#t=void 0;#n=new hz(()=>this.arrowRef.current??void 0);#r=A(()=>this.#n?.width??0);#i=A(()=>this.#n?.height??0);#o=A(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#l=A(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=A(()=>f(this.#l).length>0);get hasExplicitBoundaries(){return f(this.#s)}set hasExplicitBoundaries(e){k(this.#s,e)}#a=A(()=>({padding:this.opts.collisionPadding.current,boundary:f(this.#l).filter(_z),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return f(this.#a)}set detectOverflowOptions(e){k(this.#a,e)}#c=ge(void 0);#h=ge(void 0);#u=ge(void 0);#f=ge(void 0);#m=A(()=>[iq({mainAxis:this.opts.sideOffset.current+f(this.#i),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&sq({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?uq():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&oq({...this.detectOverflowOptions}),aq({...this.detectOverflowOptions,apply:({rects:e,availableWidth:n,availableHeight:r})=>{const{width:i,height:s}=e.reference;k(this.#c,n,!0),k(this.#h,r,!0),k(this.#u,i,!0),k(this.#f,s,!0)}}),this.arrowRef.current&&cq({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),gq({arrowWidth:f(this.#r),arrowHeight:f(this.#i)}),this.opts.hideWhenDetached.current&&lq({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return f(this.#m)}set middleware(e){k(this.#m,e)}floating;#d=A(()=>pq(this.floating.placement));get placedSide(){return f(this.#d)}set placedSide(e){k(this.#d,e)}#g=A(()=>Oq(this.floating.placement));get placedAlign(){return f(this.#g)}set placedAlign(e){k(this.#g,e)}#p=A(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return f(this.#p)}set arrowX(e){k(this.#p,e)}#O=A(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return f(this.#O)}set arrowY(e){k(this.#O,e)}#v=A(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return f(this.#v)}set cannotCenterArrow(e){k(this.#v,e)}#b=ge();get contentZIndex(){return f(this.#b)}set contentZIndex(e){k(this.#b,e,!0)}#y=A(()=>mq[this.placedSide]);get arrowBaseSide(){return f(this.#y)}set arrowBaseSide(e){k(this.#y,e)}#x=A(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${f(this.#c)}px`,"--bits-floating-available-height":`${f(this.#h)}px`,"--bits-floating-anchor-width":`${f(this.#u)}px`,"--bits-floating-anchor-height":`${f(this.#f)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...f(this.#e)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return f(this.#x)}set wrapperProps(e){k(this.#x,e)}#S=A(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:Vc({...f(this.#e)}),...this.contentAttachment}));get props(){return f(this.#S)}set props(e){k(this.#S,e)}#w=A(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return f(this.#w)}set arrowStyle(e){k(this.#w,e)}constructor(e,n){this.opts=e,this.root=n,this.#t=e.updatePositionStrategy,e.customAnchor&&(this.root.customAnchorNode.current=e.customAnchor.current),pn(()=>e.customAnchor.current,r=>{this.root.customAnchorNode.current=r}),this.floating=dq({strategy:()=>this.opts.strategy.current,placement:()=>f(this.#o),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...r)=>rq(...r,{animationFrame:this.#t?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),We(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),pn(()=>this.contentRef.current,r=>{if(!r||!this.opts.enabled.current)return;const i=wC(r),s=i.requestAnimationFrame(()=>{if(this.contentRef.current!==r||!this.opts.enabled.current)return;const o=i.getComputedStyle(r).zIndex;o!==this.contentZIndex&&(this.contentZIndex=o)});return()=>{i.cancelAnimationFrame(s)}}),We(()=>{this.floating.floating.current=this.wrapperRef.current})}}class id{static create(e,n=!1){return n?new id(e,p0.get()):new id(e,g0.get())}opts;root;constructor(e,n){this.opts=e,this.root=n,e.virtualEl&&e.virtualEl.current?n.triggerNode=M8(e.virtualEl.current):n.triggerNode=e.ref}}function gq(t){return{name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:i}=e,o=i.arrow?.centerOffset!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,u]=O0(n),h={start:"0%",center:"50%",end:"100%"}[u],d=(i.arrow?.x??0)+a/2,m=(i.arrow?.y??0)+l/2;let g="",p="";return c==="bottom"?(g=o?h:`${d}px`,p=`${-l}px`):c==="top"?(g=o?h:`${d}px`,p=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,p=o?h:`${m}px`):c==="left"&&(g=`${r.floating.width+l}px`,p=o?h:`${m}px`),{data:{x:g,y:p}}}}}function O0(t){const[e,n="center"]=t.split("-");return[e,n]}function pq(t){return O0(t)[0]}function Oq(t){return O0(t)[1]}function vq(t,e){Me(e,!0);let n=ee(e,"tooltip",3,!1);nd.create(n());var r=_e(),i=me(r);nt(i,()=>e.children??xt),y(t,r),Re()}function bq(t,e){Me(e,!0);let n=ee(e,"tooltip",3,!1);id.create({id:be(()=>e.id),virtualEl:be(()=>e.virtualEl),ref:e.ref},n());var r=_e(),i=me(r);nt(i,()=>e.children??xt),y(t,r),Re()}function yq(t,e){Me(e,!0);let n=ee(e,"side",3,"bottom"),r=ee(e,"sideOffset",3,0),i=ee(e,"align",3,"center"),s=ee(e,"alignOffset",3,0),o=ee(e,"arrowPadding",3,0),a=ee(e,"avoidCollisions",3,!0),l=ee(e,"collisionBoundary",19,()=>[]),c=ee(e,"collisionPadding",3,0),u=ee(e,"hideWhenDetached",3,!1),h=ee(e,"onPlaced",3,()=>{}),d=ee(e,"sticky",3,"partial"),m=ee(e,"updatePositionStrategy",3,"optimized"),g=ee(e,"strategy",3,"fixed"),p=ee(e,"dir",3,"ltr"),O=ee(e,"style",19,()=>({})),v=ee(e,"wrapperId",19,Bc),w=ee(e,"customAnchor",3,null),_=ee(e,"tooltip",3,!1);const C=rd.create({side:be(()=>n()),sideOffset:be(()=>r()),align:be(()=>i()),alignOffset:be(()=>s()),id:be(()=>e.id),arrowPadding:be(()=>o()),avoidCollisions:be(()=>a()),collisionBoundary:be(()=>l()),collisionPadding:be(()=>c()),hideWhenDetached:be(()=>u()),onPlaced:be(()=>h()),sticky:be(()=>d()),updatePositionStrategy:be(()=>m()),strategy:be(()=>g()),dir:be(()=>p()),style:be(()=>O()),enabled:be(()=>e.enabled),wrapperId:be(()=>v()),customAnchor:be(()=>w())},_()),T=A(()=>Bt(C.wrapperProps,{style:{pointerEvents:"auto"}}));var S=_e(),Q=me(S);nt(Q,()=>e.content??xt,()=>({props:C.props,wrapperProps:f(T)})),y(t,S),Re()}function xq(t,e){Me(e,!0),tr(()=>{e.onPlaced?.()});var n=_e(),r=me(n);nt(r,()=>e.content??xt,()=>({props:{},wrapperProps:{}})),y(t,n),Re()}function Sq(t,e){let n=ee(e,"isStatic",3,!1),r=Tt(e,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var i=_e(),s=me(i);{var o=l=>{xq(l,{get content(){return e.content},get onPlaced(){return e.onPlaced}})},a=l=>{yq(l,_i({get content(){return e.content},get onPlaced(){return e.onPlaced}},()=>r))};Z(s,l=>{n()?l(o):l(a,-1)})}y(t,i)}var wq=P(" ",1);function ST(t,e){Me(e,!0);let n=ee(e,"interactOutsideBehavior",3,"close"),r=ee(e,"trapFocus",3,!0),i=ee(e,"isValidEvent",3,()=>!1),s=ee(e,"customAnchor",3,null),o=ee(e,"isStatic",3,!1),a=ee(e,"tooltip",3,!1),l=ee(e,"contentPointerEvents",3,"auto"),c=Tt(e,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);Sq(t,{get isStatic(){return o()},get id(){return e.id},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return s()},get enabled(){return e.enabled},get tooltip(){return a()},content:(h,d)=>{let m=()=>d?.().props,g=()=>d?.().wrapperProps;var p=wq(),O=me(p);{var v=C=>{xx(C,{get preventScroll(){return e.preventScroll}})},w=C=>{xx(C,{get preventScroll(){return e.preventScroll}})};Z(O,C=>{e.forceMount&&e.enabled?C(v):e.forceMount||C(w,1)})}var _=M(O,2);aW(_,{get onOpenAutoFocus(){return e.onOpenAutoFocus},get onCloseAutoFocus(){return e.onCloseAutoFocus},get loop(){return e.loop},get enabled(){return e.enabled},get trapFocus(){return r()},get forceMount(){return e.forceMount},get ref(){return e.ref},focusScope:(T,S)=>{let Q=()=>S?.().props;oW(T,{get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get enabled(){return e.enabled},get ref(){return e.ref},children:(D,I)=>{iW(D,{get id(){return e.id},get onInteractOutside(){return e.onInteractOutside},get onFocusOutside(){return e.onFocusOutside},get interactOutsideBehavior(){return n()},get isValidEvent(){return i()},get enabled(){return e.enabled},get ref(){return e.ref},children:(L,R)=>{let F=()=>R?.().props;uW(L,{get id(){return e.id},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get enabled(){return e.enabled},get ref(){return e.ref},children:(U,j)=>{var Y=_e(),ie=me(Y);{let N=A(()=>({props:Bt(c,m(),F(),Q(),{style:{pointerEvents:l()}}),wrapperProps:g()}));nt(ie,()=>e.popper??xt,()=>f(N))}y(U,Y)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),y(h,p)},$$slots:{content:!0}}),Re()}function kq(t,e){let n=ee(e,"interactOutsideBehavior",3,"close"),r=ee(e,"trapFocus",3,!0),i=ee(e,"isValidEvent",3,()=>!1),s=ee(e,"customAnchor",3,null),o=ee(e,"isStatic",3,!1),a=Tt(e,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var l=_e(),c=me(l);{var u=h=>{ST(h,_i({get popper(){return e.popper},get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get id(){return e.id},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get preventScroll(){return e.preventScroll},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return s()},get isStatic(){return o()},get enabled(){return e.open},get onInteractOutside(){return e.onInteractOutside},get onCloseAutoFocus(){return e.onCloseAutoFocus},get onOpenAutoFocus(){return e.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return e.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return e.onFocusOutside},forceMount:!1,get ref(){return e.ref}},()=>a))};Z(c,h=>{e.shouldRender&&h(u)})}y(t,l)}function _q(t,e){let n=ee(e,"interactOutsideBehavior",3,"close"),r=ee(e,"trapFocus",3,!0),i=ee(e,"isValidEvent",3,()=>!1),s=ee(e,"customAnchor",3,null),o=ee(e,"isStatic",3,!1),a=Tt(e,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);ST(t,_i({get popper(){return e.popper},get onEscapeKeydown(){return e.onEscapeKeydown},get escapeKeydownBehavior(){return e.escapeKeydownBehavior},get preventOverflowTextSelection(){return e.preventOverflowTextSelection},get id(){return e.id},get onPointerDown(){return e.onPointerDown},get onPointerUp(){return e.onPointerUp},get side(){return e.side},get sideOffset(){return e.sideOffset},get align(){return e.align},get alignOffset(){return e.alignOffset},get arrowPadding(){return e.arrowPadding},get avoidCollisions(){return e.avoidCollisions},get collisionBoundary(){return e.collisionBoundary},get collisionPadding(){return e.collisionPadding},get sticky(){return e.sticky},get hideWhenDetached(){return e.hideWhenDetached},get updatePositionStrategy(){return e.updatePositionStrategy},get strategy(){return e.strategy},get dir(){return e.dir},get preventScroll(){return e.preventScroll},get wrapperId(){return e.wrapperId},get style(){return e.style},get onPlaced(){return e.onPlaced},get customAnchor(){return s()},get isStatic(){return o()},get enabled(){return e.enabled},get onInteractOutside(){return e.onInteractOutside},get onCloseAutoFocus(){return e.onCloseAutoFocus},get onOpenAutoFocus(){return e.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return e.loop},get trapFocus(){return r()},get isValidEvent(){return i()},get onFocusOutside(){return e.onFocusOutside}},()=>a,{forceMount:!0}))}const v0=nf({component:"date-field",parts:["input","label","segment"]}),Ua={day:{min:1,max:t=>{const e=t.segmentValues.month,n=t.value.current??t.placeholder.current;return yc(e?n.set({month:Number.parseInt(e)}):n)},cycle:1,padZero:!0},month:{min:1,max:12,cycle:1,padZero:!0,getAnnouncement:(t,e)=>e.placeholder.current?`${t} - ${e.formatter.fullMonth(Kn(e.placeholder.current.set({month:t})))}`:""},year:{min:1,max:9999,cycle:1,padZero:!1},hour:{min:t=>t.hourCycle.current===12?1:0,max:t=>t.hourCycle.current===24?23:t.hourCycle.current===12||oT(t.locale.current)===12?12:23,cycle:1,canBeZero:!0,padZero:!0},minute:{min:0,max:59,cycle:1,canBeZero:!0,padZero:!0},second:{min:0,max:59,cycle:1,canBeZero:!0,padZero:!0}},jo=new ts("DateField.Root");class b0{static create(e,n){return jo.set(new b0(e,n))}value;placeholder;validate;minValue;maxValue;disabled;readonly;granularity;readonlySegments;hourCycle;locale;hideTimeZone;required;onInvalid;errorMessageId;isInvalidProp;descriptionId=Bc();formatter;initialSegments;#e=ge();get segmentValues(){return f(this.#e)}set segmentValues(e){k(this.#e,e,!0)}announcer;#t=A(()=>new Set(this.readonlySegments.current));get readonlySegmentsSet(){return f(this.#t)}set readonlySegmentsSet(e){k(this.#t,e)}segmentStates=Cx();#n=ge(null);#r=ge(null);#i=ge(null);get descriptionNode(){return f(this.#i)}set descriptionNode(e){k(this.#i,e,!0)}#o=ge(null);get validationNode(){return f(this.#o)}set validationNode(e){k(this.#o,e,!0)}states=Cx();#l=ge(null);get dayPeriodNode(){return f(this.#l)}set dayPeriodNode(e){k(this.#l,e,!0)}rangeRoot=void 0;#s=ge("");get name(){return f(this.#s)}set name(e){k(this.#s,e,!0)}domContext=new za(()=>null);constructor(e,n){this.rangeRoot=n,this.value=e.value,this.placeholder=n?n.opts.placeholder:e.placeholder,this.validate=n?Vr(void 0):e.validate,this.minValue=n?n.opts.minValue:e.minValue,this.maxValue=n?n.opts.maxValue:e.maxValue,this.disabled=n?n.opts.disabled:e.disabled,this.readonly=n?n.opts.readonly:e.readonly,this.granularity=n?n.opts.granularity:e.granularity,this.readonlySegments=n?n.opts.readonlySegments:e.readonlySegments,this.hourCycle=n?n.opts.hourCycle:e.hourCycle,this.locale=n?n.opts.locale:e.locale,this.hideTimeZone=n?n.opts.hideTimeZone:e.hideTimeZone,this.required=n?n.opts.required:e.required,this.onInvalid=n?n.opts.onInvalid:e.onInvalid,this.errorMessageId=n?n.opts.errorMessageId:e.errorMessageId,this.isInvalidProp=e.isInvalidProp,this.formatter=cT({initialLocale:this.locale.current,monthFormat:be(()=>"long"),yearFormat:be(()=>"numeric")}),this.initialSegments=Dm(this.inferredGranularity),this.segmentValues=this.initialSegments,this.announcer=Hh(null),this.getFieldNode=this.getFieldNode.bind(this),this.updateSegment=this.updateSegment.bind(this),this.handleSegmentClick=this.handleSegmentClick.bind(this),this.getBaseSegmentAttrs=this.getBaseSegmentAttrs.bind(this),We(()=>{mr(()=>{this.initialSegments=Dm(this.inferredGranularity)})}),tr(()=>{this.announcer=Hh(this.domContext.getDocument())}),Ba(()=>{n||_Y(this.descriptionId,this.domContext.getDocument())}),We(()=>{n||this.formatter.getLocale()!==this.locale.current&&this.formatter.setLocale(this.locale.current)}),We(()=>{if(n)return;if(this.value.current){const i=mr(()=>this.descriptionId);kY({id:i,formatter:this.formatter,value:this.value.current,doc:this.domContext.getDocument()})}const r=mr(()=>this.placeholder.current);this.value.current&&r!==this.value.current&&mr(()=>{this.value.current&&(this.placeholder.current=this.value.current)})}),this.value.current&&this.syncSegmentValues(this.value.current),We(()=>{this.locale.current,this.value.current&&this.syncSegmentValues(this.value.current),this.#a()}),We(()=>{this.value.current===void 0&&(this.segmentValues=Dm(this.inferredGranularity))}),pn(()=>this.validationStatus,()=>{this.validationStatus!==!1&&this.onInvalid.current?.(this.validationStatus.reason,this.validationStatus.message)})}setName(e){this.name=e}setFieldNode(e){k(this.#n,e,!0)}getFieldNode(){return this.rangeRoot?this.rangeRoot.fieldNode:f(this.#n)}setLabelNode(e){k(this.#r,e,!0)}getLabelNode(){return this.rangeRoot?this.rangeRoot.labelNode:f(this.#r)}#a(){this.states.day.updating=null,this.states.month.updating=null,this.states.year.updating=null,this.states.hour.updating=null,this.states.minute.updating=null,this.states.dayPeriod.updating=null}setValue(e){this.value.current=e}syncSegmentValues(e){const n=cf.map(r=>{const i=e[r];if(r==="month"){if(this.states.month.updating)return[r,this.states.month.updating];if(i<10)return[r,`0${i}`]}if(r==="day"){if(this.states.day.updating)return[r,this.states.day.updating];if(i<10)return[r,`0${i}`]}if(r==="year"){if(this.states.year.updating)return[r,this.states.year.updating];const o=4-`${i}`.length;if(o>0)return[r,`${"0".repeat(o)}${i}`]}return[r,`${i}`]});if("hour"in e){const r=Uv.map(s=>{if(s==="dayPeriod")return this.states.dayPeriod.updating?[s,this.states.dayPeriod.updating]:[s,this.formatter.dayPeriod(Kn(e))];if(s==="hour"){if(this.states.hour.updating)return[s,this.states.hour.updating];if(e[s]!==void 0&&e[s]<10)return[s,`0${e[s]}`];if(e[s]===0&&this.dayPeriodNode)return[s,"12"]}else if(s==="minute"){if(this.states.minute.updating)return[s,this.states.minute.updating];if(e[s]!==void 0&&e[s]<10)return[s,`0${e[s]}`]}else if(s==="second"){if(this.states.second.updating)return[s,this.states.second.updating];if(e[s]!==void 0&&e[s]<10)return[s,`0${e[s]}`]}return[s,`${e[s]}`]}),i=[...n,...r];this.segmentValues=Object.fromEntries(i),this.#a();return}this.segmentValues=Object.fromEntries(n)}#c=A(()=>{const e=this.value.current;if(!e)return!1;const n=this.validate.current?.(e);if(n)return{reason:"custom",message:n};const r=this.minValue.current;if(r&&Do(e,r))return{reason:"min"};const i=this.maxValue.current;return i&&Do(i,e)?{reason:"max"}:!1});get validationStatus(){return f(this.#c)}set validationStatus(e){k(this.#c,e)}#h=A(()=>this.validationStatus===!1?!1:(this.isInvalidProp.current,!0));get isInvalid(){return f(this.#h)}set isInvalid(e){k(this.#h,e)}#u=A(()=>{const e=this.granularity.current;return e||SY(this.placeholder.current,this.granularity.current)});get inferredGranularity(){return f(this.#u)}set inferredGranularity(e){k(this.#u,e)}#f=A(()=>this.value.current!==void 0?this.value.current:this.placeholder.current);get dateRef(){return f(this.#f)}set dateRef(e){k(this.#f,e)}#m=A(()=>pY({segmentValues:this.segmentValues,formatter:this.formatter,locale:this.locale.current,granularity:this.inferredGranularity,dateRef:this.dateRef,hideTimeZone:this.hideTimeZone.current,hourCycle:this.hourCycle.current}));get allSegmentContent(){return f(this.#m)}set allSegmentContent(e){k(this.#m,e)}#d=A(()=>this.allSegmentContent.arr);get segmentContents(){return f(this.#d)}set segmentContents(e){k(this.#d,e)}sharedSegmentAttrs={role:"spinbutton",contenteditable:"true",tabindex:0,spellcheck:!1,inputmode:"numeric",autocorrect:"off",enterkeyhint:"next",style:{caretColor:"transparent"}};#g(e){return`${e} ${this.getLabelNode()?.id??""}`}updateSegment(e,n){const r=this.disabled.current,i=this.readonly.current,s=this.readonlySegmentsSet;if(r||i||s.has(e))return;const o=this.segmentValues;let a=o;const l=this.placeholder.current;if(xY(o)){const c=o[e],u=n;if(e==="month"){const h=u(c);if(this.states.month.updating=h,h!==null&&o.day!==null){const d=l.set({month:Number.parseInt(h)}),m=yc(Kn(d));Number.parseInt(o.day)>m&&(o.day=`${m}`)}a={...o,[e]:h}}else if(e==="dayPeriod"){const h=u(c);this.states.dayPeriod.updating=h;const d=this.value.current;if(d&&"hour"in d){const m=d.hour;h==="AM"?m>=12&&(o.hour=`${m-12}`):h==="PM"&&m<12&&(o.hour=`${m+12}`)}a={...o,[e]:h}}else if(e==="hour"){const h=u(c);if(this.states.hour.updating=h,h!==null&&o.dayPeriod!==null){const d=this.formatter.dayPeriod(Kn(l.set({hour:Number.parseInt(h)})),this.hourCycle.current);(d==="AM"||d==="PM")&&(o.dayPeriod=d)}a={...o,[e]:h}}else if(e==="minute"){const h=u(c);this.states.minute.updating=h,a={...o,[e]:h}}else if(e==="second"){const h=u(c);this.states.second.updating=h,a={...o,[e]:h}}else if(e==="year"){const h=u(c);this.states.year.updating=h,a={...o,[e]:h}}else if(e==="day"){const h=u(c);this.states.day.updating=h,a={...o,[e]:h}}else{const h=u(c);a={...o,[e]:h}}}else if(uf(e)){const c=o[e],u=n,h=u(c);if(e==="month"&&h!==null&&o.day!==null){this.states.month.updating=h;const d=l.set({month:Number.parseInt(h)}),m=yc(Kn(d));Number.parseInt(o.day)>m&&(o.day=`${m}`),a={...o,[e]:h}}else if(e==="year"){const d=u(c);this.states.year.updating=d,a={...o,[e]:d}}else if(e==="day"){const d=u(c);this.states.day.updating=d,a={...o,[e]:d}}else a={...o,[e]:h}}this.segmentValues=a,yY(a,f(this.#n))?this.setValue(bY({segmentObj:a,fieldNode:f(this.#n),dateRef:this.placeholder.current})):(this.setValue(void 0),this.segmentValues=a)}handleSegmentClick(e){this.disabled.current&&e.preventDefault()}getBaseSegmentAttrs(e,n){const r=this.readonlySegmentsSet.has(e),i={"aria-invalid":Ev(this.isInvalid),"aria-disabled":Wr(this.disabled.current),"aria-readonly":Wr(this.readonly.current||r),"data-invalid":Mt(this.isInvalid),"data-disabled":Mt(this.disabled.current),"data-readonly":Mt(this.readonly.current||r),"data-segment":`${e}`,[v0.segment]:""};if(e==="literal")return i;const s=this.descriptionNode?.id,o=wY(n,f(this.#n))&&s,a=this.errorMessageId?.current,l=o?`${s} ${this.isInvalid&&a?a:""}`:void 0,c=!(this.readonly.current||r||this.disabled.current);return{...i,"aria-labelledby":this.#g(n),contenteditable:c?"true":void 0,"aria-describedby":l,tabindex:this.disabled.current?void 0:0}}}class y0{static create(e){return new y0(e,jo.get())}opts;root;domContext;attachment;constructor(e,n){this.opts=e,this.root=n,this.domContext=new za(e.ref),this.root.domContext=this.domContext,this.attachment=Ut(e.ref,r=>this.root.setFieldNode(r)),pn(()=>this.opts.name.current,r=>{this.root.setName(r)})}#e=A(()=>{if(!(!ns||!this.domContext.getElementById(this.root.descriptionId)))return this.root.descriptionId});#t=A(()=>({id:this.opts.id.current,role:"group","aria-labelledby":this.root.getLabelNode()?.id??void 0,"aria-describedby":f(this.#e),"aria-disabled":Wr(this.root.disabled.current),"data-invalid":this.root.isInvalid?"":void 0,"data-disabled":Mt(this.root.disabled.current),[v0.input]:"",...this.attachment}));get props(){return f(this.#t)}set props(e){k(this.#t,e)}}class x0{static create(){return new x0(jo.get())}root;#e=A(()=>this.root.name!=="");get shouldRender(){return f(this.#e)}set shouldRender(e){k(this.#e,e)}#t=A(()=>this.root.value.current?this.root.value.current.toString():"");get isoValue(){return f(this.#t)}set isoValue(e){k(this.#t,e)}constructor(e){this.root=e}#n=A(()=>({name:this.root.name,value:this.isoValue,required:this.root.required.current}));get props(){return f(this.#n)}set props(e){k(this.#n,e)}}class qa{opts;root;announcer;part;config;attachment;constructor(e,n,r,i){this.opts=e,this.root=n,this.part=r,this.config=i,this.announcer=n.announcer,this.onkeydown=this.onkeydown.bind(this),this.onfocusout=this.onfocusout.bind(this),this.attachment=Ut(e.ref)}#e(){return typeof this.config.max=="function"?this.config.max(this.root):this.config.max}#t(){return typeof this.config.min=="function"?this.config.min(this.root):this.config.min}#n(e){return this.config.getAnnouncement?this.config.getAnnouncement(e,this.root):e}#r(e,n=!0){const r=String(e);return n&&this.config.padZero&&r.length===1?`0${e}`:r}onkeydown(e){const n=this.root.value.current??this.root.placeholder.current;if(!(e.ctrlKey||e.metaKey||this.root.disabled.current)&&!((this.part==="hour"||this.part==="minute"||this.part==="second")&&!(this.part in n))&&(e.key!==of&&e.preventDefault(),!!qv(e.key))){if(_0(e.key)){this.#i(n);return}if(P0(e.key)){this.#o(n);return}if(af(e.key)){this.#l(e);return}if(Q0(e.key)){this.#s(e);return}Yc(e.key)&&Wc(e,this.root.getFieldNode())}}#i(e){const n=this.part;n in this.root.states&&(this.root.states[n].hasLeftFocus=!1),this.root.updateSegment(this.part,r=>{if(r===null){const o=e[this.part];return this.announcer.announce(this.#n(o)),this.#r(o)}const s=e.set({[this.part]:Number.parseInt(r)}).cycle(this.part,this.config.cycle)[this.part];return this.announcer.announce(this.#n(s)),this.#r(s)})}#o(e){const n=this.part;n in this.root.states&&(this.root.states[n].hasLeftFocus=!1),this.root.updateSegment(this.part,r=>{if(r===null){const o=e[this.part];return this.announcer.announce(this.#n(o)),this.#r(o)}const s=e.set({[this.part]:Number.parseInt(r)}).cycle(this.part,-this.config.cycle)[this.part];return this.announcer.announce(this.#n(s)),this.#r(s)})}#l(e){const n=Number.parseInt(e.key);let r=!1;const i=this.#e(),s=Math.floor(i/10),o=n===0,a=this.part;this.root.updateSegment(this.part,l=>{if(a in this.root.states&&this.root.states[a].hasLeftFocus&&(l=null,this.root.states[a].hasLeftFocus=!1),l===null)return o?(a in this.root.states&&(this.root.states[a].lastKeyZero=!0),this.announcer.announce("0"),"0"):(a in this.root.states&&(this.root.states[a].lastKeyZero||n>s)&&(r=!0),a in this.root.states&&(this.root.states[a].lastKeyZero=!1),r&&String(n).length===1?(this.announcer.announce(n),`0${n}`):`${n}`);if(a in this.root.states&&this.root.states[a].lastKeyZero)return n!==0?(r=!0,this.root.states[a].lastKeyZero=!1,`0${n}`):this.part==="hour"&&n===0&&this.root.hourCycle.current===24?(r=!0,this.root.states[a].lastKeyZero=!1,"00"):(this.part==="minute"||this.part==="second")&&n===0?(r=!0,this.root.states[a].lastKeyZero=!1,"00"):l;const c=Number.parseInt(l+n.toString());return c>i?(r=!0,`0${n}`):(r=!0,`${c}`)}),r&&aT(e,this.root.getFieldNode())}#s(e){const n=this.part;n in this.root.states&&(this.root.states[n].hasLeftFocus=!1);let r=!1;this.root.updateSegment(this.part,i=>{if(i===null)return r=!0,this.announcer.announce(null),null;if(i.length===2&&i.startsWith("0"))return this.announcer.announce(null),null;const s=i.toString();if(s.length===1)return this.announcer.announce(null),null;const o=Number.parseInt(s.slice(0,-1));return this.announcer.announce(this.#n(o)),`${o}`}),r&&lT(e,this.root.getFieldNode())}onfocusout(e){const n=this.part;n in this.root.states&&(this.root.states[n].hasLeftFocus=!0),this.config.padZero&&this.root.updateSegment(this.part,r=>r&&r.length===1?`0${r}`:r)}getSegmentProps(){const e=this.root.segmentValues,n=this.root.placeholder.current,r=e[this.part]===null;let i=n;e[this.part]&&(i=n.set({[this.part]:Number.parseInt(e[this.part])}));const s=i[this.part],o=this.#t(),a=this.#e();let l=r?"Empty":`${s}`;return this.part==="hour"&&"dayPeriod"in e&&e.dayPeriod&&(l=r?"Empty":`${s} ${e.dayPeriod}`),{"aria-label":`${this.part}, `,"aria-valuemin":o,"aria-valuemax":a,"aria-valuenow":s,"aria-valuetext":l}}#a=A(()=>({...this.root.sharedSegmentAttrs,id:this.opts.id.current,...this.getSegmentProps(),onkeydown:this.onkeydown,onfocusout:this.onfocusout,onclick:this.root.handleSegmentClick,...this.root.getBaseSegmentAttrs(this.part,this.opts.id.current),...this.attachment}));get props(){return f(this.#a)}set props(e){k(this.#a,e)}}class Pq extends qa{#e=[];#t=0;constructor(e,n){super(e,n,"year",Ua.year)}onkeydown(e){if(!(e.ctrlKey||e.metaKey||this.root.disabled.current)&&(e.key!==of&&e.preventDefault(),!!qv(e.key))){if(_0(e.key)){this.#n(),super.onkeydown(e);return}if(P0(e.key)){this.#n(),super.onkeydown(e);return}if(af(e.key)){this.#i(e);return}if(Q0(e.key)){this.#o(e);return}Yc(e.key)&&Wc(e,this.root.getFieldNode())}}#n(){this.#t=0}#r(){this.#t++}#i(e){this.#e.push(e.key);let n=!1;const r=Number.parseInt(e.key);this.root.updateSegment("year",i=>{if(this.root.states.year.hasLeftFocus&&(i=null,this.root.states.year.hasLeftFocus=!1),i===null)return this.announcer.announce(r),`000${r}`;const s=i.toString()+r.toString(),o=Number.parseInt(s);if(String(o).length<4)return this.#t>0&&this.#e.length<=this.#t&&s.length<=4?(this.announcer.announce(o),s):(this.announcer.announce(o),Yx(o));this.announcer.announce(o),n=!0;const l=`${o}`;return l.length>4?l.slice(0,4):l}),(this.#e.length===4||this.#e.length===this.#t)&&(n=!0),n&&aT(e,this.root.getFieldNode())}#o(e){this.#e=[],this.#r();let n=!1;this.root.updateSegment("year",r=>{if(this.root.states.year.hasLeftFocus=!1,r===null)return n=!0,this.announcer.announce(null),null;const i=r.toString();if(i.length===1)return this.announcer.announce(null),null;const s=i.slice(0,-1);return this.announcer.announce(s),`${s}`}),n&&lT(e,this.root.getFieldNode())}onfocusout(e){this.root.states.year.hasLeftFocus=!0,this.#e=[],this.#n(),this.root.updateSegment("year",n=>n&&n.length!==4?Yx(Number.parseInt(n)):n)}}class Qq extends qa{constructor(e,n){super(e,n,"day",Ua.day)}}class Cq extends qa{constructor(e,n){super(e,n,"month",Ua.month)}}class Tq extends qa{constructor(e,n){super(e,n,"hour",Ua.hour)}onkeydown(e){if(af(e.key)){const n=this.root.updateSegment.bind(this.root);this.root.updateSegment=(r,i)=>{const s=n(r,i);return r==="hour"&&"hour"in this.root.segmentValues&&this.root.segmentValues.hour==="0"&&this.root.dayPeriodNode&&this.root.hourCycle.current!==24&&(this.root.segmentValues.hour="12"),s}}super.onkeydown(e),this.root.updateSegment=this.root.updateSegment.bind(this.root)}}class Aq extends qa{constructor(e,n){super(e,n,"minute",Ua.minute)}}class Eq extends qa{constructor(e,n){super(e,n,"second",Ua.second)}}class S0{static create(e){return new S0(e,jo.get())}opts;root;attachment;#e;constructor(e,n){this.opts=e,this.root=n,this.#e=this.root.announcer,this.onkeydown=this.onkeydown.bind(this),this.attachment=Ut(e.ref,r=>this.root.dayPeriodNode=r)}onkeydown(e){if(!(e.ctrlKey||e.metaKey||this.root.disabled.current)&&(e.key!==of&&e.preventDefault(),!!Mq(e.key))){if(_0(e.key)||P0(e.key)){this.root.updateSegment("dayPeriod",n=>{if(n==="AM")return this.#e.announce("PM"),"PM";const r="AM";return this.#e.announce(r),r});return}Q0(e.key)&&(this.root.states.dayPeriod.hasLeftFocus=!1,this.root.updateSegment("dayPeriod",()=>(this.#e.announce("AM"),"AM"))),(e.key===Pp||e.key===PC||_p)&&this.root.updateSegment("dayPeriod",()=>{const n=e.key===Pp||e.key===_p?"AM":"PM";return this.#e.announce(n),n}),Yc(e.key)&&Wc(e,this.root.getFieldNode())}}#t=A(()=>{const e=this.root.segmentValues;if(!("dayPeriod"in e))return;const n=0,r=12,i=e.dayPeriod==="AM"?0:12,s=e.dayPeriod??"AM";return{...this.root.sharedSegmentAttrs,id:this.opts.id.current,inputmode:"text","aria-label":"AM/PM","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":i,"aria-valuetext":s,onkeydown:this.onkeydown,onclick:this.root.handleSegmentClick,...this.root.getBaseSegmentAttrs("dayPeriod",this.opts.id.current),...this.attachment}});get props(){return f(this.#t)}set props(e){k(this.#t,e)}}class w0{static create(e){return new w0(e,jo.get())}opts;root;attachment;constructor(e,n){this.opts=e,this.root=n,this.attachment=Ut(e.ref)}#e=A(()=>({id:this.opts.id.current,"aria-hidden":Ev(!0),...this.root.getBaseSegmentAttrs("literal",this.opts.id.current),...this.attachment}));get props(){return f(this.#e)}set props(e){k(this.#e,e)}}class k0{static create(e){return new k0(e,jo.get())}opts;root;attachment;constructor(e,n){this.opts=e,this.root=n,this.onkeydown=this.onkeydown.bind(this),this.attachment=Ut(e.ref)}onkeydown(e){e.key!==of&&e.preventDefault(),!this.root.disabled.current&&Yc(e.key)&&Wc(e,this.root.getFieldNode())}#e=A(()=>({role:"textbox",id:this.opts.id.current,"aria-label":"timezone, ",style:{caretColor:"transparent"},onkeydown:this.onkeydown,...this.root.getBaseSegmentAttrs("timeZoneName",this.opts.id.current),"data-readonly":Mt(!0),...this.attachment}));get props(){return f(this.#e)}set props(e){k(this.#e,e)}}class Dq{static create(e,n){const r=jo.get();switch(e){case"day":return new Qq(n,r);case"month":return new Cq(n,r);case"year":return new Pq(n,r);case"hour":return new Tq(n,r);case"minute":return new Aq(n,r);case"second":return new Eq(n,r);case"dayPeriod":return new S0(n,r);case"literal":return new w0(n,r);case"timeZoneName":return new k0(n,r)}}}function Mq(t){return qv(t)||t===Pp||t===PC||t===_p||t===Sz}function _0(t){return t===sf}function P0(t){return t===rf}function Q0(t){return t===_C}function Yx(t){const n=4-String(t).length;return`${"0".repeat(n)}${t}`}function Rq(t,e){Me(e,!1);const n=x0.create();BA();var r=_e(),i=me(r);{var s=o=>{OU(o,_i(()=>n.props))};Z(i,o=>{n.shouldRender&&o(s)})}y(t,r),Re()}var Lq=P("
"),Iq=P(" ",1);function Xq(t,e){const n=_n();Me(e,!0);let r=ee(e,"id",19,()=>Xn(n)),i=ee(e,"ref",15,null),s=ee(e,"name",3,""),o=Tt(e,["$$slots","$$events","$$legacy","id","ref","name","children","child"]);const a=y0.create({id:be(()=>r()),ref:be(()=>i(),g=>i(g)),name:be(()=>s())}),l=A(()=>Bt(o,a.props));var c=Iq(),u=me(c);{var h=g=>{var p=_e(),O=me(p);nt(O,()=>e.child,()=>({props:f(l),segments:a.root.segmentContents})),y(g,p)},d=g=>{var p=Lq();Qt(p,()=>({...f(l)}));var O=x(p);nt(O,()=>e.children??xt,()=>({segments:a.root.segmentContents})),b(p),y(g,p)};Z(u,g=>{e.child?g(h):g(d,-1)})}var m=M(u,2);Rq(m,{}),y(t,c),Re()}var Zq=P("");function Nq(t,e){const n=_n();Me(e,!0);let r=ee(e,"id",19,()=>Xn(n)),i=ee(e,"ref",15,null),s=Tt(e,["$$slots","$$events","$$legacy","id","ref","children","child","part"]);const o=Dq.create(e.part,{id:be(()=>r()),ref:be(()=>i(),d=>i(d))}),a=A(()=>Bt(s,o.props));var l=_e(),c=me(l);{var u=d=>{var m=_e(),g=me(m);nt(g,()=>e.child,()=>({props:f(a)})),y(d,m)},h=d=>{var m=Zq();Qt(m,()=>({...f(a)}));var g=x(m);nt(g,()=>e.children??xt),b(m),y(d,m)};Z(c,d=>{e.child?d(u):d(h,-1)})}y(t,l),Re()}const wT=new ts("DatePicker.Root");class C0{static create(e){return wT.set(new C0(e))}opts;constructor(e){this.opts=e}}function Xm(t,e){const[n,r]=t;let i=!1;const s=e.length;for(let o=0,a=s-1;o=r!=h>=r&&n<=(u-l)*(r-c)/(h-c)+l&&(i=!i)}return i}function Zm(t,e){return t[0]>=e.left&&t[0]<=e.right&&t[1]>=e.top&&t[1]<=e.bottom}function Ux(t,e){const n=t.left+t.width/2,r=t.top+t.height/2,i=e.left+e.width/2,s=e.top+e.height/2,o=i-n,a=s-r;return Math.abs(o)>Math.abs(a)?o>0?"right":"left":a>0?"bottom":"top"}class Vq{#e;#t;#n;#r=null;#i=null;#o=[];#l=null;#s=null;#a=null;#c(){this.#s!==null&&(cancelAnimationFrame(this.#s),this.#s=null)}#h(){this.#c(),this.#s=requestAnimationFrame(()=>{this.#s=null,!(!this.#r||!this.#i)&&(this.#d(),this.#e.onPointerExit())})}#u(){this.#a!==null&&(clearTimeout(this.#a),this.#a=null)}#f(){this.#n!==null&&(this.#u(),this.#a=window.setTimeout(()=>{this.#a=null,!(!this.#r||!this.#i)&&(this.#d(),this.#e.onPointerExit())},this.#n))}constructor(e){this.#e=e,this.#t=e.buffer??1;const n=e.transitIntentTimeout;this.#n=typeof n=="number"&&n>0?n:null,pn([e.triggerNode,e.contentNode,e.enabled],([r,i,s])=>{if(!r||!i||!s){this.#l=null,this.#d();return}this.#l&&this.#l!==r&&this.#d(),this.#l=r;const o=tf(r),a=d=>{this.#m([d.clientX,d.clientY],r,i)},l=d=>{const m=d.relatedTarget;if(co(m)&&i.contains(m))return;const g=this.#e.ignoredTargets?.()??[];co(m)&&g.some(p=>p===m||p.contains(m))||(this.#o=co(m)&&g.length>0?g.filter(p=>m.contains(p)):[],this.#r=[d.clientX,d.clientY],this.#i="content",this.#h())},c=()=>{this.#d()},u=()=>{this.#d()},h=d=>{const m=d.relatedTarget;co(m)&&r.contains(m)||(this.#r=[d.clientX,d.clientY],this.#i="trigger",this.#h())};return[xn(o,"pointermove",a),xn(r,"pointerleave",l),xn(r,"pointerenter",c),xn(i,"pointerenter",u),xn(i,"pointerleave",h)].reduce((d,m)=>()=>{d(),m()},()=>{})})}#m(e,n,r){if(!this.#r||!this.#i)return;this.#c(),this.#f();const i=n.getBoundingClientRect(),s=r.getBoundingClientRect();if(this.#i==="content"&&Zm(e,s)){this.#d();return}if(this.#i==="trigger"&&Zm(e,i)){this.#d();return}if(this.#i==="content"&&this.#o.length>0)for(const u of this.#o){const h=u.getBoundingClientRect();if(Zm(e,h))return;const d=Ux(i,h),m=this.#g(i,h,d);if(m&&Xm(e,m))return}const o=Ux(i,s),a=this.#g(i,s,o);if(a&&Xm(e,a))return;const l=this.#i==="content"?s:i,c=this.#p(this.#r,l,o,this.#i);Xm(e,c)||(this.#d(),this.#e.onPointerExit())}#d(){this.#r=null,this.#i=null,this.#o=[],this.#c(),this.#u()}#g(e,n,r){const i=this.#t;switch(r){case"top":return[[Math.min(e.left,n.left)-i,e.top],[Math.min(e.left,n.left)-i,n.bottom],[Math.max(e.right,n.right)+i,n.bottom],[Math.max(e.right,n.right)+i,e.top]];case"bottom":return[[Math.min(e.left,n.left)-i,e.bottom],[Math.min(e.left,n.left)-i,n.top],[Math.max(e.right,n.right)+i,n.top],[Math.max(e.right,n.right)+i,e.bottom]];case"left":return[[e.left,Math.min(e.top,n.top)-i],[n.right,Math.min(e.top,n.top)-i],[n.right,Math.max(e.bottom,n.bottom)+i],[e.left,Math.max(e.bottom,n.bottom)+i]];case"right":return[[e.right,Math.min(e.top,n.top)-i],[n.left,Math.min(e.top,n.top)-i],[n.left,Math.max(e.bottom,n.bottom)+i],[e.right,Math.max(e.bottom,n.bottom)+i]]}}#p(e,n,r,i){const s=this.#t*4,[o,a]=e;switch(i==="trigger"?this.#O(r):r){case"top":return[[o-s,a+s],[o+s,a+s],[n.right+s,n.bottom],[n.right+s,n.top],[n.left-s,n.top],[n.left-s,n.bottom]];case"bottom":return[[o-s,a-s],[o+s,a-s],[n.right+s,n.top],[n.right+s,n.bottom],[n.left-s,n.bottom],[n.left-s,n.top]];case"left":return[[o+s,a-s],[o+s,a+s],[n.right,n.bottom+s],[n.left,n.bottom+s],[n.left,n.top-s],[n.right,n.top-s]];case"right":return[[o-s,a-s],[o-s,a+s],[n.left,n.bottom+s],[n.right,n.bottom+s],[n.right,n.top-s],[n.left,n.top-s]]}}#O(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}}const Rp=nf({component:"popover",parts:["root","trigger","content","close","overlay"]}),T0=new ts("Popover.Root");class A0{static create(e){return T0.set(new A0(e))}opts;#e=ge(null);get contentNode(){return f(this.#e)}set contentNode(e){k(this.#e,e,!0)}contentPresence;#t=ge(null);get triggerNode(){return f(this.#t)}set triggerNode(e){k(this.#t,e,!0)}#n=ge(null);get overlayNode(){return f(this.#n)}set overlayNode(e){k(this.#n,e,!0)}overlayPresence;#r=ge(!1);get openedViaHover(){return f(this.#r)}set openedViaHover(e){k(this.#r,e,!0)}#i=ge(!1);get hasInteractedWithContent(){return f(this.#i)}set hasInteractedWithContent(e){k(this.#i,e,!0)}#o=ge(!1);get hoverCooldown(){return f(this.#o)}set hoverCooldown(e){k(this.#o,e,!0)}#l=ge(0);get closeDelay(){return f(this.#l)}set closeDelay(e){k(this.#l,e,!0)}#s=null;#a=null;constructor(e){this.opts=e,this.contentPresence=new gx({ref:be(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new gx({ref:be(()=>this.overlayNode),open:this.opts.open}),pn(()=>this.opts.open.current,n=>{n||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#c())})}setDomContext(e){this.#a=e}#c(){this.#s!==null&&this.#a&&(this.#a.clearTimeout(this.#s),this.#s=null)}toggleOpen(){this.#c(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#c(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#c(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#c(),this.closeDelay<=0?this.opts.open.current=!1:this.#a&&(this.#s=this.#a.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#s=null},this.closeDelay))))}cancelDelayedClose(){this.#c()}markInteraction(){this.hasInteractedWithContent=!0,this.#c()}}class E0{static create(e){return new E0(e,T0.get())}opts;root;attachment;domContext;#e=null;#t=null;#n=ge(!1);constructor(e,n){this.opts=e,this.root=n,this.attachment=Ut(this.opts.ref,r=>this.root.triggerNode=r),this.domContext=new za(e.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),pn(()=>this.opts.closeDelay.current,r=>{this.root.closeDelay=r})}#r(){this.#e!==null&&(this.domContext.clearTimeout(this.#e),this.#e=null)}#i(){this.#t!==null&&(this.domContext.clearTimeout(this.#t),this.#t=null)}#o(){this.#r(),this.#i()}onpointerenter(e){if(this.opts.disabled.current||!this.opts.openOnHover.current||Bh(e)||(k(this.#n,!0),this.#i(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;const n=this.opts.openDelay.current;n<=0?this.root.handleHoverOpen():this.#e=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#e=null},n)}onpointerleave(e){this.opts.disabled.current||this.opts.openOnHover.current&&(Bh(e)||(k(this.#n,!1),this.#r(),this.root.hoverCooldown=!1))}onclick(e){if(!this.opts.disabled.current&&e.button===0){if(this.#o(),f(this.#n)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}f(this.#n)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(e){this.opts.disabled.current||(e.key===Dv||e.key===Mv)&&(e.preventDefault(),this.#o(),this.root.toggleOpen())}#l(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#s=A(()=>({id:this.opts.id.current,"aria-haspopup":"dialog","aria-expanded":Wr(this.root.opts.open.current),"data-state":kC(this.root.opts.open.current),"aria-controls":this.#l(),[Rp.trigger]:"",disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return f(this.#s)}set props(e){k(this.#s,e)}}class D0{static create(e){return new D0(e,T0.get())}opts;root;attachment;constructor(e,n){this.opts=e,this.root=n,this.attachment=Ut(this.opts.ref,r=>this.root.contentNode=r),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new Vq({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(e){this.root.markInteraction()}onfocusin(e){const n=e.target;co(n)&&$z(n)&&this.root.markInteraction()}onpointerenter(e){Bh(e)||this.root.cancelDelayedClose()}onpointerleave(e){Bh(e)}onInteractOutside=e=>{if(this.opts.onInteractOutside.current(e),e.defaultPrevented||!co(e.target))return;const n=e.target.closest(Rp.selector("trigger"));if(!(n&&n===this.root.triggerNode)){if(this.opts.customAnchor.current){if(co(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(e.target))return}else if(typeof this.opts.customAnchor.current=="string"){const r=document.querySelector(this.opts.customAnchor.current);if(r&&r.contains(e.target))return}}this.root.handleClose()}};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#e=A(()=>({open:this.root.opts.open.current}));get snippetProps(){return f(this.#e)}set snippetProps(e){k(this.#e,e)}#t=A(()=>({id:this.opts.id.current,tabindex:-1,"data-state":kC(this.root.opts.open.current),[Rp.content]:"",style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return f(this.#t)}set props(e){k(this.#t,e)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}}function Fq(t,e){Me(e,!0);let n=ee(e,"open",15,!1),r=ee(e,"onOpenChange",3,Ft),i=ee(e,"onOpenChangeComplete",3,Ft),s=ee(e,"value",15),o=ee(e,"onValueChange",3,Ft),a=ee(e,"placeholder",15),l=ee(e,"onPlaceholderChange",3,Ft),c=ee(e,"isDateUnavailable",3,()=>!1),u=ee(e,"validate",3,Ft),h=ee(e,"onInvalid",3,Ft),d=ee(e,"disabled",3,!1),m=ee(e,"readonly",3,!1),g=ee(e,"readonlySegments",19,()=>[]),p=ee(e,"hideTimeZone",3,!1),O=ee(e,"required",3,!1),v=ee(e,"calendarLabel",3,"Event"),w=ee(e,"disableDaysOutsideMonth",3,!0),_=ee(e,"preventDeselect",3,!1),C=ee(e,"pagedNavigation",3,!1),T=ee(e,"weekdayFormat",3,"narrow"),S=ee(e,"isDateDisabled",3,()=>!1),Q=ee(e,"fixedWeeks",3,!1),D=ee(e,"numberOfMonths",3,1),I=ee(e,"closeOnDateSelect",3,!0),X=ee(e,"initialFocus",3,!1),L=ee(e,"monthFormat",3,"long"),R=ee(e,"yearFormat",3,"numeric");const F=eY({granularity:e.granularity,defaultValue:s(),minValue:e.minValue,maxValue:e.maxValue});function U(){a()===void 0&&a(F)}U(),pn.pre(()=>a(),()=>{U()});function j(){I()&&n(!1)}const Y=C0.create({open:be(()=>n(),z=>{n(z),r()(z)}),value:be(()=>s(),z=>{s(z),o()(z)}),placeholder:be(()=>a(),z=>{a(z),l()(z)}),isDateUnavailable:be(()=>c()),minValue:be(()=>e.minValue),maxValue:be(()=>e.maxValue),disabled:be(()=>d()),readonly:be(()=>m()),granularity:be(()=>e.granularity),readonlySegments:be(()=>g()),hourCycle:be(()=>e.hourCycle),locale:Dz(()=>e.locale),hideTimeZone:be(()=>p()),required:be(()=>O()),calendarLabel:be(()=>v()),disableDaysOutsideMonth:be(()=>w()),preventDeselect:be(()=>_()),pagedNavigation:be(()=>C()),weekStartsOn:be(()=>e.weekStartsOn),weekdayFormat:be(()=>T()),isDateDisabled:be(()=>S()),fixedWeeks:be(()=>Q()),numberOfMonths:be(()=>D()),initialFocus:be(()=>X()),onDateSelect:be(()=>j),defaultPlaceholder:F,monthFormat:be(()=>L()),yearFormat:be(()=>R())});A0.create({open:Y.opts.open,onOpenChangeComplete:be(()=>i())}),b0.create({value:Y.opts.value,disabled:Y.opts.disabled,readonly:Y.opts.readonly,readonlySegments:Y.opts.readonlySegments,validate:be(()=>u()),onInvalid:be(()=>h()),minValue:Y.opts.minValue,maxValue:Y.opts.maxValue,granularity:Y.opts.granularity,hideTimeZone:Y.opts.hideTimeZone,hourCycle:Y.opts.hourCycle,locale:Y.opts.locale,required:Y.opts.required,placeholder:Y.opts.placeholder,errorMessageId:be(()=>e.errorMessageId),isInvalidProp:be(()=>{})});var ie=_e(),N=me(ie);Gt(N,()=>vq,(z,he)=>{he(z,{children:(te,V)=>{var J=_e(),q=me(J);nt(q,()=>e.children??xt),y(te,J)},$$slots:{default:!0}})}),y(t,ie),Re()}var jq=P("
");function Bq(t,e){const n=_n();Me(e,!0);let r=ee(e,"id",19,()=>Xn(n)),i=ee(e,"ref",15,null),s=Tt(e,["$$slots","$$events","$$legacy","children","child","id","ref"]);const o=wT.get(),a=Hv.create({id:be(()=>r()),ref:be(()=>i(),m=>i(m)),calendarLabel:o.opts.calendarLabel,fixedWeeks:o.opts.fixedWeeks,isDateDisabled:o.opts.isDateDisabled,isDateUnavailable:o.opts.isDateUnavailable,locale:o.opts.locale,numberOfMonths:o.opts.numberOfMonths,pagedNavigation:o.opts.pagedNavigation,preventDeselect:o.opts.preventDeselect,readonly:o.opts.readonly,type:be(()=>"single"),weekStartsOn:o.opts.weekStartsOn,weekdayFormat:o.opts.weekdayFormat,disabled:o.opts.disabled,disableDaysOutsideMonth:o.opts.disableDaysOutsideMonth,maxValue:o.opts.maxValue,minValue:o.opts.minValue,placeholder:o.opts.placeholder,value:o.opts.value,onDateSelect:o.opts.onDateSelect,initialFocus:o.opts.initialFocus,defaultPlaceholder:o.opts.defaultPlaceholder,maxDays:be(()=>{}),monthFormat:o.opts.monthFormat,yearFormat:o.opts.yearFormat}),l=A(()=>Bt(s,a.props));var c=_e(),u=me(c);{var h=m=>{var g=_e(),p=me(g);{let O=A(()=>({props:f(l),...a.snippetProps}));nt(p,()=>e.child,()=>f(O))}y(m,g)},d=m=>{var g=jq();Qt(g,()=>({...f(l)}));var p=x(g);nt(p,()=>e.children??xt,()=>a.snippetProps),b(g),y(m,g)};Z(u,m=>{e.child?m(h):m(d,-1)})}y(t,c),Re()}var zq=P("
"),Wq=P("
");function Yq(t,e){const n=_n();Me(e,!0);let r=ee(e,"ref",15,null),i=ee(e,"id",19,()=>Xn(n)),s=ee(e,"forceMount",3,!1),o=ee(e,"onOpenAutoFocus",3,Ft),a=ee(e,"onCloseAutoFocus",3,Ft),l=ee(e,"onEscapeKeydown",3,Ft),c=ee(e,"onInteractOutside",3,Ft),u=ee(e,"trapFocus",3,!0),h=ee(e,"preventScroll",3,!1),d=ee(e,"customAnchor",3,null),m=Tt(e,["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]);const g=D0.create({id:be(()=>i()),ref:be(()=>r(),S=>r(S)),onInteractOutside:be(()=>c()),onEscapeKeydown:be(()=>l()),customAnchor:be(()=>d())}),p=A(()=>Bt(m,g.props)),O=A(()=>u()&&g.shouldTrapFocus);function v(S){g.shouldTrapFocus||S.preventDefault(),o()(S)}var w=_e(),_=me(w);{var C=S=>{_q(S,_i(()=>f(p),()=>g.popperProps,{get ref(){return g.opts.ref},get enabled(){return g.root.opts.open.current},get id(){return i()},get trapFocus(){return f(O)},get preventScroll(){return h()},loop:!0,forceMount:!0,get customAnchor(){return d()},onOpenAutoFocus:v,get onCloseAutoFocus(){return a()},get shouldRender(){return g.shouldRender},popper:(D,I)=>{let X=()=>I?.().props,L=()=>I?.().wrapperProps;const R=A(()=>Bt(X(),{style:zx("popover")},{style:e.style}));var F=_e(),U=me(F);{var j=ie=>{var N=_e(),z=me(N);{let he=A(()=>({props:f(R),wrapperProps:L(),...g.snippetProps}));nt(z,()=>e.child,()=>f(he))}y(ie,N)},Y=ie=>{var N=zq();Qt(N,()=>({...L()}));var z=x(N);Qt(z,()=>({...f(R)}));var he=x(z);nt(he,()=>e.children??xt),b(z),b(N),y(ie,N)};Z(U,ie=>{e.child?ie(j):ie(Y,-1)})}y(D,F)},$$slots:{popper:!0}}))},T=S=>{kq(S,_i(()=>f(p),()=>g.popperProps,{get ref(){return g.opts.ref},get open(){return g.root.opts.open.current},get id(){return i()},get trapFocus(){return f(O)},get preventScroll(){return h()},loop:!0,forceMount:!1,get customAnchor(){return d()},onOpenAutoFocus:v,get onCloseAutoFocus(){return a()},get shouldRender(){return g.shouldRender},popper:(D,I)=>{let X=()=>I?.().props,L=()=>I?.().wrapperProps;const R=A(()=>Bt(X(),{style:zx("popover")},{style:e.style}));var F=_e(),U=me(F);{var j=ie=>{var N=_e(),z=me(N);{let he=A(()=>({props:f(R),wrapperProps:L(),...g.snippetProps}));nt(z,()=>e.child,()=>f(he))}y(ie,N)},Y=ie=>{var N=Wq();Qt(N,()=>({...L()}));var z=x(N);Qt(z,()=>({...f(R)}));var he=x(z);nt(he,()=>e.children??xt),b(z),b(N),y(ie,N)};Z(U,ie=>{e.child?ie(j):ie(Y,-1)})}y(D,F)},$$slots:{popper:!0}}))};Z(_,S=>{s()?S(C):s()||S(T,1)})}y(t,w),Re()}function Uq(t,e){Me(e,!0);let n=ee(e,"ref",15,null),r=Tt(e,["$$slots","$$events","$$legacy","ref","onOpenAutoFocus"]);const i=A(()=>Bt({onOpenAutoFocus:e.onOpenAutoFocus},{onOpenAutoFocus:jY}));Yq(t,_i(()=>f(i),()=>r,{get ref(){return n()},set ref(s){n(s)}})),Re()}var qq=P("");function $q(t,e){const n=_n();Me(e,!0);let r=ee(e,"id",19,()=>Xn(n)),i=ee(e,"ref",15,null),s=ee(e,"type",3,"button"),o=ee(e,"disabled",3,!1),a=ee(e,"openOnHover",3,!1),l=ee(e,"openDelay",3,700),c=ee(e,"closeDelay",3,300),u=Tt(e,["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]);const h=E0.create({id:be(()=>r()),ref:be(()=>i(),m=>i(m)),disabled:be(()=>!!o()),openOnHover:be(()=>a()),openDelay:be(()=>l()),closeDelay:be(()=>c())}),d=A(()=>Bt(u,h.props,{type:s()}));bq(t,{get id(){return r()},get ref(){return h.opts.ref},children:(m,g)=>{var p=_e(),O=me(p);{var v=_=>{var C=_e(),T=me(C);nt(T,()=>e.child,()=>({props:f(d)})),y(_,C)},w=_=>{var C=qq();Qt(C,()=>({...f(d)}));var T=x(C);nt(T,()=>e.children??xt),b(C),y(_,C)};Z(O,_=>{e.child?_(v):_(w,-1)})}y(m,p)},$$slots:{default:!0}}),Re()}function Gq(t,e){Me(e,!0);let n=ee(e,"ref",15,null),r=Tt(e,["$$slots","$$events","$$legacy","ref","onkeydown"]);function i(o){if(Yc(o.key)){const l=o.currentTarget.closest(v0.selector("input"));if(!l)return;Wc(o,l)}}const s=A(()=>Bt({onkeydown:e.onkeydown},{onkeydown:i}));$q(t,_i(()=>r,{"data-segment":"trigger"},()=>f(s),{get ref(){return n()},set ref(o){n(o)}})),Re()}var Hq=P('*'),Kq=P(''),Jq=P('

'),e$=P("
"),t$=P(' '),n$=P(''),r$=P(" ",1),i$=P(" ",1),s$=P('
'),o$=P('
',1),a$=P('

'),l$=P('

'),c$=P('
');function u$(t,e){Me(e,!0);const n=ve.tMaybe;function r(O){if(!O||typeof O!="string")return;const v=O.trim();if(!v)return;let w=null,_=v.match(/^(\d{1,2})-(\d{1,2})-(\d{2,4})(?:\s+(\d{1,2}):(\d{2})(?::(\d{2}))?)?$/);if(_){const[,C,T,S,Q,D,I]=_,X=S.length<=2?2e3+parseInt(S):parseInt(S);w=new Date(X,parseInt(T)-1,parseInt(C),parseInt(Q||"0"),parseInt(D||"0"),parseInt(I||"0"))}if((!w||isNaN(w.getTime()))&&(_=v.match(/^(\d{1,2})\/(\d{1,2})\/(\d{2,4})\s+(\d{1,2}):(\d{2})\s*(am|pm)$/i),_)){const[,C,T,S,Q,D,I]=_,X=S.length<=2?2e3+parseInt(S):parseInt(S);let L=parseInt(Q);I.toLowerCase()==="pm"&&L!==12&&(L+=12),I.toLowerCase()==="am"&&L===12&&(L=0),w=new Date(X,parseInt(C)-1,parseInt(T),L,parseInt(D))}if((!w||isNaN(w.getTime()))&&(_=v.match(/^(\d{1,2})\/(\d{1,2})\/(\d{2,4})\s+(\d{1,2}):(\d{2})(?::(\d{2}))?$/),_)){const[,C,T,S,Q,D,I]=_,X=S.length<=2?2e3+parseInt(S):parseInt(S);w=new Date(X,parseInt(C)-1,parseInt(T),parseInt(Q),parseInt(D),parseInt(I||"0"))}if((!w||isNaN(w.getTime()))&&(_=v.match(/^(\d{1,2}):(\d{2})\s+(\d{1,2})-(\d{1,2})-(\d{2,4})$/),_)){const[,C,T,S,Q,D]=_,I=D.length<=2?2e3+parseInt(D):parseInt(D);w=new Date(I,parseInt(Q)-1,parseInt(S),parseInt(C),parseInt(T))}if((!w||isNaN(w.getTime()))&&(_=v.match(/^(\d{1,2}):(\d{2})\s*(am|pm)\s+(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/i),_)){const[,C,T,S,Q,D,I]=_,X=I.length<=2?2e3+parseInt(I):parseInt(I);let L=parseInt(C);S.toLowerCase()==="pm"&&L!==12&&(L+=12),S.toLowerCase()==="am"&&L===12&&(L=0),w=new Date(X,parseInt(Q)-1,parseInt(D),L,parseInt(T))}if((!w||isNaN(w.getTime()))&&(w=new Date(v)),!(!w||isNaN(w.getTime())))return new Yr(w.getFullYear(),w.getMonth()+1,w.getDate(),w.getHours(),w.getMinutes(),w.getSeconds())}function i(O){if(!O)return"";const v=String(O.day).padStart(2,"0"),w=String(O.month).padStart(2,"0"),_=String(O.year);if("hour"in O){const C=O,T=String(C.hour).padStart(2,"0"),S=String(C.minute).padStart(2,"0");return`${v}-${w}-${_} ${T}:${S}`}return`${v}-${w}-${_}`}let s=A(()=>r(e.value));function o(O){e.onchange(i(O))}function a(){e.onchange("")}const l=new Date,c=new Yr(l.getFullYear(),l.getMonth()+1,l.getDate(),12,0);var u=c$(),h=x(u);{var d=O=>{var v=e$(),w=x(v);{var _=S=>{var Q=Kq(),D=x(Q),I=M(D);{var X=L=>{var R=Hq();y(L,R)};Z(I,L=>{e.field.validate?.required&&L(X)})}b(Q),B(L=>$(D,`${L??""} `),[()=>n(e.field.label)]),y(S,Q)};Z(w,S=>{e.field.label&&S(_)})}var C=M(w,2);{var T=S=>{var Q=Jq();lt(Q,()=>n(e.field.help),!0),b(Q),y(S,Q)};Z(C,S=>{e.field.help&&S(T)})}b(v),y(O,v)};Z(h,O=>{(e.field.label||e.field.help)&&O(d)})}var m=M(h,2);Gt(m,()=>Fq,(O,v)=>{v(O,{get value(){return f(s)},onValueChange:o,granularity:"minute",hourCycle:24,get placeholder(){return c},weekStartsOn:1,fixedWeeks:!0,get disabled(){return e.field.disabled},get readonly(){return e.field.readonly},children:(w,_)=>{var C=o$(),T=me(C),S=x(T);{const L=(R,F)=>{let U=()=>F?.().segments;var j=_e(),Y=me(j);Ue(Y,17,U,dn,(ie,N)=>{var z=_e(),he=me(z);{var te=J=>{var q=t$(),re=x(q,!0);b(q),B(()=>$(re,f(N).value)),y(J,q)},V=J=>{var q=_e(),re=me(q);Gt(re,()=>Nq,(oe,Se)=>{Se(oe,{get part(){return f(N).part},class:"inline rounded-sm px-0.5 py-0.5 text-foreground tabular-nums caret-transparent outline-none focus:bg-primary focus:text-primary-foreground",children:(se,pe)=>{na();var ae=vs();B(()=>$(ae,f(N).value)),y(se,ae)},$$slots:{default:!0}})}),y(J,q)};Z(he,J=>{f(N).part==="literal"?J(te):J(V,-1)})}y(ie,z)}),y(R,j)};Gt(S,()=>Xq,(R,F)=>{F(R,{class:"flex h-10 flex-1 items-center gap-0.5 rounded-lg border border-input bg-muted/50 px-3 text-sm shadow-sm transition-colors focus-within:ring-1 focus-within:ring-ring",children:L,$$slots:{default:!0}})})}var Q=M(S,2);{var D=L=>{var R=n$(),F=x(R);ji(F,{size:14}),b(R),B(U=>Ve(R,"aria-label",U),[()=>ve.t("ADMIN_NEXT.FIELDS.CLEAR_DATE")]),Ce("click",R,a),y(L,R)};Z(Q,L=>{f(s)&&!e.field.validate?.required&&L(D)})}var I=M(Q,2);Gt(I,()=>Gq,(L,R)=>{R(L,{class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-input bg-muted/50 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:(F,U)=>{vA(F,{size:16})},$$slots:{default:!0}})}),b(T);var X=M(T,2);Gt(X,()=>Uq,(L,R)=>{R(L,{class:"z-50 rounded-xl border border-border bg-popover p-4 text-popover-foreground shadow-lg outline-none",sideOffset:8,children:(F,U)=>{var j=_e(),Y=me(j);{const ie=(N,z)=>{let he=()=>z?.().months,te=()=>z?.().weekdays;var V=s$(),J=x(V);Gt(J,()=>lU,(re,oe)=>{oe(re,{class:"flex items-center justify-between",children:(Se,se)=>{var pe=r$(),ae=me(pe);Gt(ae,()=>mU,(H,ue)=>{ue(H,{class:"flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:(ye,De)=>{Dl(ye,{name:"chevron-back",size:16})},$$slots:{default:!0}})});var G=M(ae,2);Gt(G,()=>uU,(H,ue)=>{ue(H,{class:"text-sm font-medium text-foreground"})});var K=M(G,2);Gt(K,()=>dU,(H,ue)=>{ue(H,{class:"flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:(ye,De)=>{Dl(ye,{name:"chevron-forward",size:16})},$$slots:{default:!0}})}),y(Se,pe)},$$slots:{default:!0}})});var q=M(J,2);Ue(q,17,he,dn,(re,oe)=>{var Se=_e(),se=me(Se);Gt(se,()=>HY,(pe,ae)=>{ae(pe,{class:"w-full border-collapse",children:(G,K)=>{var H=i$(),ue=me(H);Gt(ue,()=>rU,(De,W)=>{W(De,{children:(ce,we)=>{var xe=_e(),fe=me(xe);Gt(fe,()=>Mx,(Te,Qe)=>{Qe(Te,{class:"flex w-full",children:(Be,$e)=>{var Ne=_e(),Ge=me(Ne);Ue(Ge,17,te,dn,(wt,qt)=>{var tt=_e(),ct=me(tt);Gt(ct,()=>sU,(Ot,Zn)=>{Zn(Ot,{class:"w-9 text-center text-[0.8rem] font-medium text-muted-foreground",children:(Vt,kt)=>{na();var Xt=vs();B(()=>$(Xt,f(qt))),y(Vt,Xt)},$$slots:{default:!0}})}),y(wt,tt)}),y(Be,Ne)},$$slots:{default:!0}})}),y(ce,xe)},$$slots:{default:!0}})});var ye=M(ue,2);Gt(ye,()=>JY,(De,W)=>{W(De,{children:(ce,we)=>{var xe=_e(),fe=me(xe);Ue(fe,17,()=>f(oe).weeks,dn,(Te,Qe)=>{var Be=_e(),$e=me(Be);Gt($e,()=>Mx,(Ne,Ge)=>{Ge(Ne,{class:"flex w-full",children:(wt,qt)=>{var tt=_e(),ct=me(tt);Ue(ct,17,()=>f(Qe),dn,(Ot,Zn)=>{var Vt=_e(),kt=me(Vt);Gt(kt,()=>tU,(Xt,ei)=>{ei(Xt,{get date(){return f(Zn)},get month(){return f(oe).value},class:"relative p-0 text-center",children:(ti,nr)=>{var Qn=_e(),qs=me(Qn);Gt(qs,()=>$Y,(Ga,Ha)=>{Ha(Ga,{class:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-sm font-normal transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-[disabled]:pointer-events-none data-[disabled]:text-muted-foreground/30 data-[outside-month]:pointer-events-none data-[outside-month]:text-muted-foreground/30 data-[selected]:bg-primary data-[selected]:font-semibold data-[selected]:text-primary-foreground data-[today]:border data-[today]:border-primary/40"})}),y(ti,Qn)},$$slots:{default:!0}})}),y(Ot,Vt)}),y(wt,tt)},$$slots:{default:!0}})}),y(Te,Be)}),y(ce,xe)},$$slots:{default:!0}})}),y(G,H)},$$slots:{default:!0}})}),y(re,Se)}),b(V),y(N,V)};Gt(Y,()=>Bq,(N,z)=>{z(N,{children:ie,$$slots:{default:!0}})})}y(F,j)},$$slots:{default:!0}})}),y(w,C)},$$slots:{default:!0}})});var g=M(m,2);{var p=O=>{const v=A(()=>n(e.field.description));var w=_e(),_=me(w);{var C=S=>{var Q=a$();lt(Q,()=>Ro.parseInline(f(v)),!0),b(Q),y(S,Q)},T=S=>{var Q=l$(),D=x(Q,!0);b(Q),B(()=>$(D,f(v))),y(S,Q)};Z(_,S=>{e.field.markdown?S(C):S(T,-1)})}y(O,w)};Z(g,O=>{e.field.description&&O(p)})}b(u),y(t,u),Re()}It(["click"]);var h$=P(' '),d$=P('

'),f$=P("
"),m$=P('
'),g$=P('

'),p$=P('
'),O$=P('
');function v$(t,e){Me(e,!0);const n=ve.tMaybe;let r=ge(Pt({})),i=ge(!1);function s(O){if(O&&typeof O=="object"&&!Array.isArray(O)){const v={};for(const[w,_]of Object.entries(O))Array.isArray(_)?v[w]=_.map(String):typeof _=="string"?v[w]=_.split(",").map(C=>C.trim()).filter(Boolean):v[w]=[];return v}return{}}const o=A(()=>s(e.value));We(()=>{Ns.get("/taxonomy").then(O=>{k(r,O,!0),k(i,!0)}).catch(()=>{k(i,!0)})});const a=A(()=>{const O=new Set(Object.keys(f(r)));for(const v of Object.keys(f(o)))O.add(v);return[...O].sort()});function l(O,v){const w=Array.isArray(v)?v.filter(Boolean):[],_={...f(o)};w.length>0?_[O]=w:delete _[O],e.onchange(Object.keys(_).length>0?_:void 0)}function c(O){return{name:O,type:"selectize",label:O.charAt(0).toUpperCase()+O.slice(1),placeholder:`Add ${O}...`,options:(f(r)[O]??[]).map(v=>({value:v,label:v})),validate:{type:"array"}}}var u=O$(),h=x(u);{var d=O=>{var v=f$(),w=x(v);{var _=S=>{var Q=h$(),D=x(Q,!0);b(Q),B(I=>$(D,I),[()=>n(e.field.label)]),y(S,Q)};Z(w,S=>{e.field.label&&S(_)})}var C=M(w,2);{var T=S=>{var Q=d$();lt(Q,()=>n(e.field.help),!0),b(Q),y(S,Q)};Z(C,S=>{e.field.help&&S(T)})}b(v),y(O,v)};Z(h,O=>{(e.field.label||e.field.help)&&O(d)})}var m=M(h,2);{var g=O=>{var v=m$();y(O,v)},p=O=>{var v=p$(),w=x(v);Ue(w,16,()=>f(a),T=>T,(T,S)=>{{let Q=A(()=>c(S)),D=A(()=>f(o)[S]??[]);Sp(T,{get field(){return f(Q)},get value(){return f(D)},onchange:I=>l(S,I)})}});var _=M(w,2);{var C=T=>{var S=g$(),Q=x(S,!0);b(S),B(D=>$(Q,D),[()=>ve.t("ADMIN_NEXT.FIELDS.NO_TAXONOMY_TYPES")]),y(T,S)};Z(_,T=>{f(a).length===0&&T(C)})}b(v),y(O,v)};Z(m,O=>{f(i)?O(p,-1):O(g)})}b(u),y(t,u),Re()}var b$=P('*'),y$=P(''),x$=P('

'),S$=P("
"),w$=P('

'),k$=P('

'),_$=P('
');function P$(t,e){Me(e,!0);const n=ve.tMaybe;let r=ge(!1);function i(O){return O.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[''\u2019]/g,"").replace(/[^a-z0-9\s_-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function s(){const O=e.getValue("header.title");if(typeof O=="string"&&O.trim()){const v=i(O);e.onchange(v),k(r,!0),setTimeout(()=>{k(r,!1)},600)}}function o(O){let v=O.target.value;v=v.toLowerCase().replace(/\s/g,"-").replace(/[^a-z0-9_-]/g,""),e.onchange(v)}var a=_$(),l=x(a);{var c=O=>{var v=S$(),w=x(v);{var _=S=>{var Q=y$(),D=x(Q),I=M(D);{var X=L=>{var R=b$();y(L,R)};Z(I,L=>{e.field.validate?.required&&L(X)})}b(Q),B(L=>$(D,`${L??""} `),[()=>n(e.field.label)]),y(S,Q)};Z(w,S=>{e.field.label&&S(_)})}var C=M(w,2);{var T=S=>{var Q=x$();lt(Q,()=>n(e.field.help),!0),b(Q),y(S,Q)};Z(C,S=>{e.field.help&&S(T)})}b(v),y(O,v)};Z(l,O=>{(e.field.label||e.field.help)&&O(c)})}var u=M(l,2),h=x(u);En(h);var d=M(h,2),m=x(d);{let O=A(()=>f(r)?"animate-spin":"");zA(m,{size:14,get class(){return f(O)}})}b(d),b(u);var g=M(u,2);{var p=O=>{const v=A(()=>n(e.field.description));var w=_e(),_=me(w);{var C=S=>{var Q=w$();lt(Q,()=>Ro.parseInline(f(v)),!0),b(Q),y(S,Q)},T=S=>{var Q=k$(),D=x(Q,!0);b(Q),B(()=>$(D,f(v))),y(S,Q)};Z(_,S=>{e.field.markdown?S(C):S(T,-1)})}y(O,w)};Z(g,O=>{e.field.description&&O(p)})}b(a),B((O,v)=>{Je(h,1,`flex h-10 min-w-0 flex-1 rounded-l-lg border border-r-0 border-input bg-muted/50 px-3 py-2 font-mono text-sm shadow-sm transition-all placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring ${f(r)?"bg-primary/10 text-primary":"text-foreground"}`),Jn(h,e.value??e.field.default??""),Ve(h,"placeholder",O),h.disabled=e.field.disabled,h.readOnly=e.field.readonly,Ve(d,"title",v)},[()=>n(e.field.placeholder)||"folder-name",()=>ve.t("ADMIN_NEXT.FIELDS.REGENERATE_SLUG")]),Ce("input",h,o),Ce("click",d,s),y(t,a),Re()}It(["input","click"]);var Q$=P(''),C$=P('

'),T$=P("
"),A$=P(''),E$=P('
'),D$=P('
',1),M$=P(''),R$=P('
'),L$=P('
'),I$=P('
'),X$=P(''),Z$=P('
'),N$=P(''),V$=P('
'),F$=P('
'),j$=P('
');function B$(t,e){Me(e,!0);const n=ve.tMaybe,r=Wt("pageMediaItems"),i=Wt("blueprintScope");let s=ge(!1),o=ge(""),a=ge(-1),l=ge(null);const c=A(()=>typeof e.value=="string"?e.value:""),u=A(()=>!e.field.folder||e.field.folder==="self@"||e.field.folder==="@self"||e.field.folder==="@self/"||e.field.folder==="@self@");let h=ge(null),d=ge(!1),m=ge(null);We(()=>{if(f(u)){k(h,null),k(d,!1),k(m,null);return}const V=e.field.folder,J=i?.()??"",q=e.field.accept;let re=!1;return k(d,!0),k(m,null),FA({folder:V,scope:J,accept:q}).then(oe=>{re||(oe===jA?k(h,null):k(h,oe.items,!0),k(d,!1))}).catch(oe=>{re||(k(h,[],!0),k(m,oe instanceof Error?oe.message:String(oe),!0),k(d,!1))}),()=>{re=!0}});function g(V){if(!e.field.accept||e.field.accept.length===0)return!0;const J=V.filename.toLowerCase(),q=V.type.toLowerCase();return e.field.accept.some(re=>{const oe=re.toLowerCase().trim();if(oe.includes("*")){const Se=oe.replace("*","");return q.startsWith(Se)}return oe.startsWith(".")?J.endsWith(oe):q===oe})}const p=A(()=>f(u)?r?.items??[]:f(h)??[]),O=A(()=>{const V=f(u)?f(p).filter(g):f(p);if(!f(o))return V;const J=f(o).toLowerCase();return V.filter(q=>q.filename.toLowerCase().includes(J))});function v(V){return V.type.startsWith("image/")}function w(V){const J=jp(V);return J.startsWith("http")||J.startsWith("/")?J:`${_t.serverUrl}/${J}`}function _(V){if(V.thumbnail_url){const J=V.thumbnail_url;return J.startsWith("http")?J:`${_t.serverUrl}${J}`}return w(V.url)}function C(V){e.onchange(V),k(s,!1),k(o,""),k(a,-1)}function T(){e.onchange("")}function S(V){V.key==="Escape"?(k(s,!1),k(a,-1)):V.key==="ArrowDown"?(V.preventDefault(),k(a,Math.min(f(a)+1,f(O).length-1),!0),k(s,!0)):V.key==="ArrowUp"?(V.preventDefault(),k(a,Math.max(f(a)-1,-1),!0)):V.key==="Enter"&&f(a)>=0&&(V.preventDefault(),C(f(O)[f(a)].filename))}function Q(){k(s,!0),k(a,-1)}function D(){setTimeout(()=>{k(s,!1),k(o,""),k(a,-1)},200)}const I=A(()=>f(c)?f(p).find(V=>V.filename===f(c))??null:null);We(()=>{if(!f(u))return;const V=r?.items;if(!V||V.length===0||!f(c))return;V.some(q=>q.filename===f(c))||e.onchange("")});var X=j$(),L=x(X);{var R=V=>{var J=T$(),q=x(J);{var re=se=>{var pe=Q$(),ae=x(pe,!0);b(pe),B(G=>$(ae,G),[()=>n(e.field.label)]),y(se,pe)};Z(q,se=>{e.field.label&&se(re)})}var oe=M(q,2);{var Se=se=>{var pe=C$();lt(pe,()=>n(e.field.help),!0),b(pe),y(se,pe)};Z(oe,se=>{e.field.help&&se(Se)})}b(J),y(V,J)};Z(L,V=>{(e.field.label||e.field.help)&&V(R)})}var F=M(L,2),U=x(F),j=x(U);{var Y=V=>{var J=D$(),q=me(J),re=x(q);{var oe=H=>{var ue=A$();B(ye=>{Ve(ue,"src",ye),Ve(ue,"alt",f(I).filename)},[()=>_(f(I))]),y(H,ue)},Se=A(()=>f(I)&&v(f(I))),se=H=>{var ue=E$(),ye=x(ue,!0);b(ue),B(De=>$(ye,De),[()=>f(c).split(".").pop()?.toUpperCase().slice(0,4)??""]),y(H,ue)};Z(re,H=>{f(Se)?H(oe):H(se,-1)})}var pe=M(re,2),ae=x(pe,!0);b(pe),b(q);var G=M(q,2),K=x(G);ji(K,{size:14}),b(G),B(()=>$(ae,f(c))),Ce("click",G,T),y(V,J)},ie=V=>{var J=M$();En(J),gn(J,q=>k(l,q),()=>f(l)),B(q=>{Ve(J,"placeholder",q),Jn(J,f(o))},[()=>f(c)||n(e.field.placeholder)||"Select a file..."]),Ce("input",J,q=>{k(o,q.target.value,!0)}),Ce("keydown",J,S),en("focus",J,Q),en("blur",J,D),y(V,J)};Z(j,V=>{f(c)&&!f(s)?V(Y):V(ie,-1)})}var N=M(j,2);Ve(N,"tabindex",-1);var z=x(N);da(z,{size:14}),b(N),b(U);var he=M(U,2);{var te=V=>{var J=F$(),q=x(J);{var re=pe=>{var ae=R$(),G=x(ae,!0);b(ae),B(K=>$(G,K),[()=>ve.t("ADMIN_NEXT.COMMON.LOADING")||"Loading…"]),y(pe,ae)},oe=pe=>{var ae=L$(),G=x(ae,!0);b(ae),B(()=>$(G,f(m))),y(pe,ae)},Se=pe=>{var ae=I$(),G=x(ae);{var K=ye=>{var De=vs();B(W=>$(De,W),[()=>ve.t("ADMIN_NEXT.FIELDS.FILE_PICKER.NO_MEDIA_UPLOADED")]),y(ye,De)},H=ye=>{var De=vs();B(W=>$(De,W),[()=>ve.t("ADMIN_NEXT.FIELDS.FILE_PICKER.NO_MEDIA_UPLOADED")]),y(ye,De)},ue=ye=>{var De=vs();B(W=>$(De,W),[()=>ve.t("ADMIN_NEXT.FIELDS.FILE_PICKER.NO_MATCHING_FILES")]),y(ye,De)};Z(G,ye=>{f(u)&&(r?.items??[]).length===0?ye(K):!f(u)&&f(p).length===0?ye(H,1):ye(ue,-1)})}b(ae),y(pe,ae)},se=pe=>{var ae=V$();Ue(ae,23,()=>f(O),G=>G.filename,(G,K,H)=>{var ue=N$(),ye=x(ue);{var De=fe=>{var Te=X$();B(Qe=>{Ve(Te,"src",Qe),Ve(Te,"alt",f(K).filename)},[()=>_(f(K))]),y(fe,Te)},W=A(()=>v(f(K))),ce=fe=>{var Te=Z$(),Qe=x(Te,!0);b(Te),B(Be=>$(Qe,Be),[()=>f(K).filename.split(".").pop()?.toUpperCase().slice(0,4)]),y(fe,Te)};Z(ye,fe=>{f(W)?fe(De):fe(ce,-1)})}var we=M(ye,2),xe=x(we,!0);b(we),b(ue),B(()=>{Je(ue,1,`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-start transition-colors ${f(K).filename===f(c)?"bg-primary/10 text-primary":f(H)===f(a)?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent"}`),$(xe,f(K).filename)}),Ce("mousedown",ue,fe=>{fe.preventDefault(),C(f(K).filename)}),y(G,ue)}),b(ae),y(pe,ae)};Z(q,pe=>{f(d)?pe(re):f(m)?pe(oe,1):f(O).length===0?pe(Se,2):pe(se,-1)})}b(J),y(V,J)};Z(he,V=>{f(s)&&V(te)})}b(F),b(X),Ce("click",N,()=>{k(s,!f(s)),f(s)&&f(l)?.focus()}),y(t,X),Re()}It(["click","input","keydown","mousedown"]);var z$=P(''),W$=P('

'),Y$=P("
"),U$=P(''),q$=P('
'),$$=P('
'),G$=P('
'),H$=P('
'),K$=P('

'),J$=P('

',1),eG=P('
',1),tG=P('
');function nG(t,e){Me(e,!0);const n=ve.tMaybe,r=Wt("pageRoute"),i=Wt("mediaSource"),s=Wt("pageMediaItems"),o=Wt("blueprintScope"),a=JA(),l=new Set,c=A(()=>e.field.destination??""),u=A(()=>f(c)!==""),h=A(()=>i?.()),d=A(()=>f(h)?.apiBase??null);let m=ge(!1),g=ge(0),p=ge(!1),O=ge(null),v;const w=A(()=>{if(!e.value||typeof e.value=="object"&&Object.keys(e.value).length===0)return[];if(e.value&&typeof e.value=="object"&&!Array.isArray(e.value)){const re=e.value,oe=[];for(const[Se,se]of Object.entries(re))se&&typeof se=="object"&&"name"in se&&oe.push({key:Se,entry:se});if(oe.length>0)return oe}return _(e.value).map(re=>{const oe=(s?.items??[]).find(se=>se.filename===re),Se=C(re);return{key:Se,entry:{name:re,type:oe?.type??"application/octet-stream",size:oe?.size??0,path:Se}}})});function _(q){return Array.isArray(q)?q.filter(re=>typeof re=="string"&&re!==""):typeof q=="string"&&q?[q]:[]}function C(q){if(f(d))return q;const re=r?.()??"";return`user/pages/${re.startsWith("/")?re.slice(1):re}/${q}`}function T(){if(f(u))return`${_t.serverUrl}${_t.apiPrefix}/blueprint-upload`;if(f(d))return`${_t.serverUrl}${_t.apiPrefix}/${f(d)}/media`;const q=r?.()??"",re=q.startsWith("/")?q.slice(1):q;return`${_t.serverUrl}${_t.apiPrefix}/pages/${re}/media`}function S(){const q={};return _t.accessToken&&(q["X-API-Token"]=_t.accessToken),q["X-Grav-Environment"]=_t.gravEnvironment,q}function Q(){return!e.field.accept||e.field.accept.length===0?"":e.field.accept.join(",")}function D(){const q={};return e.field.random_name&&(q.random_name="1"),e.field.avoid_overwriting&&(q.avoid_overwriting="1"),e.field.accept?.length&&(q.accept=e.field.accept.join(",")),typeof e.field.filesize=="number"&&e.field.filesize>0&&(q.filesize=String(e.field.filesize)),q}function I(q){const re={};for(const{key:oe,entry:Se}of q)re[oe]=Se;return re}function X(){const re=typeof e.field.filesize=="number"&&e.field.filesize>0?e.field.filesize*1024*1024:67108864;v=new hS({id:`file-field-${e.field.name}`,autoProceed:!0,restrictions:{maxFileSize:Math.min(67108864,re),allowedFileTypes:e.field.accept?.length?e.field.accept:void 0}});const oe=D(),Se={...oe};f(u)&&(Se.destination=f(c),Se.scope=o?.()??""),v.setMeta(Se),v.use(dS,{endpoint:T(),fieldName:"file",headers:S,formData:!0,allowedMetaFields:[...Object.keys(oe),...f(u)?["destination","scope"]:[]]}),v.addPreProcessor(async()=>{await Ns.ensureAuth()}),v.on("upload-start",()=>{k(m,!0)}),v.on("upload-progress",(se,pe)=>{const ae=pe.bytesTotal??0;k(g,ae>0?Math.round(pe.bytesUploaded/ae*100):0,!0)}),v.on("upload-success",(se,pe)=>{if(!se)return;let ae=C(se.name);if(f(u)){const K=pe?.body,H=K?.data?.find(ue=>ue.name===se.name)??K?.data?.[0];H?.path&&(ae=H.path)}const G={key:ae,entry:{name:se.name,type:se.type??"application/octet-stream",size:se.size??0,path:ae}};e.field.multiple?e.onchange(I([...f(w),G])):e.onchange(I([G]))}),v.on("upload-error",(se,pe)=>{xi.error(`Failed to upload ${se?.name??"file"}: ${pe.message}`)}),v.on("complete",()=>{if(k(m,!1),k(g,0),v?.cancelAll(),f(u))return;if(f(d)){if(Um.emit(f(h)?.invalidationKeys??[]),s){const ae=f(d);de(async()=>{const{getObjectMedia:G}=await import("./DXEgXodZ.js").then(K=>K.m);return{getObjectMedia:G}},__vite__mapDeps([6,7,8]),import.meta.url).then(({getObjectMedia:G})=>{G(ae).then(K=>s.update(K))})}return}const se=r?.()??"",pe=se.startsWith("/")?se.slice(1):se;Um.emit([`media:update:pages/${pe}`,`pages:update:/${pe}`]),s&&de(async()=>{const{getPageMedia:ae}=await import("./DXEgXodZ.js").then(G=>G.m);return{getPageMedia:ae}},__vite__mapDeps([6,7,8]),import.meta.url).then(({getPageMedia:ae})=>{ae(se).then(G=>s.update(G))})})}function L(q){return(s?.items??[]).find(re=>re.filename===q)}function R(q){if(q.thumbnail_url){const oe=q.thumbnail_url;return oe.startsWith("http")?oe:`${_t.serverUrl}${oe}`}const re=jp(q.url);return re.startsWith("http")||re.startsWith("/")?re:`${_t.serverUrl}/${re}`}function F(q){if(!v)return;let re=q;if(e.field.multiple&&typeof e.field.limit=="number"&&e.field.limit>0){const oe=e.field.limit-f(w).length;if(oe<=0){xi.error(ve.t("ADMIN_NEXT.FIELDS.FILE.LIMIT_REACHED",{limit:e.field.limit}));return}re.length>oe&&(re=re.slice(0,oe),xi.error(ve.t("ADMIN_NEXT.FIELDS.FILE.LIMIT_REACHED",{limit:e.field.limit})))}for(const oe of re)try{v.addFile({name:oe.name,type:oe.type,data:oe,source:"local"})}catch(Se){console.warn("Could not add file:",Se)}}function U(q){const oe=f(w).find(se=>se.key===q)?.entry.path??"",Se=f(w).filter(se=>se.key!==q);Se.length===0?e.onchange({}):e.onchange(I(Se)),f(u)&&oe&&l.add(oe)}We(()=>{if(a)return a.register(async()=>{if(l.size===0)return;const q=[...l];l.clear();const{deleteBlueprintFile:re}=await de(async()=>{const{deleteBlueprintFile:oe}=await import("./DXEgXodZ.js").then(Se=>Se.m);return{deleteBlueprintFile:oe}},__vite__mapDeps([6,7,8]),import.meta.url);for(const oe of q)try{await re(oe)}catch(Se){console.warn("[FileField] Failed to delete file on server:",Se)}})}),We(()=>{const q=s?.items;if(!q||q.length===0||f(w).length===0)return;const re=new Set(q.map(Se=>Se.filename)),oe=f(w).filter(Se=>re.has(Se.entry.name));oe.length!==f(w).length&&(oe.length===0?e.onchange({}):e.onchange(I(oe)))});function j(q){q.preventDefault(),k(p,!1);const re=q.dataTransfer?.files;re&&F(Array.from(re))}function Y(q){const re=q.target;re.files&&F(Array.from(re.files)),re.value=""}tr(()=>(X(),()=>v?.cancelAll()));var ie=tG(),N=x(ie);{var z=q=>{var re=Y$(),oe=x(re);{var Se=ae=>{var G=z$(),K=x(G,!0);b(G),B(H=>$(K,H),[()=>n(e.field.label)]),y(ae,G)};Z(oe,ae=>{e.field.label&&ae(Se)})}var se=M(oe,2);{var pe=ae=>{var G=W$();lt(G,()=>n(e.field.help),!0),b(G),y(ae,G)};Z(se,ae=>{e.field.help&&ae(pe)})}b(re),y(q,re)};Z(N,q=>{(e.field.label||e.field.help)&&q(z)})}var he=M(N,2);{var te=q=>{var re=G$();Ue(re,21,()=>f(w),({key:oe,entry:Se})=>oe,(oe,Se)=>{let se=()=>f(Se).key,pe=()=>f(Se).entry;const ae=A(()=>L(pe().name));var G=$$(),K=x(G);{var H=xe=>{var fe=U$();B(Te=>{Ve(fe,"src",Te),Ve(fe,"alt",pe().name)},[()=>R(f(ae))]),y(xe,fe)},ue=A(()=>f(ae)&&f(ae).type.startsWith("image/")),ye=xe=>{var fe=q$(),Te=x(fe,!0);b(fe),B(Qe=>$(Te,Qe),[()=>pe().name.split(".").pop()?.toUpperCase().slice(0,4)??""]),y(xe,fe)};Z(K,xe=>{f(ue)?xe(H):xe(ye,-1)})}var De=M(K,2),W=x(De,!0);b(De);var ce=M(De,2),we=x(ce);ji(we,{size:14}),b(ce),b(G),B(()=>$(W,pe().name)),Ce("click",ce,()=>U(se())),y(oe,G)}),b(re),y(q,re)};Z(he,q=>{f(w).length>0&&q(te)})}var V=M(he,2);{var J=q=>{var re=eG(),oe=me(re);Ve(oe,"tabindex",0);var Se=x(oe);{var se=G=>{var K=H$(),H=x(K),ue=x(H);b(H);var ye=M(H,2),De=x(ye);let W;b(ye),b(K),B(()=>{$(ue,`Uploading... ${f(g)??""}%`),W=yi(De,"",W,{width:`${f(g)??""}%`})}),y(G,K)},pe=G=>{var K=J$(),H=me(K);fS(H,{size:16,class:"text-muted-foreground/60"});var ue=M(H,2),ye=x(ue,!0);b(ue);var De=M(ue,2);{var W=ce=>{var we=K$(),xe=x(we,!0);b(we),B(fe=>$(xe,fe),[()=>e.field.accept.join(", ")]),y(ce,we)};Z(De,ce=>{e.field.accept?.length&&ce(W)})}B(()=>$(ye,f(p)?"Drop file here":"Drop file or click to upload")),y(G,K)};Z(Se,G=>{f(m)?G(se):G(pe,-1)})}b(oe);var ae=M(oe,2);gn(ae,G=>k(O,G),()=>f(O)),B(G=>{Je(oe,1,`flex cursor-pointer flex-col items-center gap-1 rounded-lg border-2 border-dashed px-4 py-4 text-center transition-colors ${f(p)?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/40"}`),Ve(ae,"accept",G),ae.multiple=!!e.field.multiple},[()=>Q()]),en("dragover",oe,G=>{G.preventDefault(),k(p,!0)}),en("dragleave",oe,()=>{k(p,!1)}),en("drop",oe,j),Ce("click",oe,()=>f(O)?.click()),Ce("keydown",oe,G=>{(G.key==="Enter"||G.key===" ")&&f(O)?.click()}),Ce("change",ae,Y),y(q,re)};Z(V,q=>{(e.field.multiple||f(w).length===0)&&q(J)})}b(ie),y(t,ie),Re()}It(["click","keydown","change"]);var rG=P('
'),iG=P('
');function sG(t,e){Me(e,!0);const n=A(()=>typeof e.value=="string"?e.value:e.field.default??""),r=A(()=>(e.field.fields??[]).filter(c=>c.type==="element")),i=A(()=>f(r).find(c=>String(c.name)===f(n)));var s=iG(),o=x(s);fC(o,{get field(){return e.field},get value(){return f(n)},get onchange(){return e.onchange}});var a=M(o,2);{var l=c=>{var u=rG();Ue(u,21,()=>f(i).fields,h=>h.name,(h,d)=>{{let m=A(()=>e.getValue(f(d).name)),g=A(()=>e.onFieldCommit?(p,O)=>e.onFieldCommit(f(d).name,p,O):void 0);Cr(h,{get field(){return f(d)},get value(){return f(m)},onchange:p=>e.onFieldChange(f(d).name,p),get oncommit(){return f(g)},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit}})}}),b(u),y(c,u)};Z(a,c=>{f(i)?.fields&&c(l)})}b(s),y(t,s),Re()}function oG(t,e){Me(e,!0);const n=A(()=>{const a=e.field.condition;if(!a)return!0;const l=a.match(/^(.+?)\s*(==|!=)\s*['"]?(.+?)['"]?\s*$/);if(l){const[,u,h,d]=l,m=r(u.trim()),g=String(m??""),p=d.trim();return h==="=="?g===p:g!==p}return!!r(a.trim())});function r(a){return a.startsWith("config.")?!0:e.getValue(a)}var i=_e(),s=me(i);{var o=a=>{var l=_e(),c=me(l);Ue(c,17,()=>e.field.fields,u=>u.name,(u,h)=>{{let d=A(()=>e.getValue(f(h).name)),m=A(()=>e.onFieldCommit?(g,p)=>e.onFieldCommit(f(h).name,g,p):void 0);Cr(u,{get field(){return f(h)},get value(){return f(d)},onchange:g=>e.onFieldChange(f(h).name,g),get oncommit(){return f(m)},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit}})}}),y(a,l)};Z(s,a=>{f(n)&&e.field.fields&&a(o)})}y(t,i),Re()}var aG=P('
');function lG(t,e){Me(e,!0);let n=ee(e,"value",3,""),r=ee(e,"language",3,"yaml"),i=ee(e,"placeholder",3,""),s=ee(e,"minHeight",3,"auto"),o=ee(e,"maxHeight",3,"400px"),a=ee(e,"disabled",3,!1),l=ee(e,"readonly",3,!1),c=ee(e,"class",3,""),u=ge(null),h,d=ge(!1);function m(){k(d,document.documentElement.classList.contains("dark"),!0)}const g=Ae.theme({"&":{fontSize:"13px",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',color:"hsl(240 10% 3.9%)"},".cm-content":{caretColor:"hsl(221 83% 53%)",padding:"8px 0",lineHeight:"1.5"},".cm-cursor":{borderLeftColor:"hsl(221 83% 53%)",borderLeftWidth:"2px"},".cm-scroller":{overflow:"auto"},".cm-gutters":{backgroundColor:"transparent",borderRight:"none",color:"hsl(240 3.8% 46.1%)",paddingRight:"8px"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"hsl(240 10% 3.9%)"},".cm-activeLine":{backgroundColor:"hsl(240 4.8% 95.9% / 0.5)"},".cm-selectionBackground":{backgroundColor:"hsl(221 83% 53% / 0.15) !important"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"hsl(221 83% 53% / 0.25) !important"},".cm-line":{padding:"0 12px"},".cm-foldPlaceholder":{backgroundColor:"hsl(240 4.8% 95.9%)",border:"1px solid hsl(240 5.9% 90%)",borderRadius:"4px",padding:"0 6px"}}),p=Ae.theme({"&":{fontSize:"13px",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace'},".cm-content":{caretColor:"hsl(217 91% 60%)",padding:"8px 0",lineHeight:"1.5"},".cm-cursor":{borderLeftColor:"hsl(217 91% 60%)",borderLeftWidth:"2px"},".cm-scroller":{overflow:"auto"},".cm-gutters":{backgroundColor:"transparent",borderRight:"none",color:"hsl(240 5% 64.9%)",paddingRight:"8px"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"hsl(0 0% 98%)"},".cm-activeLine":{backgroundColor:"hsl(240 3.7% 15.9% / 0.5)"},".cm-selectionBackground":{backgroundColor:"hsl(217 91% 60% / 0.2) !important"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"hsl(217 91% 60% / 0.3) !important"},".cm-line":{padding:"0 12px"},".cm-foldPlaceholder":{backgroundColor:"hsl(240 3.7% 15.9%)",border:"1px solid hsl(240 3.7% 15.9%)",borderRadius:"4px",padding:"0 6px"}});function O(_){const C=[Sd(),Lw(),vd(),bk(),$_(),rC(),gM(),IM(),NM(),xM(),hL(),Ac(yd,{fallback:!0}),Io.of([...K_,...Cd,...uC,...kd,...aL,Td]),Ae.lineWrapping,Ae.editable.of(!a()&&!l()),ot.readOnly.of(!!l()),Ae.updateListener.of(T=>{T.docChanged&&e.onchange?.(T.state.doc.toString())})];return i()&&C.push(Ae.contentAttributes.of({"aria-placeholder":i()})),r()==="yaml"&&C.push(xd()),_?C.push(p,Ad):C.push(g),C}function v(){f(u)&&(h?.destroy(),h=new Ae({state:ot.create({doc:n()??"",extensions:O(f(d))}),parent:f(u)}))}We(()=>{h&&n()!==h.state.doc.toString()&&h.dispatch({changes:{from:0,to:h.state.doc.length,insert:n()??""}})}),We(()=>{f(d),f(u)&&mr(()=>v())}),tr(()=>{m();const _=new MutationObserver(()=>m());return _.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),v(),()=>{_.disconnect(),h?.destroy()}});var w=aG();gn(w,_=>k(u,_),()=>f(u)),B(()=>{Je(w,1,`overflow-hidden rounded-lg border border-input bg-muted/50 shadow-sm focus-within:ring-1 focus-within:ring-ring ${c()??""}`),yi(w,`${s()&&s()!=="auto"?`min-height: ${s()};`:""} max-height: ${o()??""}; overflow-y: auto;`),w.dir=w.dir}),y(t,w),Re()}var cG=P(''),uG=P('

'),hG=P("
"),dG=P('
');function fG(t,e){Me(e,!0);const n=ve.tMaybe,r=A(()=>typeof e.value=="string"?e.value:"");var i=dG(),s=x(i);{var o=l=>{var c=hG(),u=x(c);{var h=g=>{var p=cG(),O=x(p,!0);b(p),B(v=>$(O,v),[()=>n(e.field.label)]),y(g,p)};Z(u,g=>{e.field.label&&g(h)})}var d=M(u,2);{var m=g=>{var p=uG();lt(p,()=>n(e.field.help),!0),b(p),y(g,p)};Z(d,g=>{e.field.help&&g(m)})}b(c),y(l,c)};Z(s,l=>{(e.field.label||e.field.help)&&l(o)})}var a=M(s,2);lG(a,{get value(){return f(r)},onchange:l=>e.onchange(l),language:"yaml",maxHeight:"600px",get disabled(){return e.field.disabled},get readonly(){return e.field.readonly}}),b(i),y(t,i),Re()}var mG=P(''),gG=P('

'),pG=P("
"),OG=P('
',1),vG=P(''),bG=P(''),yG=P(''),xG=P('
'),SG=P('
'),wG=P('
'),kG=P('
');function _G(t,e){Me(e,!0);const n=ve.tMaybe;let r=ge(!1),i=ge(""),s=ge(null),o=ge(null);const a=A(()=>typeof e.value=="string"?e.value:""),l=A(()=>f(a).replace(/^fa-/,"")),c=A(()=>{if(!f(i))return j0.slice(0,200);const I=f(i).toLowerCase();return j0.filter(X=>X.n.includes(I)||X.t.includes(I)).slice(0,200)});function u(I){e.onchange("fa-"+I),k(r,!1),k(i,"")}function h(){e.onchange("")}function d(I){f(s)&&!f(s).contains(I.target)&&k(r,!1)}tr(()=>(document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)));var m=kG(),g=x(m);{var p=I=>{var X=pG(),L=x(X);{var R=j=>{var Y=mG(),ie=x(Y,!0);b(Y),B(N=>$(ie,N),[()=>n(e.field.label)]),y(j,Y)};Z(L,j=>{e.field.label&&j(R)})}var F=M(L,2);{var U=j=>{var Y=gG();lt(Y,()=>n(e.field.help),!0),b(Y),y(j,Y)};Z(F,j=>{e.field.help&&j(U)})}b(X),y(I,X)};Z(g,I=>{(e.field.label||e.field.help)&&I(p)})}var O=M(g,2),v=x(O),w=x(v);{var _=I=>{var X=OG(),L=me(X),R=x(L),F=M(R,2),U=x(F);b(F),b(L);var j=M(L,2),Y=x(j);ji(Y,{size:14}),b(j),B(()=>{Je(R,1,`fa-solid fa-${f(l)??""} text-base text-foreground`),$(U,`fa-${f(l)??""}`)}),Ce("click",j,h),y(I,X)},C=I=>{var X=vG(),L=x(X,!0);b(X),B(()=>$(L,f(a)?`fa-${f(l)}`:"Select an icon...")),Ce("click",X,()=>{k(r,!f(r))}),y(I,X)};Z(w,I=>{f(a)&&!f(r)?I(_):I(C,-1)})}var T=M(w,2);Ve(T,"tabindex",-1);var S=x(T);da(S,{size:14}),b(T),b(v);var Q=M(v,2);{var D=I=>{var X=wG(),L=x(X),R=x(L);cS(R,{size:14,class:"shrink-0 text-muted-foreground"});var F=M(R,2);En(F),tA(F,!0);var U=M(F,2);{var j=V=>{var J=bG(),q=x(J);ji(q,{size:12}),b(J),Ce("click",J,()=>{k(i,"")}),y(V,J)};Z(U,V=>{f(i)&&V(j)})}b(L);var Y=M(L,2),ie=x(Y);Ue(ie,17,()=>f(c),V=>V.n,(V,J)=>{var q=yG(),re=x(q);b(q),B(()=>{Je(q,1,`flex h-9 w-full items-center justify-center rounded-md transition-colors ${f(l)===f(J).n?"bg-primary text-primary-foreground":"text-foreground hover:bg-accent"}`),Ve(q,"title",f(J).n),Je(re,1,`fa-solid fa-${f(J).n??""} text-sm`)}),Ce("mousedown",q,oe=>{oe.preventDefault(),u(f(J).n)}),y(V,q)});var N=M(ie,2);{var z=V=>{var J=xG(),q=x(J,!0);b(J),B(re=>$(q,re),[()=>ve.t("ADMIN_NEXT.FIELDS.ICON_PICKER.NO_ICONS_FOUND")]),y(V,J)};Z(N,V=>{f(c).length===0&&V(z)})}b(Y),gn(Y,V=>k(o,V),()=>f(o));var he=M(Y,2);{var te=V=>{var J=SG(),q=x(J,!0);b(J),B(re=>$(q,re),[()=>ve.t("ADMIN_NEXT.FIELDS.ICON_PICKER.SHOWING_FIRST_200_RESULTS_TYPE_TO_NARROW")]),y(V,J)};Z(he,V=>{f(c).length>=200&&V(te)})}b(X),B(V=>{Ve(F,"placeholder",V),Jn(F,f(i))},[()=>ve.t("ADMIN_NEXT.FIELDS.ICON_PICKER.SEARCH_ICONS")]),Ce("input",F,V=>{k(i,V.target.value,!0)}),y(I,X)};Z(Q,I=>{f(r)&&I(D)})}b(O),gn(O,I=>k(s,I),()=>f(s)),b(m),Ce("click",T,()=>{k(r,!f(r))}),y(t,m),Re()}It(["click","input","mousedown"]);var PG=P(''),QG=P('

'),CG=P("
"),TG=P('
'),AG=P('
'),EG=P('
'),DG=P('
');function MG(t,e){Me(e,!0);const n=ve.tMaybe,r=A(()=>{if(!e.value||typeof e.value!="object")return[];const d=e.value;return Object.entries(d).map(([m,g])=>({key:m,state:g===!0?"allowed":g===!1?"denied":"unset"}))});function i(d,m){const g={...e.value??{}};m==="unset"?delete g[d]:g[d]=m==="allowed",e.onchange(g)}function s(d,m){if(d===m)switch(m){case"allowed":return"bg-green-500 text-white";case"denied":return"bg-red-500 text-white";case"unset":return"bg-muted text-foreground"}return"text-muted-foreground hover:bg-accent"}var o=DG(),a=x(o);{var l=d=>{var m=CG(),g=x(m);{var p=w=>{var _=PG(),C=x(_,!0);b(_),B(T=>$(C,T),[()=>n(e.field.label)]),y(w,_)};Z(g,w=>{e.field.label&&w(p)})}var O=M(g,2);{var v=w=>{var _=QG();lt(_,()=>n(e.field.help),!0),b(_),y(w,_)};Z(O,w=>{e.field.help&&w(v)})}b(m),y(d,m)};Z(a,d=>{(e.field.label||e.field.help)&&d(l)})}var c=M(a,2);{var u=d=>{var m=TG(),g=x(m,!0);b(m),B(p=>$(g,p),[()=>ve.t("ADMIN_NEXT.FIELDS.PERMISSIONS.NO_PERMISSIONS_CONFIGURED")]),y(d,m)},h=d=>{var m=EG();Ue(m,21,()=>f(r),g=>g.key,(g,p)=>{var O=AG(),v=x(O),w=x(v,!0);b(v);var _=M(v,2),C=x(_),T=x(C,!0);b(C);var S=M(C,2),Q=x(S,!0);b(S);var D=M(S,2),I=x(D,!0);b(D),b(_),b(O),B((X,L,R,F,U,j)=>{$(w,f(p).key),Je(C,1,`px-2.5 py-1 transition-colors ${X??""}`),$(T,L),Je(S,1,`border-x border-border px-2.5 py-1 transition-colors ${R??""}`),$(Q,F),Je(D,1,`px-2.5 py-1 transition-colors ${U??""}`),$(I,j)},[()=>s(f(p).state,"allowed"),()=>ve.t("ADMIN_NEXT.ALLOWED"),()=>s(f(p).state,"denied"),()=>ve.t("ADMIN_NEXT.DENIED"),()=>s(f(p).state,"unset"),()=>ve.t("ADMIN_NEXT.FIELDS.PERMISSIONS.NOT_SET")]),Ce("click",C,()=>i(f(p).key,"allowed")),Ce("click",S,()=>i(f(p).key,"denied")),Ce("click",D,()=>i(f(p).key,(f(p).state==="unset","unset"))),y(g,O)}),b(m),y(d,m)};Z(c,d=>{f(r).length===0?d(u):d(h,-1)})}b(o),y(t,o),Re()}It(["click"]);var RG=P('
'),LG=P(" ",1),IG=P(" ",1),XG=P('
'),ZG=P(' Error'),NG=P(' Ready'),VG=P(' ',1),FG=P(' ',1),jG=P(' '),BG=P('
Run State
'),zG=P('HEALTHY'),WG=P('WARNING'),YG=P('ERROR'),UG=P('

'),qG=P('CONFIGURED'),$G=P(' '),GG=P('ENABLED'),HG=P(' '),KG=P(' '),JG=P('
'),eH=P('

'),tH=P('

',1),nH=P('
');function rH(t,e){Me(e,!0);let n=ge(null),r=ge(Pt([])),i=ge(!0),s=ge(!1);async function o(){k(i,!0);try{await(async g=>{var p=nS(g,2);k(n,p[0],!0),k(r,p[1],!0)})(await Promise.all([lS(),bA()]))}catch{xi.error(ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.FAILED_TO_LOAD_SCHEDULER_STATUS"))}finally{k(i,!1)}}async function a(){k(s,!0);try{await xA(),xi.success(ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.SCHEDULER_RUN_COMPLETED")),await o()}catch{xi.error(ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.FAILED_TO_RUN_SCHEDULER"))}finally{k(s,!1)}}function l(g){if(g===null)return"Never";if(g<60)return`${g} second(s) ago`;const p=Math.floor(g/60);if(p<60)return`${p} minute(s) ago`;const O=Math.floor(p/60);return O<24?`${O} hour(s) ago`:`${Math.floor(O/24)} day(s) ago`}function c(g){const p=g.split(/\s+/);if(p.length<5)return g;const[O,v,w,_,C]=p;return O==="*"&&v==="*"?"Every minute":O==="*"&&v!=="*"&&!v.includes("/")?`Every minute at ${v.padStart(2,"0")}:xx`:v==="*"&&O!=="*"&&!O.includes("/")?`Every hour at :${O.padStart(2,"0")}`:w==="*"&&_==="*"&&C==="*"&&v!=="*"&&O!=="*"?`Every day at ${v.padStart(2,"0")}:${O.padStart(2,"0")}`:v.startsWith("*/")?`Every ${v.slice(2)} hours`:O.startsWith("*/")?`Every ${O.slice(2)} minutes`:g}tr(o);var u=nH(),h=x(u);{var d=g=>{var p=RG(),O=x(p,!0);b(p),B(v=>$(O,v),[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.LOADING_SCHEDULER_STATUS")]),y(g,p)},m=g=>{var p=tH(),O=me(p),v=x(O),w=x(v),_=x(w,!0);b(w);var C=M(w,2);sS(C,{size:"sm",variant:"outline",onclick:a,get disabled(){return f(s)},children:(R,F)=>{var U=_e(),j=me(U);{var Y=N=>{var z=LG(),he=me(z);qm(he,{size:14,class:"animate-spin"});var te=M(he);B(V=>$(te,` ${V??""}`),[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.RUNNING")]),y(N,z)},ie=N=>{var z=IG(),he=me(z);yA(he,{size:14});var te=M(he);B(V=>$(te,` ${V??""}`),[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.RUN_ALL")]),y(N,z)};Z(j,N=>{f(s)?N(Y):N(ie,-1)})}y(R,U)},$$slots:{default:!0}}),b(v);var T=M(v,2);{var S=R=>{var F=XG(),U=x(F,!0);b(F),B(j=>$(U,j),[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.NO_SCHEDULED_JOBS_REGISTERED")]),y(R,F)},Q=R=>{var F=BG(),U=x(F),j=x(U),Y=x(j),ie=x(Y,!0);b(Y);var N=M(Y,2),z=x(N,!0);b(N),na(),b(j),b(U);var he=M(U);Ue(he,21,()=>f(r),te=>te.id,(te,V)=>{var J=jG(),q=x(J),re=x(q),oe=x(re,!0);b(re),b(q);var Se=M(q),se=x(Se,!0);b(Se);var pe=M(Se),ae=x(pe);{var G=W=>{var ce=ZG(),we=x(ce);WA(we,{size:12}),na(),b(ce),y(W,ce)},K=W=>{var ce=NG(),we=x(ce);mS(we,{size:12}),na(),b(ce),y(W,ce)};Z(ae,W=>{f(V).error?W(G):W(K,-1)})}b(pe);var H=M(pe),ue=x(H);{var ye=W=>{var ce=VG(),we=me(ce),xe=x(we,!0);b(we);var fe=M(we),Te=x(fe,!0);b(fe),B((Qe,Be)=>{$(xe,Qe),$(Te,Be)},[()=>ve.t("ADMIN_NEXT.ENABLED"),()=>ve.t("ADMIN_NEXT.DISABLED")]),y(W,ce)},De=W=>{var ce=FG(),we=me(ce),xe=x(we,!0);b(we);var fe=M(we),Te=x(fe,!0);b(fe),B((Qe,Be)=>{$(xe,Qe),$(Te,Be)},[()=>ve.t("ADMIN_NEXT.ENABLED"),()=>ve.t("ADMIN_NEXT.DISABLED")]),y(W,ce)};Z(ue,W=>{f(V).enabled?W(ye):W(De,-1)})}b(H),b(J),B(W=>{$(oe,f(V).id),$(se,W)},[()=>c(f(V).expression)]),y(te,J)}),b(he),b(F),B((te,V)=>{$(ie,te),$(z,V)},[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.JOB_ID"),()=>ve.t("ADMIN_NEXT.PAGES.HEADER_STATUS")]),y(R,F)};Z(T,R=>{f(r).length===0?R(S):R(Q,-1)})}b(O);var D=M(O,2);{var I=R=>{var F=UG(),U=x(F),j=x(U);SA(j,{size:15,class:"text-muted-foreground"});var Y=M(j,2),ie=x(Y,!0);b(Y),b(U);var N=M(U,2),z=x(N),he=x(z),te=x(he,!0);b(he);var V=M(he,2);{var J=fe=>{var Te=zG();y(fe,Te)},q=fe=>{var Te=WG();y(fe,Te)},re=fe=>{var Te=YG();y(fe,Te)};Z(V,fe=>{f(n).health.status==="healthy"?fe(J):f(n).health.status==="warning"?fe(q,1):fe(re,-1)})}b(z);var oe=M(z,2),Se=x(oe),se=x(Se),pe=x(se,!0);b(se);var ae=M(se,2),G=x(ae,!0);b(ae),b(Se);var K=M(Se,2),H=x(K),ue=x(H,!0);b(H);var ye=M(H,2),De=x(ye,!0);b(ye),b(K),b(oe);var W=M(oe,2),ce=x(W),we=M(ce),xe=x(we,!0);b(we),b(W),b(N),b(F),B((fe,Te,Qe,Be,$e,Ne)=>{$(ie,fe),$(te,Te),$(pe,Qe),$(G,Be),$(ue,$e),$(De,f(n).health.scheduled_jobs),$(ce,`${Ne??""} `),$(xe,f(n).health.queue_size)},[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.HEALTH_STATUS"),()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.STATUS"),()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.LAST_RUN"),()=>l(f(n).health.last_run_age),()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.SCHEDULED_JOBS"),()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.QUEUE_SIZE")]),y(R,F)};Z(D,R=>{f(n)?.health&&R(I)})}var X=M(D,2);{var L=R=>{var F=eH(),U=x(F),j=x(U);N0(j,{size:15,class:"text-muted-foreground"});var Y=M(j,2),ie=x(Y,!0);b(Y),b(U);var N=M(U,2),z=x(N),he=x(z),te=x(he);wA(te,{size:16,class:"text-muted-foreground"});var V=M(te,2),J=x(V,!0);b(V),b(he);var q=M(he,2);{var re=xe=>{var fe=qG();y(xe,fe)},oe=A(()=>f(n).triggers.includes("cron")),Se=xe=>{var fe=$G(),Te=x(fe,!0);b(fe),B(Qe=>$(Te,Qe),[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.NOT_CONFIGURED")]),y(xe,fe)};Z(q,xe=>{f(oe)?xe(re):xe(Se,-1)})}b(z);var se=M(z,2),pe=x(se),ae=x(pe);N0(ae,{size:16,class:"text-muted-foreground"});var G=M(ae,2),K=x(G,!0);b(G),b(pe);var H=M(pe,2);{var ue=xe=>{var fe=GG();y(xe,fe)},ye=A(()=>f(n).triggers.includes("webhook")),De=xe=>{var fe=HG(),Te=x(fe,!0);b(fe),B(Qe=>$(Te,Qe),[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.NOT_INSTALLED")]),y(xe,fe)},W=xe=>{var fe=KG(),Te=x(fe,!0);b(fe),B(Qe=>$(Te,Qe),[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.NOT_ENABLED")]),y(xe,fe)};Z(H,xe=>{f(ye)?xe(ue):f(n).webhook_installed?xe(W,-1):xe(De,1)})}b(se);var ce=M(se,2);{var we=xe=>{var fe=JG(),Te=x(fe),Qe=x(Te);gS(Qe,{size:14});var Be=M(Qe);b(Te),b(fe),B($e=>$(Be,` ${$e??""}`),[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.NO_TRIGGERS_ACTIVE_ENABLE_WEBHOOKS_OR")]),y(xe,fe)};Z(ce,xe=>{f(n).triggers.length===0&&xe(we)})}b(N),b(F),B((xe,fe,Te)=>{$(ie,xe),$(J,fe),$(K,Te)},[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.ACTIVE_TRIGGERS"),()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.CRON"),()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.WEBHOOK")]),y(R,F)};Z(X,R=>{f(n)&&R(L)})}B(R=>$(_,R),[()=>ve.t("ADMIN_NEXT.FIELDS.CRON_STATUS.SCHEDULER_STATUS")]),y(g,p)};Z(h,g=>{f(i)?g(d):g(m,-1)})}b(u),y(t,u),Re()}var iH=P('
'),sH=P('
scheduler-webhook
'),oH=P('
scheduler-webhook
'),aH=P(" ",1),lH=P('

The scheduler-webhook

');function cH(t,e){Me(e,!0);let n=ge(null),r=ge(!1),i=ge(!0);async function s(){try{const m=await lS();k(n,m.webhook_installed,!0),k(r,m.webhook_enabled,!0)}catch{k(n,!1)}finally{k(i,!1)}}async function o(){try{await Ns.post("/gpm/install",{package:"scheduler-webhook",type:"plugin"}),k(n,!0),window.location.reload()}catch{}}tr(s);var a=_e(),l=me(a);{var c=m=>{var g=iH(),p=x(g,!0);b(g),B(O=>$(p,O),[()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_STATUS.CHECKING_WEBHOOK_PLUGIN_STATUS")]),y(m,g)},u=m=>{var g=sH(),p=x(g);mS(p,{size:16});var O=M(p,2),v=M(x(O));b(O),b(g),B(w=>$(v,` ${w??""}`),[()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_STATUS.PLUGIN_IS_INSTALLED_AND_ENABLED")]),y(m,g)},h=m=>{var g=oH(),p=x(g);gS(p,{size:16});var O=M(p,2),v=M(x(O));b(O),b(g),B(w=>$(v,` ${w??""}`),[()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_STATUS.PLUGIN_IS_INSTALLED_ENABLE_WEBHOOK")]),y(m,g)},d=m=>{var g=lH(),p=x(g),O=x(p,!0);b(p);var v=M(p,2),w=M(x(v),2);b(v);var _=M(v,2),C=x(_);sS(C,{size:"sm",onclick:o,children:(I,X)=>{var L=aH(),R=me(L);YA(R,{size:14});var F=M(R);B(U=>$(F,` ${U??""}`),[()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_STATUS.INSTALL_PLUGIN_NOW")]),y(I,L)},$$slots:{default:!0}});var T=M(C,2),S=x(T),Q=M(S),D=x(Q,!0);b(Q),b(T),b(_),b(g),B((I,X,L,R)=>{$(O,I),$(w,` ${X??""}`),$(S,`${L??""} `),$(D,R)},[()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_STATUS.WEBHOOK_PLUGIN_REQUIRED"),()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_STATUS.PLUGIN_IS_REQUIRED_FOR_WEBHOOK"),()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_STATUS.OR_RUN"),()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_STATUS.BIN_GPM_INSTALL_SCHEDULER_WEBHOOK")]),y(m,g)};Z(l,m=>{f(i)?m(c):f(n)&&f(r)?m(u,1):f(n)&&!f(r)?m(h,2):m(d,-1)})}y(t,a),Re()}var uH=P(" ",1),hH=P(" ",1),dH=P('');function Nm(t,e){Me(e,!0);let n=ee(e,"label",3,"Copy"),r=ge(!1);async function i(){try{await navigator.clipboard.writeText(e.text),k(r,!0),setTimeout(()=>{k(r,!1)},2e3)}catch{const c=document.createElement("textarea");c.value=e.text,c.style.position="fixed",c.style.opacity="0",document.body.appendChild(c),c.select(),document.execCommand("copy"),document.body.removeChild(c),k(r,!0),setTimeout(()=>{k(r,!1)},2e3)}}var s=dH(),o=x(s);{var a=c=>{var u=uH(),h=me(u);$m(h,{size:13,class:"text-emerald-500"});var d=M(h);B(m=>$(d,` ${m??""}`),[()=>ve.t("ADMIN_NEXT.COPY_BUTTON.COPIED")]),y(c,u)},l=c=>{var u=hH(),h=me(u);UA(h,{size:13});var d=M(h);B(()=>$(d,` ${n()??""}`)),y(c,u)};Z(o,c=>{f(r)?c(a):c(l,-1)})}b(s),Ce("click",s,i),y(t,s),Re()}It(["click"]);var fH=P('

');function mH(t,e){Me(e,!0);const n=A(()=>`${_t.serverUrl}`),r=A(()=>`curl -X POST "${f(n)}/scheduler/webhook" \\ -H "X-API-Token: YOUR_TOKEN"`),i=A(()=>`curl -X POST "${f(n)}/scheduler/webhook?job=backup" \\ -H "X-API-Token: YOUR_TOKEN"`),s=A(()=>`curl "${f(n)}/scheduler/health"`),o=A(()=>`- name: Trigger Scheduler run: | curl -X POST \${{ secrets.SITE_URL }}/scheduler/webhook \\ -H "X-API-Token: \${{ secrets.WEBHOOK_TOKEN }}"`);var a=fH(),l=x(a),c=x(l,!0);b(l);var u=M(l,2),h=x(u),d=x(h,!0);b(h);var m=M(h,2),g=x(m),p=x(g,!0);b(g);var O=M(g,2);Nm(O,{get text(){return f(r)}}),b(m),b(u);var v=M(u,2),w=x(v),_=x(w,!0);b(w);var C=M(w,2),T=x(C),S=x(T,!0);b(T);var Q=M(T,2);Nm(Q,{get text(){return f(i)}}),b(C),b(v);var D=M(v,2),I=x(D),X=x(I,!0);b(I);var L=M(I,2),R=x(L),F=x(R,!0);b(R);var U=M(R,2);Nm(U,{get text(){return f(s)}}),b(L),b(D);var j=M(D,2),Y=x(j),ie=x(Y,!0);b(Y);var N=M(Y,2);N.textContent=f(o),b(j),b(a),B((z,he,te,V,J)=>{$(c,z),$(d,he),$(p,f(r)),$(_,te),$(S,f(i)),$(X,V),$(F,f(s)),$(ie,J)},[()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_EXAMPLES.HOW_TO_USE_WEBHOOKS"),()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_EXAMPLES.TRIGGER_ALL_DUE_JOBS_RESPECTS_SCHEDULE"),()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_EXAMPLES.FORCE_RUN_SPECIFIC_JOB_IGNORES_SCHEDULE"),()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_EXAMPLES.CHECK_HEALTH_STATUS"),()=>ve.t("ADMIN_NEXT.FIELDS.WEBHOOK_EXAMPLES.GITHUB_ACTIONS_EXAMPLE")]),y(t,a),Re()}var gH=P(''),pH=P('

'),OH=P("
"),vH=P('
'),bH=P('
'),yH=P('
'),xH=P('

'),SH=P('
');function qx(t,e){Me(e,!0);const n=Wt("editorCollab"),r=Wt("collabPending"),i=A(()=>r?r(e.field.name):!1);let s=ee(e,"providerKind",3,"plugins");const o=ve.tMaybe;let a=ge(null),l=ge(!1),c=ge("");const u=`grav-${e.pluginSlug}--${e.fieldType}`,h=window.__GRAV_FIELD_LOADING??={};function d(){return`/gpm/${s()}/${e.pluginSlug}/field/${e.fieldType}`}async function m(){if(customElements.get(u)){k(l,!0),g();return}if(h[u]){try{await h[u],k(l,!0),g()}catch{k(c,`Failed to load custom field "${e.fieldType}"`)}return}h[u]=(async()=>{const X=await Ns.fetchScript(d());window.__GRAV_API_SERVER_URL=_t.serverUrl,window.__GRAV_API_PREFIX=_t.apiPrefix||"/api/v1",window.__GRAV_API_TOKEN=_t.accessToken;const L=new Blob([`window.__GRAV_FIELD_TAG = ${JSON.stringify(u)}; ${X}`],{type:"application/javascript"}),R=URL.createObjectURL(L);await import(R),URL.revokeObjectURL(R),await customElements.whenDefined(u)})();try{await h[u],k(l,!0),g()}catch(X){console.error(`[CustomField] Failed to load ${e.pluginSlug}/${e.fieldType}:`,X),k(c,`Failed to load custom field "${e.fieldType}"`)}}function g(){if(!f(a))return;f(a).innerHTML="";const X=document.createElement(u),L=n?.(e.field.name);L&&(X.yFragment=L.fragment,X.yAwareness=L.awareness,X.yUser=L.user),X.field=e.field,X.value=e.value,X.addEventListener("change",R=>{e.onchange(R.detail),e.oncommit?.(R.detail)}),X.addEventListener("commit",R=>{e.oncommit?.(R.detail)}),f(a).appendChild(X)}We(()=>{if(!f(a))return;const X=f(a).firstElementChild;X&&"value"in X&&(X.value=e.value)}),We(()=>{window.__GRAV_CONTENT_LANG=qA.activeLang});let p=ge(!1);We(()=>{f(i)||f(p)||(k(p,!0),m())});var O=SH(),v=x(O);{var w=X=>{var L=OH(),R=x(L);{var F=Y=>{var ie=gH(),N=x(ie,!0);b(ie),B(z=>$(N,z),[()=>o(e.field.label)]),y(Y,ie)};Z(R,Y=>{e.field.label&&Y(F)})}var U=M(R,2);{var j=Y=>{var ie=pH();lt(ie,()=>o(e.field.help),!0),b(ie),y(Y,ie)};Z(U,Y=>{e.field.help&&Y(j)})}b(L),y(X,L)};Z(v,X=>{(e.field.label||e.field.help)&&X(w)})}var _=M(v,2);{var C=X=>{var L=vH(),R=x(L,!0);b(L),B(()=>$(R,f(c))),y(X,L)},T=X=>{var L=bH(),R=x(L),F=x(R,!0);b(R),b(L),B(U=>$(F,U),[()=>ve.t("ADMIN_NEXT.PAGES.EDIT.CONNECTING_TO_COLLAB")]),y(X,L)},S=X=>{var L=yH(),R=x(L),F=x(R,!0);b(R),b(L),B(U=>$(F,U),[()=>ve.t("ADMIN_NEXT.FIELDS.CUSTOM_FIELD_WRAPPER.LOADING_CUSTOM_FIELD")]),y(X,L)};Z(_,X=>{f(c)?X(C):f(i)?X(T,1):f(l)||X(S,2)})}var Q=M(_,2);gn(Q,X=>k(a,X),()=>f(a));var D=M(Q,2);{var I=X=>{var L=xH(),R=x(L,!0);b(L),B(()=>$(R,e.error)),y(X,L)};Z(D,X=>{e.error&&X(I)})}b(O),y(t,O),Re()}var wH=P('
'),kH=P('
'),_H=P('
'),PH=P('
'),QH=P('
');function CH(t,e){Me(e,!0);const n=ve.tMaybe,r=A(()=>e.getValue(e.field.page_field)??""),i=A(()=>e.field.page_template??""),s=A(()=>e.field.success_msg??""),o=A(()=>e.field.error_msg??"");let a=ge(!1),l=ge(!1),c="";We(()=>{const m=f(r),g=f(i);if(m===c)return;if(c=m,!m){k(l,!1),k(a,!1);return}k(a,!0);const p=m.replace(/^\//,""),O=m;Ns.get(`/pages/${p}`,{summary:"true"}).then(v=>{O===c&&k(l,g&&v?.template?v.template===g:!0,!0)}).catch(()=>{O===c&&k(l,!1)}).finally(()=>{O===c&&k(a,!1)})});var u=_e(),h=me(u);{var d=m=>{var g=QH(),p=x(g);{var O=Q=>{var D=wH(),I=x(D,!0);b(D),B(X=>$(I,X),[()=>ve.t("ADMIN_NEXT.FIELDS.PAGE_EXISTS.CHECKING_PAGE")]),y(Q,D)},v=Q=>{var D=kH(),I=x(D,!0);b(D),B(X=>$(I,X),[()=>n(f(s))]),y(Q,D)},w=Q=>{var D=_H(),I=x(D,!0);b(D),B(X=>$(I,X),[()=>n(f(o))]),y(Q,D)};Z(p,Q=>{f(a)?Q(O):f(l)?Q(v,1):Q(w,-1)})}var _=M(p,2),C=x(_);Ue(C,21,()=>e.field.fields,Q=>Q.name,(Q,D)=>{{let I=A(()=>e.getValue(f(D).name)),X=A(()=>e.onFieldCommit?(L,R)=>e.onFieldCommit(f(D).name,L,R):void 0);Cr(Q,{get field(){return f(D)},get value(){return f(I)},onchange:L=>e.onFieldChange(f(D).name,L),get oncommit(){return f(X)},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit}})}}),b(C);var T=M(C,2);{var S=Q=>{var D=PH();y(Q,D)};Z(T,Q=>{f(l)&&Q(S)})}b(_),b(g),y(m,g)};Z(h,m=>{e.field.fields&&m(d)})}y(t,u),Re()}const TH=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],AH=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],EH=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],DH=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],MH=[[.4123907992659595,.35758433938387796,.1804807884018343],[.21263900587151036,.7151686787677559,.07219231536073371],[.01933081871559185,.11919477979462599,.9505321522496606]],RH=[[3.2409699419045213,-1.5373831775700935,-.4986107602930033],[-.9692436362808798,1.8759675015077206,.04155505740717561],[.05563007969699361,-.20397695888897657,1.0569715142428786]],LH=[[.4122214694707629,.5363325372617349,.051445993267502196],[.2119034958178251,.6806995506452345,.10739695353694051],[.08830245919005637,.2817188391361215,.6299787016738223]],IH=[[4.076741636075959,-3.307711539258062,.2309699031821041],[-1.2684379732850313,2.6097573492876878,-.3413193760026569],[-.004196076138675526,-.703418617935936,1.7076146940746113]],XH=[[.48657094864821626,.26566769316909294,.1982172852343625],[.22897456406974884,.6917385218365062,.079286914093745],[0,.045113381858902575,1.0439443689009757]],ZH=[[2.4934969119414245,-.9313836179191236,-.40271078445071684],[-.829488969561575,1.7626640603183468,.02362468584194359],[.035845830243784335,-.07617238926804171,.9568845240076873]],NH=[[.48137985274995443,.4621183710113181,.05650177623872757],[.22883194181124475,.6532168193835676,.11795123880518778],[.08394575232299319,.22416527097756642,.6918889766994405]],VH=[[3.1277689713618737,-2.2571357625916395,.1293667912297651],[-1.091009018437798,2.413331710306923,-.3223226918691248],[-.02601080193857041,-.5080413317041669,1.5340521336427373]],FH=[[.6369580483012913,.14461690358620838,.16888097516417205],[.26270021201126703,.677998071518871,.059301716469861945],[0,.028072693049087508,1.0609850577107909]],jH=[[1.7166511879712676,-.3556707837763924,-.2533662813736598],[-.666684351832489,1.616481236634939,.01576854581391113],[.017639857445310915,-.042770613257808655,.942103121235474]],BH=[[.6167557848654444,.3601984012264634,.023045813908092266],[.26513305939263676,.6358393720678492,.09902756853951414],[.10010262952034828,.20390652261661452,.6959908478630372]],zH=[[2.1399067304346513,-1.246389493760618,.10648276332596689],[-.8847358357577675,2.1632309383612007,-.27849510260343363],[-.04857374640044396,-.45450314971409633,1.5030768961145404]],kT=(t,e,n)=>Math.max(Math.min(t,n),e),WH=t=>(t%360+360)%360,YH=(t,e=Er())=>{let n=t.replace(/#/,"");n.length===3?n=n[0]+n[0]+n[1]+n[1]+n[2]+n[2]:n.length>6&&(n=n.slice(0,6));const r=parseInt(n,16);return e[0]=(r>>16&255)/255,e[1]=(r>>8&255)/255,e[2]=(r&255)/255,e},UH=t=>`#${t.map(e=>vo(e).toString(16).padStart(2,"0")).join("")}`,vo=t=>kT(Math.round(255*t),0,255),Er=()=>[0,0,0],Ir=Er(),qH=t=>{const e=t[0],n=t[1],r=t[2];t[0]=e*e*e,t[1]=n*n*n,t[2]=r*r*r},$H=t=>{t[0]=Math.cbrt(t[0]),t[1]=Math.cbrt(t[1]),t[2]=Math.cbrt(t[2])},Vm=(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2],GH=(t,e,n=Er())=>(Os(t,TH,n),qH(n),Os(n,e,n)),$x=(t,e,n=Er())=>(Os(t,e,n),$H(n),Os(n,AH,n)),Os=(t,e,n=Er())=>{const r=Vm(t,e[0]),i=Vm(t,e[1]),s=Vm(t,e[2]);return n[0]=r,n[1]=i,n[2]=s,n},_T=(t,e)=>{e[0]=t[0],e[1]=t[1],e[2]=t[2]},HH=(t,e,n=e)=>{if(!e)throw new Error("must specify an input space");let r=1;t.length>3&&(r=t[3]),_T(t,Ir),e!==n&&Sr(t,e,n,Ir);const i=n.id;if(i=="srgb"){const s=vo(Ir[0]),o=vo(Ir[1]),a=vo(Ir[2]),l=`${s}, ${o}, ${a}`;return r===1?`rgb(${l})`:`rgba(${l}, ${r})`}else{const s=r===1?"":` / ${r}`;return i=="oklab"||i=="oklch"?`${i}(${Ir[0]*100}% ${Ir[1]} ${Ir[2]}${s})`:`color(${i} ${Ir[0]} ${Ir[1]} ${Ir[2]}${s})`}},Gx=t=>t.length>=4&&t[3]===1?t.slice(0,3):t,Fm=t=>parseFloat(t)||0,Hx=(t,e=!1)=>e?kT(Fm(t)/255,0,255):t.includes("%")?Fm(t)/100:Fm(t),KH=t=>{if(typeof t!="string")throw new Error("expected a string as input");if(t=t.trim(),t.charAt(0)==="#"){const e=t.slice(0,7);let n=t.length>7?parseInt(t.slice(7,9),16):255,r=isNaN(n)?1:n/255;const i=YH(e);return r!==1&&i.push(r),{id:"srgb",coords:i}}else{const e=/^(rgb|rgba|oklab|oklch|color)\((.+)\)$/i.exec(t);if(!e)throw new Error(`could not parse color string ${t}`);const n=e[1].toLowerCase();if(/^rgba?$/i.test(n)&&e[2].includes(",")){const r=e[2].split(",").map((i,s)=>Hx(i.trim(),s<3));return{id:"srgb",coords:Gx(r)}}else{let r,i,s=!1;if(/^color$/i.test(n)){const a=/([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+([^\s/]+)(?:\s?\/\s?([^\s]+))?/.exec(e[2]);if(!a)throw new Error(`could not parse color() function ${t}`);r=a[1].toLowerCase(),i=a.slice(2,6)}else{if(/^(oklab|oklch)$/i.test(n))r=n;else if(/rgba?/i.test(n))r="srgb",s=!0;else throw new Error(`unknown color function ${n}`);const a=/([^\s]+)\s+([^\s]+)\s+([^\s/]+)(?:\s?\/\s?([^\s]+))?/.exec(e[2]);if(!a)throw new Error(`could not parse color() function ${t}`);i=a.slice(1,6)}i[3]==null&&(i=i.slice(0,3));const o=i.map((a,l)=>Hx(a.trim(),s&&l<3));if(o.length<3||o.length>4)throw new Error("invalid number of coordinates");return{id:r,coords:Gx(o)}}}},Sr=(t,e,n,r=Er())=>{if(_T(t,r),!e)throw new Error("must specify a fromSpace");if(!n)throw new Error("must specify a toSpace");if(e==n)return r;e.base&&(r=e.toBase(r,r),e=e.base);let i=e,s=n.base??n;if(e.base||s.base)throw new Error("Currently only base of depth=1 is supported");if(i!==s){let o=i.id==="xyz",a=s.id==="xyz",l=!1,c=!1;if(i.id==="oklab"){let u=s.fromLMS_M;u||(u=Kx.fromLMS_M,l=!0,o=!0),r=GH(r,u,r)}else if(s.id==="oklab"){let u=i.toLMS_M;u?r=$x(r,u,r):(l=!0,c=!0)}else l=!0;if(l){if(!o)if(i.toXYZ)r=i.toXYZ(r,r);else if(i.toXYZ_M)r=Os(r,i.toXYZ_M,r);else throw new Error(`no toXYZ or toXYZ_M on ${i.id}`);if(i.adapt&&(r=Os(r,i.adapt.to,r)),s.adapt&&(r=Os(r,s.adapt.from,r)),!a)if(c)r=$x(r,Kx.toLMS_M,r);else if(s.fromXYZ)r=s.fromXYZ(r,r);else if(s.fromXYZ_M)r=Os(r,s.fromXYZ_M,r);else throw new Error(`no fromXYZ or fromXYZ_M on ${s.id}`)}}if(s!==n)if(n.fromBase)r=n.fromBase(r,r);else throw new Error(`could not transform ${s.id} to ${n.id}`);return r},Kx={toLMS_M:EH,fromLMS_M:DH},jm=t=>{let e=t<0?-1:1,n=Math.abs(t);return n<=.04045?t/12.92:e*Math.pow((n+.055)/1.055,2.4)},Bm=t=>{let e=t<0?-1:1,n=Math.abs(t);return n>.0031308?e*(1.055*Math.pow(n,1/2.4)-.055):12.92*t},PT=(t,e=Er())=>(e[0]=Bm(t[0]),e[1]=Bm(t[1]),e[2]=Bm(t[2]),e),QT=(t,e=Er())=>(e[0]=jm(t[0]),e[1]=jm(t[1]),e[2]=jm(t[2]),e),JH={id:"srgb-linear",toXYZ_M:MH,fromXYZ_M:RH,toLMS_M:LH,fromLMS_M:IH},ai={id:"srgb",base:JH,toBase:QT,fromBase:PT},Jx=(.4-0)/1e5,eK={id:"oklab"},Xr={id:"oklch",base:eK,toBase:(t,e=Er())=>{const n=t[1],r=t[2];return e[0]=t[0],e[1]=n*Math.cos(r*Math.PI/180),e[2]=n*Math.sin(r*Math.PI/180),e},fromBase:(t,e=Er())=>{const n=t[1],r=t[2];let i=Math.abs(n)tt>=CT?sd*Math.pow(t,.45)-(sd-1):4.5*t,rK={id:"rec2020-linear",toXYZ_M:FH,fromXYZ_M:jH,toLMS_M:BH,fromLMS_M:zH},iK={id:"rec2020",base:rK,toBase:(t,e=Er())=>(e[0]=zm(t[0]),e[1]=zm(t[1]),e[2]=zm(t[2]),e),fromBase:(t,e=Er())=>(e[0]=Wm(t[0]),e[1]=Wm(t[1]),e[2]=Wm(t[2]),e)},Lp=Symbol("huey-color"),sK=/^#?(?:[A-F0-9]{8}|[A-F0-9]{6}|[A-F0-9]{3})$/i,oK=/^rgba?\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*(?:[,/]\s*([\d.]+)\s*)?\)$/i,TT=/^hsla?\(\s*([\d.]+)(?:deg|rad|grad|turn)?\s*[,\s]\s*([\d.]+)%?\s*[,\s]\s*([\d.]+)%?\s*(?:[,/]\s*([\d.]+))?\s*\)$/i,AT=/^oklch\(\s*([\d.]+%?)\s*[,\s]\s*([\d.]+)\s*[,\s]\s*([\d.]+)(?:deg|rad|grad|turn)?\s*(?:[,/]\s*([\d.]+))?\s*\)$/i;function aK(t){return typeof t=="object"&&t!==null&&Lp in t&&t[Lp]===!0}function vl(t){return sK.test(t.trim())}function lK(t){const e=oK.exec(t);if(!e)return!1;const[,n,r,i,s]=e;return[Number.parseInt(n),Number.parseInt(r),Number.parseInt(i)].some(o=>o<0||o>255)?!1:s!==void 0?M0(s):!0}function cK(t){const e=TT.exec(t);if(!e)return!1;const[,n,r,i,s]=e;return!ET(n)||!Ip(r)||!Ip(i)?!1:s!==void 0?M0(s):!0}function uK(t){const e=AT.exec(t);if(!e)return!1;const[,n,r,i,s]=e;return!Ip(n)||!hK(r)||!ET(i)?!1:s!==void 0?M0(s):!0}function Ip(t){const e=typeof t=="string"?Number.parseFloat(t):t;return e>=0&&e<=1||e>=0&&e<=100}function hK(t){return(typeof t=="string"?Number.parseFloat(t):t)>=0}function ET(t){const e=typeof t=="string"?Number.parseFloat(t):t;return!(e<0||e>360)}function M0(t){const e=typeof t=="string"?Number.parseFloat(t):t;return e>=0&&e<=1}function dK(t){const e=t.trim();return vl(e)?"hex":lK(e)?"rgb":cK(e)?"hsl":uK(e)?"oklch":"unknown"}function fK(){const t=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0,e=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;return{x:t,y:e}}function Xp(t){const{x:e,y:n}=fK(),r=t.getBoundingClientRect();return{x:r.left+e,y:r.top+n}}function Zp(t){const e={x:0,y:0};return t instanceof MouseEvent&&(e.x=t.pageX,e.y=t.pageY),typeof TouchEvent<"u"&&t instanceof TouchEvent&&(e.x=t.touches?t.touches[0].pageX:t.changedTouches?t.changedTouches[0].pageX:0,e.y=t.touches?t.touches[0].pageY:t.changedTouches?t.changedTouches[0].pageY:0),e}function DT(t){return{ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"}[t.code]}function Rt(t,e,n){return Math.min(Math.max(t,e),n)}function Cu(t,e,n,r=0,i=1){const s=(t-e)/(n-e);return(i-r)*s+r}function Ym(t,e){const n=e<1?Math.ceil(-Math.log10(e)):0;return Math.round(t*10**n)/10**n}function mK(t){const e=TT.exec(t.trim());if(!e)return null;const[,n,r,i,s]=e;if(!n||!r||!i)return null;const o=Number.parseFloat(n),a=Number.parseFloat(r),l=Number.parseFloat(i),c=s?Number.parseFloat(s):1;if(Number.isNaN(o)||Number.isNaN(a)||Number.isNaN(l)||a<0||a>100||l<0||l>100||c<0||c>1)return null;const{r:u,g:h,b:d}=qu(o,a,l);return{coords:[u/255,h/255,d/255,c],space:"rgb"}}function gK(t){const e=AT.exec(t.trim());if(!e)return null;const[,n,r,i,s]=e;if(!n||!r||!i)return null;let o=Number.parseFloat(n.replace("%",""));const a=Number.parseFloat(r),l=Number.parseFloat(i),c=s?Number.parseFloat(s):1;return Number.isNaN(o)||Number.isNaN(a)||Number.isNaN(l)||(n.includes("%")&&(o=o/100),o<0||o>1)||a<0||c<0||c>1?null:{coords:[o,a,l,c],space:"oklch"}}function qu(t,e,n,r=!1){const i=t/360,s=e/100,o=n/100;let a,l,c;if(s===0)a=l=c=o;else{const u=(m,g,p)=>(p<0&&(p+=1),p>1&&(p-=1),p<.16666666666666666?m+(g-m)*6*p:p<.5?g:p<.6666666666666666?m+(g-m)*(.6666666666666666-p)*6:m),h=o<.5?o*(1+s):o+s-o*s,d=2*o-h;a=u(d,h,i+1/3),l=u(d,h,i),c=u(d,h,i-1/3)}return r?{r:a,g:l,b:c}:{r:a*255,g:l*255,b:c*255}}function pK(t,e,n){const r=t/255,i=e/255,s=n/255,o=Math.max(r,i,s),a=Math.min(r,i,s),l=o-a;let c=0,u=0;const h=(o+a)/2;if(l!==0)switch(u=h>.5?l/(2-o-a):l/(o+a),o){case r:c=((i-s)/l+(i{const g=Math.max(0,Math.min(1,u)),p=Fi(`oklch(${g*100}% ${h} ${d} / ${m})`);return p.getFormat=()=>e,p.getOriginalInput=()=>t,p},c={[Lp]:!0,_l:Number(s.toFixed(4)),_c:Number(o.toFixed(4)),_h:Number(a.toFixed(4)),_a:r,getFormat:()=>e,getOriginalInput:()=>t,getAlpha:()=>c._a,setAlpha:u=>l(c._l,c._c,c._h,u),setHue:u=>{const h=c.toHsl(),{r:d,g:m,b:g}=qu(u,h.s,h.l,!0),[p,O,v]=Sr([d,m,g],ai,Xr);return l(p,O,v,c._a)},setSaturation:u=>{const h=c.toHsl(),{r:d,g:m,b:g}=qu(h.h,u,h.l,!0),[p,O,v]=Sr([d,m,g],ai,Xr);return l(p,O,v,c._a)},setLightness:u=>{const h=c.toHsl(),{r:d,g:m,b:g}=qu(h.h,h.s,u,!0),[p,O,v]=Sr([d,m,g],ai,Xr);return l(p,O,v,c._a)},desaturate:u=>l(c._l,Math.max(0,c._c-u),c._h,c._a),saturate:u=>l(c._l,Math.max(0,c._c+u),c._h,c._a),brighten:u=>l(Math.min(1,c._l+u),c._c,c._h,c._a),lighten:u=>l(Math.min(1,c._l+u),c._c,c._h,c._a),darken:u=>l(Math.max(0,c._l-u),c._c,c._h,c._a),randomize:()=>l(Math.random(),Math.random()*.4,Math.random()*360,c._a),clone:()=>l(c._l,c._c,c._h,c._a),contrastRatio:u=>{const h=c.getLuminance(),d=u.getLuminance(),m=Math.max(h,d),g=Math.min(h,d);return(m+.05)/(g+.05)},getLuminance:()=>{const[u,h,d]=Sr([c._l,c._c,c._h],Xr,ai),m=g=>g<=.03928?g/12.92:((g+.055)/1.055)**2.4;return .2126*m(u)+.7152*m(h)+.0722*m(d)},getBrightness:()=>c._l,isLight:()=>c._l>.5,isDark:()=>c._l<=.5,toHsl:()=>{const[u,h,d]=Sr([c._l,c._c,c._h],Xr,ai).map(O=>O*255),{h:m,s:g,l:p}=pK(u,h,d);return{h:Number(m),s:Number(g.toFixed(2)),l:Number(p.toFixed(2)),a:Number(c._a.toFixed(1))}},toHslString:()=>{const{h:u,s:h,l:d}=c.toHsl(),m=Number(c._a.toFixed(1));return m<1?`hsla(${u.toFixed(0)}, ${h.toFixed(0)}%, ${d.toFixed(0)}%, ${m})`:`hsl(${u.toFixed(0)}, ${h.toFixed(0)}%, ${d.toFixed(0)}%)`},toHex:()=>{let u=c.toHexString().replace("#","");return r===1&&(u=u.slice(0,6)),u},toHexString:()=>{const u=Sr([c._l,c._c,c._h],Xr,ai);let h=UH([...u,c._a]);return r===1&&(h=h.slice(0,7)),h},toRgb:()=>{const[u,h,d]=Sr([c._l,c._c,c._h],Xr,ai);return{r:vo(u),g:vo(h),b:vo(d),a:Number(c._a.toFixed(1))}},toRgbString:()=>{const u=Sr([c._l,c._c,c._h],Xr,ai);return HH([...u,Number(c._a.toFixed(1))],ai)},toString:()=>e==="hex"?c.toHexString():e==="hsl"?c.toHslString():e==="oklch"?c.toOklchString():e==="rgb"?c.toRgbString():"",toOklchString:()=>{const u=(c._l*100).toFixed(2),h=c._c.toFixed(2),d=c._h.toFixed(2),m=c._a;return m<1?`oklch(${u}% ${h} ${d} / ${m})`:`oklch(${u}% ${h} ${d})`},toDisplayP3:()=>{const[u,h,d]=Sr([c._l,c._c,c._h],Xr,nK),m=u.toFixed(2),g=h.toFixed(2),p=d.toFixed(2),O=c._a;return O<1?`color(display-p3 ${m} ${g} ${p} / ${O})`:`color(display-p3 ${m} ${g} ${p})`},toRec2020:()=>{const[u,h,d]=Sr([c._l,c._c,c._h],Xr,iK),m=u.toFixed(2),g=h.toFixed(2),p=d.toFixed(2),O=c._a;return O<1?`color(rec2020 ${m} ${g} ${p} / ${O})`:`color(rec2020 ${m} ${g} ${p})`}};return c}class OK{#e=ge(0);get hue(){return f(this.#e)}set hue(e){k(this.#e,e,!0)}#t=ge(0);get saturation(){return f(this.#t)}set saturation(e){k(this.#t,e,!0)}#n=ge(0);get lightness(){return f(this.#n)}set lightness(e){k(this.#n,e,!0)}#r=ge(1);get alpha(){return f(this.#r)}set alpha(e){k(this.#r,e,!0)}#i=ge(null);get colorValue(){return f(this.#i)}set colorValue(e){k(this.#i,e,!0)}setColor=()=>{}}const MT=Symbol("huey");function vK(t){return ad(MT,t),t}function $a(){const t=Wt(MT);if(!t)throw new Error("Huey components must be used within ");return t}function RT(){document.body.style.userSelect="none"}function LT(){document.body.style.userSelect="unset"}var bK=P("
");function IT(t,e){let n=Tt(e,["$$slots","$$events","$$legacy"]);const r={"huey-slider-thumb":""};var i=bK();Qt(i,()=>({...r,...n})),y(t,i)}var yK=P("
");function XT(t,e){Me(e,!0);let n=ee(e,"value",15,0),r=ee(e,"min",3,0),i=ee(e,"max",3,100),s=ee(e,"step",3,1),o=ee(e,"orientation",3,"horizontal"),a=Tt(e,["$$slots","$$events","$$legacy","value","min","max","step","orientation"]),l=ge(void 0);const c=A(()=>o()==="vertical"),u=A(()=>{const C=Cu(n(),r(),i(),0,100);return f(c)?`${100-C}%`:"50%"}),h=A(()=>{const C=Cu(n(),r(),i(),0,100);return f(c)?"50%":`${C}%`});function d(C){if(!f(l))return;let T;if(f(c)){const{y:Q}=Xp(f(l)),{y:D}=Zp(C),I=D-Q,X=f(l).clientHeight;T=Cu(1-I/X,0,1,r(),i())}else{const{x:Q}=Xp(f(l)),{x:D}=Zp(C),I=D-Q,X=f(l).clientWidth;T=Cu(I/X,0,1,r(),i())}const S=Math.round(T/s())*s();n(Rt(Ym(S,s()),r(),i()))}function m(C){d(C),RT(),window.addEventListener("mousemove",d),window.addEventListener("mouseup",O)}function g(C){const T=DT(C);if(!T)return;C.preventDefault();const S=n(),Q=C.shiftKey?s()*10:s();switch(T){case"left":case"down":n(Rt(Ym(S-Q,Q),r(),i()));break;case"right":case"up":n(Rt(Ym(S+Q,Q),r(),i()));break}}function p(){window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",O)}function O(){LT(),p()}We(()=>()=>p());const v={"huey-slider-track":""};var w=yK();Qt(w,()=>({...a,...v,role:"slider","aria-orientation":o(),"aria-valuemin":r(),"aria-valuemax":i(),"aria-valuenow":n(),onmousedown:m,ontouchmove:d,ontouchstart:d}));var _=x(w);IT(_,{tabindex:0,get style(){return`top: ${f(u)??""}; left: ${f(h)??""};`},onkeydown:g}),b(w),gn(w,C=>k(l,C),()=>f(l)),y(t,w),Re()}function xK(t,e){Me(e,!0);let n=Tt(e,["$$slots","$$events","$$legacy","aria-label","orientation"]);const r=$a(),i=A(()=>{const a=e.orientation==="vertical",l=a?"0deg":"90deg",c=a?"66.67% auto":"auto 66.67%";return` linear-gradient(${l}, hsla(${r.hue}, ${r.saturation}%, ${r.lightness}%, 0) 0 calc(var(--huey-slider-track-height) / 2), hsla(${r.hue}, ${r.saturation}%, ${r.lightness}%, 1) calc(100% - calc(var(--huey-slider-track-height) / 2)) 100%), url('data:image/svg+xml;utf8,%3Csvg%20width%3D%222%22%20height%3D%222%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M0%200h1v2h1V1H0%22%20fill-rule%3D%22nonzero%22%20fill%3D%22%23e1e1e1%22/%3E%3C/svg%3E') 0 0 / ${c}, #fff `}),s=A(()=>`color-mix(in srgb, white, hsl(${r.hue}, ${r.saturation}%, ${r.lightness}%) ${r.alpha*100}%)`),o={"huey-slider":"alpha"};{let a=A(()=>e["aria-label"]??"Alpha slider"),l=A(()=>`--huey-slider-bg: ${f(i)}; --huey-thumb-color: ${f(s)};`);XT(t,_i(()=>n,()=>o,{get orientation(){return e.orientation},get"aria-label"(){return f(a)},max:1,min:0,step:.01,get style(){return f(l)},get value(){return r.alpha},set value(c){r.alpha=c}}))}Re()}var SK=P("");function wK(t,e){Me(e,!0);const n=$a(),r=typeof window<"u"&&window.EyeDropper?new window.EyeDropper:void 0;function i(){r&&r.open().then(c=>{const u=Fi(c.sRGBHex),{h,s:d,l:m}=u.toHsl();n.hue=Rt(h,0,360),n.saturation=Rt(d,0,100),n.lightness=Rt(m,0,100)}).catch(c=>{e.onerror?.(c)})}const s={"huey-color-dropper":""};var o=_e(),a=me(o);{var l=c=>{var u=SK();Qt(u,()=>({...s,class:e.class,"aria-label":e["aria-label"]??"Eye dropper button",onclick:i}));var h=x(u);nt(h,()=>e.children??xt),b(u),y(c,u)};Z(a,c=>{r&&c(l)})}y(t,o),Re()}var kK=P("
"),_K=P("
");function PK(t,e){Me(e,!0);const n=$a();function r(d,m){d.preventDefault(),n.setColor(m)}const i=A(()=>n.colorValue.toHexString());function s(d){const m=Fi(d).toHexString();return f(i)===m}function o(d,m){(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r(d,m))}const a={"huey-swatch":""},l={"huey-swatch-color":""};var c=_e(),u=me(c);{var h=d=>{var m=_K();Qt(m,()=>({...a,role:"listbox","aria-label":e["aria-label"]??"Color swatch"})),Ue(m,20,()=>e.swatch,g=>g,(g,p)=>{var O=kK(),v=_=>r(_,p),w=_=>o(_,p);Qt(O,_=>({...l,tabindex:"0",role:"option","aria-label":p,"aria-selected":_,style:`--swatch-color: ${p};`,onclick:v,onkeydown:w}),[()=>s(p)]),y(g,O)}),b(m),y(d,m)};Z(u,d=>{e.swatch&&d(h)})}y(t,c),Re()}var QK=P("");function CK(t,e){Me(e,!0);let n=ee(e,"alpha",3,!1),r=Tt(e,["$$slots","$$events","$$legacy","alpha","id"]);const i=$a();function s(p){return n()?p:p.slice(0,6)}let o=A(()=>s(i.colorValue.toHex().toUpperCase()));function a(p,O){p.value=String(O),k(o,p.value.toUpperCase());const v=Fi(f(o)),{h:w,s:_,l:C}=v.toHsl();_>0&&(i.hue=w),i.saturation=_,i.lightness=C,n()&&(i.alpha=v.getAlpha())}function l(p){const O=p.target,v=O.value;if(!vl(v)){O.value=f(o);return}a(O,v)}function c(p,O){const v=Number.parseInt(p,16);return v+O<0?"00":v+O>255?"FF":((v+O+256)%256).toString(16).toUpperCase().padStart(2,"0")}function u(p,O){const v=p.target,w=v.value,_=w.replace(/^#/,"").slice(0,6);if(!vl(w)&&vl(_)){v.value=_;return}if(!vl(_)){v.value=f(o);return}const C=_.match(/.{2}/g);let T=p.shiftKey?10:1;T*=O==="down"?-1:1;const{selectionEnd:S,selectionStart:Q}=v,D=Q??0,I=S??0;if(I-D===v.value.length){let Y="";C?.forEach(ie=>{Y=Y.concat(c(ie,T))}),a(v,Y),v.setSelectionRange(0,v.value.length);return}let L,R;D===I?(L=Math.min(Math.floor(D/2),2),R=L):(L=Math.floor(D/2),R=Math.floor((I-1)/2));let F="";C?.forEach((Y,ie)=>{ie>=L&&ie<=R?F=F.concat(c(Y,T)):F=F.concat(Y)}),a(v,F);const U=L*2,j=(R+1)*2;v.setSelectionRange(U,j)}function h(p){p.target.setSelectionRange(0,-1)}function d(p){switch(p.key){case"Enter":p.preventDefault(),l(p);break;case"ArrowUp":p.preventDefault(),u(p,"up");break;case"ArrowDown":p.preventDefault(),u(p,"down");break}}const m={"huey-input":"hex"};var g=QK();Qt(g,()=>({id:e.id,...r,...m,value:f(o),type:"text",autocomplete:"off",spellcheck:"false",dir:"ltr",onkeydown:d,onblur:l,onfocus:h}),void 0,void 0,void 0,void 0,!0),B(()=>g.dir=g.dir),y(t,g),Re()}function TK(t,e){Me(e,!0);let n=Tt(e,["$$slots","$$events","$$legacy","aria-label"]);const r=$a(),i=A(()=>`hsl(${r.hue}, 100%, 50%)`),s={"huey-slider":"hue"};{let o=A(()=>e["aria-label"]??"Hue slider"),a=A(()=>`--huey-thumb-color: ${f(i)};`);XT(t,_i(()=>n,()=>s,{get"aria-label"(){return f(o)},max:360,min:0,step:1,get style(){return f(a)},get value(){return r.hue},set value(l){r.hue=l}}))}Re()}function AK(t,e){Me(e,!0);let n=ee(e,"color",15);if(!n())throw new Error(" is missing required bind:color of type string or HueyColor");const r=vK(new OK);function i(u){try{return Fi(u)}catch{return Fi("#000000")}}const s=i(n()),o=s.toHsl();r.hue=o.h,r.saturation=o.s,r.lightness=o.l,r.alpha=o.a,r.colorValue=s;let a=typeof n()=="string"?s.getFormat():null;r.setColor=u=>{const d=i(u).toHsl();r.hue=Rt(d.h,0,360),r.saturation=Rt(d.s,0,100),r.lightness=Rt(d.l,0,100),r.alpha=Rt(d.a,0,1)},tr(()=>iS(()=>{We(()=>{const u=r.hue,h=r.saturation,d=r.lightness,m=r.alpha,g=Fi(`hsla(${Rt(u,0,360)}, ${Rt(h,0,100)}%, ${Rt(d,0,100)}%, ${Rt(m,0,1)})`);r.colorValue=g,n(a===null?g:a==="hex"?g.toHexString():a==="rgb"?g.toRgbString():a==="oklch"?g.toOklchString():g.toHslString())})}));var l=_e(),c=me(l);nt(c,()=>e.children??xt),y(t,l),Re()}var EK=P("
");function DK(t,e){Me(e,!0);let n=ee(e,"colorFormat",3,"hsl");const r=$a();let i=ge(void 0),s=ge(Pt(Tu(r.hue,r.saturation,r.lightness).s)),o=ge(!1);We(()=>{const T=r.hue,S=r.saturation,Q=r.lightness;f(o)||k(s,Tu(T,S,Q).s,!0)});const a=A(()=>{const T=`hsl(${r.hue}, 100%, 50%)`;return n()==="hsl"?`linear-gradient(to top, black, transparent, white), linear-gradient(to right, hsl(0, 0%, 50%), transparent), ${T}`:`linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent), ${T}`}),l=A(()=>`hsl(${r.hue}, ${r.saturation}%, ${r.lightness}%)`);function c(T){if(!f(i))return;const S=f(i).clientWidth,Q=f(i).clientHeight,{x:D,y:I}=Xp(f(i)),{x:X,y:L}=Zp(T),R=Rt(X-D,0,S),F=Rt(L-I,0,Q);if(n()==="hsl"){r.saturation=R/S*100,r.lightness=Rt(1-F/Q,0,1)*100;return}const U=R/S*100,j=Rt(1-F/Q,0,1)*100;k(s,U);const Y=eS(r.hue,U,j);r.saturation=Y.s,r.lightness=Y.l}const u=A(()=>n()==="hsl"?`${r.saturation}%`:`${f(s)}%`),h=A(()=>n()==="hsl"?`${100-r.lightness}%`:`${100-Tu(r.hue,r.saturation,r.lightness).v}%`);function d(T){T.preventDefault(),k(o,!0),RT(),window.addEventListener("mousemove",c),window.addEventListener("mouseup",c),window.addEventListener("mouseup",v)}function m(T){k(o,!0),c(T),window.addEventListener("touchend",g)}function g(){k(o,!1),window.removeEventListener("touchend",g)}function p(T){const S=DT(T),Q=T.shiftKey?10:1;if(!S)return;if(T.preventDefault(),k(o,!0),n()==="hsl"){switch(S){case"left":r.saturation=Rt(r.saturation-Q,0,100);break;case"down":r.lightness=Rt(r.lightness-Q,0,100);break;case"right":r.saturation=Rt(r.saturation+Q,0,100);break;case"up":r.lightness=Rt(r.lightness+Q,0,100);break}k(o,!1);return}const D=Tu(r.hue,r.saturation,r.lightness);switch(D.s=f(s),S){case"left":D.s=Rt(D.s-Q,0,100);break;case"down":D.v=Rt(D.v-Q,0,100);break;case"right":D.s=Rt(D.s+Q,0,100);break;case"up":D.v=Rt(D.v+Q,0,100);break}k(s,D.s,!0);const I=eS(r.hue,D.s,D.v);r.saturation=I.s,r.lightness=I.l,k(o,!1)}function O(){window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",c),window.removeEventListener("mouseup",v),window.removeEventListener("touchend",g)}function v(){k(o,!1),LT(),O()}We(()=>()=>O());const w={"huey-area":""};var _=EK();Qt(_,()=>({...w,role:"group",class:e.class,style:`background: ${f(a)}; --huey-thumb-color: ${f(l)};`,onmousedown:d,ontouchmove:c,ontouchstart:m}));var C=x(_);{let T=A(()=>`top: ${f(h)}; left: ${f(u)};`),S=A(()=>e["aria-label"]??"Color thumb"),Q=A(()=>Math.round(r.saturation)),D=A(()=>`Saturation ${Math.round(r.saturation)}%, Lightness ${Math.round(r.lightness)}%`);IT(C,{get style(){return f(T)},tabindex:0,role:"slider",get"aria-label"(){return f(S)},get"aria-valuenow"(){return f(Q)},"aria-valuemin":0,"aria-valuemax":100,get"aria-valuetext"(){return f(D)},onkeydown:p})}b(_),gn(_,T=>k(i,T),()=>f(i)),y(t,_),Re()}var MK=P('
Hex
',1),RK=P('
'),LK=P('
');function IK(t,e){Me(e,!0);const n=A(()=>e.field.alpha!==!1),r=A(()=>{const S=typeof e.value=="string"?e.value.trim():"";if(S)return S;const Q=typeof e.field.default=="string"?e.field.default.trim():"";if(Q)return Q;const D=(e.field.placeholder||"").trim();return D||"#000000"});function i(S){try{return Fi(S)}catch{return Fi("#000000")}}function s(S){return(S||"").trim().toLowerCase()}function o(S){return f(n)?S.toHexString().toUpperCase():"#"+S.toHex().toUpperCase()}let a=ge(Pt(i(f(r)))),l=!1,c=s(o(f(a)));We(()=>{const S=s(typeof e.value=="string"?e.value:"");S!==c&&(c=S,l=!0,k(a,i(S||f(r)),!0))}),We(()=>{const S=o(f(a)),Q=s(S);if(l){l=!1;return}Q!==c&&(c=Q,e.onchange(S))});let u=ge(!1),h=ge(null);function d(S){f(h)&&!f(h).contains(S.target)&&k(u,!1)}tr(()=>document.addEventListener("mousedown",d)),sA(()=>document.removeEventListener("mousedown",d));const m=["#ef4444","#f97316","#f59e0b","#eab308","#84cc16","#22c55e","#10b981","#14b8a6","#06b6d4","#0ea5e9","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e","#000000"],g=A(()=>f(a).toHexString());var p=LK(),O=x(p),v=x(O),w=M(v,2),_=x(w,!0);b(w),b(O);var C=M(O,2);{var T=S=>{var Q=RK(),D=x(Q);AK(D,{get color(){return f(a)},set color(I){k(a,I,!0)},children:(I,X)=>{var L=MK(),R=me(L);DK(R,{class:"huey-saturation","aria-label":"Saturation and lightness"});var F=M(R,2),U=x(F);wK(U,{class:"huey-dropper","aria-label":"Pick color from screen",children:J=>{kA(J,{size:16})},$$slots:{default:!0}});var j=M(U,2),Y=x(j);TK(Y,{class:"huey-slider","aria-label":"Hue"});var ie=M(Y,2);{var N=V=>{xK(V,{class:"huey-slider","aria-label":"Opacity"})};Z(ie,V=>{f(n)&&V(N)})}b(j),b(F);var z=M(F,2),he=M(x(z),2);CK(he,{class:"huey-hex"}),b(z);var te=M(z,2);PK(te,{class:"huey-swatches",get swatch(){return m}}),y(I,L)},$$slots:{default:!0}}),b(Q),y(S,Q)};Z(C,S=>{f(u)&&S(T)})}b(p),gn(p,S=>k(h,S),()=>f(h)),B(S=>{yi(v,`background:${f(g)??""}`),$(_,S)},[()=>f(g).toUpperCase()]),Ce("click",O,()=>{k(u,!f(u))}),y(t,p),Re()}It(["click"]);var XK=P('

');function ZK(t,e){Me(e,!0);const n=A(()=>e.ownerType==="codemirror"?ve.t("ADMIN_NEXT.SYNC.EDITOR_LOCK_NOTICE.BUILTIN_MARKDOWN_EDITOR"):e.ownerType);var r=XK(),i=x(r);_A(i,{size:13,class:"shrink-0 text-amber-700 dark:text-amber-300"});var s=M(i,2);lt(s,()=>ve.tHtml("ADMIN_NEXT.SYNC.EDITOR_LOCK_NOTICE.LOCKED",{owner:e.ownerName,editor:f(n),href:`${$A}/users/${_t.username}`}),!0),b(s),b(r),y(t,r),Re()}var NK=P('*'),VK=P(' '),FK=P('

'),jK=P('
'),BK=P('
'),zK=P("
"),WK=P('
'),YK=P('
'),UK=P('
'),qK=P('*'),$K=P(''),GK=P('

'),HK=P("
"),KK=P(' '),JK=P('
'),eJ=P("
"),tJ=P("
"),nJ=P("
"),rJ=P('
'),iJ=P("
"),sJ=P("
"),oJ=P("
"),aJ=P('*'),lJ=P('

'),cJ=P(`
`),uJ=P('*'),hJ=P(' '),dJ=P('

'),fJ=P("
"),mJ=P(``),gJ=P('
'),pJ=P('*'),OJ=P(' '),vJ=P('

'),bJ=P("
"),yJ=P(''),xJ=P('
'),SJ=P("
"),wJ=P("
"),kJ=P("
"),_J=P("
"),PJ=P("
");function Cr(t,e){const n=_n();Me(e,!0);const r=Wt("editorLock"),i=A(()=>r?.()??null),s=A(()=>{const ne=_t.contentEditor||"";return ne&&ne!=="default"&&Gc.has(ne)?ne:""});let o=ee(e,"filter",3,""),a=ee(e,"externalLabel",3,!1);const l=new Set(["toggle","switch","select","selectize","checkbox","checkboxes","radio","datetime","dateformat","filepicker","mediapicker","pagemediaselect","file","pages","parents","taxonomy","cron","multilevel","iconpicker","permissions","acl_picker","themeselect"]),c=A(()=>l.has(e.field.type)),u=A(()=>f(c)&&e.oncommit?ne=>{e.oncommit(ne),e.onchange(ne)}:e.onchange);let h=ge(void 0),d=ge(!1);const m=ve.tMaybe,g=Wt("blueprintErrors"),p=A(()=>(g?.()??{})[e.field.name]),O=new Set(["section","fieldset","tabs","tab","columns","column","pagemedia","cronstatus","webhook-status","page-exists"]),v=new Set(["save-redirect"]),w=A(()=>!a()&&!O.has(e.field.type)&&!v.has(e.field.type)&&e.field.type!=="spacer"&&e.field.type!=="display"&&e.field.style!=="vertical"&&!!(e.field.label||e.field.help)),_=new Set(["order_title","header.order_by","header.order_manual","enabled","health_status","active_triggers"]),C=new Set(["status_title"]),T=new Set(["order","blueprint","hidden"]),S=new Set(["ordering"]),Q=A(()=>e.field.type==="display"&&(()=>{const ne=e.field.content||e.field.text||e.field.description||"";return ne===""||ne.includes("{},R=A(()=>_.has(e.field.name)||T.has(e.field.type)),F=ne=>{mH(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange}})},U=ne=>{},j=ne=>{},Y=A(()=>o()&&!Bp(e.field,o(),e.value)),ie=ne=>{var Pe=jK(),Fe=x(Pe),Ie=x(Fe);{var gt=ht=>{var He=VK(),qe=x(He),dt=M(qe);{var zt=Nn=>{var cn=NK();y(Nn,cn)};Z(dt,Nn=>{e.field.validate?.required&&Nn(zt)})}var vn=M(dt,2);Wo(vn,{get path(){return e.field.name}}),b(He),B(Nn=>$(qe,`${Nn??""} `),[()=>m(e.field.label)]),y(ht,He)};Z(Ie,ht=>{e.field.label&&ht(gt)})}var ut=M(Ie,2);{var st=ht=>{var He=FK();lt(He,()=>m(e.field.help),!0),b(He),y(ht,He)};Z(ut,ht=>{e.field.help&&ht(st)})}b(Fe);var pt=M(Fe,2),rt=x(pt);{let ht=A(()=>({...e.field,label:void 0,help:void 0}));Cr(rt,{get field(){return f(ht)},get value(){return e.value},get onchange(){return e.onchange},get oncommit(){return e.oncommit},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit},get filter(){return o()},externalLabel:!0})}b(pt),b(Pe),y(ne,Pe)},N=ne=>{cE(ne,{get field(){return e.field},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit},get filter(){return o()}})},z=ne=>{},he=ne=>{{let Pe=A(()=>C.has(e.field.name)?{...e.field,title:void 0,label:void 0}:e.field);wE(ne,{get field(){return f(Pe)},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit},get filter(){return o()}})}},te=ne=>{const Pe=A(()=>(()=>{function gt(rt,ht){const He=[];for(const qe of rt)ht.has(qe.name)&&He.push(qe),qe.fields&&He.push(...gt(qe.fields,ht));return He}const ut=e.field.fields.map(rt=>({name:rt.name,fields:[...rt.fields??[]]})),st=[];if(ut.length>=2&&S.size>0)for(let rt=1;rt({name:rt.name,fields:rt.fields.filter(ht=>!_.has(ht.name)&&!T.has(ht.type))}));if(st.length>0){const rt=pt[0].fields.find(ht=>ht.type==="section"||ht.type==="fieldset");rt&&rt.fields?rt.fields=[...rt.fields,...st]:pt[0].fields=[...pt[0].fields,...st]}return pt})()),Fe=A(()=>f(Pe).filter(gt=>gt.fields.length>0));var Ie=zK();Ue(Ie,21,()=>f(Fe),gt=>gt.name,(gt,ut)=>{var st=BK();Ue(st,21,()=>f(ut).fields,pt=>pt.name,(pt,rt)=>{var ht=_e(),He=me(ht);{let qe=A(()=>e.getValue(f(rt).name)),dt=A(()=>e.onFieldCommit?(zt,vn)=>e.onFieldCommit(f(rt).name,zt,vn):void 0);Cr(He,{get field(){return f(rt)},get value(){return f(qe)},onchange:zt=>e.onFieldChange(f(rt).name,zt),get oncommit(){return f(dt)},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit},get filter(){return o()}})}y(pt,ht)}),b(st),y(gt,st)}),b(Ie),B(()=>Je(Ie,1,ro(f(Fe).length>1?"grid gap-4 lg:grid-cols-2":""))),y(ne,Ie)},V=ne=>{const Pe=A(()=>e.field.fields.filter(Ie=>!_.has(Ie.name)&&!T.has(Ie.type)));var Fe=WK();Ue(Fe,21,()=>f(Pe),Ie=>Ie.name,(Ie,gt)=>{var ut=_e(),st=me(ut);{let pt=A(()=>e.getValue(f(gt).name)),rt=A(()=>e.onFieldCommit?(ht,He)=>e.onFieldCommit(f(gt).name,ht,He):void 0);Cr(st,{get field(){return f(gt)},get value(){return f(pt)},onchange:ht=>e.onFieldChange(f(gt).name,ht),get oncommit(){return f(rt)},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit},get filter(){return o()}})}y(Ie,ut)}),b(Fe),y(ne,Fe)},J=ne=>{PE(ne,{get field(){return e.field}})},q=ne=>{var Pe=_e(),Fe=me(Pe);{var Ie=gt=>{const ut=A(()=>m(e.field.content||e.field.text||e.field.description));var st=_e(),pt=me(st);{var rt=He=>{var qe=YK();lt(qe,()=>Ro.parse(f(ut)),!0),b(qe),y(He,qe)},ht=He=>{var qe=UK();lt(qe,()=>f(ut),!0),b(qe),y(He,qe)};Z(pt,He=>{e.field.markdown?He(rt):He(ht,-1)})}y(gt,st)};Z(Fe,gt=>{(e.field.content||e.field.text||e.field.description)&>(Ie)})}y(ne,Pe)},re=ne=>{var Pe=JK(),Fe=x(Pe);{var Ie=He=>{var qe=HK(),dt=x(qe);{var zt=cn=>{var $t=$K(),xr=x($t,!0),$c=M(xr);{var UT=Ka=>{var $T=qK();y(Ka,$T)};Z($c,Ka=>{e.field.validate?.required&&Ka(UT)})}var qT=M($c);Wo(qT,{get path(){return e.field.name}}),b($t),B(Ka=>$(xr,Ka),[()=>m(e.field.label)]),y(cn,$t)};Z(dt,cn=>{e.field.label&&cn(zt)})}var vn=M(dt,2);{var Nn=cn=>{var $t=GK();lt($t,()=>m(e.field.help),!0),b($t),y(cn,$t)};Z(vn,cn=>{e.field.help&&cn(Nn)})}b(qe),y(He,qe)};Z(Fe,He=>{(e.field.label||e.field.help)&&He(Ie)})}var gt=M(Fe,2),ut=x(gt);En(ut);var st=M(ut,2),pt=x(st,!0);b(st);var rt=M(st,2);{var ht=He=>{var qe=KK(),dt=x(qe,!0);b(qe),B(zt=>$(dt,zt),[()=>m(e.field.append)]),y(He,qe)};Z(rt,He=>{e.field.append&&He(ht)})}b(gt),b(Pe),B(()=>{Jn(ut,e.value??e.field.default??50),Ve(ut,"min",e.field.min??0),Ve(ut,"max",e.field.max??100),Ve(ut,"step",e.field.step??1),$(pt,e.value??e.field.default??50)}),Ce("focusin",Pe,function(...He){(e.oncommit?()=>{f(d)||(k(h,JSON.parse(JSON.stringify(e.value??null)),!0),k(d,!0))}:void 0)?.apply(this,He)}),Ce("focusout",Pe,function(...He){(e.oncommit?()=>{e.oncommit(e.value,f(h)),k(d,!1),k(h,void 0)}:void 0)?.apply(this,He)}),Ce("input",ut,He=>e.onchange(Number(He.target.value))),y(ne,Pe)},oe=ne=>{u$(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},Se=ne=>{var Pe=eJ(),Fe=x(Pe);P$(Fe,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange},get getValue(){return e.getValue}}),b(Pe),Ce("focusin",Pe,function(...Ie){(e.oncommit?()=>{f(d)||(k(h,JSON.parse(JSON.stringify(e.value??null)),!0),k(d,!0))}:void 0)?.apply(this,Ie)}),Ce("focusout",Pe,function(...Ie){(e.oncommit?()=>{e.oncommit(e.value,f(h)),k(d,!1),k(h,void 0)}:void 0)?.apply(this,Ie)}),y(ne,Pe)},se=ne=>{ax(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},pe=A(()=>e.field.type==="text"&&(e.field.wrapper_classes??"").includes("cron-selector")),ae=ne=>{var Pe=tJ(),Fe=x(Pe);UE(Fe,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange},get error(){return f(p)}}),b(Pe),B(()=>{Ve(Pe,"data-translate",e.field.translate||void 0),Ve(Pe,"data-field-name",e.field.translate?e.field.name:void 0)}),Ce("focusin",Pe,function(...Ie){(e.oncommit?()=>{f(d)||(k(h,JSON.parse(JSON.stringify(e.value??null)),!0),k(d,!0))}:void 0)?.apply(this,Ie)}),Ce("focusout",Pe,function(...Ie){(e.oncommit?()=>{e.oncommit(e.value,f(h)),k(d,!1),k(h,void 0)}:void 0)?.apply(this,Ie)}),y(ne,Pe)},G=ne=>{var Pe=nJ(),Fe=x(Pe);VE(Fe,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange},get error(){return f(p)}}),b(Pe),B(()=>{Ve(Pe,"data-translate",e.field.translate||void 0),Ve(Pe,"data-field-name",e.field.translate?e.field.name:void 0)}),Ce("focusin",Pe,function(...Ie){(e.oncommit?()=>{f(d)||(k(h,JSON.parse(JSON.stringify(e.value??null)),!0),k(d,!0))}:void 0)?.apply(this,Ie)}),Ce("focusout",Pe,function(...Ie){(e.oncommit?()=>{e.oncommit(e.value,f(h)),k(d,!1),k(h,void 0)}:void 0)?.apply(this,Ie)}),y(ne,Pe)},K=A(()=>D.has(e.field.type)),H=ne=>{var Pe=rJ(),Fe=x(Pe);ZK(Fe,{get ownerType(){return f(i).ownerType},get ownerName(){return f(i).ownerName}});var Ie=M(Fe,2);{let gt=A(()=>({...e.field,readonly:!0}));sx(Ie,{get field(){return f(gt)},get value(){return e.value},get onchange(){return e.onchange}})}b(Pe),y(ne,Pe)},ue=ne=>{const Pe=A(()=>Gc.getProvider(f(s)));var Fe=iJ(),Ie=x(Fe);{let gt=A(()=>f(Pe)?.slug??""),ut=A(()=>f(Pe)?.kind??"plugins");qx(Ie,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)},get oncommit(){return e.oncommit},get pluginSlug(){return f(gt)},get providerKind(){return f(ut)},get fieldType(){return f(s)},get error(){return f(p)}})}b(Fe),B(()=>{Ve(Fe,"data-translate",e.field.translate||void 0),Ve(Fe,"data-field-name",e.field.translate?e.field.name:void 0)}),y(ne,Fe)},ye=ne=>{var Pe=sJ(),Fe=x(Pe);sx(Fe,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange}}),b(Pe),B(()=>{Ve(Pe,"data-translate",e.field.translate||void 0),Ve(Pe,"data-field-name",e.field.translate?e.field.name:void 0)}),Ce("focusin",Pe,function(...Ie){(e.oncommit?()=>{f(d)||(k(h,JSON.parse(JSON.stringify(e.value??null)),!0),k(d,!0))}:void 0)?.apply(this,Ie)}),Ce("focusout",Pe,function(...Ie){(e.oncommit?()=>{e.oncommit(e.value,f(h)),k(d,!1),k(h,void 0)}:void 0)?.apply(this,Ie)}),y(ne,Pe)},De=ne=>{var Pe=oJ(),Fe=x(Pe);Q4(Fe,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange},get error(){return f(p)}}),b(Pe),B(()=>{Ve(Pe,"data-translate",e.field.translate||void 0),Ve(Pe,"data-field-name",e.field.translate?e.field.name:void 0)}),Ce("focusin",Pe,function(...Ie){(e.oncommit?()=>{f(d)||(k(h,JSON.parse(JSON.stringify(e.value??null)),!0),k(d,!0))}:void 0)?.apply(this,Ie)}),Ce("focusout",Pe,function(...Ie){(e.oncommit?()=>{e.oncommit(e.value,f(h)),k(d,!1),k(h,void 0)}:void 0)?.apply(this,Ie)}),y(ne,Pe)},W=ne=>{const Pe=A(()=>e.field.selectize!==null&&typeof e.field.selectize=="object"&&e.field.selectize.store_keys===!0);{let Fe=A(()=>f(Pe)?e.field:{...e.field,options:e.field.options?.map(Ie=>({value:Ie.label,label:Ie.label}))});Sp(ne,{get field(){return f(Fe)},get value(){return e.value},get onchange(){return f(u)},get error(){return f(p)}})}},ce=ne=>{fC(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)},get error(){return f(p)}})},we=ne=>{oB(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},xe=ne=>{kB(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},fe=ne=>{Rj(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},Te=ne=>{var Pe=cJ(),Fe=x(Pe),Ie=x(Fe);En(Ie);var gt=M(Ie,2),ut=x(gt,!0),st=M(ut);{var pt=qe=>{var dt=aJ();y(qe,dt)};Z(st,qe=>{e.field.validate?.required&&qe(pt)})}b(gt);var rt=M(gt,2);Wo(rt,{get path(){return e.field.name}}),b(Fe);var ht=M(Fe,2);{var He=qe=>{var dt=lJ();lt(dt,()=>m(e.field.help),!0),b(dt),y(qe,dt)};Z(ht,qe=>{e.field.help&&qe(He)})}b(Pe),B(qe=>{gf(Ie,!!e.value),$(ut,qe)},[()=>m(e.field.label)]),Ce("change",Ie,qe=>{const dt=qe.target.checked;e.oncommit?.(dt),e.onchange(dt)}),y(ne,Pe)},Qe=ne=>{const Pe=A(()=>e.field.use==="keys");var Fe=gJ(),Ie=x(Fe);{var gt=st=>{var pt=fJ(),rt=x(pt);{var ht=dt=>{var zt=hJ(),vn=x(zt,!0),Nn=M(vn);{var cn=xr=>{var $c=uJ();y(xr,$c)};Z(Nn,xr=>{e.field.validate?.required&&xr(cn)})}var $t=M(Nn);Wo($t,{get path(){return e.field.name}}),b(zt),B(xr=>$(vn,xr),[()=>m(e.field.label)]),y(dt,zt)};Z(rt,dt=>{e.field.label&&dt(ht)})}var He=M(rt,2);{var qe=dt=>{var zt=dJ();lt(zt,()=>m(e.field.help),!0),b(zt),y(dt,zt)};Z(He,dt=>{e.field.help&&dt(qe)})}b(pt),y(st,pt)};Z(Ie,st=>{(e.field.label||e.field.help)&&st(gt)})}var ut=M(Ie,2);Ue(ut,21,()=>e.field.options,st=>st.value,(st,pt)=>{const rt=A(()=>String(f(pt).value??"")),ht=A(()=>f(Pe)?e.value!=null&&typeof e.value=="object"&&!Array.isArray(e.value)&&!!e.value[f(pt).value]:Array.isArray(e.value)&&e.value.some(vn=>String(vn??"")===f(rt)));var He=mJ(),qe=x(He);En(qe);var dt=M(qe,2),zt=x(dt,!0);b(dt),b(He),B(vn=>{gf(qe,f(ht)),$(zt,vn)},[()=>m(f(pt).label)]),Ce("change",qe,vn=>{const Nn=vn.target.checked;let cn;if(f(Pe)){const $t=e.value!=null&&typeof e.value=="object"&&!Array.isArray(e.value)?{...e.value}:{};$t[f(pt).value]=Nn,cn=$t}else{const $t=Array.isArray(e.value)?[...e.value]:[];cn=Nn?[...$t,f(pt).value]:$t.filter(xr=>xr!==f(pt).value)}e.oncommit?.(cn),e.onchange(cn)}),y(st,He)}),b(ut),b(Fe),y(ne,Fe)},Be=ne=>{var Pe=xJ(),Fe=x(Pe);{var Ie=ut=>{var st=bJ(),pt=x(st);{var rt=qe=>{var dt=OJ(),zt=x(dt,!0),vn=M(zt);{var Nn=$t=>{var xr=pJ();y($t,xr)};Z(vn,$t=>{e.field.validate?.required&&$t(Nn)})}var cn=M(vn);Wo(cn,{get path(){return e.field.name}}),b(dt),B($t=>$(zt,$t),[()=>m(e.field.label)]),y(qe,dt)};Z(pt,qe=>{e.field.label&&qe(rt)})}var ht=M(pt,2);{var He=qe=>{var dt=vJ();lt(dt,()=>m(e.field.help),!0),b(dt),y(qe,dt)};Z(ht,qe=>{e.field.help&&qe(He)})}b(st),y(ut,st)};Z(Fe,ut=>{(e.field.label||e.field.help)&&ut(Ie)})}var gt=M(Fe,2);Ue(gt,21,()=>e.field.options,ut=>ut.value,(ut,st)=>{var pt=yJ(),rt=x(pt);En(rt);var ht=M(rt,2),He=x(ht,!0);b(ht),b(pt),B((qe,dt)=>{Ve(rt,"name",`${e.field.name}-${n}`),Jn(rt,f(st).value),gf(rt,qe),$(He,dt)},[()=>String(e.value??"")===String(f(st).value??""),()=>m(f(st).label)]),Ce("change",rt,()=>{e.oncommit?.(f(st).value),e.onchange(f(st).value)}),y(ut,pt)}),b(gt),b(Pe),y(ne,Pe)},$e=ne=>{UB(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit},get filter(){return o()}})},Ne=ne=>{var Pe=SJ(),Fe=x(Pe);OB(Fe,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange}}),b(Pe),B(()=>{Ve(Pe,"data-translate",e.field.translate||void 0),Ve(Pe,"data-field-name",e.field.translate?e.field.name:void 0)}),Ce("focusin",Pe,function(...Ie){(e.oncommit?()=>{f(d)||(k(h,JSON.parse(JSON.stringify(e.value??null)),!0),k(d,!0))}:void 0)?.apply(this,Ie)}),Ce("focusout",Pe,function(...Ie){(e.oncommit?()=>{e.oncommit(e.value,f(h)),k(d,!1),k(h,void 0)}:void 0)?.apply(this,Ie)}),y(ne,Pe)},Ge=ne=>{},wt=ne=>{A8(ne,{})},qt=ne=>{B$(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},tt=ne=>{nG(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},ct=ne=>{Kj(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},Ot=ne=>{v$(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},Zn=ne=>{Sp(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)},get error(){return f(p)}})},Vt=ne=>{ax(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},kt=ne=>{v8(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},Xt=ne=>{var Pe=wJ(),Fe=x(Pe);IK(Fe,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange}}),b(Pe),Ce("focusin",Pe,function(...Ie){(e.oncommit?()=>{f(d)||(k(h,JSON.parse(JSON.stringify(e.value??null)),!0),k(d,!0))}:void 0)?.apply(this,Ie)}),Ce("focusout",Pe,function(...Ie){(e.oncommit?()=>{e.oncommit(e.value,f(h)),k(d,!1),k(h,void 0)}:void 0)?.apply(this,Ie)}),y(ne,Pe)},ei=ne=>{sG(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit}})},ti=ne=>{},nr=ne=>{oG(ne,{get field(){return e.field},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit}})},Qn=ne=>{var Pe=kJ(),Fe=x(Pe);fG(Fe,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange}}),b(Pe),Ce("focusin",Pe,function(...Ie){(e.oncommit?()=>{f(d)||(k(h,JSON.parse(JSON.stringify(e.value??null)),!0),k(d,!0))}:void 0)?.apply(this,Ie)}),Ce("focusout",Pe,function(...Ie){(e.oncommit?()=>{e.oncommit(e.value,f(h)),k(d,!1),k(h,void 0)}:void 0)?.apply(this,Ie)}),y(ne,Pe)},qs=ne=>{_G(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},Ga=ne=>{MG(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return f(u)}})},Ha=ne=>{rH(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange}})},jT=ne=>{cH(ne,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange}})},BT=ne=>{CH(ne,{get field(){return e.field},get getValue(){return e.getValue},get onFieldChange(){return e.onFieldChange},get onFieldCommit(){return e.onFieldCommit}})},zT=ne=>{const Pe=A(()=>Gc.getProvider(e.field.type));var Fe=_J(),Ie=x(Fe);{let gt=A(()=>v.has(e.field.type)?{...e.field,label:void 0,help:void 0}:e.field),ut=A(()=>f(Pe)?.slug??""),st=A(()=>f(Pe)?.kind??"plugins");qx(Ie,{get field(){return f(gt)},get value(){return e.value},get onchange(){return f(u)},get oncommit(){return e.oncommit},get pluginSlug(){return f(ut)},get providerKind(){return f(st)},get fieldType(){return e.field.type},get error(){return f(p)}})}b(Fe),B(()=>{Ve(Fe,"data-translate",e.field.translate||void 0),Ve(Fe,"data-field-name",e.field.translate?e.field.name:void 0)}),y(ne,Fe)},WT=A(()=>Gc.has(e.field.type)),YT=ne=>{var Pe=PJ(),Fe=x(Pe);Ij(Fe,{get field(){return e.field},get value(){return e.value},get onchange(){return e.onchange}}),b(Pe),Ce("focusin",Pe,function(...Ie){(e.oncommit?()=>{f(d)||(k(h,JSON.parse(JSON.stringify(e.value??null)),!0),k(d,!0))}:void 0)?.apply(this,Ie)}),Ce("focusout",Pe,function(...Ie){(e.oncommit?()=>{e.oncommit(e.value,f(h)),k(d,!1),k(h,void 0)}:void 0)?.apply(this,Ie)}),y(ne,Pe)};Z(X,ne=>{f(R)?ne(L):e.field.name==="webhook_examples"?ne(F,1):f(Q)?ne(U,2):f(Y)?ne(j,3):f(w)?ne(ie,4):e.field.type==="tabs"&&e.field.fields?ne(N,5):e.field.type==="tab"&&e.field.fields?ne(z,6):e.field.type==="section"||e.field.type==="fieldset"?ne(he,7):e.field.type==="columns"&&e.field.fields?ne(te,8):e.field.type==="column"&&e.field.fields?ne(V,9):e.field.type==="spacer"?ne(J,10):e.field.type==="display"?ne(q,11):e.field.type==="range"?ne(re,12):e.field.type==="datetime"?ne(oe,13):e.field.type==="folder-slug"?ne(Se,14):f(pe)?ne(se,15):e.field.type==="password"?ne(ae,16):f(K)?ne(G,17):(e.field.type==="markdown"||e.field.type==="editor")&&e.field.name==="content"&&f(i)?ne(H,18):e.field.type==="markdown"&&f(s)?ne(ue,19):e.field.type==="markdown"||e.field.type==="editor"?ne(ye,20):e.field.type==="textarea"?ne(De,21):e.field.type==="select"&&(e.field.multiple||e.field.selectize)?ne(W,22):e.field.type==="select"?ne(ce,23):e.field.type==="themeselect"?ne(we,24):e.field.type==="dateformat"?ne(xe,25):e.field.type==="toggle"||e.field.type==="switch"?ne(fe,26):e.field.type==="checkbox"?ne(Te,27):e.field.type==="checkboxes"&&e.field.options?ne(Qe,28):e.field.type==="radio"&&e.field.options?ne(Be,29):e.field.type==="list"&&e.field.fields?ne($e,30):e.field.type==="array"?ne(Ne,31):e.field.type==="xss"||e.field.type==="ignore"||e.field.type==="nonce"||e.field.type==="honeypot"?ne(Ge,32):e.field.type==="pagemedia"?ne(wt,33):e.field.type==="filepicker"||e.field.type==="mediapicker"||e.field.type==="pagemediaselect"?ne(qt,34):e.field.type==="file"?ne(tt,35):e.field.type==="pages"||e.field.type==="parents"?ne(ct,36):e.field.type==="taxonomy"?ne(Ot,37):e.field.type==="selectize"?ne(Zn,38):e.field.type==="cron"?ne(Vt,39):e.field.type==="multilevel"?ne(kt,40):e.field.type==="colorpicker"?ne(Xt,41):e.field.type==="elements"?ne(ei,42):e.field.type==="element"?ne(ti,43):e.field.type==="conditional"?ne(nr,44):e.field.type==="frontmatter"||e.field.type==="codemirror"?ne(Qn,45):e.field.type==="iconpicker"?ne(qs,46):e.field.type==="permissions"||e.field.type==="acl_picker"?ne(Ga,47):e.field.type==="cronstatus"?ne(Ha,48):e.field.type==="webhook-status"?ne(jT,49):e.field.type==="page-exists"&&e.field.fields?ne(BT,50):f(WT)?ne(zT,51):ne(YT,-1)})}y(t,I),Re()}It(["focusin","focusout","input","change"]);var QJ=P('
');function Fee(t,e){Me(e,!0);let n=ee(e,"filter",3,""),r=ee(e,"errors",19,()=>({}));ad("blueprintErrors",()=>r());function i(u){const h=new Set(["section","fieldset"]),d=[];let m=0;for(;m0?d.push({...g,fields:i(p)}):d.push(g),m=O}else g.fields?.length?d.push({...g,fields:i(g.fields)}):d.push(g),m++}return d}const s=A(()=>i(e.fields));function o(u){const h=u.split(".");let d=e.data;for(const m of h){if(d==null||typeof d!="object")return;d=d[m]}return d}function a(u,h){const d=u.split(".");let g={...e.data};for(let p=0;pf(s),u=>u.name,(u,h)=>{{let d=A(()=>o(f(h).name)),m=A(()=>e.oncommit?(p,O)=>l(f(h).name,p,O):void 0),g=A(()=>e.oncommit?l:void 0);Cr(u,{get field(){return f(h)},get value(){return f(d)},onchange:p=>a(f(h).name,p),get oncommit(){return f(m)},getValue:o,onFieldChange:a,get onFieldCommit(){return f(g)},get filter(){return n()}})}}),b(c),y(t,c),Re()}const ZT=new Set(["tabs","tab","section","fieldset","columns","column","conditional","page-exists"]),NT=new Set(["order_title","header.order_by","header.order_manual","enabled","health_status","active_triggers"]),VT=new Set(["order","blueprint","hidden","spacer","display"]);function CJ(t,e){if(!t)return;let n=t;for(const r of e.split(".")){if(n==null||typeof n!="object")return;n=n[r]}return n}function od(t){return t==null?!0:typeof t=="string"?t.trim()==="":Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}function R0(t,e){const n=CJ(e,t.name),r=od(n)?t.default:n;if(!od(r))return null;if(t.validate?.message)return ve.tMaybe(t.validate.message);const i=t.label?ve.tMaybe(t.label):"";return i?ve.t("ADMIN_NEXT.VALIDATION.FIELD_REQUIRED",{label:i}):ve.t("ADMIN_NEXT.VALIDATION.REQUIRED_GENERIC")}function FT(t,e){for(const n of t){const r=ZT.has(n.type);if(!r&&n.name===e)return n;if(r&&n.fields?.length){const i=FT(n.fields,e);if(i)return i}}}function L0(t,e){for(const n of t){const r=ZT.has(n.type);n.validate?.required===!0&&!r&&!NT.has(n.name)&&!VT.has(n.type)&&e.push(n),n.fields?.length&&r&&L0(n.fields,e)}}function TJ(t,e){const n=[];L0(t,n);const r={};for(const i of n){const s=R0(i,e);s&&(r[i.name]=s)}return r}function jee(t,e,n){const r=FT(t,e);return!r||r.validate?.required!==!0||NT.has(r.name)||VT.has(r.type)?null:R0(r,n)}function Bee(t,e){const n=[];return L0(t,n),n.some(r=>R0(r,e)!==null)}function Np(t){if(Array.isArray(t))return t.map(Np).filter(e=>!od(e));if(t&&typeof t=="object"){const e={};for(const[n,r]of Object.entries(t)){const i=Np(r);od(i)||(e[n]=i)}return e}return t}function zee(t){return JSON.stringify(Np(t))}function Wee(t,e){const n=TJ(t,e),r=Object.keys(n).length;return r>0&&xi.error(ve.t("ADMIN_NEXT.VALIDATION.FORM_HAS_ERRORS",{count:r})),n}function Yee(){typeof document>"u"||requestAnimationFrame(()=>{document.querySelector("[data-field-error]")?.scrollIntoView({behavior:"smooth",block:"center"})})}export{Vee as $,Yn as A,Fee as B,cO as C,yk as D,Pn as E,B0 as F,Nm as G,Qi as H,St as I,E7 as J,zu as K,Cs as L,at as M,Uw as N,Nee as O,go as P,Ke as Q,mo as R,Pr as S,Za as T,Rn as U,Ws as V,J9 as W,Vi as X,Co as Y,ln as Z,Es as _,zee as a,t6 as a0,Gg as a1,lG as a2,lx as a3,Kj as a4,fC as a5,ZK as a6,fj as a7,Yi as b,Wee as c,Zu as d,js as e,Zo as f,E4 as g,Bee as h,Xo as i,A4 as j,Qs as k,Et as l,Ae as m,Oe as n,aP as o,Cee as p,lO as q,Xg as r,Yee as s,E as t,hh as u,jee as v,X2 as w,gO as x,Qr as y,KR as z};