114 lines
1.1 MiB
Plaintext
114 lines
1.1 MiB
Plaintext
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("<button> </button>"),nE=P('<div class="py-12 text-center text-sm text-muted-foreground"> </div>'),rE=P("<div></div>"),iE=P('<div class="flex flex-col lg:flex-row lg:gap-0"><div class="shrink-0 border-b border-border lg:w-52 lg:self-start lg:sticky lg:border-b-0 lg:border-e" style="top: var(--sticky-header-height, 0px)"><nav class="flex gap-1 overflow-x-auto p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden lg:flex-col lg:overflow-x-visible lg:p-2"></nav></div> <div class="min-w-0 flex-1 py-4 lg:p-4 lg:ps-6"><!></div></div>'),sE=P("<button> </button>"),oE=P('<div class="py-12 text-center text-sm text-muted-foreground"> </div>'),aE=P("<div></div>"),lE=P('<div><div class="sticky z-[8] flex gap-1 overflow-x-auto border-b border-border bg-background [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" style="top: var(--sticky-header-height-base, 0px)"></div> <!></div>');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('<button type="button" class="inline-flex shrink-0 items-center justify-center rounded p-0.5 text-amber-500/80 transition-colors hover:bg-muted hover:text-amber-500 disabled:cursor-not-allowed disabled:opacity-40"><!></button>');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('<svg class="h-3 w-3 text-white" viewBox="0 0 16 16" fill="currentColor"><path d="M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z"></path></svg>'),dE=P('<button type="button"><!></button>'),fE=P('<p class="mt-1 text-sm text-muted-foreground"></p>'),mE=P('<p class="mt-1 text-sm text-muted-foreground"></p>'),gE=P('<div class="px-6 pt-6 pb-2"><h3 class="text-base font-bold text-foreground"> </h3> <!></div>'),pE=P("<div><!></div>"),OE=P('<span class="text-red-500">*</span>'),vE=P('<span class="inline-flex items-center gap-1.5"><span><!> <!></span> <!></span>'),bE=P('<p class="mt-0.5 text-xs text-muted-foreground"><!></p>'),yE=P('<div class="grid gap-1.5 lg:grid-cols-[minmax(0,1fr)_2fr] lg:items-start lg:gap-x-6"><div class="flex items-start gap-2 lg:pt-2.5"><!> <div><!> <!></div></div> <div><!></div></div>'),xE=P('<div class="space-y-5 px-6 py-5"></div>'),SE=P('<div class="rounded-xl border border-border bg-muted/30"><!> <!></div>');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("<script")||C.includes("<div id="))return!0}return!1}function h(_){return _.style==="vertical"||o.has(_.type)||a.has(_.type)}function d(_){if(!_.toggleable)return!0;const C=e.getValue(_.name);return C!=null}function m(_,C){return _.toggleable&&!C?_.default??null:e.getValue(_.name)}function g(_,C){d(C)?e.onFieldChange(_,null):e.onFieldChange(_,C.default??"")}function p(_){if(!r())return _;const C=r().replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return _.replace(new RegExp(`(${C})`,"gi"),'<mark class="bg-yellow-400/40 text-inherit rounded-sm">$1</mark>')}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('<div class="mt-2 border-b border-border pb-1"><h4 class="text-xs font-semibold uppercase tracking-wider text-muted-foreground"> </h4></div>'),_E=P('<hr class="border-border"/>');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('<span class="text-red-500">*</span>'),CE=P('<label class="text-sm font-semibold text-foreground"> <!></label>'),TE=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),AE=P("<div><!> <!></div>"),EE=P('<span class="flex items-center rounded-l-lg border border-r-0 border-input bg-muted px-3 text-sm text-muted-foreground"> </span>'),DE=P('<span class="flex items-center rounded-r-lg border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground"> </span>'),ME=P('<div class="flex items-stretch rounded-lg"><!> <input/> <!></div>'),RE=P("<input/>"),LE=P('<p class="text-xs text-muted-foreground"></p>'),IE=P('<p class="text-xs text-muted-foreground"> </p>'),XE=P('<p class="text-xs font-medium text-destructive" data-field-error=""> </p>'),ZE=P('<div class="space-y-2"><!> <!> <!> <!></div>'),NE=P('<input type="hidden"/>');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('<span class="text-red-500">*</span>'),jE=P('<label class="text-sm font-semibold text-foreground"> <!></label>'),BE=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),zE=P("<div><!> <!></div>"),WE=P('<p class="text-xs font-medium text-destructive" data-field-error=""> </p>'),YE=P('<div class="space-y-2"><!> <div><!></div> <!></div>');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,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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<t.length;e++)(e%2?vS:Gm).push(n=n+t[e])})();function qE(t){if(t<768)return!1;for(let e=0,n=Gm.length;;){let r=e+n>>1;if(t<Gm[r])n=r;else 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<t.length;){let i=vf(t,e);if(r==W0||i==W0||n&&qE(i))e+=Y0(i),r=i;else if(z0(i)){let s=0,o=e-2;for(;o>=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<e)return r;e--}return 0}function vf(t,e){let n=t.charCodeAt(e);if(!xS(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return yS(r)?(n-55296<<10)+(r-56320)+65536:n}function yS(t){return t>=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&&o<this.text.length;o++){let a=this.text[o],l=s+a.length;s>e&&o&&(i+=r),e<l&&n>s&&(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<this.children.length;s++){let a=this.children[s],l=o+a.length;if(e<=l&&n>=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<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],a=s+o.length;if(e>=s&&n<=a){let l=o.replace(e-s,n-s,r),c=this.lines-o.lines+l.lines;if(l.lines<c>>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;s<this.children.length&&o<=n;s++){let a=this.children[s],l=o+a.length;o>e&&s&&(i+=r),e<l&&n>o&&(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<t.length&&i<=r;s++){let a=t[s],l=i+a.length;l>=n&&(l>r&&(a=a.slice(0,r-i)),i<n&&(a=a.slice(n-i)),o?(e[e.length-1]+=a,o=!1):e.push(a)),i=l+1}return e}function U0(t,e,n){return Au(t,[""],e,n)}class bl{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?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;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],o=this.sections[n++];o<0?(e(r,i,s),i+=s):i+=o,r+=s}}iterChangedRanges(e,n=!1){Km(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new Si(e)}composeDesc(e){return this.empty?e:e.empty?this:_S(this,e)}mapDesc(e,n=!1){return e.empty?this:Jm(this,e,n)}mapPos(e,n=-1,r=Tn.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],c=i+a;if(l<0){if(c>e)return s+(e-i);s+=a}else{if(r!=Tn.Simple&&c>=e&&(r==Tn.TrackDel&&i<e&&c>e||r==Tn.TrackBefore&&i<e||r==Tn.TrackAfter&&c>e))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<this.sections.length&&i<=n;){let s=this.sections[r++],o=this.sections[r++],a=i+s;if(o>=0&&i<=n&&a>=e)return i<e&&a>n?"cover":!0;i=a}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=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<n.length;i+=2){let o=n[i],a=n[i+1];if(a>=0){n[i]=a,n[i+1]=o;let l=i>>1;for(;r.length<l;)r.push(bt.empty);r.push(o?e.slice(s,s+o):bt.empty)}s+=o}return new on(n,r)}compose(e){return this.empty?e:e.empty?this:_S(this,e,!0)}map(e,n=!1){return e.empty?this:Jm(this,e,n,!0)}iterChanges(e,n=!1){Km(this,e,n)}get desc(){return Si.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new Ml(this);e:for(let o=0,a=0;;){let l=o==e.length?1e9:e[o++];for(;a<l||a==l&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,l-a);Cn(i,u,-1);let h=s.ins==-1?-1:s.off==0?s.ins:0;Cn(n,u,h),h>0&&ds(r,n,s.text),s.forward(u),a+=u}let c=e[o++];for(;a<c;){if(s.done)break e;let u=Math.min(s.len,c-a);Cn(n,u,-1),Cn(i,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),a+=u}}return{changes:new on(n,r),filtered:Si.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>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;o<n&&Cn(i,n-o,-1);let h=new on(i,s);a=a?a.compose(h.map(a)):h,i=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let h of u)c(h);else if(u instanceof on){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);l(),a=a?a.compose(u.map(a)):u}else{let{from:h,to:d=h,insert:m}=u;if(h>d||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;h<o&&l(),h>o&&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;i<e.length;i++){let s=e[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,a)=>a&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(bt.empty);r[i]=bt.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new on(n,r)}static createSet(e,n){return new on(e,n)}}function Cn(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=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<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(bt.empty);t.push(n)}}function Km(t,e,n){let r=t.inserted;for(let i=0,s=0,o=0;o<t.sections.length;){let a=t.sections[o++],l=t.sections[o++];if(l<0)i+=a,s+=a;else{let c=i,u=s,h=bt.empty;for(;c+=a,u+=l,l&&r&&(h=h.append(r[o-2>>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<o.len||a.len==o.len&&!n))){let c=a.len;for(Cn(i,a.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&l<o.i&&o.len<=u&&(Cn(i,0,o.ins),s&&ds(s,i,o.text),l=o.i),o.forward(u),c-=u}a.next()}else if(o.ins>=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.len<u)u-=a.len,a.next();else break;Cn(i,c,l<o.i?o.ins:0),s&&l<o.i&&ds(s,i,o.text),l=o.i,o.forward(o.len-u)}else{if(o.done&&a.done)return s?on.createSet(i,s):Si.create(i);throw new Error("Mismatched change set lengths")}}}function _S(t,e,n=!1){let r=[],i=n?[]:null,s=new Ml(t),o=new Ml(e);for(let a=!1;;){if(s.done&&o.done)return i?on.createSet(r,i):Si.create(r);if(s.ins==0)Cn(r,s.len,0,a),s.next();else if(o.len==0&&!o.done)Cn(r,0,o.ins,a),i&&ds(i,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let l=Math.min(s.len2,o.len),c=r.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;Cn(r,l,u,a),i&&u&&ds(i,r,o.text)}else o.ins==-1?(Cn(r,s.off?0:s.len,l,a),i&&ds(i,r,s.textBit(l))):(Cn(r,s.off?0:s.len,o.off?0:o.ins,a),i&&!o.off&&ds(i,r,o.text));a=(s.ins>l||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<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>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;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Oe([this.main],0)}addRange(e,n=!0){return Oe.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,Oe.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.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;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return Oe.normalized(e.slice(),n);r=s.to}return new Oe(e,n)}static cursor(e,n=0,r,i){return io.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i,s){let o=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!s&&e!=n&&(s=n<e?1:-1),n<e?io.create(n,e,48|o):io.create(e,n,(s?s<0?8:16:0)|o)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],o=e[i-1];if(s.empty?s.from<=o.to:s.from<o.to){let a=o.from,l=Math.max(s.to,o.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.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;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function eg(t,e){let n=!1;for(let r of e)yl(t,r)&1&&(n=!0);return n}function tD(t,e,n){let r=n.map(l=>t[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;u<r.length;u++){let h=Ku(l,r[u]);if(i[u]==2)for(let d of h)c.push(d);else c.push(h)}return e.combine(c)}return{create(l){for(let c of r)yl(l,c);return l.values[o]=a(l),1},update(l,c){if(!eg(l,s))return 0;let u=a(l);return e.compare(u,l.values[o])?0:(l.values[o]=u,1)},reconfigure(l,c){let u=eg(l,r),h=c.config.facets[e.id],d=c.facet(e);if(h&&!u&&Wp(n,h))return l.values[o]=d,0;let m=a(l);return e.compare(m,d)?(l.values[o]=d,0):(l.values[o]=m,1)}}}const Hc=Ze.define({static:!0});class yr{constructor(e,n,r,i,s){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let n=new yr(zp++,e.create,e.update,e.compare||((r,i)=>r===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<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>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.length&&(i==e.length||e[i]>=t[r]))s=t[r++],o=t[r++];else if(i<e.length)s=e[i++],o=e[i++];else return n;!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function RS(t,e,n){var r;let i,s,o;return n?(i=e.changes,s=on.empty(e.changes.length),o=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(s):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:yt.mapEffects(t.effects,i).concat(yt.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function rg(t,e,n){let r=e.selection,i=ra(e.annotations);return e.userEvent&&(i=i.concat(Bn.userEvent.of(e.userEvent))),{changes:e.changes instanceof on?e.changes:on.of(e.changes||[],n,t.facet(TS)),selection:r&&(r instanceof Oe?r:Oe.single(r.anchor,r.head)),effects:ra(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function LS(t,e,n){let r=rg(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let o=!!e[s].sequential;r=RS(r,rg(t,e[s],o?r.changes.newLength:t.doc.length),o)}let i=Bn.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return aD(n?oD(i):i)}function oD(t){let e=t.startState,n=!0;for(let i of e.facet(AS)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:sD(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=on.empty(e.doc.length);else{let o=t.changes.filter(n);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=Bn.create(e,i,t.selection&&t.selection.map(s),yt.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(ES);for(let i=r.length-1;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<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(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<t.length;n++)if(e.indexOf(t[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;a<this.config.dynamicSlots.length;a++)yl(this,a<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return yl(this,r),Ku(this,r)}update(...e){return LS(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let a of e.effects)a.is(cd.reconfigure)?(n&&(i=new Map,n.compartments.forEach((l,c)=>i.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;a<n.ranges.length;a++){let l=e(n.ranges[a]),c=this.changes(l.changes),u=c.map(i);for(let d=0;d<a;d++)s[d]=s[d].map(u);let h=i.mapDesc(c,!0);s.push(l.range.map(h)),i=i.compose(u),o=yt.mapEffects(o,u).concat(yt.mapEffects(ra(l.effects),h))}return{changes:i,selection:Oe.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof on?e:on.of(e,this.doc.length,this.facet(ot.lineSeparator))}toText(e){return bt.of(e.split(this.facet(ot.lineSeparator)||Hm))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(yl(this,n),Ku(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof yr&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let o=r[s],a=e[s];i.push(o.init(l=>o.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(;a<i;){let l=fn(n,a);if(s(n.slice(a,l))!=Zt.Word)break;a=l}return o==a?null:Oe.range(o+r,a+r)}}ot.allowMultipleSelections=ng;ot.tabSize=Ze.define({combine:t=>t.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);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let r=[],i=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],u=this.from[l]+e,h=this.to[l]+e,d,m;if(u==h){let g=n.mapPos(u,c.startSide,c.mapMode);if(g==null||(d=m=g,c.startSide!=c.endSide&&(m=n.mapPos(u,c.endSide),m<d)))continue}else if(d=n.mapPos(u,c.startSide),m=n.mapPos(h,c.endSide),d>m||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<n.length;)if(l<n.length&&(a.from-n[l].from||a.startSide-n[l].value.startSide)>=0){let h=n[l++];u.addInner(h.from,h.to,h.value)||c.push(h)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(a.chunkIndex)<n[l].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||s<a.from||o(a.from,a.to,a.value))&&(u.addInner(a.from,a.to,a.value)||c.push(sg.create(a.from,a.to,a.value))),a.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?ft.empty:this.nextLayer.update({add:c,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],c=e.touchesRange(a,a+l.length);if(c===!1)i=Math.max(i,l.maxPoint),n.push(l),r.push(e.mapPos(a));else if(c===!0){let{mapped:u,pos:h}=l.map(a,e);u&&(i=Math.max(i,u.maxPoint),n.push(u),r.push(h))}}let s=this.nextLayer.map(e);return n.length==0?s:new ft(r,n,s||ft.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(n>=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.pointFrom<n?u.length+1:o.point.startSide<0?u.length:Math.min(u.length,l);i.point(a,c,o.point,u,h,o.pointRank),l=Math.min(o.openEnd(c),u.length)}else c>a&&(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;n<t.length;n++){let r=t[n];if(og(e,r)>0)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<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&r.set(s.chunk[o],s.chunkPos[o]);let i=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let a=r.get(s.chunk[o]);a!=null&&(n?n.mapPos(a):a)==s.chunkPos[o]&&!n?.touchesRange(a,a+s.chunk[o].length)&&i.add(s.chunk[o])}return i}class XS{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Rl{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=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<t.length&&i.compare(t[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(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)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<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[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&&g<o&&(h||t.openEnd(m)!=n.openEnd(m))&&(u=!0)),m>o)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<t.length;n++)if(t[n]!=e[n]&&!Yp(t[n],e[n]))return!1;return!0}function Kc(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function Jc(t,e,n){for(let r=t.length-1;r>=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.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function Pi(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=fn(t,i));return r}function fD(t,e,n,r){for(let i=0,s=0;;){if(s>=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<e.length;o++){let a=e[o],l=this.modules.indexOf(a);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),r)for(let c=0;c<a.rules.length;c++)r.insertRule(a.rules[c],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=a.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let o="";for(let l=0;l<this.modules.length;l++)o+=this.modules[l].getRules()+`
|
||
`;this.styleTag.textContent=o;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ks={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ll={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",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(;e<arguments.length;e++)ZS(t,arguments[e]);return t}function ZS(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)ZS(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let Vn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},ug=typeof document<"u"?document:{documentElement:{style:{}}};const hg=/Edge\/(\d+)/.exec(Vn.userAgent),NS=/MSIE \d/.test(Vn.userAgent),dg=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vn.userAgent),ud=!!(NS||dg||hg),tb=!ud&&/gecko\/(\d+)/i.test(Vn.userAgent),xf=!ud&&/Chrome\/(\d+)/.exec(Vn.userAgent),vD="webkitFontSmoothing"in ug.documentElement.style,fg=!ud&&/Apple Computer/.test(Vn.vendor),nb=fg&&(/Mobile\/\w+/.test(Vn.userAgent)||Vn.maxTouchPoints>2);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;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class Gr{eq(e){return!1}updateDOM(e,n,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Sn=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Sn||(Sn={}));class ze extends xs{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new kc(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?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.top<d.top?(v=e.top-(d.top+o),n>0&&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-v<d.top&&(v=e.top-(d.top+o)));else{let w=e.bottom-e.top,_=d.bottom-d.top;v=(i=="center"&&w<=_?e.top+w/2-_/2:i=="start"||i=="center"&&n<0?e.top-o:e.bottom-_+o)-d.top}if(r=="nearest"?e.left<d.left?(O=e.left-(d.left+s),n>0&&e.right>d.right+O&&(O=e.right-d.right+s)):e.right>d.right&&(O=e.right-d.right+s,n<0&&e.left<d.left+O&&(O=e.left-(d.left+s))):O=(r=="center"?e.left+(e.right-e.left)/2-(d.right-d.left)/2:r=="start"==a?e.left-s:e.right-(d.right-d.left)+s)-d.left,O||v)if(m)c.scrollBy(O,v);else{let w=0,_=0;if(v){let C=u.scrollTop;u.scrollTop+=v/p,_=(u.scrollTop-C)*p}if(O){let C=u.scrollLeft;u.scrollLeft+=O/g,w=(u.scrollLeft-C)*g}e={left:e.left-w,top:e.top-_,right:e.right-w,bottom:e.bottom-_},w&&Math.abs(w-O)<1&&(r="nearest"),_&&Math.abs(_-v)<1&&(i="nearest")}if(m)break;(e.top<d.top||e.bottom>d.bottom||e.left<d.left||e.right>d.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;n<e.length;){let r=e[n++],i=e[n++],s=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let sb;function Nl(t,e,n=e){let r=sb||(sb=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function sa(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function _D(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function PD(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,Bi(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Bi(n))}else{if(n==t)return!0;r=_s(n),n=n.parentNode}}function zS(t){return t instanceof Window?t.pageYOffset>Math.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.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!eh(n))r=_s(n)+1,n=n.parentNode;else return null}}class Nr{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new Nr(e.parentNode,_s(e),n)}static after(e,n){return new Nr(e.parentNode,_s(e)+1,n)}}var Nt=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Nt||(Nt={}));const yo=Nt.LTR,Gp=Nt.RTL;function US(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const QD=US("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),CD=US("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),gg=Object.create(null),ni=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);gg[e]=n,gg[n]=-e}function qS(t){return t<=247?QD[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?CD[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const TD=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class fi{get dir(){return this.level%2?Gp:yo}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let s=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=n&&a.to>=n){if(a.level==r)return o;(s<0||(i!=0?i<0?a.from<n:a.to>n: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<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!$S(r.inner,i.inner))return!1}return!0}const Dt=[];function AD(t,e,n,r,i){for(let s=0;s<=r.length;s++){let o=s?r[s-1].to:e,a=s<r.length?r[s].from:n,l=s?256:i;for(let c=o,u=l,h=l;c<a;c++){let d=qS(t.charCodeAt(c));d==512?d=u:d==8&&h==4&&(d=16),Dt[c]=d==4?2:d,d&7&&(h=d),u=d}for(let c=o,u=l,h=l;c<a;c++){let d=Dt[c];if(d==128)c<a-1&&u==Dt[c+1]&&u&24?d=Dt[c]=u:Dt[c]=256;else if(d==64){let m=c+1;for(;m<a&&Dt[m]==64;)m++;let g=c&&u==8||m<n&&Dt[m]==8?h==1?1:8:256;for(let p=c;p<m;p++)Dt[p]=g;c=m-1}else d==8&&h==1&&(Dt[c]=1);u=d,d&7&&(h=d)}}}function ED(t,e,n,r,i){let s=i==1?2:1;for(let o=0,a=0,l=0;o<=r.length;o++){let c=o?r[o-1].to:e,u=o<r.length?r[o].from:n;for(let h=c,d,m,g;h<u;h++)if(m=gg[d=t.charCodeAt(h)])if(m<0){for(let p=a-3;p>=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=i<n.length?n[i].from:e;for(let l=o;l<a;){let c=Dt[l];if(c==256){let u=l+1;for(;;)if(u==a){if(i==n.length)break;u=n[i++].to,a=i<n.length?n[i].from:e}else if(Dt[u]==256)u++;else break;let h=s==1,d=(u<e?Dt[u]:r)==1,m=h==d?h?1:2:r;for(let g=u,p=i,O=p?n[p-1].to:t;g>l;)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;l<n;){let u=!0,h=!1;if(c==s.length||l<s[c].from){let p=Dt[l];p!=a&&(u=!1,h=p==16)}let d=!u&&a==1?[]:null,m=u?r:r+1,g=l;e:for(;;)if(c<s.length&&g==s[c].from){if(h)break e;let p=s[c];if(!u)for(let O=p.to,v=c+1;;){if(O==n)break e;if(v<s.length&&s[v].from==O)O=s[v++].to;else{if(Dt[O]==a)break e;break}}if(c++,d)d.push(p);else{p.from>l&&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):l<g&&o.push(new fi(l,g,m)),l=g}else for(let l=n,c=s.length;l>e;){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.to<l&&o.push(new fi(p.to,l,m));let O=p.direction==yo!=!(m%2);Og(t,O?r+1:r,i,p.inner,p.from,p.to,o),l=p.from}g=p.from}else{if(g==e||(u?Dt[g-1]!=a:Dt[g-1]==a))break;g--}d?pg(t,g,l,r+1,i,d,o):g<l&&o.push(new fi(g,l,m)),l=g}}function Og(t,e,n,r,i,s,o){let a=e%2?2:1;AD(t,i,s,r,a),ED(t,i,s,r,a),DD(i,s,r,a),pg(t,i,s,e,n,r,o)}function MD(t,e,n){if(!t)return[new fi(0,0,e==Gp?1:0)];if(e==yo&&!n.length&&!TD.test(t))return GS(t.length);if(n.length)for(;t.length>Dt.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));(u<l.from||u>l.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)<l.level?Oe.cursor(h.side(!i,n)+t.from,h.forward(i,n)?1:-1,h.level):Oe.cursor(u+t.from,l.forward(i,n)?-1:1,l.level)}function LD(t,e,n){for(let r=e;r<n;r++){let i=qS(t.charCodeAt(r));if(i==1)return yo;if(i==2||i==4)return Gp}return yo}const KS=Ze.define(),JS=Ze.define(),ew=Ze.define(),tw=Ze.define(),vg=Ze.define(),nw=Ze.define(),rw=Ze.define(),Hp=Ze.define(),Kp=Ze.define(),iw=Ze.define({combine:t=>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<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class nn{constructor(e,n,r,i,s){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Ho.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Ho.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:o}=n||{};return new nn(ID++,e,r,i,a=>{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.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,s=0,o=0;;){let a=i<e.length?e[i].fromB:1e9,l=s<n.length?n[s]:1e9,c=Math.min(a,l);if(c==1e9)break;let u=c+o,h=c,d=u;for(;;)if(s<n.length&&n[s]<=h){let m=n[s+1];s+=2,h=Math.max(h,m);for(let g=i;g<e.length&&e[g].fromB<=h;g++)o=e[g].toA-e[g].toB;d=Math.max(d,m+o)}else if(i<e.length&&e[i].fromB<=h){let m=e[i++];h=Math.max(h,m.toB),d=Math.max(d,m.toA),o=m.toA-m.toB}else break;r.push(new wr(u,d,c,h))}return r}}class th{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=on.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,l)=>i.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)}(l<e||e==c&&(n<-1?a.length:a.covers(1)))&&(!r||!a.isWidget()&&r.isWidget())&&(r=a,i=e-l),(c>e||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<u.children.length&&m<=h;d++){let g=u.children[d],p=m+g.length;p>=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):(m<h||g.flags&16&&!g.isHidden)&&(i=g,s=h-m)),m=p}}l(this,e);let c=(n<0?i:o)||i||o;return c?{tile:c,offset:c==i?s:a}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):ZD(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new Nr(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let o=r.tile.parent,a=!1;for(let l of o.children){if(a)return new Nr(l.dom,0);l==r.tile&&(a=!0)}}return new Nr(this.dom,0)}}function ZD(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Sl(e);return n[n.length-1]||null}function ND(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class Un extends dd{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new Un(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class so extends Yt{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let r=this.dom.nodeValue.length;e>r&&(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<r&&(s++,o=-1)):n<0?i--:s<r&&s++;let a=Nl(this.dom,i,s).getClientRects();if(!a.length)return null;let l=a[(o?o<0:n>=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.top<o.bottom);l+=a?-1:1);return Zl(o,!a)}}get overrideDOMText(){if(!this.length)return bt.empty;let{root:e}=this;if(!e)return bt.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new xo(s,r,e,i)}}class nh extends Yt{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return bt.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class VD{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:s,beforeBreak:o,parents:a}=this;for(;e||n>0;)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<e)&&(!r||r.skip(l,0,l.length)!==!1||!l.isComposite)?(o=!!c,s++,e-=l.length):(a.push({tile:i,index:s}),i=l,s=0,r&&l.isComposite()&&r.enter(l))}else if(s==i.length)o=!!i.breakAfter,{tile:i,index:s}=a.pop(),s++;else if(e){let l=Math.min(e,i.length-s);r&&r.skip(i,s,s+l),e-=l,s+=l}else break;return this.tile=i,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class FD{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class jD{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var s;this.flushBuffer();let o=this.ensureMarks(n,r),a=o.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let l=o.children[o.children.length-1]=new so(a.dom,a.text+e);l.parent=o}else o.append(i||so.of(e,(s=this.cache.find(so))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?wf(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let a=n.marks.length-1;a>=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&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(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.from<this.pos&&i instanceof Xi&&i.wrapper.eq(r.wrapper))n=i;else{let s=Xi.of(r.wrapper,(e=this.cache.find(Xi,o=>o.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<rh.length;t++)rh[t].bucket=t;class zD{constructor(e){this.view=e,this.buckets=rh.map(()=>[]),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<o&&this.index[i]--,this.reused.set(c,r),c}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let s=0,o=0;;s++){if(s==i.length){if(o)return null;o=1,s=0}let a=i[s];if(!this.reused.has(a)&&(o==0?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view,a.widget)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,a.widget==e&&a.length==n&&(a.flags&497)==r?(this.reused.set(a,1),a):(this.reused.set(a,2),new xo(a.dom,n,e,a.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class WD{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new zD(e),this.text=new BD(e.state.doc),this.builder=new jD(this.cache,new fd(e,e.contentDOM),ft.iter(r)),this.cache.reused.set(n,2),this.old=new VD(n),this.reuseWalker={skip:(o,a,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=o<e.length?e[o++]:null,l=a?a.fromA:this.old.root.length;if(l>i){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<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,a.toA),this.emit(n.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(s,a.toB)),s=a.toB,i=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=qD(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(o,a,l)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let c=l>0||a<o.length?xo.of(o.widget,this.view,l-a,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,i,s),s=i.length)}else if(o.isText())this.builder.ensureLine(null),!a&&l==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,i,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(a,l),i,s)),s=i.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof nh)this.cache.add(o);else if(o instanceof Un)this.builder.ensureLine(null),this.builder.addMark(o,i,s),this.cache.reused.set(o,1),s=i.length;else return!1;this.openWidget=!1},enter:o=>{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;h<l;){let d=this.text.next(Math.min(512,l-h));d==null?(i.addLineStartIfNotCovered(r),i.addBreak(),h++):(i.ensureLine(r),i.addText(d,c,h==a?u:c.length),h+=d.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=o>s,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})=>h<this.minWidthFrom||u>this.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<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof _f&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(aw)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,o=!s&&!(this.view.state.facet(Li)||r.tabIndex>-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),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()&&o<s.length){let a=fn(s.text,o);if(a==o)return null;let l=Nl(s.dom,o,a).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(c==l.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,o=s>Math.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;g<h.children.length&&!(d>i);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];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(cw).map(s=>typeof 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.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,c),-c),this.view.textDirection==Nt.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let u=this.view.docView.lineAt(r.head,1);u&&u.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.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<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let KD=class{constructor(){this.changes=[]}compareRange(e,n){ia(e,n,this.changes)}comparePoint(e,n){ia(e,n,this.changes)}boundChange(e){ia(e,e,this.changes)}};function JD(t,e,n){let r=new KD;return ft.compare(t,e,n,r),r.changes}class e5{constructor(){this.changes=[]}compareRange(e,n){ia(e,n,this.changes)}comparePoint(){}boundChange(e){ia(e,e,this.changes)}}function t5(t,e,n){let r=new e5;return ft.compare(t,e,n,r),r.changes}function n5(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function r5(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.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(;a<i.length;){let c=fn(i.text,a);if(r(i.text.slice(a,c))!=l)break;a=c}return Oe.range(o+i.from,a+i.from)}function s5(t,e,n,r,i){let s=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.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.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==Sn.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(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:p<l.top)return Oe.cursor(O.pos,O.assoc);let v=t.coordsAtPos(O.pos,O.assoc),w=v?(v.top+v.bottom)/2:0;if(!v||(n?w>a:w<a))return Oe.cursor(O.pos,O.assoc,void 0,o)}}function kl(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=r||n||(e-s<o-e?-1:1);e=l<0?s:o,r=l}});if(!r)return e}}function gw(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let o=kl(t,i.from,0);o!=i.from&&(s=Oe.cursor(o,-1))}else{let o=kl(t,i.from,-1),a=kl(t,i.to,1);(o!=i.from||a!=i.to)&&(s=Oe.range(i.from==i.anchor?o:a,i.from==i.head?o:a))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?Oe.create(n,e.mainIndex):e}function Pf(t,e,n){let r=kl(t.state.facet(Pc).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Oe.cursor(r,r<n.from?1:-1)}class hi{constructor(e,n){this.pos=e,this.assoc=n}}function xg(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:o,y:a}=e,l=a-s,c;for(;;){if(l<0)return new hi(0,1);if(l>t.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.to<t.viewport.from:c.from>t.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.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[fi.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[fi.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n){let r=0,i=e.length-1,s=new Set,o=this.bidiIn(e[0],e[i]),a,l,c=-1,u=1e9,h;e:for(;r<i;){let m=i-r,g=r+i>>1;t:if(s.has(g)){let O=r+Math.floor(Math.random()*m);for(let v=0;v<m;v++){if(!s.has(O)){g=O;break t}O++,O==i&&(O=r)}break e}s.add(g);let p=n(g);if(p)for(let O=0;O<p.length;O++){let v=p[O],w=0;if(!(v.width==0&&p.length>1)){if(v.bottom<this.y)(!a||a.bottom<v.bottom)&&(a=v),w=1;else if(v.top>this.y)(!l||l.top>v.top)&&(l=v),w=-1;else{let _=v.left>this.x?this.x-v.left:v.right<this.x?this.x-v.right:0,C=Math.abs(_);C<u&&(c=g,u=C,h=v),_&&(w=_<0==(this.baseDir==Nt.LTR)?-1:1)}w==-1&&(!o||this.baseDirAt(e[g],1))?i=g:w==1&&(!o||this.baseDirAt(e[g+1],-1))&&(r=g+1)}}}if(!h){let m=a&&(!l||this.y-a.bottom<l.top-this.y)?a:l;return this.y=(m.top+m.bottom)/2,this.scan(e,n)}let d=(o?this.dirAt(e[c],1):this.baseDir)==Nt.LTR;return{i:c,after:this.x>(h.left+h.right)/2==d}}scanText(e,n){let r=[];for(let s=0;s<e.length;s=fn(e.text,s))r.push(n+s);r.push(n+e.length);let i=this.scan(r,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<e.children.length;a++)r.push(l+=e.children[a].length);let i=this.scan(r,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<Bi(e))return!1;if(e==t)return!0;n=_s(e)+1,e=e.parentNode}}function d5(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Yt.get(t);if(!r?.isWidget())return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i?.length)return!1}return!0}class hb{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class f5{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=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<e.state.doc.length)){let d=Math.min(c,u),m=Math.max(c,u),g=h.from-d,p=h.to-m;(g==0||g==1||d==0)&&(p==0||p==-1||m==e.state.doc.length)&&(c=0,u=e.state.doc.length)}if(e.inputState.composing>-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;l<t.children.length;l++){let h=t.children[l],d=c+h.length;if(c<e&&d>n)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<t.children.length&&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<l-a)&&(c=s.to,u="end");let h=i.doc.sliceString(a,l,Yo),d,m;!s.empty&&s.from>=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).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.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.length<e.to-e.from&&e.to>i.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.from<s.from||e.from>s.to){let l=e.from<s.from?-1:1,c=l<0?s.from:s.to,u=kl(i.facet(Pc).map(h=>h(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.from<e.from?i.sliceDoc(s.from,e.from):"",c=s.to>e.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(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let o=t.length,a=e.length;for(;o>0&&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<s&&t.length<e.length){let l=n<=s&&n>=o?s-n:0;s-=l,a=s+(a-o),o=s}else if(a<s){let l=n<=s&&n>=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.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,sa(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!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<i.length;s++){let o=i[s];if(o.left<=e.clientX&&o.right>=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 a<t.state.doc.length&&a==s.to&&a++,Oe.range(o,a)}}const Q5=Xe.ie&&Xe.ie_version<=11;let mb=null,gb=0,pb=0;function ww(t){if(!Q5)return t.detail;let e=mb,n=pb;return mb=t,pb=Date.now(),gb=!e||n>Date.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=d<u.from?Oe.range(d,m,u.assoc):Oe.range(m,d,u.assoc)}return o?i.replaceRange(i.main.extend(u.from,u.to,u.assoc)):a&&r==1&&i.ranges.length>1&&(c=T5(i,l.pos))?c:a?i.addRange(u):Oe.create([u])}}}function T5(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=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<n.length;o++){let a=new FileReader;a.onerror=s,a.onload=()=>{/[\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<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,s,o){let a=bb.indexOf(e)>-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;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return l}}class R5{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Zr{constructor(e,n,r,i,s){this.from=e,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?Sn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof bo?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Zr(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Lt=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Lt||(Lt={}));const Du=.001;class zn{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}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--,l<d.from&&(d=s.lineAt(l,Lt.ByPosNoHeight,r,0,0));u+=d.from-l,l=d.from;let g=nO.build(r.setDoc(o),e,u,h);s=sh(s,s.replace(l,c,g))}return s.updateHeight(r,0)}static empty(){return new hr(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,s=0;for(;;)if(n==r)if(i>s*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){let a=e[n++];a&&(i+=a.size)}else{let a=e[--r];a&&(s+=a.size)}let o=0;return e[n-1]==null?(o=1,n--):e[n]==null&&(o=1,r++),new I5(zn.of(e.slice(0,n)),o,zn.of(e.slice(r)))}}function sh(t,e){return t==e?t:(t.constructor!=e.constructor&&(pa=!0),e)}zn.prototype.size=1;const L5=ze.replace({});class Qw extends zn{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Zr(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new Zr(i,0,r,this.spaceAbove,L5):this.mainBlock(r,i)}lineAt(e,n,r,i,s){let o=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(o):o}forEachLine(e,n,r,i,s,o){e<=s+this.length&&n>=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+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),u=n.doc.lineAt(c),h=a+u.length*l,d=Math.max(r,e-h/2);return new Zr(u.from,u.length,d,h,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-r)/a))),{from:u,length:h}=n.doc.line(s+c);return new Zr(u,h,r+a*c,a,0)}}lineAt(e,n,r,i,s){if(n==Lt.ByHeight)return this.blockAt(e,r,i,s);if(n==Lt.ByPosNoHeight){let{from:m,to:g}=r.doc.lineAt(e);return new Zr(m,g-m,0,0,0)}let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(r,s),c=r.doc.lineAt(e),u=a+c.length*l,h=c.number-o,d=i+a*h+l*(c.from-s-h);return new Zr(c.from,c.length,Math.max(i,Math.min(d,i+this.height-u)),u,0)}forEachLine(e,n,r,i,s,o){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,s);for(let u=e,h=i;u<=n;){let d=r.doc.lineAt(u);if(u==e){let g=d.number-a;h+=l*g+c*(e-s-g)}let m=l+c*d.length;o(new Zr(d.from,d.length,h,m,0)),h+=m,u=d.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){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 e<s?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,s,i+this.left.length+this.break)}lineAt(e,n,r,i,s){let o=i+this.left.height,a=s+this.left.length+this.break,l=n==Lt.ByHeight?e<o:e<a,c=l?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,o,a);if(this.break||(l?c.to<a:c.from>a))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.left.forEachLine(e,n,r,i,s,o),n>=l&&this.right.forEachLine(e,n,r,a,l,o);else{let c=this.lineAt(l,Lt.ByPos,r,i,s);e<c.from&&this.left.forEachLine(e,c.from-1,r,i,s,o),c.to>=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(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.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<this.length){let a=s.length;this.decomposeRight(n,s),xb(s,a)}return zn.of(s)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=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);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*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<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=n-e;r.block?this.addBlock(new Qw(o,i,r)):(o||s||i>=X5)&&this.addLineDeco(i,s,o)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&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.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof hr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new nO(r,e);return ft.spans(n,r,i,s,0),s.finish(r)}}function Z5(t,e,n){let r=new N5;return ft.compare(t,e,n,r,0),r.changes}class N5{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&ia(e,n,this.changes,5)}}function V5(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=r.body;)if(c.nodeType==1){let u=c,h=window.getComputedStyle(u);if((u.scrollHeight>u.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.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}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;r<e.length;r++){let i=e[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,n){return ze.replace({widget:new B5(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class B5 extends Gr{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Sb{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=wb,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Nt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(Jp).some(i=>typeof 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.head<l.from||n.range.head>l.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.head<this.viewport.from||this.scrollTarget.range.head>this.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(c<l.from||c>l.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<l.from?d=h.top:d=h.bottom-u,l=new ru(i.lineAt(d-1e3/2,Lt.ByHeight,s,0,0).from,i.lineAt(d+u+1e3/2,Lt.ByHeight,s,0,0).to)}}return l}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new ru(this.heightMap.lineAt(r,Lt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Lt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Lt.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Lt.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(e==0||i<=o-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=a+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s<a+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new Qf(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,o=i<<1;if(this.defaultTextDirection!=Nt.LTR&&!r)return[];let a=[],l=(u,h,d,m)=>{if(h-u<s)return;let g=this.state.selection.main,p=[g.from];g.empty||p.push(g.to);for(let v of p)if(v>u&&v<h){l(u,v-10,d,m),l(v+10,h,d,m);return}let O=W5(e,v=>v.from>=d.from&&v.to<=d.to&&Math.abs(v.from-u)<s&&Math.abs(v.to-h)<s&&!p.some(w=>v.from<w&&v.to>w));if(!O){if(h<d.to&&n&&r&&n.visibleRanges.some(_=>_.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.length<o||u.type!=Sn.Text)return;let h=z5(u.from,u.to,this.stateDeco);if(h.total<o)return;let d=this.scrollTarget?this.scrollTarget.range.head:null,m,g;if(r){let p=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,O,v;if(d!=null){let w=su(h,d),_=((this.visibleBottom-this.visibleTop)/2+p)/u.height;O=w-_,v=w+_}else O=(this.visibleTop-u.top-p)/u.height,v=(this.visibleBottom-u.top+p)/u.height;m=iu(h,O),g=iu(h,v)}else{let p=h.total*this.heightOracle.charWidth,O=i*this.heightOracle.charWidth,v=0;if(p>2e6)for(let S of e)S.from>=u.from&&S.from<u.to&&S.size!=S.displaySize&&S.from*this.heightOracle.charWidth+v<this.pixelViewport.left&&(v=S.size-S.displaySize);let w=this.pixelViewport.left+v,_=this.pixelViewport.right+v,C,T;if(d!=null){let S=su(h,d),Q=((_-w)/2+O)/p;C=S-Q,T=S+Q}else C=(w-O)/p,T=(_+O)/p;m=iu(h,C),g=iu(h,T)}m>u.from&&l(u.from,m,u,h),g<u.to&&l(g,u.to,u,h)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return a}gapSize(e,n,r,i){let s=su(i,r)-su(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){Qf.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ze.set(e.map(n=>n.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<r.length&&!(i&8);s++){let o=this.visibleRanges[s],a=r[s];(o.from!=a.from||o.to!=a.to)&&(i|=4,e&&e.mapPos(o.from,-1)==a.from&&e.mapPos(o.to,1)==a.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=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<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function iu({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=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=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof rO?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.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,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,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)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{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<Date.now()-300&&PD(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,U5),Cf&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Cf&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{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<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{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&&s<this.from?a=s:l==this.to&&s>this.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<h.to&&!h.insert.length&&e.inputState.composing>=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<a;o++){let l=e.coordsForChar(o);s=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{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<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;i.push(ze.mark({attributes:{style:u}}).range(l,c))}}}e.dispatch({effects:aw.of(ze.set(i))})},this.handlers.compositionstart=()=>{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(s<this.to){if(s<this.from||o>this.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.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*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<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){mi(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-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;m<c.length;m++)if(u[m]!=Qb)try{let g=c[m];g.write&&g.write(u[m],this)}catch(g){mi(this.state,g)}if(d&&this.docView.updateSelection(!0),!h.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let g=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((g>1||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;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.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)||e<this.viewport.from||e>this.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<e.length;s++){let o=e[s];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new oh(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function Cb(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=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;l<n.length-1;++l){const c=n[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),a&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function au(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const eM=Lo.default(Ae.domEventHandlers({keydown(t,e){return Dw(Ew(e.state),t,e,"editor")}})),Io=Ze.define({enables:eM}),Tb=new WeakMap;function Ew(t){let e=t.facet(Io),n=Tb.get(e);return n||Tb.set(e,n=rM(e.reduce((r,i)=>r.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<g.length;v++){let w=g.slice(0,v).join(" ");i(w,!0),m[w]||(m[w]={preventDefault:!0,stopPropagation:!1,run:[_=>{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/2<S.top?Q.push(v(h,T.bottom,d,S.top)):T.bottom<S.top&&t.elementAtHeight((T.bottom+S.top)/2).type==Sn.Text&&(T.bottom=S.top=(T.bottom+S.top)/2),w(T).concat(Q).concat(w(S))}function v(T,S,Q,D){return new uo(e,T-l.left,S-l.top,Math.max(0,Q-T),D-S)}function w({top:T,bottom:S,horizontal:Q}){let D=[];for(let I=0;I<Q.length;I+=2)D.push(v(Q[I],T,Q[I+1],S));return D}function _(T,S,Q){let D=1e9,I=-1e9,X=[];function L(U,j,Y,ie,N){let z=t.coordsAtPos(U,U==Q.to?-2:2),he=t.coordsAtPos(Y,Y==Q.from?2:-2);!z||!he||(D=Math.min(z.top,he.top,D),I=Math.max(z.bottom,he.bottom,I),N==Nt.LTR?X.push(s&&j?h:z.left,s&&ie?d:he.right):X.push(!s&&ie?h:he.left,!s&&j?d:z.right))}let R=T??Q.from,F=S??Q.to;for(let U of t.visibleRanges)if(U.to>R&&U.from<F)for(let j=Math.max(U.from,R),Y=Math.min(U.to,F);;){let ie=t.state.doc.lineAt(j);for(let N of t.bidiSpans(ie)){let z=N.from+ie.from,he=N.to+ie.from;if(z>=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<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!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.to<a?e.state.doc.lineAt(a):l,u=Math.max(s.from,l.from),h=Math.min(s.to,c.to);if(this.boundary){for(;o>l.from;o--)if(this.boundary.test(l.text[o-1-l.from])){u=o;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){h=a;break}}let d=[],m,g=(p,O,v)=>d.push(v.range(p,O));if(l==c)for(this.regexp.lastIndex=u-l.from;(m=this.regexp.exec(l.text))&&m.index<h-l.from;)this.addMatch(m,e,m.index+l.from,g);else Db(e.state.doc,this.regexp,u,h,(p,O)=>this.addMatch(O,e,p,g));n=n.update({filterFrom:u,filterTo:h,filter:(p,O)=>p<u||O>h,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<i.length;a++){let l=i[a];l.addEventListener("keydown",c=>{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=s<n.length?n[s++]:null,c=!1;if(l){let u=l.elementClass;u&&(r+=" "+u);for(let h=o;h<this.markers.length;h++)if(this.markers[h].compare(l)){a=h,c=!0;break}}else a=this.markers.length;for(;o<a;){let u=this.markers[o++];if(u.toDOM){u.destroy(i);let h=i.nextSibling;i.remove(),i=h}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),c&&o++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function DM(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const MM=Ze.define(),RM=Ze.define(),Ko=Ze.define({combine(t){return Fs(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let s=r[i],o=n[i];r[i]=s?(a,l,c)=>s(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<t;)e=e*10+9;return e}const XM=new class extends zi{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},ZM=Lu.compute(["selection"],t=>{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;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let s of e){let o=s(r);if(o){i||(i=Object.assign({},r.props));let a=o[1],l=o[0];l.combine&&l.id in i&&(a=l.combine(i[l.id],a)),i[l.id]=a}}n.push(i?new rn(r.name,i,r.id,r.flags):r)}return new La(n)}}const cu=new WeakMap,Vb=new WeakMap;var St;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(St||(St={}));class mt{constructor(e,n,r,i,s){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,a]of s)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=aa.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new lh(this.topNode,e)}cursorAt(e,n=0,r=0){let i=cu.get(this)||this.topNode,s=new lh(i);return s.moveTo(e,n),cu.set(this,s._tree),s}get topNode(){return new Dn(this,0,0,null)}resolve(e,n=0){let r=Vl(cu.get(this)||this.topNode,e,n,!1);return cu.set(this,r),r}resolveInner(e,n=0){let r=Vl(Vb.get(this)||this.topNode,e,n,!0);return Vb.set(this,r),r}resolveStack(e,n=0){return zM(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,a=(o&St.IncludeAnonymous)>0;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;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,n,r,i,s){let{buffer:o}=this,a=-1;for(let l=e;l!=n&&!(zw(s,i,o[l+1],o[l+2])&&(a=l,r>0));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<n;){s[l++]=i[a++],s[l++]=i[a++]-r;let c=s[l++]=i[a++]-r;s[l++]=i[a++]-e,o=Math.max(o,c)}return new Ps(s,o,this.set)}}function zw(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;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.to<e);){let o=!r&&t instanceof Dn&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=r?0:St.IgnoreOverlays;if(r)for(let o=t,a=o.parent;a;o=a,a=o.parent)o instanceof Dn&&o.index<0&&((i=a.enter(e,n,s))===null||i===void 0?void 0:i.from)!=o.from&&(t=a);for(;;){let o=t.enter(e,n,s);if(!o)return t;t=o}}class Ww{cursor(e=0){return new lh(this,e)}getChild(e,n=null,r=null){let i=Fb(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return Fb(this,e,n,r)}resolve(e,n=0){return Vl(this,e,n,!1)}resolveInner(e,n=0){return Vl(this,e,n,!0)}matchContext(e){return Tg(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Dn extends Ww{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,s=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,c=n>0?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)&&(n<0||o?l>=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;s<t.length;s++){let o=t[s];(o.from>n.from||o.to<n.to)&&(n=o,e=s)}let r=n instanceof Dn&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new BM(i,n)}class BM{constructor(e,n){this.heads=e,this.node=n}get next(){return Yw(this.heads)}}function zM(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof Dn?r:r.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[r])).push(o.resolve(e,n)),s=o}else{let o=aa.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].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<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-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<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=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<this.stack.length;i++)n=new gi(this.buffer,n,this.stack[i]);return this.bufferNode=new gi(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return Tg(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,s=this.stack.length-1;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<V.length&&g(V,J,R,re,R,oe,q,j,Y),V.reverse(),J.reverse(),q>-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<L)break;L<0&&(L=U-i),I.push(R,F,U),X++,a.next()}}if(X){let R=new Uint16Array(X*4),F=I[I.length-2];for(let U=I.length-3,j=0;U>=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<F||Q.start<L)break;let Y=Q.id>=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&&D<o){let R=Q;if(L>4){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<i;g++)c+=Iu(t,e[g]);let u=Math.ceil(c*1.5/8),h=[],d=[];function m(g,p,O,v,w){for(let _=O;_<v;){let C=_,T=p[_],S=Iu(t,g[_]);for(_++;_<v;_++){let Q=Iu(t,g[_]);if(S+Q>=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<n.length?n[a]:null,h=u?u.fromA:1e9;if(h-l>=r)for(;o&&o.from<h;){let d=o;if(l>=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=s<e.length?e[s++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class gd{startParse(e,n,r){return typeof e=="string"&&(e=new YM(e)),r=r?r.length?r.map(i=>new 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.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new HM(this.fragments),n=null,r=null,i=new lh(new Dn(this.baseTree,this.ranges[0].from,0,null),St.IncludeAnonymous|St.IgnoreMounts);e:for(let s,o;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=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.from<d&&m.to>h)&&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.from<i.to||!s.overlay)){i.tree||(GM(i),n&&n.depth++,r&&r.depth++);let c=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")n=new UM(s.parser,s.overlay,c,this.inner.length,i.from,!!s.bracketed,i.tree,n);else{let u=Ub(this.ranges,s.overlay||(i.from<i.to?[new kr(i.from,i.to)]:[]));u.length&&zb(u),(u.length||!s.overlay)&&this.inner.push(new Bb(s.parser,u.length?s.parser.startParse(this.input,qb(c,u),u):s.parser.startParse(""),s.overlay?s.overlay.map(h=>new 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<l.to)){let c=n.ranges.length-1;c>=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<n){let o=t.buffer[e+1];r.push(t.slice(e,n,o)),i.push(o-s)}}function GM(t){let{node:e}=t,n=[],r=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let i=t.tree,s=i.children.indexOf(r),o=i.children[s],a=o.buffer,l=[s];function c(u,h,d,m,g,p){let O=n[p],v=[],w=[];Wb(o,u,O,v,w,m);let _=a[O+1],C=a[O+2];l.push(v.length);let T=p?c(O+4,a[O+3],o.set.types[a[O]],_,C-_,p-1):e.toTree();return v.push(T),w.push(_-m),Wb(o,a[O+3],h,v,w,m),new mt(d,v,w,g)}i.children[s]=c(0,a.length,rn.none,0,o.length,n.length-1);for(let u of l){let h=t.tree.children[u],d=t.tree.positions[u];t.yield(new Dn(h,d+t.from,u,t._tree))}}class Yb{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(St.IncludeAnonymous|St.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)n.to>=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<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=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<t.length;i++){let o=t[i-1].to,a=t[i].from;for(;s<r.length;s++){let l=r[s];if(l.from>=a)break;l.to<=o||(n||(r=n=e.slice()),l.from<o?(n[s]=new kr(l.from,o),l.to>a&&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);d<m&&c.push(new kr(d,m))}if(l=Math.min(u,h),l==1e9)break;u==l&&(o?(o=!1,i++):o=!0),h==l&&(a?(a=!1,s++):a=!0)}return c}function qb(t,e){let n=[];for(let{pos:r,mount:i,frag:s}of t){let o=r+(i.overlay?i.overlay[0].from:0),a=o+i.tree.length,l=Math.max(s.from,o),c=Math.min(s.to,a);if(i.overlay){let u=i.overlay.map(d=>new 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<this.pos-25&&this.setLookAhead(this.pos),a=s.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=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.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let h=l?this.stack[l-1]:0,d=this.bufferBase+this.buffer.length-h;if(i<s.minRepeatTerm||e&131072){let m=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,m,d+4,!0)}if(e&262144)this.state=this.stack[l];else{let m=this.stack[l-3];this.state=s.getGoto(m,i,!0)}for(;this.stack.length>l;)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]<this.buffer.length+this.bufferBase)){let o=this,a=this.buffer.length;if(a==0&&o.parent&&(a=o.bufferBase-o.parent.bufferBase,o=o.parent),a>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;s<n.length;s+=2)(o=n[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&i.push(n[s],o);if(this.stack.length<120)for(let s=0;i.length<8&&s<n.length;s+=2){let o=n[s+1];i.some((a,l)=>l&1&&a==o)||i.push(n[s],o)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let s=n[i+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(n[i],this.pos),o.reducePos=this.pos,o.score-=200,r.push(o)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let r=n>>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;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new Gb(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&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<t.length;){let s=0;for(;;){let o=t.charCodeAt(r++),a=!1;if(o==126){s=65535;break}o>=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(;s<r.from;){if(!i)return null;let o=this.ranges[--i];s-=r.from-o.to,r=o}for(;n<0?s>r.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&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(r=s,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let o=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.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.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.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.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(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<<r,{dialect:l}=n.p.parser;e:for(;(a&t[o])!=0;){let c=t[o+1];for(let m=o+3;m<c;m+=2)if((t[m+1]&a)>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<d;){let m=h+d>>1,g=c+m+(m<<1),p=t[g],O=t[g+1]||65536;if(u<p)d=m;else 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)<i}const rr=typeof process<"u"&&$b&&/\bparse\b/.test($b.LOG);let Mf=null;function Jb(t,e,n){let r=t.cursor(St.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>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(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=r.children[i],o=this.start[n]+r.positions[i];if(o>e)return this.nextStart=o,null;if(s instanceof mt){if(o==e){if(o<this.safeFrom)return null;let a=o+s.length;if(a<=this.safeTo){let l=s.prop(et.lookAhead);if(!l||a+l<this.fragment.to)return s}}this.index[n]++,o+s.length>=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;c<s.length;c++){if((1<<c&o)==0)continue;let u=s[c],h=this.tokens[c];if(!(r&&!u.fallback)&&((u.contextual||h.start!=e.pos||h.mask!=o||h.context!=a)&&(this.updateCachedToken(h,u,e),h.mask=o,h.context=a),h.lookAhead>h.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<s.specialized.length;o++)if(s.specialized[o]==e.value){let a=s.specializers[o](this.stream.read(e.start,e.end),r);if(a>=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;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:s}=e,{parser:o}=e.p,{data:a}=o;for(let l=0;l<2;l++)for(let c=o.stateSlot(s,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=Ri(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(Ri(a,c+2),n,r,i));break}a[c]==n&&(i=this.putAction(Ri(a,c+1),n,r,i))}return i}}let iR=class{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new eR(n,i),this.tokens=new rR(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[ch.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.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;o<e.length;o++){let a=e[o];for(;;){if(this.tokens.mainToken=null,a.pos>n)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;o<r.length-1;o++){let a=r[o];for(let l=o+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&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<r.length;o++)r[o].pos<this.minStackPos&&(this.minStackPos=r[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:s}=this,o=rr?this.stackID(e)+" -> ":"";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;c<l.length;){let u=l[c++],h=l[c++],d=l[c++],m=c==l.length||!r,g=m?e:e.split(),p=this.tokens.mainToken;if(g.apply(u,h,p?p.start:g.pos,d),rr&&console.log(o+this.stackID(g)+` (via ${(u&65536)==0?"shift":`reduce of ${s.getName(u&65535)}`} for ${s.getName(h)} @ ${i}${g==e?"":", split"})`),m)return!0;g.pos>i?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<e.length;o++){let a=e[o],l=n[o<<1],c=n[(o<<1)+1],u=rr?this.stackID(a)+" -> ":"";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.score<h.score)&&(i=h)}return i}stackToTree(e){return e.close(),mt.build({buffer:uh.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(Mf||(Mf=new WeakMap)).get(e);return n||Mf.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}};function ey(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class sR{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const Rf=t=>t;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;a<e.repeatNodeCount;a++)n.push("");let r=Object.keys(e.topRules).map(a=>e.topRules[a][1]),i=[];for(let a=0;a<n.length;a++)i.push([]);function s(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=et[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=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;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(ty),this.states=gl(e.states,Uint32Array),this.data=gl(e.stateData),this.goto=gl(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof 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);s<c;s++)if(i[s]==e)return l;if(a)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),o;;s+=3){if((o=r[s])==65535)if(r[s+1]==1)o=r[s=Ri(r,s+2)];else{if(r[s+1]==2)return Ri(r,s+2);break}if(o==n||o==0)return Ri(r,s+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}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;s<n.length;s++)if(!r[s])for(let o=this.dialects[n[s]],a;(a=this.data[o++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new sR(e,r,i)}static deserialize(e){return new Qs(e)}}function Ri(t,e){return t[e]|t[e+1]<<16}function oR(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function ty(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.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;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.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<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Fl.empty=new Fl([],2,null);function Gw(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let o of s.tag)n[o.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{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<d.overlay.length?d.overlay[O]:null,_=w?w.from+a:l,C=Math.max(n,v),T=Math.min(r,_);if(C<T&&p)for(;e.from<T&&(this.highlightRange(e,C,T,i,s),this.startSpan(Math.min(T,e.to),c),!(e.to>=_||!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<e.context.depth||r==e.context.depth&&e.context.type==uO&&(t.next!=45||!oo(t.peek(1))))&&t.next!=-1&&!Wi(t.next)&&t.next!=35&&t.acceptToken(Uo,-r)}},{contextual:!0}),LR=new Pn((t,e)=>{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)),i<n))break;for(;;){if(t.next<0)break e;let o=Wi(t.next);if(t.advance(),o)continue e;r=t.pos}}t.acceptTokenTo(ek,r)}),FR=js({DirectiveName:E.keyword,DirectiveContent:E.attributeValue,"DirectiveEnd DocEnd":E.meta,QuotedLiteral:E.string,BlockLiteralHeader:E.special(E.string),BlockLiteralContent:E.content,Literal:E.content,"Key/Literal Key/QuotedLiteral":E.definition(E.propertyName),"Anchor Alias":E.labelName,Tag:E.typeName,Comment:E.lineComment,": , -":E.separator,"?":E.punctuation,"[ ]":E.squareBracket,"{ }":E.brace}),jR=Qs.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO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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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")||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;l<s.children.length;l++){let c=s.children[l];c instanceof mt&&i(c,s.positions[l]+o)}};return i(Et(e),0),r}get allowsNesting(){return!0}}gr.setState=yt.define();function ay(t,e,n){let r=t.facet(Ts),i=Et(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,St.ExcludeBuffers|St.EnterBracketed))s.type.isTop&&(i=s);return i}class Cs extends gr{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=pd(e.languageData);return new Cs(n,e.parser.configure({props:[fs.add(r=>r.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<r||n>=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.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Zi.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=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);u<h&&a.push({from:u,to:h})}}}return new So(this.parser,n,r,i,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.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.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(gr.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Zf?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<i&&r.doc.length>i+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;s++)n+=i;return n}function fO(t,e){t instanceof ot&&(t=new Od(t));for(let r of t.state.facet(WR)){let i=r(t,e);if(i!==void 0)return i}let n=Et(t.state);return n.length>=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<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-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.from<r.node.from||o.to>r.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.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function eL(t,e,n){let r=Et(t);if(r.length<n)return null;let i=r.resolveStack(n,1),s=null;for(let o=i;o;o=o.next){let a=o.node;if(a.to<=n||a.from>n)continue;if(s&&a.from<e)break;let l=a.type.prop(Zo);if(l&&(a.to<r.length-50||r.length==t.doc.length||!tL(a))){let c=l(a,t);c&&c.from<=n&&c.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<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(uy.range(r,i))}return ze.set(e,!0)}});function cy(t,e,n=e){let r=!1;return t.between(e,n,(i,s)=>{i<n&&s>e&&(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<e.doc.length;){let i=t.lineBlockAt(r),s=mh(e,i.from,i.to);s&&n.push(bd.of(s)),r=(s?t.lineBlockAt(s.to):i).to+1}return n.length&&t.dispatch({effects:uk(t.state,n)}),!!n.length},oL=t=>{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&&!i&&n.type==this.tree.type&&o>=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.head<t.doc.length&&pi(t,r.head+1,-1,n));i&&(e=e.concat(n.renderMatch(i,t)))}return ze.set(e,!0)}const bL=nn.fromClass(class{constructor(t){this.paused=!1,this.decorations=hy(t.state)}update(t){(t.docChanged||t.selectionSet||this.paused)&&(t.view.composing?(this.decorations=this.decorations.map(t.changes),this.paused=!0):(this.decorations=hy(t.state),this.paused=!1))}},{decorations:t=>t.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.from<l.to){let u=Vg(l);if(u&&(n>0?e>=u.from&&e<u.to:e>u.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.from<u.to){let h=Vg(u);return{start:l,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(Ng(u.type,n,o))c++;else if(Ng(u.type,-n,o)){if(c==0){let h=Vg(u);return{start:l,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function SL(t,e,n,r,i,s,o){if(n<0?!e:e==t.doc.length)return null;let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=n>0)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<e;o++)t.charCodeAt(o)==9?s+=n-s%n:s++;return s}class xk{constructor(e,n,r,i){this.string=e,this.tabSize=n,this.indentUnit=r,this.overrideIndent=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let n=this.string.charAt(this.pos),r;if(typeof e=="string"?r=n==e:r=n&&(e instanceof RegExp?e.test(n):e(n)),r)return++this.pos,n}eatWhile(e){let n=this.pos;for(;this.eat(e););return this.pos>n}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.lastColumnPos<this.start&&(this.lastColumnValue=dy(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:dy(this.string,null,this.tabSize)}match(e,n,r){if(typeof e=="string"){let i=o=>r?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&&n<e.pos-1e4&&(n=void 0));let i=OO(this,e.node.tree,e.node.from,e.node.from,n??e.pos),s,o;if(i?(o=i.state,s=i.pos+1):(o=this.streamParser.startState(e.unit),s=e.node.from),e.pos-s>1e4)return null;for(;s<e.pos;){let l=e.state.doc.lineAt(s),c=Math.min(e.pos,l.to);if(l.length){let u=r?r(l.from):-1,h=new xk(l.text,e.state.tabSize,e.unit,u<0?void 0:u);for(;h.pos<c-l.from;)wk(this.streamParser.token,h,o)}else this.streamParser.blankLine(o,e.unit);if(c==e.pos)break;s=l.to+1}let a=e.lineAt(e.pos);return r&&n==null&&fy.set(e.state,a.from),this.streamParser.indent(o,/^\s*(.*)/.exec(a.text)[1],e)}get allowsNesting(){return!1}}function OO(t,e,n,r,i){let s=n>=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<i&&OO(t,a,l,r,i);if(c)return c}return null}function Sk(t,e,n,r,i){if(i&&n<=0&&r>=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(o<r&&a instanceof mt){if(!(l=Sk(t,a,n-o,r-o,i)))break;return i?new mt(e.type,e.children.slice(0,s).concat(l),e.positions.slice(0,s+1),o+l.length):l}}return null}function _L(t,e,n,r,i){for(let s of e){let o=s.from+(s.openStart?25:0),a=s.to-(s.openEnd?25:0),l=o<=n&&a>n&&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;c<l.children.length;c++)this.chunks.push(l.children[c]),this.chunkPos.push(l.positions[c]);s&&this.parsedPos<s.viewport.from-1e5&&i.some(c=>c.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<r;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),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].to<this.parsedPos;)this.rangeIndex++}emitToken(e,n,r,i){let s=4;if(this.ranges.length>1){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.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=mt.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:QL,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new mt(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new mt(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function wk(t,e,n){e.start=e.pos;for(let r=0;r<10;r++){let i=t(e,n);if(e.pos>e.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.from<e.to)return t.baseIndentFor(e);if(e.name=="BlockLiteral")return t.baseIndentFor(e)+t.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return t.column(e.firstChild.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let n=t.column(e.from,1);if(n==t.lineIndent(e.from,1))return n;if(e.to>t.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;o<i.length;o++)if(a=i[o]){let l=r[o],{open:c,close:u}=a;s.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:s}}return null}function VL(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:o}of n){let a=r.length,l=1e9,c;for(let u=s;u<=o;){let h=e.doc.lineAt(u);if(c==null&&(c=xO(e,h.from).line,!c))continue e;if(h.from>i&&(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;d<h.text.length&&d<l&&(l=d),r.push({line:h,comment:g,token:c,indent:d,empty:m,single:!1})}u=h.to+1}if(l<1e9)for(let u=a;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=l);r.length==a+1&&(r[a].single=!0)}if(t!=2&&r.some(s=>s.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<n.length;){let c=n[l++],u=n[l++];a>=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.prevTime<i.newGroupDelay&&i.joinToEvent(s,WL(a.changes,e.changes))||r=="input.type.compose")?o=Oh(o,o.length-1,i.minDepth,new Gn(e.changes.compose(a.changes),Ak(yt.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,_r)):o=Oh(o,o.length,i.minDepth,e),new Oi(o,_r,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:_r;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&YL(s[s.length-1],e)?this:new Oi(Ek(this.done,e),this.undone,n,r)}addMapping(e){return new Oi(jf(this.done,e),jf(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Fg.of({side:e,rest:qL(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let a=i.length==1?_r:i.slice(0,i.length-1);return s.mapped&&(a=jf(a,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Fg.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Oi.empty=new Oi(_r,_r);const kd=[{key:"Mod-z",run:SO,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ph,preventDefault:!0},{linux:"Ctrl-Shift-z",run:ph,preventDefault:!0},{key:"Mod-u",run:BL,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:zL,preventDefault:!0}];function Ia(t,e){return Oe.create(t.ranges.map(e),t.mainIndex)}function Hr(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Kr({state:t,dispatch:e},n){let r=Ia(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Hr(t,r)),!0)}function _d(t,e){return Oe.cursor(e?t.to:t.from)}function Dk(t,e){return Kr(t,n=>n.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.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(Ae.scrollMargins)){let o=s(t);o?.top&&(n=Math.max(o?.top,n)),o?.bottom&&(r=Math.max(o?.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function Vk(t,e){let n=Nk(t),{state:r}=t,i=Ia(r.selection,o=>o.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.bottom<c&&(s=Ae.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-l}))}return t.dispatch(Hr(r,i),{effects:s}),!0}const py=t=>Vk(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.head<t.doc.length&&pi(t,s.head+1,-1);if(!o||!o.end)return s;r=!0;let a=o.start.from==s.head?o.end.to:o.end.from;return Oe.cursor(a)});return r?(e(Hr(t,i)),!0):!1}const c3=({state:t,dispatch:e})=>l3(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.from&&a.to>=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.to<t.state.doc.length:o.from>0)for(let a=s;;){let l=t.moveVertically(a,e);if(l.head<o.from||l.head>o.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);l<o?(n="delete.backward",l=fu(t,l,!1)):l>o&&(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,o<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Ae.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function fu(t,e,n){if(t instanceof Ae)for(let r of t.state.facet(Ae.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(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&&i<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,i-o.from))){if(a[a.length-1]==" ")return i-1;let c=Pi(a,s.tabSize),u=c%wo(s)||wo(s);for(let h=0;h<u&&a[a.length-1-h]==" ";h++)i--;l=i}else l=fn(o.text,i-o.from,e,e)+o.from,l==i&&o.number!=(e?s.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(l-o.from,i-o.from))&&(l=fn(o.text,l-o.from,!1,!1)+o.from);return l}),Bg=t=>Gk(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.head<n?n:Math.min(t.state.doc.length,e.head+1)}),C3=t=>Ec(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<n?n:Math.min(t.state.doc.length,e.head+1)}),A3=({state:t,dispatch:e})=>{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<e.doc.length&&s++,{from:i,to:s}))),r=Ia(e.selection,i=>{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));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;l?{from:s,to:o}=l:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let h=["",Bl(e,u)];return l&&h.push(Bl(e,c.lineIndent(a.from,-1))),{changes:{from:s,to:o,insert:bt.of(h)},range:Oe.cursor(s+1+h[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function wO(t,e){let n=-1;return t.changeByRange(r=>{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.from<s.from+c.length)&&(n[s.from]=l,o.push({from:s.from,to:s.from+c.length,insert:u}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},r_=({state:t,dispatch:e})=>t.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<i.length&&o<a.length&&i.charCodeAt(o)==a.charCodeAt(o);)o++;r.push({from:n.from+o,to:n.from+i.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),V3=t=>(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;n<r;n+=1)i=s[n],t[i]=e[i];return t}function nI(t,e){var n="",r;for(r=0;r<e;r+=1)n+=t;return n}function rI(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var iI=s_,sI=J3,oI=eI,aI=nI,lI=rI,cI=tI,an={isNothing:iI,isObject:sI,toArray:oI,repeat:aI,isNegativeZero:lI,extend:cI};function o_(t,e){var n="",r=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+=`
|
||
|
||
`+t.mark.snippet),r+" "+n):r}function Wl(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=o_(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Wl.prototype=Object.create(Error.prototype);Wl.prototype.constructor=Wl;Wl.prototype.toString=function(e){return this.name+": "+o_(this,e)};var Fn=Wl;function zf(t,e,n,r,i){var s="",o="",a=Math.floor(i/2)-1;return r-e>a&&(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<n;e+=1)arguments[e].forEach(r);return t}function Wg(t){return this.extend(t)}Wg.prototype.extend=function(e){var n=[],r=[];if(e instanceof wn)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(n=n.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new Fn("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof wn))throw new Fn("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Fn("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new Fn("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(s){if(!(s instanceof wn))throw new Fn("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Wg.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Ty(i,"implicit"),i.compiledExplicit=Ty(i,"explicit"),i.compiledTypeMap=pI(i.compiledImplicit,i.compiledExplicit),i};var a_=Wg,l_=new wn("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),c_=new wn("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),u_=new wn("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),h_=new a_({explicit:[l_,c_,u_]});function OI(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function vI(){return null}function bI(t){return t===null}var d_=new wn("tag:yaml.org,2002:null",{kind:"scalar",resolve:OI,construct:vI,predicate:bI,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function yI(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function xI(t){return t==="true"||t==="True"||t==="TRUE"}function SI(t){return Object.prototype.toString.call(t)==="[object Boolean]"}var f_=new wn("tag:yaml.org,2002:bool",{kind:"scalar",resolve:yI,construct:xI,predicate:SI,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function wI(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function kI(t){return 48<=t&&t<=55}function _I(t){return 48<=t&&t<=57}function PI(t){if(t===null)return!1;var e=t.length,n=0,r=!1,i;if(!e)return!1;if(i=t[n],(i==="-"||i==="+")&&(i=t[++n]),i==="0"){if(n+1===e)return!0;if(i=t[++n],i==="b"){for(n++;n<e;n++)if(i=t[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<e;n++)if(i=t[n],i!=="_"){if(!wI(t.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<e;n++)if(i=t[n],i!=="_"){if(!kI(t.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<e;n++)if(i=t[n],i!=="_"){if(!_I(t.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function QI(t){var e=t,n=1,r;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),r=e[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),e=e.slice(1),r=e[0]),e==="0")return 0;if(r==="0"){if(e[1]==="b")return n*parseInt(e.slice(2),2);if(e[1]==="x")return n*parseInt(e.slice(2),16);if(e[1]==="o")return n*parseInt(e.slice(2),8)}return n*parseInt(e,10)}function CI(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!an.isNegativeZero(t)}var m_=new wn("tag:yaml.org,2002:int",{kind:"scalar",resolve:PI,construct:QI,predicate:CI,represent:{binary:function(t){return t>=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;n<i;n++)if(e=s.indexOf(t.charAt(n)),!(e>64)){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<i;e++)e%4===0&&e&&(a.push(o>>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<s;r++)r%3===0&&r&&(e+=o[n>>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<r;n+=1){if(i=a[n],o=!1,zI.call(i)!=="[object Object]")return!1;for(s in i)if(BI.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}function YI(t){return t!==null?t:[]}var w_=new wn("tag:yaml.org,2002:omap",{kind:"sequence",resolve:WI,construct:YI}),UI=Object.prototype.toString;function qI(t){if(t===null)return!0;var e,n,r,i,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1){if(r=o[e],UI.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[e]=[i[0],r[i[0]]]}return!0}function $I(t){if(t===null)return[];var e,n,r,i,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1)r=o[e],i=Object.keys(r),s[e]=[i[0],r[i[0]]];return s}var k_=new wn("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:qI,construct:$I}),GI=Object.prototype.hasOwnProperty;function HI(t){if(t===null)return!0;var e,n=t;for(e in n)if(GI.call(n,e)&&n[e]!==null)return!1;return!0}function KI(t){return t!==null?t:{}}var __=new wn("tag:yaml.org,2002:set",{kind:"mapping",resolve:HI,construct:KI}),_O=O_.extend({implicit:[y_,x_],explicit:[S_,w_,k_,__]}),As=Object.prototype.hasOwnProperty,vh=1,P_=2,Q_=3,bh=4,Yf=1,JI=2,Ay=3,eX=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,tX=/[\x85\u2028\u2029]/,nX=/[,\[\]\{\}]/,C_=/^(?:!|!!|![a-z\-]+!)$/i,T_=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Ey(t){return Object.prototype.toString.call(t)}function wi(t){return t===10||t===13}function ho(t){return t===9||t===32}function Hn(t){return t===9||t===32||t===10||t===13}function Jo(t){return t===44||t===91||t===93||t===123||t===125}function rX(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}function iX(t){return t===120?2:t===117?4:t===85?8:0}function sX(t){return 48<=t&&t<=57?t-48:-1}function Dy(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
|
||
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"
":t===95?" ":t===76?"\u2028":t===80?"\u2029":""}function oX(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>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(e<n){if(a=t.input.slice(e,n),r)for(i=0,s=a.length;i<s;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||Ye(t,"expected valid JSON character");else eX.test(a)&&Ye(t,"the stream contains non-printable characters");t.result+=a}}function Ry(t,e,n,r){var i,s,o,a;for(an.isObject(n)||Ye(t,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)s=i[o],As.call(e,s)||(A_(e,s,n[s]),r[s]=!0)}function ea(t,e,n,r,i,s,o,a,l){var c,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,u=i.length;c<u;c+=1)Array.isArray(i[c])&&Ye(t,"nested arrays are not supported inside keys"),typeof i=="object"&&Ey(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&Ey(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,u=s.length;c<u;c+=1)Ry(t,e,s[c],n);else Ry(t,e,s,n);else!t.json&&!As.call(n,i)&&As.call(e,i)&&(t.line=o||t.line,t.lineStart=a||t.lineStart,t.position=l||t.position,Ye(t,"duplicated mapping key")),A_(e,i,s),delete n[i];return e}function PO(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):Ye(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function tn(t,e,n){for(var r=0,i=t.input.charCodeAt(t.position);i!==0;){for(;ho(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(wi(i))for(PO(t),i=t.input.charCodeAt(t.position),r++,t.lineIndent=0;i===32;)t.lineIndent++,i=t.input.charCodeAt(++t.position);else break}return n!==-1&&r!==0&&t.lineIndent<n&&yh(t,"deficient indentation"),r}function Ed(t){var e=t.position,n;return n=t.input.charCodeAt(e),!!((n===45||n===46)&&n===t.input.charCodeAt(e+1)&&n===t.input.charCodeAt(e+2)&&(e+=3,n=t.input.charCodeAt(e),n===0||Hn(n)))}function QO(t,e){e===1?t.result+=" ":e>1&&(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.lineIndent<a)&&h===32;)t.lineIndent++,h=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>a&&(a=t.lineIndent),wi(h)){l++;continue}if(t.lineIndent<a){i===Ay?t.result+=an.repeat(`
|
||
`,s?1+l:l):i===Yf&&s&&(t.result+=`
|
||
`);break}for(r?ho(h)?(c=!0,t.result+=an.repeat(`
|
||
`,s?1+l:l)):c?(c=!1,t.result+=an.repeat(`
|
||
`,l+1)):l===0?s&&(t.result+=" "):t.result+=an.repeat(`
|
||
`,l):t.result+=an.repeat(`
|
||
`,s?1+l:l),s=!0,o=!0,l=0,n=t.position;!wi(h)&&h!==0;)h=t.input.charCodeAt(++t.position);bs(t,n,t.position,!1)}return!0}function Ly(t,e){var n,r=t.tag,i=t.anchor,s=[],o,a=!1,l;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),l=t.input.charCodeAt(t.position);l!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Ye(t,"tab characters must not be used in indentation")),!(l!==45||(o=t.input.charCodeAt(t.position+1),!Hn(o))));){if(a=!0,t.position++,tn(t,!0,-1)&&t.lineIndent<=e){s.push(null),l=t.input.charCodeAt(t.position);continue}if(n=t.line,ya(t,e,Q_,!1,!0),s.push(t.result),tn(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&l!==0)Ye(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return a?(t.tag=r,t.anchor=i,t.kind="sequence",t.result=s,!0):!1}function fX(t,e,n){var r,i,s,o,a,l,c=t.tag,u=t.anchor,h={},d=Object.create(null),m=null,g=null,p=null,O=!1,v=!1,w;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=h),w=t.input.charCodeAt(t.position);w!==0;){if(!O&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Ye(t,"tab characters must not be used in indentation")),r=t.input.charCodeAt(t.position+1),s=t.line,(w===63||w===58)&&Hn(r))w===63?(O&&(ea(t,h,d,m,g,null,o,a,l),m=g=p=null),v=!0,O=!0,i=!0):O?(O=!1,i=!0):Ye(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,w=r;else{if(o=t.line,a=t.lineStart,l=t.position,!ya(t,n,P_,!1,!0))break;if(t.line===s){for(w=t.input.charCodeAt(t.position);ho(w);)w=t.input.charCodeAt(++t.position);if(w===58)w=t.input.charCodeAt(++t.position),Hn(w)||Ye(t,"a whitespace character is expected after the key-value separator within a block mapping"),O&&(ea(t,h,d,m,g,null,o,a,l),m=g=p=null),v=!0,O=!1,i=!1,m=t.tag,g=t.result;else if(v)Ye(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=c,t.anchor=u,!0}else if(v)Ye(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=c,t.anchor=u,!0}if((t.line===s||t.lineIndent>e)&&(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.lineIndent<e)break}return O&&ea(t,h,d,m,g,null,o,a,l),v&&(t.tag=c,t.anchor=u,t.kind="mapping",t.result=h),v}function mX(t){var e,n=!1,r=!1,i,s,o;if(o=t.input.charCodeAt(t.position),o!==33)return!1;if(t.tag!==null&&Ye(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(n=!0,o=t.input.charCodeAt(++t.position)):o===33?(r=!0,i="!!",o=t.input.charCodeAt(++t.position)):i="!",e=t.position,n){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(s=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):Ye(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Hn(o);)o===33&&(r?Ye(t,"tag suffix cannot contain exclamation marks"):(i=t.input.slice(e-1,t.position+1),C_.test(i)||Ye(t,"named tag handle cannot contain such characters"),r=!0,e=t.position+1)),o=t.input.charCodeAt(++t.position);s=t.input.slice(e,t.position),nX.test(s)&&Ye(t,"tag suffix cannot contain flow indicator characters")}s&&!T_.test(s)&&Ye(t,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{Ye(t,"tag name is malformed: "+s)}return n?t.tag=s:As.call(t.tagMap,i)?t.tag=t.tagMap[i]+s:i==="!"?t.tag="!"+s:i==="!!"?t.tag="tag:yaml.org,2002:"+s:Ye(t,'undeclared tag handle "'+i+'"'),!0}function gX(t){var e,n;if(n=t.input.charCodeAt(t.position),n!==38)return!1;for(t.anchor!==null&&Ye(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;n!==0&&!Hn(n)&&!Jo(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&Ye(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function pX(t){var e,n,r;if(r=t.input.charCodeAt(t.position),r!==42)return!1;for(r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!Hn(r)&&!Jo(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&Ye(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),As.call(t.anchorMap,n)||Ye(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],tn(t,!0,-1),!0}function ya(t,e,n,r,i){var s,o,a,l=1,c=!1,u=!1,h,d,m,g,p,O;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s=o=a=bh===n||Q_===n,r&&tn(t,!0,-1)&&(c=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;mX(t)||gX(t);)tn(t,!0,-1)?(c=!0,a=s,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):a=!1;if(a&&(a=c||i),(l===1||bh===n)&&(vh===n||P_===n?p=e:p=e+1,O=t.position-t.lineStart,l===1?a&&(Ly(t,O)||fX(t,O,p))||hX(t,p)?u=!0:(o&&dX(t,p)||cX(t,p)||uX(t,p)?u=!0:pX(t)?(u=!0,(t.tag!==null||t.anchor!==null)&&Ye(t,"alias node should not have any properties")):lX(t,p,vh===n)&&(u=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):l===0&&(u=a&&Ly(t,O))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&Ye(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),h=0,d=t.implicitTypes.length;h<d;h+=1)if(g=t.implicitTypes[h],g.resolve(t.result)){t.result=g.construct(t.result),t.tag=g.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(As.call(t.typeMap[t.kind||"fallback"],t.tag))g=t.typeMap[t.kind||"fallback"][t.tag];else for(g=null,m=t.typeMap.multi[t.kind||"fallback"],h=0,d=m.length;h<d;h+=1)if(t.tag.slice(0,m[h].tag.length)===m[h].tag){g=m[h];break}g||Ye(t,"unknown tag !<"+t.tag+">"),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<t.length-1)Ye(t,"end of the stream or a document separator is expected");else return}function R_(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
|
||
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var n=new aX(t,e),r=t.indexOf("\0");for(r!==-1&&(n.position=r,Ye(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)OX(n);return n.documents}function vX(t,e,n){e!==null&&typeof e=="object"&&typeof n>"u"&&(n=e,e=null);var r=R_(t,n);if(typeof e!="function")return r;for(var i=0,s=r.length;i<s;i+=1)e(r[i])}function bX(t,e){var n=R_(t,e);if(n.length!==0){if(n.length===1)return n[0];throw new Fn("expected a single document in the stream, but found more")}}var yX=vX,xX=bX,L_={loadAll:yX,load:xX},I_=Object.prototype.toString,X_=Object.prototype.hasOwnProperty,CO=65279,SX=9,Yl=10,wX=13,kX=32,_X=33,PX=34,Yg=35,QX=37,CX=38,TX=39,AX=42,Z_=44,EX=45,xh=58,DX=61,MX=62,RX=63,LX=64,N_=91,V_=93,IX=96,F_=123,XX=124,j_=125,In={};In[0]="\\0";In[7]="\\a";In[8]="\\b";In[9]="\\t";In[10]="\\n";In[11]="\\v";In[12]="\\f";In[13]="\\r";In[27]="\\e";In[34]='\\"';In[92]="\\\\";In[133]="\\N";In[160]="\\_";In[8232]="\\L";In[8233]="\\P";var ZX=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],NX=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function VX(t,e){var n,r,i,s,o,a,l;if(e===null)return{};for(n={},r=Object.keys(e),i=0,s=r.length;i<s;i+=1)o=r[i],a=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=t.compiledTypeMap.fallback[o],l&&X_.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function FX(t){var e,n,r;if(e=t.toString(16).toUpperCase(),t<=255)n="x",r=2;else if(t<=65535)n="u",r=4;else if(t<=4294967295)n="U",r=8;else throw new Fn("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+an.repeat("0",r-e.length)+e}var jX=1,Ul=2;function BX(t){this.schema=t.schema||_O,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=an.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=VX(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Ul:jX,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Iy(t,e){for(var n=an.repeat(" ",e),r=0,i=-1,s="",o,a=t.length;r<a;)i=t.indexOf(`
|
||
`,r),i===-1?(o=t.slice(r),r=a):(o=t.slice(r,i+1),r=i+1),o.length&&o!==`
|
||
`&&(s+=n),s+=o;return s}function Ug(t,e){return`
|
||
`+an.repeat(" ",t.indent*e)}function zX(t,e){var n,r,i;for(n=0,r=t.implicitTypes.length;n<r;n+=1)if(i=t.implicitTypes[n],i.resolve(e))return!0;return!1}function Sh(t){return t===kX||t===SX}function ql(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==CO||65536<=t&&t<=1114111}function Xy(t){return ql(t)&&t!==CO&&t!==wX&&t!==Yl}function Zy(t,e,n){var r=Xy(t),i=r&&!Sh(t);return(n?r:r&&t!==Z_&&t!==N_&&t!==V_&&t!==F_&&t!==j_)&&t!==Yg&&!(e===xh&&!i)||Xy(e)&&!Sh(e)&&t===Yg||e===xh&&i}function WX(t){return ql(t)&&t!==CO&&!Sh(t)&&t!==EX&&t!==RX&&t!==xh&&t!==Z_&&t!==N_&&t!==V_&&t!==F_&&t!==j_&&t!==Yg&&t!==CX&&t!==AX&&t!==_X&&t!==XX&&t!==DX&&t!==MX&&t!==TX&&t!==PX&&t!==QX&&t!==LX&&t!==IX}function YX(t){return!Sh(t)&&t!==xh}function pl(t,e){var n=t.charCodeAt(e),r;return n>=55296&&n<=56319&&e+1<t.length&&(r=t.charCodeAt(e+1),r>=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<t.length;c>=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<t.length;c>=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<t.length;n>=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<o;s+=1)a=n[s],t.replacer&&(a=t.replacer.call(n,String(s),a)),(Ui(t,e,a,!1,!1)||typeof a>"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<a;o+=1)l=n[o],t.replacer&&(l=t.replacer.call(n,String(o),l)),(Ui(t,e+1,l,!0,!0,!1,!0)||typeof l>"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;o<a;o+=1)u="",r!==""&&(u+=", "),t.condenseFlow&&(u+='"'),l=s[o],c=n[l],t.replacer&&(c=t.replacer.call(n,l,c)),Ui(t,e,l,!1,!1)&&(t.dump.length>1024&&(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;a<l;a+=1)d="",(!r||i!=="")&&(d+=Ug(t,e)),c=o[a],u=n[c],t.replacer&&(u=t.replacer.call(n,c,u)),Ui(t,e+1,c,!0,!0,!0)&&(h=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,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<o;s+=1)if(a=i[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(n?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){if(l=t.styleMap[a.tag]||a.defaultStyle,I_.call(a.represent)==="[object Function]")r=a.represent(e,l);else if(X_.call(a.represent,l))r=a.represent[l](e,l);else throw new Fn("!<"+a.tag+'> 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<s;i+=1)e.duplicates.push(n[r[i]]);e.usedDuplicates=new Array(s)}function $g(t,e,n){var r,i,s;if(t!==null&&typeof t=="object")if(i=e.indexOf(t),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(e.push(t),Array.isArray(t))for(i=0,s=t.length;i<s;i+=1)$g(t[i],e,n);else for(r=Object.keys(t),i=0,s=r.length;i<s;i+=1)$g(t[r[i]],e,n)}function t4(t,e){e=e||{};var n=new BX(e);n.noRefs||e4(t,n);var r=t;return n.replacer&&(r=n.replacer.call({"":r},"",r)),Ui(n,0,r,!0,!0)?n.dump+`
|
||
`:""}var n4=t4,r4={dump:n4};function TO(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var i4=wn,s4=a_,o4=h_,a4=p_,l4=O_,c4=_O,u4=L_.load,h4=L_.loadAll,d4=r4.dump,f4=Fn,m4={binary:S_,float:g_,map:u_,null:d_,pairs:k_,set:__,timestamp:y_,bool:f_,int:m_,merge:x_,omap:w_,seq:c_,str:l_},g4=TO("safeLoad","load"),p4=TO("safeLoadAll","loadAll"),O4=TO("safeDump","dump"),Gg={Type:i4,Schema:s4,FAILSAFE_SCHEMA:o4,JSON_SCHEMA:a4,CORE_SCHEMA:l4,DEFAULT_SCHEMA:c4,load:u4,loadAll:h4,dump:d4,YAMLException:f4,types:m4,safeLoad:g4,safeLoadAll:p4,safeDump:O4},v4=P('<span class="text-red-500">*</span>'),b4=P('<label class="text-sm font-semibold text-foreground"> <!></label>'),y4=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),x4=P("<div><!> <!></div>"),S4=P('<div class="flex items-start gap-1.5 text-xs text-red-400"><!> <span> </span></div>'),w4=P("<div></div> <!>",1),k4=P('<textarea style="resize: vertical;"></textarea>'),_4=P('<p class="text-xs font-medium text-destructive" data-field-error=""> </p>'),P4=P('<div class="space-y-2"><!> <!> <!></div>');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;s<i.length;s++)n[i[s]]=!0}let r=zy(e)+zy(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function A4(t){let e=t.map(i=>typeof 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;h<u;h++)c+=e.facet(Qc);i.push(n+c.length-u),l=c+l.slice(u)}r.push(l),n+=l.length+1}let a=this.fieldPositions.map(l=>new 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<n.length;h++)(a!=null?n[h].seq==a:u&&n[h].name==u)&&(c=h);if(c<0){let h=0;for(;h<n.length&&(a==null||n[h].seq!=null&&n[h].seq<a);)h++;n.splice(h,0,{seq:a,name:u}),c=h;for(let d of i)d.field>=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<Uf.length;e+=2)if(Uf.charCodeAt(e)==t)return Uf.charAt(e+1);return kS(t<128?t:t+1)}function H_(t,e){return t.languageDataAt("closeBrackets",e)[0]||Gl}const Y4=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),U4=Ae.inputHandler.of((t,e,n,r)=>{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;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(e){let n=0;for(let r=0;n<this.text.length&&r<e;n++)r+=this.text.charCodeAt(n)==9?4-r%4:1;return n}scrub(){if(!this.baseIndent)return this.text;let e="";for(let n=0;n<this.basePos;n++)e+=" ";return e+this.text.slice(this.basePos)}}function qy(t,e,n){if(n.pos==n.text.length||t!=e.block&&n.indent>=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<n.baseIndent+t.value&&n.next>-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(;e<t.length&&Mr(t.charCodeAt(e));)e++;return e}function $y(t,e,n){for(;e>n&&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<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let n=e;n<t.text.length;n++)if(t.text.charCodeAt(n)==96)return-1}return e}function n2(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function RO(t,e,n){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let r=1;for(let i=t.pos+1;i<t.text.length;i++){let s=t.text.charCodeAt(i);if(s==t.next)r++;else if(!Mr(s))return-1}return n&&t.next==45&&s2(t)>-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)<t.text.length)?1:-1}function IO(t,e,n){let r=t.pos,i=t.next;for(;i>=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||r<t.text.length-1&&!Mr(t.text.charCodeAt(r+1))||n&&!r2(e,Ee.OrderedList)&&(t.skipSpace(r+1)==t.text.length||r>t.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(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let n=e-t.pos;return n>6?-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<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let n=e;for(;e<t.text.length&&Mr(t.text.charCodeAt(e));)e++;return e==t.text.length?n:-1}const Hg=/^[ \t]*$/,o2=/-->/,a2=/\?>/,Kg=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,o2],[/^\s*<\?/,a2],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,Hg],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Hg]];function l2(t,e,n){if(t.next!=60)return-1;let r=t.text.slice(t.pos);for(let i=0,s=Kg.length-(n?1:0);i<s;i++)if(Kg[i][0].test(r))return i;return-1}function Gy(t,e){let n=t.countIndent(e,t.pos,t.indent),r=t.countIndent(t.skipSpace(e),e,n);return r>=n+5?n+1:r}function is(t,e,n){let r=t.length-1;r>=0&&t[r].to==e&&t[r].type==Ee.CodeText?t[r].to=n:t.push(vt(Ee.CodeText,e,n))}const mu={LinkReference:void 0,IndentedCode(t,e){let n=e.baseIndent+4;if(e.indent<n)return!1;let r=e.findColumn(n),i=t.lineStart+r,s=t.lineStart+e.text.length,o=[],a=[];for(is(o,i,s);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){is(a,t.lineStart-1,t.lineStart);for(let l of e.markers)a.push(l)}else{if(e.indent<n)break;{if(a.length){for(let c of a)c.type==Ee.CodeText?is(o,c.from,c.to):o.push(c);a=[]}is(o,t.lineStart-1,t.lineStart);for(let c of e.markers)o.push(c);s=t.lineStart+e.text.length;let l=t.lineStart+e.findColumn(e.baseIndent+4);l<s&&is(o,l,s)}}return a.length&&(a=a.filter(l=>l.type!=Ee.CodeText),a.length&&(e.markers=a.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-i).finish(Ee.CodeBlock,s-i),i),!0},FencedCode(t,e){let n=t2(e);if(n<0)return!1;let r=t.lineStart+e.pos,i=e.next,s=n-e.pos,o=e.skipSpace(n),a=$y(e.text,e.text.length,o),l=[vt(Ee.CodeMark,r,r+s)];o<a&&l.push(vt(Ee.CodeInfo,t.lineStart+o,t.lineStart+a));for(let c=!0,u=!0,h=!1;t.nextLine()&&e.depth>=t.stack.length;c=!1){let d=e.pos;if(e.indent-e.baseIndent<4)for(;d<e.text.length&&e.text.charCodeAt(d)==i;)d++;if(d-e.pos>=s&&e.skipSpace(d)==e.text.length){for(let m of e.markers)l.push(m);u&&h&&is(l,t.lineStart-1,t.lineStart),l.push(vt(Ee.CodeMark,t.lineStart+e.pos,t.lineStart+d)),t.nextLine();break}else{h=!0,c||(is(l,t.lineStart-1,t.lineStart),u=!1);for(let p of e.markers)l.push(p);let m=t.lineStart+e.basePos,g=t.lineStart+e.text.length;m<g&&(is(l,m,g),u=!1)}}return t.addNode(t.buffer.writeElements(l,-r).finish(Ee.FencedCode,t.prevLineEnd()-r),r),!0},Blockquote(t,e){let n=n2(e);return n<0?!1:(t.startContext(Ee.Blockquote,e.pos),t.addNode(Ee.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+n),null)},HorizontalRule(t,e){if(RO(e,t,!1)<0)return!1;let n=t.lineStart+e.pos;return t.nextLine(),t.addNode(Ee.HorizontalRule,n),!0},BulletList(t,e){let n=LO(e,t,!1);if(n<0)return!1;t.block.type!=Ee.BulletList&&t.startContext(Ee.BulletList,e.basePos,e.next);let r=Gy(e,e.pos+1);return t.startContext(Ee.ListItem,e.basePos,r-e.baseIndent),t.addNode(Ee.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},OrderedList(t,e){let n=IO(e,t,!1);if(n<0)return!1;t.block.type!=Ee.OrderedList&&t.startContext(Ee.OrderedList,e.basePos,e.text.charCodeAt(e.pos+n-1));let r=Gy(e,e.pos+n);return t.startContext(Ee.ListItem,e.basePos,r-e.baseIndent),t.addNode(Ee.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},ATXHeading(t,e){let n=i2(e);if(n<0)return!1;let r=e.pos,i=t.lineStart+r,s=$y(e.text,e.text.length,r),o=s;for(;o>r&&e.text.charCodeAt(o-1)==e.next;)o--;(o==s||o==r||!Mr(e.text.charCodeAt(o-1)))&&(o=e.text.length);let a=t.buffer.write(Ee.HeaderMark,0,n).writeElements(t.parser.parseInline(e.text.slice(r+n+1,o),i+n+1),-i);o<e.text.length&&a.write(Ee.HeaderMark,o-r,s-r);let l=a.finish(Ee.ATXHeading1-1+n,e.text.length-r);return t.nextLine(),t.addNode(l,i),!0},HTMLBlock(t,e){let n=l2(e,t,!1);if(n<0)return!1;let r=t.lineStart+e.pos,i=Kg[n][1],s=[],o=i!=Hg;for(;!i.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let c of e.markers)s.push(c)}o&&t.nextLine();let a=i==o2?Ee.CommentBlock:i==a2?Ee.ProcessingInstructionBlock:Ee.HTMLBlock,l=t.prevLineEnd();return t.addNode(t.buffer.writeElements(s,-r).finish(a,l-r),r),!0},SetextHeading:void 0};class rZ{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,n,r){if(this.stage==-1)return!1;let i=r.content+`
|
||
`+n.scrub(),s=this.advance(i);return s>-1&&s<i.length?this.complete(e,r,s):!1}finish(e,n){return(this.stage==2||this.stage==3)&&Ql(n.content,this.pos)==n.content.length?this.complete(e,n,n.content.length):!1}complete(e,n,r){return e.addLeafElement(n,vt(Ee.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(v2(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(vt(Ee.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(p2(e,Ql(e,this.pos),this.start)))return-1}else if(this.stage==2){let n=Ql(e,this.pos),r=0;if(n>this.pos){let i=O2(e,n,this.start);if(i){let s=qf(e,i.to-this.start);s>0&&(this.nextStage(i),r=s)}}return r||(r=qf(e,this.pos)),r>0&&r<e.length?r:-1}else return qf(e,this.pos)}}}function qf(t,e){for(;e<t.length;e++){let n=t.charCodeAt(e);if(n==10)break;if(!Mr(n))return-1}return e}class iZ{nextLine(e,n,r){let i=n.depth<e.stack.length?-1:s2(n),s=n.next;if(i<0)return!1;let o=vt(Ee.HeaderMark,e.lineStart+n.pos,e.lineStart+i);return e.nextLine(),e.addLeafElement(r,vt(s==61?Ee.SetextHeading1:Ee.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),o])),!0}finish(){return!1}}const c2={LinkReference(t,e){return e.content.charCodeAt(0)==91?new rZ(e):null},SetextHeading(){return new iZ}},sZ=[(t,e)=>i2(e)>=0,(t,e)=>t2(e)>=0,(t,e)=>n2(e)>=0,(t,e)=>LO(e,t,!0)>=0,(t,e)=>IO(e,t,!0)>=0,(t,e)=>RO(e,t,!0)>=0,(t,e)=>l2(e,t,!0)>=0],oZ={text:"",end:0};class aZ{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.line=new nZ,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=wh.create(Ee.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new uZ(r,n):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let i=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!i||e.markers[r].from<i.end);){let s=e.markers[r++];this.addNode(s.type,s.from,s.to)}if(!i)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let i=r(this,e);if(i!=!1){if(i==!0)return null;e.forward();continue e}}break}let n=new tZ(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let i=r(this,n);i&&n.parsers.push(i)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,n))break e}for(let r of n.parsers)if(r.nextLine(this,e,n))return null;n.content+=`
|
||
`+e.scrub();for(let r of e.markers)n.marks.push(r)}return this.finishLeaf(n),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let n=this.fragments.takeNodes(this);return n?(this.absoluteLineStart+=n,this.lineStart=b2(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let n=oZ;if(n.end=e,e>=this.to)n.text="";else if(n.text=this.lineChunkAt(e),n.end+=n.text.length,this.ranges.length>1){let r=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<n.end;){i++;let s=this.ranges[i].from,o=this.lineChunkAt(s);n.end=s+o.length,n.text=n.text.slice(0,this.ranges[i-1].to-r)+o,r=n.end-n.text.length}}return n}readLine(){let{line:e}=this,{text:n,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(n);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],s=this.parser.skipContextMarkup[i.type];if(!s)throw new Error("Unhandled block context "+Ee[i.type]);let o=this.line.markers.length;if(!s(i,this,e)){this.line.markers.length>o&&(i.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let n=this.input.chunk(e),r;if(this.input.lineChunks)r=n==`
|
||
`?"":n;else{let i=n.indexOf(`
|
||
`);r=i<0?n:n.slice(0,i)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,n,r=0){this.block=wh.create(e,r,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,n,r=0){this.startContext(this.parser.getNodeType(e),n,r)}addNode(e,n,r){typeof e=="number"&&(e=new mt(this.parser.nodeSet.types[e],xa,xa,(r??this.prevLineEnd())-n)),this.block.addChild(e,n-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,n){this.addNode(this.buffer.writeElements(ep(n.children,e.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let e=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(e.toTree(this.parser.nodeSet),e.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?u2(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let n=ep(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(n,-e.start).finish(Ee.Paragraph,e.content.length),e.start)}elt(e,n,r,i){return typeof e=="string"?vt(this.parser.getNodeType(e),n,r,i):new f2(e,n)}get buffer(){return new d2(this.parser.nodeSet)}}function u2(t,e,n,r,i){let s=t[e].to,o=[],a=[],l=n.from+r;function c(u,h){for(;h?u>=s:u>s;){let d=t[e+1].from-s;r+=d,u+=d,e++,s=t[e].to}}for(let u=n.firstChild;u;u=u.nextSibling){c(u.from+r,!0);let h=u.from+r,d,m=i.get(u.tree);m?d=m:u.to+r>s?(d=u2(t,e,u,r,i),c(u.to+r,!1)):d=u.toTree(),o.push(d),a.push(h-l)}return c(n.to+r,!1),new mt(n.type,o,a,n.to+r-l,n.tree?n.tree.propValues:void 0)}class Md extends gd{constructor(e,n,r,i,s,o,a,l,c){super(),this.nodeSet=e,this.blockParsers=n,this.leafBlockParsers=r,this.blockNames=i,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=l,this.wrappers=c,this.nodeTypes=Object.create(null);for(let u of e.types)this.nodeTypes[u.name]=u.id}createParse(e,n,r){let i=new aZ(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}configure(e){let n=Jg(e);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),l=this.inlineParsers.slice(),c=this.inlineNames.slice(),u=this.endLeafBlock.slice(),h=this.wrappers;if(sl(n.defineNodes)){i=Object.assign({},i);let d=r.types.slice(),m;for(let g of n.defineNodes){let{name:p,block:O,composite:v,style:w}=typeof g=="string"?{name:g}:g;if(d.some(T=>T.name==p))continue;v&&(i[d.length]=(T,S,Q)=>v(S,Q,T.value));let _=d.length,C=v?["Block","BlockContext"]:O?_>=Ee.ATXHeading1&&_<=Ee.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;d.push(rn.define({id:_,name:p,props:C&&[[et.group,C]]})),w&&(m||(m={}),Array.isArray(w)||w instanceof ci?m[p]=w:Object.assign(m,w))}r=new La(d),m&&(r=r.extend(js(m)))}if(sl(n.props)&&(r=r.extend(...n.props)),sl(n.remove))for(let d of n.remove){let m=this.blockNames.indexOf(d),g=this.inlineNames.indexOf(d);m>-1&&(s[m]=o[m]=void 0),g>-1&&(l[g]=void 0)}if(sl(n.parseBlock))for(let d of n.parseBlock){let m=a.indexOf(d.name);if(m>-1)s[m]=d.parse,o[m]=d.leaf;else{let g=d.before?gu(a,d.before):d.after?gu(a,d.after)+1:a.length-1;s.splice(g,0,d.parse),o.splice(g,0,d.leaf),a.splice(g,0,d.name)}d.endLeaf&&u.push(d.endLeaf)}if(sl(n.parseInline))for(let d of n.parseInline){let m=c.indexOf(d.name);if(m>-1)l[m]=d.parse;else{let g=d.before?gu(c,d.before):d.after?gu(c,d.after)+1:c.length-1;l.splice(g,0,d.parse),c.splice(g,0,d.name)}}return n.wrap&&(h=h.concat(n.wrap)),new Md(r,s,o,a,u,i,l,c,h)}getNodeType(e){let n=this.nodeTypes[e];if(n==null)throw new RangeError(`Unknown node type '${e}'`);return n}parseInline(e,n){let r=new XO(this,e,n);e:for(let i=n;i<r.end;){let s=r.char(i);for(let o of this.inlineParsers)if(o){let a=o(r,s,i);if(a>=0){i=a;continue e}}i++}return r.resolveMarkers(0)}}function sl(t){return t!=null&&t.length>0}function Jg(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=Jg(t[0]);if(t.length==1)return e;let n=Jg(t.slice(1));if(!n||!e)return e||n;let r=(o,a)=>(o||xa).concat(a||xa),i=e.wrap,s=n.wrap;return{props:r(e.props,n.props),defineNodes:r(e.defineNodes,n.defineNodes),parseBlock:r(e.parseBlock,n.parseBlock),parseInline:r(e.parseInline,n.parseInline),remove:r(e.remove,n.remove),wrap:i?s?(o,a,l,c)=>i(s(o,a,l,c),a,l,c):i:s}}function gu(t,e){let n=t.indexOf(e);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return n}let h2=[rn.none];for(let t=1,e;e=Ee[t];t++)h2[t]=rn.define({id:t,name:e,props:t>=Ee.Escape?[]:[[et.group,t in e2?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const xa=[];class d2{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,n,r,i=0){return this.content.push(e,n,r,4+i*4),this}writeElements(e,n=0){for(let r of e)r.writeTo(this,n);return this}finish(e,n){return mt.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:n})}}let Hl=class{constructor(e,n,r,i=xa){this.type=e,this.from=n,this.to=r,this.children=i}writeTo(e,n){let r=e.content.length;e.writeElements(this.children,n),e.content.push(this.type,this.from+n,this.to+n,e.content.length+4-r)}toTree(e){return new d2(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class f2{constructor(e,n){this.tree=e,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return xa}writeTo(e,n){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function vt(t,e,n,r){return new Hl(t,e,n,r)}const m2={resolve:"Emphasis",mark:"EmphasisMark"},g2={resolve:"Emphasis",mark:"EmphasisMark"},to={},kh={};class dr{constructor(e,n,r,i){this.type=e,this.from=n,this.to=r,this.side=i}}const Hy="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Kl=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Kl=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const $f={Escape(t,e,n){if(e!=92||n==t.end-1)return-1;let r=t.char(n+1);for(let i=0;i<Hy.length;i++)if(Hy.charCodeAt(i)==r)return t.append(vt(Ee.Escape,n,n+2));return-1},Entity(t,e,n){if(e!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(n+1,n+31));return r?t.append(vt(Ee.Entity,n,n+1+r[0].length)):-1},InlineCode(t,e,n){if(e!=96||n&&t.char(n-1)==96)return-1;let r=n+1;for(;r<t.end&&t.char(r)==96;)r++;let i=r-n,s=0;for(;r<t.end;r++)if(t.char(r)==96){if(s++,s==i&&t.char(r+1)!=96)return t.append(vt(Ee.InlineCode,n,r+1,[vt(Ee.CodeMark,n,n+i),vt(Ee.CodeMark,r+1-i,r+1)]))}else s=0;return-1},HTMLTag(t,e,n){if(e!=60||n==t.end-1)return-1;let r=t.slice(n+1,t.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return t.append(vt(Ee.Autolink,n,n+1+i[0].length,[vt(Ee.LinkMark,n,n+1),vt(Ee.URL,n+1,n+i[0].length),vt(Ee.LinkMark,n+i[0].length,n+1+i[0].length)]));let 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;a<r;a++){let l=t.parts[a];l instanceof dr&&l.type==to&&(l.side=0)}return o.to}}return-1}};function lZ(t,e,n,r,i){let{text:s}=t,o=t.char(i),a=i;if(e.unshift(vt(Ee.LinkMark,r,r+(n==Ee.Image?2:1))),e.push(vt(Ee.LinkMark,i-1,i)),o==40){let l=t.skipSpace(i+1),c=p2(s,l-t.offset,t.offset),u;c&&(l=t.skipSpace(c.to),l!=c.to&&(u=O2(s,l-t.offset,t.offset),u&&(l=t.skipSpace(u.to)))),t.char(l)==41&&(e.push(vt(Ee.LinkMark,i,i+1)),a=l+1,c&&e.push(c),u&&e.push(u),e.push(vt(Ee.LinkMark,l,a)))}else if(o==91){let l=v2(s,i-t.offset,t.offset,!1);l&&(e.push(l),a=l.to)}return vt(n,r,a,e)}function p2(t,e,n){if(t.charCodeAt(e)==60){for(let i=e+1;i<t.length;i++){let s=t.charCodeAt(i);if(s==62)return vt(Ee.URL,e+n,i+1+n);if(s==60||s==10)return!1}return null}else{let i=0,s=e;for(let o=!1;s<t.length;s++){let a=t.charCodeAt(s);if(Mr(a))break;if(o)o=!1;else if(a==40)i++;else if(a==41){if(!i)break;i--}else a==92&&(o=!0)}return s>e?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<t.length;s++){let a=t.charCodeAt(s);if(o)o=!1;else{if(a==i)return vt(Ee.LinkTitle,e+n,s+1+n);a==92&&(o=!0)}}return null}function v2(t,e,n,r){for(let i=!1,s=e+1,o=Math.min(t.length,s+999);s<o;s++){let a=t.charCodeAt(s);if(i)i=!1;else{if(a==93)return r?!1:vt(Ee.LinkLabel,e+n,s+1+n);if(r&&!Mr(a)&&(r=!1),a==91)return!1;a==92&&(i=!0)}}return null}class XO{constructor(e,n,r){this.parser=e,this.text=n,this.offset=r,this.parts=[]}char(e){return e>=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<this.parts.length;r++){let i=this.parts[r];if(!(i instanceof dr&&i.type.resolve&&i.side&2))continue;let s=i.type==m2||i.type==g2,o=i.to-i.from,a,l=r-1;for(;l>=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<r;p++)this.parts[p]instanceof Hl&&u.push(this.parts[p]),this.parts[p]=null;i.type.mark&&u.push(this.elt(i.type.mark,i.from,d));let m=this.elt(c,h,d,u);this.parts[l]=s&&a.from!=h?new dr(a.type,a.from,h,a.side):null,(this.parts[r]=s&&i.to!=d?new dr(i.type,d,i.to,i.side):null)?this.parts.splice(r,0,m):this.parts[r]=m}let n=[];for(let r=e;r<this.parts.length;r++){let i=this.parts[r];i instanceof Hl&&n.push(i)}return n}findOpeningDelimiter(e){for(let n=this.parts.length-1;n>=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<n.length&&n[r].to<i.to;)r++;if(r<n.length&&n[r].from<i.from){let s=n[r];s instanceof Hl&&(n[r]=new Hl(s.type,s.from,s.to,ep(s.children,[i])))}else n.splice(r++,0,i)}return n}const cZ=[Ee.CodeBlock,Ee.ListItem,Ee.OrderedList,Ee.BulletList];class uZ{constructor(e,n){this.fragments=e,this.input=n,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,n){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(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;r<e.length;r++){let i=e[r-1].to,s=e[r].from;i<t&&(n-=s-i)}return n}const hZ=js({"Blockquote/...":E.quote,HorizontalRule:E.contentSeparator,"ATXHeading1/... SetextHeading1/...":E.heading1,"ATXHeading2/... SetextHeading2/...":E.heading2,"ATXHeading3/...":E.heading3,"ATXHeading4/...":E.heading4,"ATXHeading5/...":E.heading5,"ATXHeading6/...":E.heading6,"Comment CommentBlock":E.comment,Escape:E.escape,Entity:E.character,"Emphasis/...":E.emphasis,"StrongEmphasis/...":E.strong,"Link/... Image/...":E.link,"OrderedList/... BulletList/...":E.list,"BlockQuote/...":E.quote,"InlineCode CodeText":E.monospace,"URL Autolink":E.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":E.processingInstruction,"CodeInfo LinkLabel":E.labelName,LinkTitle:E.string,Paragraph:E.content}),dZ=new Md(new La(h2).extend(hZ),Object.keys(mu).map(t=>mu[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<e.length;h++){let d=e.charCodeAt(h);d==124&&!c?((!o||a>-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;n<t.length;n++){let r=t.charCodeAt(n);if(r==124)return!0;r==92&&n++}return!1}const y2=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Jy{constructor(){this.rows=null}nextLine(e,n,r){if(this.rows==null){this.rows=!1;let i;if((n.next==45||n.next==58||n.next==124)&&y2.test(i=n.text.slice(n.pos))){let s=[];Cl(e,r.content,0,s,r.start)==Cl(e,i,n.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,s),e.elt("TableDelimiter",e.lineStart+n.pos,e.lineStart+n.text.length)])}}else if(this.rows){let i=[];Cl(e,n.text,n.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+n.pos,e.lineStart+n.text.length,i))}return!1}finish(e,n){return this.rows?(e.addLeafElement(n,e.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const OZ={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":E.heading}},"TableRow",{name:"TableCell",style:E.content},{name:"TableDelimiter",style:E.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return Ky(e.content,0)?new Jy:null},endLeaf(t,e,n){if(n.parsers.some(i=>i 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<n;s++)t[s]==r&&i++;return i}function xZ(t,e){t1.lastIndex=e;let n=t1.exec(t);if(!n||yZ.exec(n[0])[0].indexOf("_")>-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<r.end;a++){let l=r.char(a);if(l==t)return r.addElement(r.elt(e,s,a+1,o.concat(r.elt(n,a,a+1))));if(l==92&&o.push(r.elt("Escape",a,a+++2)),Mr(l))break}return-1}}const kZ={defineNodes:[{name:"Superscript",style:E.special(E.content)},{name:"SuperscriptMark",style:E.processingInstruction}],parseInline:[{name:"Superscript",parse:x2(94,"Superscript","SuperscriptMark")}]},_Z={defineNodes:[{name:"Subscript",style:E.special(E.content)},{name:"SubscriptMark",style:E.processingInstruction}],parseInline:[{name:"Subscript",parse:x2(126,"Subscript","SubscriptMark")}]},PZ={defineNodes:[{name:"Emoji",style:E.character}],parseInline:[{name:"Emoji",parse(t,e,n){let r;return e!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(t.slice(n+1,t.end)))?-1:t.addElement(t.elt("Emoji",n,n+1+r[0].length))}}]},QZ=55,CZ=1,TZ=56,AZ=2,EZ=57,DZ=3,o1=4,MZ=5,ZO=6,S2=7,w2=8,k2=9,_2=10,RZ=11,LZ=12,IZ=13,Gf=58,XZ=14,ZZ=15,a1=59,P2=21,NZ=23,Q2=24,VZ=25,tp=27,C2=28,FZ=29,jZ=32,BZ=35,zZ=37,WZ=38,YZ=0,UZ=1,qZ={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},$Z={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},l1={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function GZ(t){return t==45||t==46||t==58||t>=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&&s<r&&i.next==t.charCodeAt(s-2))s++,o++;else if(s==r&&i.next==_h){a>o?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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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:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^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!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!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[oN,aN,lN,sN,nN,rN,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function A2(t,e){let n=Object.create(null);for(let r of t.getChildren(Q2)){let i=r.getChild(VZ),s=r.getChild(tp)||r.getChild(C2);i&&(n[e.read(i.from,i.to)]=s?s.type.id==tp?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return n}function f1(t,e){let n=t.getChild(NZ);return n?e.read(n.from,n.to):" "}function Hf(t,e,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||(r=A2(t.node.parent.firstChild,e))))return{parser:i.parser,bracketed:!0};return null}function E2(t=[],e=[]){let n=[],r=[],i=[],s=[];for(let a of t)(a.tag=="script"?n:a.tag=="style"?r:a.tag=="textarea"?i:s).push(a);let o=e.length?Object.create(null):null;for(let a of e)(o[a.name]||(o[a.name]=[])).push(a);return lO((a,l)=>{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'#C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%e$OQ&S$tQ&y&OQ&|&TR'h&xSnP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:159,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[EN],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>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;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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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-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < 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:_tuE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:{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:`</${d}>`}}}}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:"</"+o+">",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.from<l.to)break;s=i=a,o=l.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?k1(n,i,i.from,r):w1(n,t,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?w1(n,t,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?k1(n,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?MV(n,t,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?RV(n,t,i,i.name=="Is"?r:i.from,r):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?DV(n,t,i,r):null}function nP(t){return tP(tc.default,t)}function rP(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new tc(e,n):tc.default;return i=>tP(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].length<t.node.to)return t.continue();let e=null,n;for(let r=t.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),Zo.add({Element(t){let e=t.firstChild,n=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:n.name=="CloseTag"?n.from:t.to}}}),yk.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},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=`</${p}>`;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:"<!--",close:"-->"}}}),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.from<e);r=r.parent){let i=r.type.prop(uP);if(i==null)continue;let s=ZV(r,i);if(s>n)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.length<e;)r+=" ";return r}else{for(let i=this.to-this.from-r.length-this.spaceAfter.length;i>0;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.to<l||c.from>0&&!/[^\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<c.from,p="";if(!g||/^[\s\d.)\-+*>]*/.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(v<w?Pi(c.text,4,u[v+1].from)-p.length:null);let O=l;for(;O>c.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)<s.number}function Q1(t,e,n){let r="";for(let i=0,s=t.length-2;i<=s;i++)r+=t[i].blank(i<s?Pi(n.text,4,t[i+1].from)-r.length:null,i<s);return $O(r,e)}function BV(t,e){let n=t.resolveInner(e,-1),r=e;P1(n)&&(r=n.from,n=n.parent);for(let i;i=n.childBefore(r);)if(P1(i))r=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")n=i.lastChild,r=n.to;else break;return n}const OP=({state:t,dispatch:e})=>{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<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let m=u.blank(Pi(l.text,4,u.to)-Pi(l.text,4,u.from));return d==l.from&&(m=$O(m,t)),{range:Oe.cursor(d+m.length),changes:{from:d,to:l.from+u.to,insert:m}}}if(d<o)return{range:Oe.cursor(d),changes:{from:d,to:o}}}}}return r={range:s}});return r?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},vP=[{key:"Enter",run:pP},{key:"Backspace",run:OP}],bP=aP({matchClosingTags:!1});function yP(t={}){let{codeLanguages:e,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=dP,completeHTMLTags:s=!0,pasteURLAsLink:o=!0,htmlTagLanguage:a=bP}=t;if(!(i instanceof Md))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=t.extensions?[t.extensions]:[],c=[a.support,NV],u;o&&c.push(xP),n instanceof Yi?(c.push(n.support),u=n.language):n&&(u=n);let h=e||u?FV(e,u):void 0;l.push(mZ({codeParser:h,htmlParser:a.language.parser})),r&&c.push(Lo.high(Io.of(vP)));let d=qO(i.configure(l));return s&&c.push(d.data.of({autocomplete:zV})),new Yi(d,c)}function zV(t){let{state:e,pos:n}=t,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(n-25,n));if(!r)return null;let i=Et(e).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:n-r[0].length,to:n,options:WV(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let am=null;function WV(){if(am)return am;let t=nP(new C4(ot.create({extensions:bP}),0,!0));return am=t?t.options:[]}const YV=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,xP=Ae.domEventHandlers({paste:(t,e)=>{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.to<r.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),UV=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:dP,deleteMarkupBackward:OP,insertNewlineContinueMarkup:pP,insertNewlineContinueMarkupCommand:gP,markdown:yP,markdownKeymap:vP,markdownLanguage:ka,pasteURLAsLink:xP},Symbol.toStringTag,{value:"Module"}));function ke(t){return new Yi(pO.define(t))}function ss(t){return de(()=>import("./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<e.length;n++)t.push(e[n])},qi=Array.from,GO=(t,e)=>{for(let n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0},HO=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},KV=(t,e)=>{const n=new Array(t);for(let r=0;r<t;r++)n[r]=e(r,n);return n},_a=Array.isArray;class KO{constructor(){this._observers=mn()}on(e,n){return qn(this._observers,e,_o).add(n),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()}}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)=>t<e?t:e,zs=(t,e)=>t>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;i<n;i++)r[i]=e.codePointAt(i);return r},rc=typeof TextEncoder<"u"?new TextEncoder:null,a7=t=>rc.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<t.bufs.length;n++)e+=t.bufs[n].length;return e},Pr=t=>{const e=new Uint8Array(c7(t));let n=0;for(let r=0;r<t.bufs.length;r++){const i=t.bufs[r];e.set(i,n),n+=i.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},u7=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(zs(n,e)*2),t.cpos=0)},hn=(t,e)=>{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<h7){const n=rc.encodeInto(e,lp).written||0;Ke(t,n);for(let r=0;r<n;r++)hn(t,lp[r])}else or(t,l7(e))},f7=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;Ke(t,r);for(let i=0;i<r;i++)hn(t,n.codePointAt(i))},mo=rc&&rc.encodeInto?d7:f7,m7=(t,e)=>Rc(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;n<e.length;n++)sc(t,e[n])}else if(e instanceof Uint8Array)hn(t,116),or(t,e);else{hn(t,118);const n=Object.keys(e);Ke(t,n.length);for(let r=0;r<n.length;r++){const i=n[r];mo(t,i),sc(t,e[i])}}break;case"boolean":hn(t,e?120:121);break;default:hn(t,127)}};class M1 extends Mc{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&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.pos<r;){const i=t.arr[t.pos++];if(e=e+(i&fo)*n,n*=128,i<Or)return e;if(e>Qh)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.pos<s;){if(e=t.arr[t.pos++],n=n+(e&fo)*r,r*=128,e<Or)return i*n;if(n>Qh)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<e;r++){const i=go(t);n[i]=oc(t)}return n},t=>{const e=at(t),n=[];for(let r=0;r<e;r++)n.push(oc(t));return n},ar],oc=t=>P7[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(;n<t.length;n++)t[n](...e)}finally{n<t.length&&rv(t,e,n+1)}},EP=t=>t,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;n<t.length;n++)if(t[n]!==e[n])return!1;break}case Set:{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;break}case Map:{if(t.size!==e.size)return!1;for(const n of t.keys())if(!e.has(n)||!zu(t.get(n),e.get(n)))return!1;break}case void 0:case Object:if(Ch(t)!==Ch(e))return!1;for(const n in t)if(!nv(t,n)||!zu(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!zu(t[n],e[n]))return!1;break;default:return!1}return!0},j7=(t,e)=>e.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<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&si.set(e,""),e=r):e!==null&&(si.set(e,r),e=null)}e!==null&&si.set(e,"")}else typeof location=="object"?(si=mn(),(location.search||"?").slice(1).split("&").forEach(t=>{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;s<r;s++)i+=H7(t);return i},mm=(t,e)=>e[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;r<this.patterns.length;r++){const i=this.patterns[r];if(i.if.check(e))return i.h(e,n)}throw Ci("Unhandled pattern")}}}const _9=t=>new 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;i<r;i++)n.push(zo(e,t.shape));return n}).if(LP,(t,e)=>mm(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<r;i++){const s=zo(e,t.shape.keys),o=zo(e,t.shape.values);n[s]=o}return n}).done(),zo=(t,e)=>$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<t.length;n++)GP(e,t[n]);return e},E9=(t,e)=>(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(;r<t.length;r++){const i=t[r];if(i===void 0)break;if(i.constructor===String||i.constructor===Number)e.push(i);else if(i.constructor===Object)break}for(r>0&&n.push(e.join(""));r<t.length;r++){const i=t[r];i instanceof Symbol||n.push(i)}return n},B9={[HP]:ur("font-weight","bold"),[KP]:ur("font-weight","normal"),[X9]:ur("color","blue"),[N9]:ur("color","green"),[Z9]:ur("color","grey"),[JP]:ur("color","red"),[V9]:ur("color","purple"),[cv]:ur("color","orange"),[F9]:ur("color","black")},z9=t=>{t.length===1&&t[0]?.constructor===Function&&(t=t[0]());const e=[],n=[],r=mn();let i=[],s=0;for(;s<t.length;s++){const o=t[s],a=B9[o];if(a!==void 0)r.set(a.left,a.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){const l=D9(r);s>0||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<t.length;s++){const o=t[s];o instanceof Symbol||i.push(o)}return i},eQ=Y7?z9:j9,hp=(...t)=>{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<r.length&&c.clock<a;c=r[++l])gQ(t,s,c.clock,c.len,n)}}),U9=(t,e)=>{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<o+s.len)return i;n=i+1}else r=i-1}return null},No=(t,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<e.length;n++){const i=e[r-1],s=e[n];i.clock+i.len>=s.clock?e[r-1]=new Bd(i.clock,zs(i.len,s.clock+s.len-i.clock)):(r<n&&(e[r]=s),r++)}e.length=r})},Qo=t=>{const e=new Va;for(let n=0;n<t.length;n++)t[n].clients.forEach((r,i)=>{if(!e.clients.has(i)){const s=r.slice();for(let o=n+1;o<t.length;o++)HV(s,t[o].clients.get(i)||[]);e.clients.set(i,s)}});return uv(e),e},uc=(t,e,n,r)=>{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;s<n.length;s++){const o=n[s];if(o.deleted){const a=o.id.clock;let l=o.length;if(s+1<n.length)for(let c=n[s+1];s+1<n.length&&c.deleted;c=n[++s+1])l+=c.length;i.push(new Bd(a,l))}}i.length>0&&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<i;s++){const o=r[s];t.writeDsClock(o.clock),t.writeDsLen(o.len)}})},$i=t=>{const e=new Va,n=at(t.restDecoder);for(let r=0;r<n;r++){t.resetDsCurVal();const i=at(t.restDecoder),s=at(t.restDecoder);if(s>0){const o=qn(e.clients,i,()=>[]);for(let a=0;a<s;a++)o.push(new Bd(t.readDsClock(),t.readDsLen()))}}return e},F1=(t,e,n)=>{const r=new Va,i=at(t.restDecoder);for(let s=0;s<i;s++){t.resetDsCurVal();const o=at(t.restDecoder),a=at(t.restDecoder),l=n.clients.get(o)||[],c=jt(n,o);for(let u=0;u<a;u++){const h=t.readDsClock(),d=h+t.readDsLen();if(h<c){c<d&&uc(r,o,c,d-c);let m=Tr(l,h),g=l[m];for(!g.deleted&&g.id.clock<h&&(l.splice(m+1,0,Ih(e,g,h-g.id.clock)),m++);m<l.length&&(g=l[m++],g.id.clock<d);)g.deleted||(d<g.id.clock+g.length&&l.splice(m,0,Ih(e,g,d-g.id.clock)),g.delete(e))}else uc(r,o,h,d-h)}}if(r.clients.size>0){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<r.length;s++){const o=r[s],a=i[s];if(o.clock!==a.clock||o.len!==a.len)return!1}}return!0},sQ=QP;class Ws extends KO{constructor({guid:e=A7(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!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<this.keys.length)return this.keys[e];{const n=this.stringDecoder.read();return this.keys.push(n),n}}}class Ca{constructor(){this.restEncoder=Za()}toUint8Array(){return Pr(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Ke(this.restEncoder,e)}writeDsLen(e){Ke(this.restEncoder,e)}}class Ys extends Ca{writeLeftID(e){Ke(this.restEncoder,e.client),Ke(this.restEncoder,e.clock)}writeRightID(e){Ke(this.restEncoder,e.client),Ke(this.restEncoder,e.clock)}writeClient(e){Ke(this.restEncoder,e)}writeInfo(e){ic(this.restEncoder,e)}writeString(e){mo(this.restEncoder,e)}writeParentInfo(e){Ke(this.restEncoder,e?1:0)}writeTypeRef(e){Ke(this.restEncoder,e)}writeLen(e){Ke(this.restEncoder,e)}writeAny(e){sc(this.restEncoder,e)}writeBuf(e){or(this.restEncoder,e)}writeJSON(e){mo(this.restEncoder,JSON.stringify(e))}writeKey(e){mo(this.restEncoder,e)}}class Wd{constructor(){this.restEncoder=Za(),this.dsCurrVal=0}toUint8Array(){return Pr(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,Ke(this.restEncoder,n)}writeDsLen(e){e===0&&Mn(),Ke(this.restEncoder,e-1),this.dsCurrVal+=e}}class zr extends Wd{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new hm,this.clientEncoder=new ju,this.leftClockEncoder=new hm,this.rightClockEncoder=new hm,this.infoEncoder=new M1(ic),this.stringEncoder=new b7,this.parentInfoEncoder=new M1(ic),this.typeRefEncoder=new ju,this.lenEncoder=new ju}toUint8Array(){const e=Za();return Ke(e,0),or(e,this.keyClockEncoder.toUint8Array()),or(e,this.clientEncoder.toUint8Array()),or(e,this.leftClockEncoder.toUint8Array()),or(e,this.rightClockEncoder.toUint8Array()),or(e,Pr(this.infoEncoder)),or(e,this.stringEncoder.toUint8Array()),or(e,Pr(this.parentInfoEncoder)),or(e,this.typeRefEncoder.toUint8Array()),or(e,this.lenEncoder.toUint8Array()),Rc(e,Pr(this.restEncoder)),Pr(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){sc(this.restEncoder,e)}writeBuf(e){or(this.restEncoder,e)}writeJSON(e){sc(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const q9=(t,e,n,r)=>{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<e.length;o++)e[o].write(t,0)},dv=(t,e,n)=>{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<r;i++){const s=at(t.restDecoder),o=new Array(s),a=t.readClient();let l=at(t.restDecoder);n.set(a,{i:0,refs:o});for(let c=0;c<s;c++){const u=t.readInfo();switch(Rd&u){case 0:{const h=t.readLen();o[c]=new $n(it(a,l),h),l+=h;break}case 10:{const h=at(t.restDecoder);o[c]=new jn(it(a,l),h),l+=h;break}default:{const h=(u&(Ni|Or))===0,d=new Ct(it(a,l),null,(u&Or)===Or?t.readLeftID():null,null,(u&Ni)===Ni?t.readRightID():null,h?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,h&&(u&nc)===nc?t.readString():null,HQ(t,u));o[c]=d,l+=d.length}}}}return n},G9=(t,e,n)=>{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||g<u.length)&&(u.integrate(t,g),h.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=s(),o===null)break;u=o.refs[o.i++]}}if(a.clients.size>0){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(m<jt(a,d)){s=!0;break}if(c){for(const[d,m]of c.missing){const g=u.missing.get(d);(g==null||g>m)&&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;r<n;r++){const i=at(t.restDecoder),s=at(t.restDecoder);e.set(i,s)}return e},mv=t=>lQ(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<a.length;c++){const u=a[c],h=l[c];if(u.clock!==h.clock||u.len!==h.len)return!1}}return!0},hQ=(t,e=new Wd)=>(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<jt(r,s)&&An(t,it(s,i))}),Po(t,e.ds,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<jt(t.store,l)&&An(o,it(l,c));const u=t.store.clients.get(l)||[],h=Tr(u,c-1);Ke(s.restEncoder,h+1),s.writeClient(l),Ke(s.restEncoder,0);for(let d=0;d<=h;d++)u[d].write(s,0)}Ti(s,i)}),Yd(n,s.toUint8Array(),"snapshot"),n},y6=(t,e,n=br)=>{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)<o.id.clock+o.length)return!1;const s=Qo([t.ds,$i(r)]);return iQ(t.ds,s)},x6=(t,e)=>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<s+i.length)return o;n=o+1}else r=o-1;o=Qi((n+r)/2)}throw Mn()},S6=(t,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<n&&i instanceof Ct?(e.splice(r+1,0,Ih(t,i,n-i.id.clock)),r+1):r},An=(t,e)=>{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++],s<a.id.clock+a.length&&gp(t,e,s),i(a);while(o<e.length&&e[o].id.clock<s)};class pQ{constructor(e,n,r){this.doc=e,this.deleteSet=new Va,this.beforeState=Ic(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const U1=(t,e)=>e.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<s.length&&u.id.clock<l;u=s[++c]){const h=s[c];if(a.clock+a.len<=h.id.clock)break;h instanceof Ct&&h.deleted&&!h.keep&&n(h)&&h.gc(e,!1)}}}},vQ=(t,e)=>{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(e<t.length){const n=t[e],r=n.doc,i=r.store,s=n.deleteSet,o=n._mergeStructs;try{uv(s),n.afterState=Ic(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const a=[];n.changed.forEach((l,c)=>a.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+1<m.length&&Wu(m,g+1)>1||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.lastChange<this.captureTimeout&&h.length>0&&!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;n<e;n++){const r=at(t.restDecoder),i=t.readClient();let s=at(t.restDecoder);for(let o=0;o<r;o++){const a=t.readInfo();if(a===10){const l=at(t.restDecoder);yield new jn(it(i,s),l),s+=l}else if((Rd&a)!==0){const l=(a&(Ni|Or))===0,c=new Ct(it(i,s),null,(a&Or)===Or?t.readLeftID():null,null,(a&Ni)===Ni?t.readRightID():null,l?t.readParentInfo()?t.readString():t.readLeftID():null,l&&(a&nc)===nc?t.readString():null,HQ(t,a));yield c,s+=c.length}else{const l=t.readLen();yield new $n(it(i,s),l),s+=l}}}}class Us{constructor(e,n){this.gen=P6(e),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===jn);return this.curr}}const Q6=t=>yQ(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.length<d.id.clock)if(s.struct.constructor===jn)s.struct.length=d.id.clock+d.length-s.struct.id.clock;else{us(a,s.struct,s.offset);const g=d.id.clock-s.struct.id.clock-s.struct.length;s={struct:new jn(it(h,s.struct.id.clock+s.struct.length),g),offset:0}}else{const g=s.struct.id.clock+s.struct.length-d.id.clock;g>0&&(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<t.clientStructs.length;n++){const r=t.clientStructs[n];Ke(e,r.written),Rc(e,r.restEncoder)}},$d=(t,e,n,r)=>{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<s.timestamp?i:s);return TQ(r,e,n),r}else{const r=new X6(e,n);return t.push(r),r}},Gd=(t,e)=>{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)<Fu(e-o.index)?s:o);let r=t._start,i=0;for(n!==null&&(r=n.p,i=n.index,Z6(n));r.right!==null&&i<e;){if(!r.deleted&&r.countable){if(e<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>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)<r.parent.length/CQ?(TQ(n,r,i),n):N6(t._searchMarker,r,i)},mc=(t,e,n)=>{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}(e<i.index||n>0&&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;a<o.length&&r>0;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<r.length;i++)e.push(r[i])}n=n.right}return e},F6=(t,e)=>{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<i.length;s++)n.push(i[s])}r=r.right}return n},gc=(t,e)=>{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<i.length;s++)e(i[s],n++,t)}r=r.right}},DQ=(t,e)=>{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<r.length)return r.content.getContent()[e];e-=r.length}},Rh=(t,e,n,r)=>{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<o.length&&An(t,it(o.id.client,o.id.clock+n));break}n-=o.length}return e._searchMarker&&mc(e._searchMarker,i,r.length),Rh(t,e,o,r)},B6=(t,e,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&&(n<a.length&&An(t,it(a.id.client,a.id.clock+n)),n-=a.length);for(;r>0&&a!==null;)a.deleted||(r<a.length&&An(t,it(a.id.client,a.id.clock+r)),a.delete(t),r-=a.length),a=a.right;if(r>0)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<e.right.length&&An(t,it(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length),e.left=e.right,e.right=e.right.right;return e},yu=(t,e,n,r)=>{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:r<n.right.length&&An(t,it(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){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<e.right.length&&An(t,it(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}s&&WQ(t,s,e.right,i,e.currentAttributes);const o=(e.left||e.right).parent;return o._searchMarker&&mc(o._searchMarker,e.index,-r+n),e};class UQ extends Xc{constructor(e,n,r){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(i=>{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;s<e.length;s++){const o=e[s];if(o.insert!==void 0){const a=!n&&typeof o.insert=="string"&&s===e.length-1&&i.right===null&&o.insert.slice(-1)===`
|
||
`?o.insert.slice(0,-1):o.insert;(typeof a!="string"||a.length>0)&&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;a<i;a++){const l=r[a];n.push(l+'="'+e[l]+'"')}const s=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}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.key<a.key?-1:1),n.push({nodeName:i,attrs:s})}n.sort((i,s)=>i.nodeName<s.nodeName?-1:1);let r="";for(let i=0;i<n.length;i++){const s=n[i];r+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){const a=s.attrs[o];r+=` ${a.key}="${a.value}"`}r+=">"}r+=e.insert;for(let i=n.length-1;i>=0;i--)r+=`</${n[i].nodeName}>`;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<r;i++){const s=this.arr[i];e.writeString(s===void 0?"undefined":JSON.stringify(s))}}getRef(){return 2}}const oF=t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++){const i=t.readString();i==="undefined"?n.push(void 0):n.push(JSON.parse(i))}return new Ea(n)},aF=Th("node_env")==="development";class Gi{constructor(e){this.arr=e,aF&&AP(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Gi(this.arr)}splice(e){const n=new Gi(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<r;i++){const s=this.arr[i];e.writeAny(s)}}getRef(){return 8}}const lF=t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++)n.push(t.readAny());return new Gi(n)};class Ar{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new Ar(this.str)}splice(e){const n=new Ar(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return 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<this.id.client)r=i,s.clear();else if(lo(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&o.has(Oo(e.doc.store,i.origin)))s.has(Oo(e.doc.store,i.origin))||(r=i,s.clear());else break;i=i.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),mQ(e.doc.store,this),this.content.integrate(e,this),q1(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new $n(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:it(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&lo(e.origin,this.lastId)&&this.right===e&&lo(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(r=>{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&&s<n.length&&n.charCodeAt(s)==a&&o++}}}match(e,n,r){let i=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],a=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?i={from:this.matches[s+1],to:r}:(this.matches[s]++,a=!0)),a||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:n,to:r}:this.matches.push(1,n)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(Da.prototype[Symbol.iterator]=function(){return this});const eC={from:-1,to:-1,match:/.*/.exec("")},Pv="gm"+(/x/.unicode==null?"":"u");class tC{constructor(e,n,r,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=eC,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new nC(e,n,r,i,s);this.re=new RegExp(n,Pv+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=Xh(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.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(),(r<i||r>this.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<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const bm=new WeakMap;class ua{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=bm.get(e);if(!i||i.from>=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<r&&(s+=e.sliceString(i.to,r)),bm.set(e,new ua(o,s)),new ua(n,s.slice(n-o,r-o))}}class nC{constructor(e,n,r,i,s){this.text=e,this.to=s,this.done=!1,this.value=eC,this.matchPos=Xh(e,i),this.re=new RegExp(n,Pv+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=ua.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=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<n.to&&(r=n.text.charCodeAt(e-n.from))>=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(l<e.minSelectionLength||l>200)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<r)&&(s=Math.max(0,n-2),i=t.sliceString(s,Math.min(t.length,r+2))),(e(Zh(i,n-s))!=Zt.Word||e(Nh(i,n-s))!=Zt.Word)&&(e(Nh(i,r-s))!=Zt.Word||e(Zh(i,r-s))!=Zt.Word))}class LF extends sC{constructor(e){super(e)}nextMatch(e,n,r){let i=$o(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,n+this.spec.unquoted.length);i=$o(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let s=Math.max(n,i-1e4-this.spec.unquoted.length),o=$o(this.spec,e,s,i),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==n)return null;i-=1e4}}prevMatch(e,n,r){let i=this.prevMatchInRange(e,0,n);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=$o(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(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<e.match.length)return e.match[s]+r.slice(i)}return n})}matchAll(e,n){let r=Go(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=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;i<o;i++){let{from:a,to:l}=s[i];for(;i<o-1&&l>s[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;l<xu;l++)if(!Su.test(a[l+1])&&Su.test(a[l])){a=a.slice(l);break}}if(o!=i){for(let l=a.length-1;l>a.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("<div></div>");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;a<i.length;a++){const l=i[a];l.insert!=null?s.push({from:o,to:o,insert:l.insert}):l.delete!=null?(s.push({from:o,to:o+l.delete,insert:""}),o+=l.delete):o+=l.retain}e.dispatch({changes:s,annotations:[yp.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&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;_<w.number;_++){const C=e.view.state.doc.line(_).from;s.push({from:C,to:C,value:ze.line({attributes:{style:`background-color: ${g}`,class:"cm-yLineSelection"}})})}}s.push({from:h.index,to:h.index,value:ze.widget({side:h.index-u.index>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('<button type="button"><!></button>'),hj=P('<p class="text-muted-foreground italic"> </p>'),dj=P('<div><div></div> <div><!></div> <div dir="ltr"></div></div>');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}`),``})}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=>``).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=>``).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=``;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:""},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('<span class="text-red-500">*</span>'),gj=P('<span class="text-sm font-medium text-foreground"> <!></span>'),pj=P('<div class="flex h-64 items-center justify-center rounded-lg border border-border bg-card text-sm text-muted-foreground"><span class="animate-pulse"> </span></div>'),Oj=P('<span class="text-xs text-muted-foreground"></span>'),vj=P('<div class="space-y-2"><!> <!> <!></div>');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<bj)return r.data;const i={callable:t,...e},s=await Ns.get("/data/resolve",i);return ox.set(n,{data:s,timestamp:Date.now()}),s}var yj=P('<span class="text-red-500">*</span>'),xj=P('<label class="text-sm font-semibold text-foreground"> <!></label>'),Sj=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),wj=P("<div><!> <!></div>"),kj=P("<option> </option>"),_j=P('<p class="text-xs font-medium text-destructive" data-field-error=""> </p>'),Pj=P('<div class="space-y-2"><!> <div><select></select> <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center pe-2.5"><!></div></div> <!></div>');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('<span class="text-sm font-semibold text-foreground"> </span>'),Cj=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),Tj=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),Aj=P('<p class="mt-0.5 text-xs text-muted-foreground"> </p>'),Ej=P("<div><!> <!> <!></div>"),Dj=P('<button type="button"> </button>'),Mj=P('<div class="space-y-2"><!> <div class="relative isolate inline-grid rounded-lg border border-input bg-muted/30 p-0.5"><div></div> <!></div></div>');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('<label class="label"><span class="flex items-center gap-2 text-sm font-semibold text-foreground"> <span class="inline-flex items-center rounded-md border border-border px-2 py-0.5 text-[0.625rem] font-medium text-muted-foreground"> </span></span> <textarea class="flex min-h-[80px] w-full rounded-lg border border-input bg-muted/50 px-3 py-2.5 text-xs shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring font-mono" style="resize: vertical;"></textarea></label>');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('<span class="flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground" role="button" tabindex="-1"><!></span>'),Zj=P('<span class="w-5 shrink-0"></span>'),Nj=P('<span class="text-muted-foreground"> </span>'),Vj=P('<div><button type="button"><!> <!> <span class="min-w-0 truncate"><!> </span> <!></button></div> <!>',1),Fj=P('<span class="text-red-500">*</span>'),jj=P('<label class="text-sm font-semibold text-foreground"> <!></label>'),Bj=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),zj=P("<div><!> <!></div>"),Wj=P('<button type="button" class="shrink-0 text-muted-foreground hover:text-foreground"><!></button>'),Yj=P('<div class="flex items-center justify-center py-6 text-sm text-muted-foreground"><!> </div>'),Uj=P('<button type="button"><!> <span class="truncate"> </span> <!></button>'),qj=P('<div class="py-4 text-center text-sm text-muted-foreground"> </div>'),$j=P("<!> <!> <!>",1),Gj=P('<div class="absolute left-0 right-0 top-full z-50 mt-1 overflow-hidden rounded-xl border border-border bg-popover shadow-lg"><div class="flex items-center gap-2 border-b border-border px-3 py-2"><!> <input type="text" class="flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"/> <!></div> <div class="max-h-72 overflow-y-auto p-1"><!></div></div>'),Hj=P('<div class="space-y-2"><!> <div class="pages-field-popover relative"><button type="button" class="flex h-10 w-full items-center justify-between rounded-lg border border-input bg-muted/50 px-3 py-2 text-sm shadow-sm transition-colors hover:bg-muted/70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"><span> </span> <!></button> <!></div></div>');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('<label class="text-sm font-semibold text-foreground"> </label>'),eB=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),tB=P("<div><!> <!></div>"),nB=P("<option> </option>"),rB=P("<option> </option>"),iB=P("<option> </option> <!>",1),sB=P('<div class="space-y-2"><!> <div class="relative"><select class="flex h-10 w-full appearance-none rounded-lg border border-input 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"><!></select> <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center pe-2.5"><!></div></div></div>');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('<label class="text-sm font-semibold text-foreground"> </label>'),lB=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),cB=P("<div><!> <!></div>"),uB=P('<input type="text" class="flex h-9 w-1/3 shrink-0 rounded-lg border border-input bg-muted/50 px-3 py-1.5 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"/>'),hB=P("<option> </option>"),dB=P('<div class="relative flex min-w-0 flex-1 items-center"><select class="flex h-9 w-full appearance-none rounded-lg border border-input bg-muted/50 ps-3 pe-8 py-1.5 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"><option> </option><!></select> <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center pe-2.5"><!></div></div>'),fB=P('<input type="text" class="flex h-9 min-w-0 flex-1 rounded-lg border border-input bg-muted/50 px-3 py-1.5 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"/>'),mB=P('<div draggable="true"><span class="flex shrink-0 cursor-grab items-center text-muted-foreground/40 transition-colors group-hover:text-muted-foreground active:cursor-grabbing"><!></span> <!> <!> <button type="button" class="flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground/40 transition-colors hover:bg-red-500/10 hover:text-red-400"><!></button></div>'),gB=P('<button type="button" class="flex h-9 w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-border text-sm text-muted-foreground transition-colors hover:border-primary/50 hover:text-primary"><!> </button>'),pB=P('<div class="space-y-2"><!> <div class="space-y-1"></div> <!></div>');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<f(l).length);let u=ge(0);function h(j){return j==null?[]:r?(Array.isArray(j)?j:[]).map(ie=>({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('<label class="text-sm font-semibold text-foreground"> </label>'),bB=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),yB=P("<div><!> <!></div>"),xB=P("<option> </option>"),SB=P('<p class="text-xs text-muted-foreground"> <code class="rounded bg-muted px-1 py-0.5 font-mono text-[0.6875rem]"> </code></p>'),wB=P('<div class="space-y-2"><!> <div class="relative"><select class="flex h-10 w-full appearance-none rounded-lg border border-input 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"><option> </option><!></select> <div class="pointer-events-none absolute inset-y-0 right-0 flex items-center pe-2.5"><!></div></div> <!></div>');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(;U<C.length;)C[U]==="\\"&&U+1<C.length?(F+=C[U+1],U+=2):C.slice(U,U+2)==="jS"?(F+=R.jS,U+=2):R[C[U]]!==void 0?(F+=R[C[U]],U++):(F+=C[U],U++);return F}const s=A(()=>e.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('<label class="text-sm font-semibold text-foreground"> </label>'),PB=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),QB=P("<div><!> <!></div>"),CB=P('<span> <button type="button"><!></button></span>'),TB=P('<button type="button"> </button>'),AB=P('<div class="absolute left-0 right-0 top-full z-50 mt-1 overflow-hidden rounded-lg border border-border bg-popover shadow-lg"><div class="max-h-48 overflow-y-auto p-1"></div></div>'),EB=P('<p class="text-xs font-medium text-destructive" data-field-error=""> </p>'),DB=P('<div class="space-y-2"><!> <div class="relative"><div><!> <input type="text" class="min-w-[80px] flex-1 border-0 bg-transparent py-0.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"/></div> <!></div> <!></div>');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)<f(i).length-1?ta(c):(k(c,-1),f(o)?.focus());return}if(N.key==="Escape"){k(c,-1),f(o)?.focus();return}k(c,-1);return}N.key==="Enter"||N.key==="Tab"||N.key===","?f(l)>=0&&f(l)<f(m).length?(N.preventDefault(),p(f(m)[f(l)])):f(s).trim()?(N.preventDefault(),p(f(s))):N.key==="Enter"&&f(m).length>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('<label class="text-sm font-semibold text-foreground"> </label>'),RB=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),LB=P("<div><!> <!></div>"),IB=P('<span class="flex shrink-0 cursor-grab items-center text-muted-foreground/40 hover:text-muted-foreground active:cursor-grabbing"><!></span>'),XB=P('<button type="button" class="flex shrink-0 items-center text-muted-foreground hover:text-foreground"><!></button>'),ZB=P('<span class="min-w-0 flex-1 truncate text-sm text-muted-foreground"> </span>'),NB=P('<span class="flex-1"></span>'),VB=P('<label class="text-sm font-semibold text-foreground"> </label>'),FB=P('<div><!> <input type="text" class="flex h-10 w-full rounded-lg border border-input bg-muted/50 px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"/></div>'),jB=P("<div><!> <!></div>"),BB=P('<div><div class="flex items-center gap-1.5 px-3 py-2"><!> <!> <!> <button type="button" class="flex shrink-0 items-center rounded-md p-1 text-muted-foreground/40 transition-colors hover:bg-red-500/10 hover:text-red-400"><!></button></div> <!></div>'),zB=P('<div class="space-y-2"></div>'),WB=P('<button type="button" class="flex h-9 items-center gap-1.5 rounded-lg border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground"><!> </button> <button type="button" class="flex h-9 items-center gap-1.5 rounded-lg border border-border px-3 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground"><!> </button>',1),YB=P('<div class="space-y-2"><!> <!> <div class="flex items-center gap-2"><!> <button type="button" class="flex h-9 flex-1 items-center justify-center gap-1.5 rounded-lg border border-dashed border-border text-sm text-muted-foreground transition-colors hover:border-primary/50 hover:text-primary"><!> </button></div></div>');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('<label class="text-sm font-semibold text-foreground"> </label>'),$B=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),GB=P("<div><!> <!></div>"),HB=P('<button type="button"> </button>'),KB=P("<option> </option>"),JB=P('<span class="text-muted-foreground"> </span> <select class="h-8 rounded-md border border-input bg-muted/50 px-2 text-sm"></select>',1),e8=P("<option> </option>"),t8=P("<option> </option>"),n8=P('<span class="text-muted-foreground">At</span> <select class="h-8 rounded-md border border-input bg-muted/50 px-2 text-sm"></select> <span class="text-muted-foreground">:</span> <select class="h-8 rounded-md border border-input bg-muted/50 px-2 text-sm"></select>',1),r8=P("<option> </option>"),i8=P("<option> </option>"),s8=P("<option> </option>"),o8=P('<span class="text-muted-foreground">On</span> <select class="h-8 rounded-md border border-input bg-muted/50 px-2 text-sm"></select> <span class="text-muted-foreground">at</span> <select class="h-8 rounded-md border border-input bg-muted/50 px-2 text-sm"></select> <span class="text-muted-foreground">:</span> <select class="h-8 rounded-md border border-input bg-muted/50 px-2 text-sm"></select>',1),a8=P("<option> </option>"),l8=P("<option> </option>"),c8=P("<option> </option>"),u8=P('<span class="text-muted-foreground"> </span> <select class="h-8 rounded-md border border-input bg-muted/50 px-2 text-sm"></select> <span class="text-muted-foreground">at</span> <select class="h-8 rounded-md border border-input bg-muted/50 px-2 text-sm"></select> <span class="text-muted-foreground">:</span> <select class="h-8 rounded-md border border-input bg-muted/50 px-2 text-sm"></select>',1),h8=P('<div class="space-y-3 border-t border-border px-3 py-3"><div class="flex flex-wrap items-center gap-1.5"></div> <div class="flex flex-wrap items-center gap-2 text-sm"><!></div> <div class="flex items-center gap-2"><span class="text-xs text-muted-foreground"> </span> <input type="text" class="flex h-8 flex-1 rounded-md border border-input bg-muted/30 px-2 font-mono text-xs shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" placeholder="* * * * *"/> <span class="hidden text-[0.625rem] text-muted-foreground/60 sm:block"> </span></div></div>'),d8=P('<div class="space-y-2"><!> <div class="rounded-lg border border-input bg-muted/50 shadow-sm"><button type="button" class="flex w-full items-center gap-2 px-3 py-2.5 text-start"><!> <span class="flex-1 text-sm text-foreground"> </span> <code class="rounded bg-muted px-1.5 py-0.5 font-mono text-[0.6875rem] text-muted-foreground"> </code> <!></button> <!></div></div>');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('<label class="text-sm font-semibold text-foreground"> </label>'),m8=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),g8=P("<div><!> <!></div>"),p8=P('<div class="flex items-center gap-1.5 text-xs text-red-400"><!> </div>'),O8=P('<div class="space-y-2"><!> <div></div> <!></div>');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('<span class="ms-1 font-normal text-muted-foreground"> </span>'),y8=P('<div class="space-y-1"><div class="flex items-center justify-between text-xs text-muted-foreground"><span class="truncate"> </span> <span> </span></div> <div class="h-1.5 overflow-hidden rounded-full bg-secondary"><div class="h-full rounded-full bg-primary transition-[width] duration-200"></div></div></div>'),x8=P('<div class="space-y-2 p-3"></div>'),S8=P('<div class="aspect-square animate-pulse rounded-md bg-muted"></div>'),w8=P('<div class="grid grid-cols-3 gap-1.5 p-2"></div>'),k8=P('<img class="h-full w-full object-cover" loading="lazy"/>'),_8=P('<div class="flex h-full w-full flex-col items-center justify-center gap-1 p-2"><span class="text-lg text-muted-foreground"> </span> <span class="max-w-full truncate text-[0.625rem] text-muted-foreground"> </span></div>'),P8=P('<div class="group relative aspect-square cursor-grab overflow-hidden rounded-md border border-border bg-muted/50 transition-shadow hover:shadow-md active:cursor-grabbing" draggable="true"><!> <div class="absolute inset-0 flex items-end bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 transition-opacity group-hover:opacity-100"><div class="flex w-full items-center justify-between p-1.5"><span class="max-w-[calc(100%-24px)] truncate text-[0.625rem] text-white/90"> </span> <button type="button" class="inline-flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-sm text-white/80 transition-colors hover:bg-red-500 hover:text-white"><!></button></div></div> <div class="absolute right-1 top-1 rounded bg-black/30 p-0.5 opacity-0 transition-opacity group-hover:opacity-100"><!></div></div>'),Q8=P('<div class="grid grid-cols-3 gap-1.5 p-2"></div>'),C8=P('<div class="space-y-3"><div class="flex items-center justify-between"><h3 class="text-sm font-semibold text-foreground"> <!></h3> <button type="button" class="inline-flex h-7 items-center gap-1 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"><!> Add</button> <input type="file" multiple="" class="hidden"/></div> <div><!> <!> <button type="button" class="flex w-full items-center justify-center gap-1.5 px-3 py-3 text-center"><!> <p class="text-xs text-muted-foreground"> </p></button></div></div>');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})`;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('<div class="rounded-lg border border-dashed border-border p-4 text-center text-sm text-muted-foreground"> </div>');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<t.length;n++){const r=t[n];if(r){for(const i of Object.keys(r)){const s=e[i],o=r[i],a=typeof s=="function",l=typeof o=="function";if(a&&iz(i)){const c=s,u=o;e[i]=pC(c,u)}else if(a&&l)e[i]=El(s,o);else if(i==="class"){const c=wp(s),u=wp(o);c&&u?e[i]=pf(s,o):c?e[i]=pf(s):u&&(e[i]=pf(o))}else if(i==="style"){const c=typeof s=="object",u=typeof o=="object",h=typeof s=="string",d=typeof o=="string";if(c&&u)e[i]={...s,...o};else if(c&&d){const m=Ol(o);e[i]={...s,...m}}else if(h&&u){const m=Ol(s);e[i]={...m,...o}}else if(h&&d){const m=Ol(s),g=Ol(o);e[i]={...m,...g}}else c?e[i]=s:u?e[i]=o:h?e[i]=s:d&&(e[i]=o)}else e[i]=o!==void 0?o:s}for(const i of Object.getOwnPropertySymbols(r)){const s=e[i],o=r[i];e[i]=o!==void 0?o:s}}}return typeof e.style=="object"&&(e.style=Vc(e.style).replaceAll(`
|
||
`," ")),e.hidden===!1&&(e.hidden=void 0,delete e.hidden),e.disabled===!1&&(e.disabled=void 0,delete e.disabled),e}const sz={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"},vC=Vc(sz),bC=typeof window<"u"?window:void 0;function oz(t){let e=t.activeElement;for(;e?.shadowRoot;){const n=e.shadowRoot.activeElement;if(n===e)break;e=n}return e}class az{#e;#t;constructor(e={}){const{window:n=bC,document:r=n?.document}=e;n!==void 0&&(this.#e=r,this.#t=oS(i=>{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 n<i.left||n>i.right||r<i.top||r>i.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;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},Vz=function(e){if(!e.name)return!0;var n=e.form||Wh(e),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(e.name));else try{i=r(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=Nz(i,e.form);return!s||s===e},Fz=function(e){return RC(e)&&e.type==="radio"},jz=function(e){return Fz(e)&&!Vz(e)},Bz=function(e){var n,r=e&&Wh(e),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==e){var o,a,l;for(s=!!((o=i)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(i)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!s&&i;){var c,u,h;r=Wh(i),i=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=i)!==null&&u!==void 0&&(h=u.ownerDocument)!==null&&h!==void 0&&h.contains(i))}}return s},Ox=function(e){var n=e.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},zz=function(e,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var s=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(e).visibility==="hidden")return!0;var o=Ao.call(e,"details>summary: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<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Ao.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},qh=function(e,n){return!(n.disabled||Xz(n)||zz(n,e)||Zz(n)||Wz(n))},Qp=function(e,n){return!(jz(n)||MC(n)<0||!qh(e,n))},Yz=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=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<t.length;r+=e)n.push(t.slice(r,r+e));return n}function xm(t,e){return t>=0&&t<e.length}const Jz="data-context-menu-trigger",eW="data-context-menu-content";nf({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});globalThis.bitsDismissableLayers??=new Map;class Rv{static create(e){return new Rv(e)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#i=!1;#o=void 0;#l;#s=Ft;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#l=e.onFocusOutside,We(()=>{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),t<n&&(t=r);let s=Math.abs(e);e>0?t=Math.ceil(t/s)*s:t=Math.floor(t/s)*s,t>r&&(t=n)}else t+=e,t<n?t=r-(n-t-1):t>r&&(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(r<e||r>n)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<e)throw new RangeError("End date must be >= 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<e)throw new RangeError("End date must be >= 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[0]?-1:1).join():"");if(Qm.has(n))return Qm.get(n);let r=new Intl.DateTimeFormat(t,e);return Qm.set(n,r),r}let Cm=null;function $W(){return Cm==null&&(Cm=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Cm}let Tm=null;function GW(){return Tm==null&&(Tm=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Tm}function HW(t,e){if(!e.timeStyle&&!e.hour)return;t=t.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),t+=(t.includes("-u-")?"":"-u")+"-nu-latn";let n=nT(t,{...e,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(s=>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&&o<i.toDate(ps())?o=i.toDate(ps()):s&&o>s.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;s<e;s++){const o=n.add({months:s});i.push(Mm({...r,dateObj:o}))}return i}function Rm(t){return t?Array.from(t.querySelectorAll("[data-bits-day]:not([data-disabled]):not([data-outside-visible-months])")).filter(n=>jr(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.placeholderYear<o?t.placeholderYear-10:o}t.maxValue?i=t.maxValue.year:i=n+10,r>i&&(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("<div><!></div>");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("<table><!></table>");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("<tbody><!></tbody>");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("<td><!></td>");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("<thead><!></thead>");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("<th><!></th>");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("<tr><!></tr>");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("<header><!></header>");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("<div><!></div>");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("<button><!></button>");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("<button><!></button>");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("<input/>"),pU=P("<input/>");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<s.length;p++){const O=s[p];if(!O)continue;const{name:v,fn:w}=O,{x:_,y:C,data:T,reset:S}=await w({x:u,y:h,initialPlacement:r,placement:d,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:t,floating:e}});u=_??u,h=C??h,g[v]={...g[v],...T},S&&m<CU&&(m++,typeof S=="object"&&(S.placement&&(d=S.placement),S.rects&&(c=S.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:u,y:h}=Ix(c,d,l)),p=-1)}return{x:u,y:h,placement:d,strategy:i,middlewareData:g}},AU=t=>({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-(U<R?X:L)-p[g]/2<0,ie=Y?U<R?U-R:U-F:0;return{[m]:d[m]+ie,data:{[m]:j,centerOffset:U-j-ie,...Y&&{alignmentOffset:ie}},reset:Y}}}),EU=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...O}=Hi(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Ki(i),w=bi(a),_=Ki(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),T=d||(_||!p?[ed(a)]:xU(a)),S=g!=="none";!d&&S&&T.push(..._U(a,p,g,C));const Q=[a,...T],D=await l.detectOverflow(e,O),I=[];let X=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&I.push(D[v]),h){const U=yU(i,o,C);I.push(D[U[0]],D[U[1]])}if(X=[...X,{placement:i,overflows:I}],!I.every(U=>U<=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;m<C?m=C:m>T&&(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);g<T?g=T:g>S&&(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.length;d++){const m=Fx(e,o[d],i);l=fr(m.top,l),c=Xs(m.right,c),u=Xs(m.bottom,u),h=fr(m.left,h)}return{width:c-h,height:u-l,x:h,y:l}}function HU(t){const{width:e,height:n}=gT(t);return{width:e,height:n}}function KU(t,e,n){const r=rs(e),i=Di(e),s=n==="fixed",o=Mo(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=ki(0);function c(){l.x=mf(i)}if(r||!r&&!s)if((Ya(e)!=="body"||qc(i))&&(a=ff(e)),r){const m=Mo(e,!0,s,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&c();s&&!r&&i&&c();const u=i&&!r&&!s?OT(i,a):ki(0),h=o.left+a.scrollLeft-l.x-u.x,d=o.top+a.scrollTop-l.y-u.y;return{x:h,y:d,width:o.width,height:o.height}}function Im(t){return qr(t).position==="static"}function jx(t,e){if(!rs(t)||qr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Di(t)===n&&(n=n.ownerDocument.body),n}function bT(t,e){const n=vr(t);if(df(t))return n;if(!rs(t)){let i=Zs(t);for(;i&&!Ra(i);){if(Ur(i)&&!Im(i))return i;i=Zs(i)}return n}let r=jx(t,e);for(;r&&ZU(r)&&Im(r);)r=jx(r,e);return r&&Ra(r)&&Im(r)&&!d0(r)?n:r||FU(t)||n}const JU=async function(t){const e=this.getOffsetParent||bT,n=this.getDimensions,r=await n(t.floating);return{reference:KU(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function eq(t){return qr(t).direction==="rtl"}const tq={convertOffsetParentRelativeRectToViewportRelativeRect:zU,getDocumentElement:Di,getClippingRect:GU,getOffsetParent:bT,getElementRects:JU,getClientRects:WU,getDimensions:HU,getScale:ha,isElement:Ur,isRTL:eq};function yT(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function nq(t,e){let n=null,r;const i=Di(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=t.getBoundingClientRect(),{left:u,top:h,width:d,height:m}=c;if(a||e(),!d||!m)return;const g=Qu(h),p=Qu(i.clientWidth-(u+d)),O=Qu(i.clientHeight-(h+m)),v=Qu(u),_={rootMargin:-g+"px "+-p+"px "+-O+"px "+-v+"px",threshold:fr(0,Xs(1,l))||1};let C=!0;function T(S){const Q=S[0].intersectionRatio;if(Q!==l){if(!C)return o();Q?o(!1,Q):r=setTimeout(()=>{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("<div><!></div>"),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("<span><!></span>");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<s;a=o++){const[l,c]=e[o]??[0,0],[u,h]=e[a]??[0,0];c>=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("<div><!></div>");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("<div><div><!></div></div>"),Wq=P("<div><div><!></div></div>");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("<button><!></button>");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('<span class="text-red-500">*</span>'),Kq=P('<label class="text-sm font-semibold text-foreground"> <!></label>'),Jq=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),e$=P("<div><!> <!></div>"),t$=P('<span class="text-muted-foreground"> </span>'),n$=P('<button type="button" 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"><!></button>'),r$=P("<!> <!> <!>",1),i$=P("<!> <!>",1),s$=P('<div class="flex flex-col gap-4"><!> <!></div>'),o$=P('<div class="flex items-center gap-1.5"><!> <!> <!></div> <!>',1),a$=P('<p class="text-xs text-muted-foreground"></p>'),l$=P('<p class="text-xs text-muted-foreground"> </p>'),c$=P('<div class="space-y-2"><!> <!> <!></div>');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('<span class="text-sm font-semibold text-foreground"> </span>'),d$=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),f$=P("<div><!> <!></div>"),m$=P('<div class="h-10 animate-pulse rounded-lg bg-muted/50"></div>'),g$=P('<p class="text-xs text-muted-foreground"> </p>'),p$=P('<div class="space-y-3"><!> <!></div>'),O$=P('<div class="space-y-2"><!> <!></div>');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('<span class="text-red-500">*</span>'),y$=P('<label class="text-sm font-semibold text-foreground"> <!></label>'),x$=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),S$=P("<div><!> <!></div>"),w$=P('<p class="text-xs text-muted-foreground"></p>'),k$=P('<p class="text-xs text-muted-foreground"> </p>'),_$=P('<div class="space-y-2"><!> <div class="flex items-stretch"><input type="text"/> <button type="button" class="flex h-10 w-10 shrink-0 items-center justify-center rounded-r-lg border border-input bg-muted/50 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"><!></button></div> <!></div>');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('<label class="text-sm font-semibold text-foreground"> </label>'),C$=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),T$=P("<div><!> <!></div>"),A$=P('<img class="h-8 w-8 shrink-0 rounded border border-border object-cover"/>'),E$=P('<div class="flex h-8 w-8 shrink-0 items-center justify-center rounded bg-muted text-[0.625rem] font-semibold text-muted-foreground"> </div>'),D$=P('<div class="flex flex-1 items-center gap-2.5 px-2"><!> <span class="truncate text-sm text-foreground"> </span></div> <button type="button" class="shrink-0 px-2 text-muted-foreground transition-colors hover:text-foreground" title="Clear"><!></button>',1),M$=P('<input type="text" class="h-10 flex-1 rounded-lg border-0 bg-transparent px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"/>'),R$=P('<div class="px-3 py-4 text-center text-sm text-muted-foreground"> </div>'),L$=P('<div class="px-3 py-4 text-center text-sm text-destructive"> </div>'),I$=P('<div class="px-3 py-4 text-center text-sm text-muted-foreground"><!></div>'),X$=P('<img class="h-8 w-8 shrink-0 rounded object-cover"/>'),Z$=P('<div class="flex h-8 w-8 shrink-0 items-center justify-center rounded bg-muted text-[0.625rem] font-medium text-muted-foreground"> </div>'),N$=P('<button type="button"><!> <span class="truncate text-sm"> </span></button>'),V$=P('<div class="max-h-60 overflow-y-auto p-1"></div>'),F$=P('<div class="absolute left-0 right-0 top-full z-50 mt-1 overflow-hidden rounded-lg border border-border bg-popover shadow-lg"><!></div>'),j$=P('<div class="space-y-2"><!> <div class="relative"><div class="flex min-h-[40px] items-center rounded-lg border border-input bg-muted/50 shadow-sm transition-colors focus-within:ring-1 focus-within:ring-ring"><!> <button type="button" class="shrink-0 px-2 text-muted-foreground"><!></button></div> <!></div></div>');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('<label class="text-sm font-semibold text-foreground"> </label>'),W$=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),Y$=P("<div><!> <!></div>"),U$=P('<img class="h-8 w-8 shrink-0 rounded border border-border object-cover"/>'),q$=P('<div class="flex h-8 w-8 shrink-0 items-center justify-center rounded bg-muted text-[0.625rem] font-semibold text-muted-foreground"> </div>'),$$=P('<div class="flex items-center gap-2.5 rounded-md border border-border bg-muted/30 px-2 py-1.5"><!> <span class="flex-1 truncate text-sm text-foreground"> </span> <button type="button" class="shrink-0 text-muted-foreground transition-colors hover:text-destructive"><!></button></div>'),G$=P('<div class="space-y-1"></div>'),H$=P('<div class="w-full space-y-1"><div class="text-xs text-muted-foreground"> </div> <div class="h-1.5 overflow-hidden rounded-full bg-secondary"><div class="h-full rounded-full bg-primary transition-[width] duration-200"></div></div></div>'),K$=P('<p class="text-[0.625rem] text-muted-foreground/60"> </p>'),J$=P('<!> <p class="text-xs text-muted-foreground"> </p> <!>',1),eG=P('<div role="button"><!></div> <input type="file" class="hidden"/>',1),tG=P('<div class="space-y-2"><!> <!> <!></div>');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('<div class="space-y-4 rounded-lg border border-border bg-muted/20 p-4"></div>'),iG=P('<div class="space-y-3"><!> <!></div>');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('<div dir="ltr"></div>');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('<label class="text-sm font-semibold text-foreground"> </label>'),uG=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),hG=P("<div><!> <!></div>"),dG=P('<div class="space-y-2"><!> <!></div>');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('<label class="text-sm font-semibold text-foreground"> </label>'),gG=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),pG=P("<div><!> <!></div>"),OG=P('<div class="flex flex-1 items-center gap-2.5 px-3"><i></i> <span class="text-sm text-foreground"> </span></div> <button type="button" class="shrink-0 px-2 text-muted-foreground transition-colors hover:text-foreground"><!></button>',1),vG=P('<button type="button" class="flex h-10 flex-1 items-center px-3 text-sm text-muted-foreground"> </button>'),bG=P('<button type="button" class="text-muted-foreground"><!></button>'),yG=P('<button type="button"><i></i></button>'),xG=P('<div class="col-span-8 py-4 text-center text-sm text-muted-foreground"> </div>'),SG=P('<div class="border-t border-border px-3 py-1.5 text-center text-[0.625rem] text-muted-foreground"> </div>'),wG=P('<div class="absolute left-0 right-0 top-full z-50 mt-1 overflow-hidden rounded-lg border border-border bg-popover shadow-lg"><div class="flex items-center gap-2 border-b border-border px-3 py-2"><!> <input type="text" class="flex-1 border-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus:outline-none"/> <!></div> <div class="grid max-h-64 grid-cols-8 gap-0.5 overflow-y-auto p-2"><!> <!></div> <!></div>'),kG=P('<div class="space-y-2"><!> <div class="relative"><div class="flex min-h-[40px] items-center rounded-lg border border-input bg-muted/50 shadow-sm transition-colors focus-within:ring-1 focus-within:ring-ring"><!> <button type="button" class="shrink-0 px-2 text-muted-foreground"><!></button></div> <!></div></div>');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('<label class="text-sm font-semibold text-foreground"> </label>'),QG=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),CG=P("<div><!> <!></div>"),TG=P('<div class="rounded-lg border border-dashed border-border p-4 text-center text-sm text-muted-foreground"> </div>'),AG=P('<div class="flex items-center gap-3 rounded-md border border-border bg-muted/20 px-3 py-2"><span class="flex-1 font-mono text-xs text-foreground"> </span> <div class="flex overflow-hidden rounded-md border border-border text-xs"><button type="button"> </button> <button type="button"> </button> <button type="button"> </button></div></div>'),EG=P('<div class="space-y-1"></div>'),DG=P('<div class="space-y-2"><!> <!></div>');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('<div class="p-6 text-center text-sm text-muted-foreground"> </div>'),LG=P("<!> ",1),IG=P("<!> ",1),XG=P('<div class="p-6 text-center text-sm text-muted-foreground"> </div>'),ZG=P('<span class="inline-flex items-center gap-1.5 rounded-full bg-destructive/10 px-2.5 py-1 text-xs font-semibold text-destructive"><!> Error</span>'),NG=P('<span class="inline-flex items-center gap-1.5 rounded-full bg-emerald-500/10 px-2.5 py-1 text-xs font-semibold text-emerald-500"><!> Ready</span>'),VG=P('<span class="inline-block rounded-l-md bg-primary px-2.5 py-1 text-xs font-semibold text-primary-foreground"> </span><span class="inline-block rounded-r-md bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground"> </span>',1),FG=P('<span class="inline-block rounded-l-md bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground"> </span><span class="inline-block rounded-r-md bg-destructive px-2.5 py-1 text-xs font-semibold text-destructive-foreground"> </span>',1),jG=P('<tr class="border-b border-border last:border-0 hover:bg-muted/30"><td class="px-4 py-3"><span class="font-medium text-primary"> </span></td><td class="px-4 py-3 text-muted-foreground"> </td><td class="px-4 py-3"><!></td><td class="px-4 py-3 text-end"><!></td></tr>'),BG=P('<table class="w-full text-sm"><thead><tr class="border-b border-border text-start text-xs font-medium text-muted-foreground"><th class="px-4 py-3"> </th><th class="px-4 py-3">Run</th><th class="px-4 py-3"> </th><th class="px-4 py-3 text-end">State</th></tr></thead><tbody></tbody></table>'),zG=P('<span class="rounded-md bg-emerald-600/10 px-2.5 py-1 text-xs font-semibold text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300">HEALTHY</span>'),WG=P('<span class="rounded-md bg-amber-600/10 px-2.5 py-1 text-xs font-semibold text-amber-700 dark:bg-amber-500/15 dark:text-amber-300">WARNING</span>'),YG=P('<span class="rounded-md bg-red-600/10 px-2.5 py-1 text-xs font-semibold text-red-700 dark:bg-red-500/15 dark:text-red-300">ERROR</span>'),UG=P('<div class="rounded-lg border border-border bg-card"><div class="flex items-center gap-2 border-b border-border px-4 py-3"><!> <h3 class="text-sm font-semibold text-foreground"> </h3></div> <div class="space-y-3 p-4"><div class="flex items-center justify-between rounded-md bg-muted/50 px-4 py-2.5"><span class="text-sm font-medium text-muted-foreground"> </span> <!></div> <div class="grid grid-cols-2 gap-3"><div class="rounded-md bg-muted/50 px-4 py-3"><p class="text-[0.625rem] font-semibold uppercase tracking-wide text-muted-foreground"> </p> <p class="mt-1 text-lg font-bold text-foreground"> </p></div> <div class="rounded-md bg-muted/50 px-4 py-3"><p class="text-[0.625rem] font-semibold uppercase tracking-wide text-muted-foreground"> </p> <p class="mt-1 text-lg font-bold text-foreground"> </p></div></div> <div class="rounded-md bg-muted/50 px-4 py-2.5 text-sm text-muted-foreground"> <span class="font-semibold text-foreground"> </span></div></div></div>'),qG=P('<span class="rounded-full bg-emerald-500/10 px-3 py-1 text-xs font-semibold text-emerald-500">CONFIGURED</span>'),$G=P('<span class="rounded-full bg-muted px-3 py-1 text-xs font-semibold text-muted-foreground"> </span>'),GG=P('<span class="rounded-full bg-emerald-500/10 px-3 py-1 text-xs font-semibold text-emerald-500">ENABLED</span>'),HG=P('<span class="rounded-full bg-muted px-3 py-1 text-xs font-semibold text-muted-foreground"> </span>'),KG=P('<span class="rounded-full bg-amber-500/10 px-3 py-1 text-xs font-semibold text-amber-500"> </span>'),JG=P('<div class="px-4 py-3"><div class="flex items-center gap-2 text-xs text-amber-500"><!> </div></div>'),eH=P('<div class="rounded-lg border border-border bg-card"><div class="flex items-center gap-2 border-b border-border px-4 py-3"><!> <h3 class="text-sm font-semibold text-foreground"> </h3></div> <div class="divide-y divide-border"><div class="flex items-center justify-between px-4 py-3"><div class="flex items-center gap-2.5"><!> <span class="text-sm font-medium text-foreground"> </span></div> <!></div> <div class="flex items-center justify-between px-4 py-3"><div class="flex items-center gap-2.5"><!> <span class="text-sm font-medium text-foreground"> </span></div> <!></div> <!></div></div>'),tH=P('<div class="rounded-lg border border-border bg-card"><div class="flex items-center justify-between border-b border-border px-4 py-3"><h3 class="text-sm font-semibold text-foreground"> </h3> <!></div> <!></div> <!> <!>',1),nH=P('<div class="space-y-4"><!></div>');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('<div class="text-sm text-muted-foreground"> </div>'),sH=P('<div class="flex items-center gap-2 rounded-lg border border-emerald-200 bg-emerald-50 p-3 text-sm text-emerald-700 dark:border-emerald-800/50 dark:bg-emerald-950/30 dark:text-emerald-300"><!> <span><strong>scheduler-webhook</strong> </span></div>'),oH=P('<div class="flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300"><!> <span><strong>scheduler-webhook</strong> </span></div>'),aH=P("<!> ",1),lH=P('<div class="rounded-lg border border-border bg-card p-4"><h4 class="text-sm font-semibold text-foreground"> </h4> <p class="mt-1 text-sm text-muted-foreground">The <span class="inline-flex items-center rounded-md bg-red-600/10 px-2 py-0.5 text-[0.6875rem] font-medium text-red-700 dark:bg-red-500/15 dark:text-red-300">scheduler-webhook</span> </p> <div class="mt-3 flex items-center gap-3"><!> <span class="text-xs text-muted-foreground"> <code class="rounded bg-muted px-1.5 py-0.5 font-mono text-xs"> </code></span></div></div>');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('<button class="inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"><!></button>');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('<div class="space-y-4"><h4 class="text-sm font-semibold text-foreground"> </h4> <div><p class="mb-1.5 text-sm text-muted-foreground"> </p> <div class="flex items-start gap-2"><code class="block flex-1 overflow-x-auto whitespace-pre rounded-md bg-muted px-3 py-2.5 font-mono text-xs text-foreground"> </code> <!></div></div> <div><p class="mb-1.5 text-sm text-muted-foreground"> </p> <div class="flex items-start gap-2"><code class="block flex-1 overflow-x-auto whitespace-pre rounded-md bg-muted px-3 py-2.5 font-mono text-xs text-foreground"> </code> <!></div></div> <div><p class="mb-1.5 text-sm text-muted-foreground"> </p> <div class="flex items-start gap-2"><code class="block flex-1 overflow-x-auto whitespace-pre rounded-md bg-muted px-3 py-2.5 font-mono text-xs text-foreground"> </code> <!></div></div> <div><p class="mb-2 text-sm font-semibold text-foreground"> </p> <pre class="overflow-x-auto rounded-md bg-muted px-4 py-3 font-mono text-xs text-foreground"></pre></div></div>');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('<label class="text-sm font-semibold text-foreground"> </label>'),pH=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),OH=P("<div><!> <!></div>"),vH=P('<div class="rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive"> </div>'),bH=P('<div class="flex h-64 items-center justify-center rounded-lg border border-border bg-card text-sm text-muted-foreground"><span class="animate-pulse"> </span></div>'),yH=P('<div class="flex h-10 items-center justify-center rounded-lg border border-dashed border-border"><span class="text-xs text-muted-foreground"> </span></div>'),xH=P('<p class="text-xs font-medium text-destructive" data-field-error=""> </p>'),SH=P('<div class="space-y-2"><!> <!> <div></div> <!></div>');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('<div class="flex items-center gap-2 rounded-lg border border-blue-200 bg-blue-50 p-3 text-sm text-blue-700 dark:border-blue-800/50 dark:bg-blue-950/30 dark:text-blue-300"> </div>'),kH=P('<div class="flex items-center gap-2 rounded-lg border border-emerald-200 bg-emerald-50 p-3 text-sm text-emerald-700 dark:border-emerald-800/50 dark:bg-emerald-950/30 dark:text-emerald-300"> </div>'),_H=P('<div class="flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300"> </div>'),PH=P('<div class="absolute inset-0 z-10 rounded bg-background/50"></div>'),QH=P('<div class="space-y-4"><!> <div class="relative"><div class="space-y-5"></div> <!></div></div>');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)<Jx&&Math.abs(r)<Jx,s=i?0:WH(Math.atan2(r,n)*180/Math.PI),o=i?0:Math.sqrt(n*n+r*r);return e[0]=t[0],e[1]=o,e[2]=s,e}},tK={id:"display-p3-linear",toXYZ_M:XH,fromXYZ_M:ZH,toLMS_M:NH,fromLMS_M:VH},nK={id:"display-p3",base:tK,toBase:QT,fromBase:PT},sd=1.09929682680944,CT=.018053968510807,zm=t=>t<CT*4.5?t/4.5:Math.pow((t+sd-1)/sd,1/.45),Wm=t=>t>=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<s?6:0))/6;break;case i:c=((s-r)/l+2)/6;break;case s:c=((r-i)/l+4)/6;break}return{h:c*360,s:u*100,l:h*100}}function Tu(t,e,n){const r=e/100,i=n/100,s=i+r*Math.min(i,1-i),o=s===0?0:2*(1-i/s);return{h:t,s:o*100,v:s*100}}function eS(t,e,n){const r=e/100,i=n/100,s=i*(1-r/2),o=s===0||s===1?0:(i-s)/Math.min(s,1-s);return{h:t,s:o*100,l:s*100}}function Fi(t){if(aK(t))return t;const e=dK(t);if(e==="unknown")throw new Error(`invalid color provided: ${t}`);let n,r;if(e==="hsl"){const u=mK(t);if(!u)throw new Error(`invalid color provided: ${t}`);n=u.coords,r=n[3]??1}else if(e==="oklch"){const u=gK(t);if(!u)throw new Error(`invalid color provided: ${t}`);n=u.coords,r=n[3]??1}else{const u=e==="hex"&&!t.startsWith("#")?`#${t}`:t;n=KH(u).coords,r=n[3]??1}const i=e==="oklch"?n.slice(0,3):Sr(n.slice(0,3),ai,Xr),[s,o,a]=i,l=(u,h,d,m)=>{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 <HueyRoot>");return t}function RT(){document.body.style.userSelect="none"}function LT(){document.body.style.userSelect="unset"}var bK=P("<div></div>");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("<div><!></div>");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("<button><!></button>");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("<div></div>"),_K=P("<div></div>");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("<input/>");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("<HueyRoot> 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("<div><!></div>");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('<!> <div class="flex items-center gap-2"><!> <div class="flex-1 space-y-2"><!> <!></div></div> <div class="flex items-center gap-2"><span class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">Hex</span> <!></div> <!>',1),RK=P('<div class="huey-popover absolute left-0 top-full z-50 mt-1 w-[260px] space-y-3 rounded-xl border border-border bg-popover p-3 shadow-lg"><!></div>'),LK=P('<div class="relative inline-block w-full max-w-[260px]"><button type="button" class="flex h-10 w-full items-center gap-2 rounded-lg border border-input bg-muted/50 px-2 text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"><span class="h-6 w-6 shrink-0 rounded border border-border" aria-hidden="true"></span> <span class="flex-1 text-start font-mono text-foreground"> </span></button> <!></div>');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('<div class="flex items-center gap-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-1.5 text-xs dark:border-amber-700/60 dark:bg-amber-950/30"><!> <p class="text-amber-900 dark:text-amber-200"></p></div>');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('<span class="text-red-500">*</span>'),VK=P('<span class="inline-flex items-center gap-1.5 text-sm font-semibold text-foreground"> <!> <!></span>'),FK=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),jK=P('<div class="grid gap-1.5 lg:grid-cols-[minmax(0,1fr)_2fr] lg:items-start lg:gap-x-6"><div class="lg:pt-2.5"><!> <!></div> <div><!></div></div>'),BK=P('<div class="space-y-4"></div>'),zK=P("<div></div>"),WK=P('<div class="space-y-4"></div>'),YK=P('<div class="prose prose-sm dark:prose-invert max-w-none text-muted-foreground"></div>'),UK=P('<div class="text-sm text-muted-foreground"></div>'),qK=P('<span class="text-red-500">*</span>'),$K=P('<label class="inline-flex items-center gap-1.5 text-sm font-semibold text-foreground"> <!><!></label>'),GK=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),HK=P("<div><!> <!></div>"),KK=P('<span class="text-sm text-muted-foreground"> </span>'),JK=P('<div class="space-y-2"><!> <div class="flex items-center gap-3"><input type="range" class="h-2 flex-1 cursor-pointer appearance-none rounded-full bg-muted accent-primary"/> <span class="w-10 text-end font-mono text-sm font-medium text-foreground"> </span> <!></div></div>'),eJ=P("<div><!></div>"),tJ=P("<div><!></div>"),nJ=P("<div><!></div>"),rJ=P('<div class="space-y-2"><!> <!></div>'),iJ=P("<div><!></div>"),sJ=P("<div><!></div>"),oJ=P("<div><!></div>"),aJ=P('<span class="text-red-500">*</span>'),lJ=P('<p class="mt-0.5 ms-7 text-xs text-muted-foreground"></p>'),cJ=P(`<div><label class="flex cursor-pointer items-center gap-2.5"><input type="checkbox" class="h-[18px] w-[18px] shrink-0 appearance-none rounded border border-input bg-muted/50 checked:border-primary checked:bg-primary checked:bg-[url('data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22white%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.207%204.793a1%201%200%20010%201.414l-5%205a1%201%200%2001-1.414%200l-2-2a1%201%200%20011.414-1.414L6.5%209.086l4.293-4.293a1%201%200%20011.414%200z%22%2F%3E%3C%2Fsvg%3E')] checked:bg-no-repeat checked:bg-center"/> <span class="text-sm font-semibold text-foreground"> <!></span> <!></label> <!></div>`),uJ=P('<span class="text-red-500">*</span>'),hJ=P('<span class="inline-flex items-center gap-1.5 text-sm font-semibold text-foreground"> <!><!></span>'),dJ=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),fJ=P("<div><!> <!></div>"),mJ=P(`<label class="flex cursor-pointer items-center gap-2.5"><input type="checkbox" class="h-[18px] w-[18px] shrink-0 appearance-none rounded border border-input bg-muted/50 checked:border-primary checked:bg-primary checked:bg-[url('data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22white%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.207%204.793a1%201%200%20010%201.414l-5%205a1%201%200%2001-1.414%200l-2-2a1%201%200%20011.414-1.414L6.5%209.086l4.293-4.293a1%201%200%20011.414%200z%22%2F%3E%3C%2Fsvg%3E')] checked:bg-no-repeat checked:bg-center"/> <span class="text-sm text-foreground"> </span></label>`),gJ=P('<div class="space-y-2"><!> <div class="space-y-1.5"></div></div>'),pJ=P('<span class="text-red-500">*</span>'),OJ=P('<span class="inline-flex items-center gap-1.5 text-sm font-semibold text-foreground"> <!><!></span>'),vJ=P('<p class="mt-0.5 text-xs text-muted-foreground"></p>'),bJ=P("<div><!> <!></div>"),yJ=P('<label class="flex cursor-pointer items-center gap-2"><input type="radio" class="radio"/> <span class="text-sm text-muted-foreground"> </span></label>'),xJ=P('<div class="space-y-2"><!> <div class="space-y-1"></div></div>'),SJ=P("<div><!></div>"),wJ=P("<div><!></div>"),kJ=P("<div><!></div>"),_J=P("<div><!></div>"),PJ=P("<div><!></div>");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("<script")||ne.includes("<div id=")})()),D=new Set(["text","email","url","tel","password","number","date","time","month","week","color"]);var I=_e(),X=me(I);{var L=ne=>{},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<ut.length;rt++)st.push(...gt(ut[rt].fields,S));const pt=ut.map(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('<div class="space-y-4"></div>');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(;m<u.length;){const g=u[m];if(h.has(g.type)&&!g.fields?.length){const p=[];let O=m+1;for(;O<u.length&&!h.has(u[O].type);)p.push(u[O]),O++;p.length>0?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;p<d.length-1;p++)(!g[d[p]]||typeof g[d[p]]!="object")&&(g[d[p]]={}),g[d[p]]={...g[d[p]]},g=g[d[p]];g[d[d.length-1]]=h,e.onchange?.(u,h)}function l(u,h,d){e.oncommit?.(u,h,d)}var c=QJ();Ue(c,21,()=>f(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};
|