diff --git a/ui/dist/assets/AuthMethodsDocs-6ea6a435.js b/ui/dist/assets/AuthMethodsDocs-595e4af6.js similarity index 98% rename from ui/dist/assets/AuthMethodsDocs-6ea6a435.js rename to ui/dist/assets/AuthMethodsDocs-595e4af6.js index 5442e179..b7d1b1f7 100644 --- a/ui/dist/assets/AuthMethodsDocs-6ea6a435.js +++ b/ui/dist/assets/AuthMethodsDocs-595e4af6.js @@ -1,4 +1,4 @@ -import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as me,f as k,g as h,h as n,m as _e,x as G,O as re,P as we,k as ve,Q as Ce,n as Pe,t as L,a as Y,o as m,d as pe,R as Me,C as Se,p as $e,r as H,u as je,N as Ae}from"./index-0b562d0f.js";import{S as Be}from"./SdkTabs-69545b17.js";function ue(a,l,o){const s=a.slice();return s[5]=l[o],s}function de(a,l,o){const s=a.slice();return s[5]=l[o],s}function fe(a,l){let o,s=l[5].code+"",_,f,i,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){o=r("button"),_=b(s),f=g(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(v,C){h(v,o,C),n(o,_),n(o,f),i||(u=je(o,"click",d),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&G(_,s),C&6&&H(o,"active",l[1]===l[5].code)},d(v){v&&m(o),i=!1,u()}}}function he(a,l){let o,s,_,f;return s=new Ae({props:{content:l[5].body}}),{key:a,first:null,c(){o=r("div"),me(s.$$.fragment),_=g(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(i,u){h(i,o,u),_e(s,o,null),n(o,_),f=!0},p(i,u){l=i;const d={};u&4&&(d.content=l[5].body),s.$set(d),(!f||u&6)&&H(o,"active",l[1]===l[5].code)},i(i){f||(L(s.$$.fragment,i),f=!0)},o(i){Y(s.$$.fragment,i),f=!1},d(i){i&&m(o),pe(s)}}}function Oe(a){var ae,ne;let l,o,s=a[0].name+"",_,f,i,u,d,v,C,F=a[0].name+"",U,R,q,P,D,j,W,M,K,X,Q,A,Z,V,y=a[0].name+"",E,x,I,B,J,S,O,w=[],ee=new Map,te,T,p=[],le=new Map,$;P=new Be({props:{js:` +import{S as ke,i as be,s as ge,e as r,w as b,b as g,c as me,f as k,g as h,h as n,m as _e,x as G,O as re,P as we,k as ve,Q as Ce,n as Pe,t as L,a as Y,o as m,d as pe,R as Me,C as Se,p as $e,r as H,u as je,N as Ae}from"./index-4bd199fb.js";import{S as Be}from"./SdkTabs-fc1a80c5.js";function ue(a,l,o){const s=a.slice();return s[5]=l[o],s}function de(a,l,o){const s=a.slice();return s[5]=l[o],s}function fe(a,l){let o,s=l[5].code+"",_,f,i,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){o=r("button"),_=b(s),f=g(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(v,C){h(v,o,C),n(o,_),n(o,f),i||(u=je(o,"click",d),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&G(_,s),C&6&&H(o,"active",l[1]===l[5].code)},d(v){v&&m(o),i=!1,u()}}}function he(a,l){let o,s,_,f;return s=new Ae({props:{content:l[5].body}}),{key:a,first:null,c(){o=r("div"),me(s.$$.fragment),_=g(),k(o,"class","tab-item"),H(o,"active",l[1]===l[5].code),this.first=o},m(i,u){h(i,o,u),_e(s,o,null),n(o,_),f=!0},p(i,u){l=i;const d={};u&4&&(d.content=l[5].body),s.$set(d),(!f||u&6)&&H(o,"active",l[1]===l[5].code)},i(i){f||(L(s.$$.fragment,i),f=!0)},o(i){Y(s.$$.fragment,i),f=!1},d(i){i&&m(o),pe(s)}}}function Oe(a){var ae,ne;let l,o,s=a[0].name+"",_,f,i,u,d,v,C,F=a[0].name+"",U,R,q,P,D,j,W,M,K,X,Q,A,Z,V,y=a[0].name+"",E,x,I,B,J,S,O,w=[],ee=new Map,te,T,p=[],le=new Map,$;P=new Be({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/AuthRefreshDocs-eb689dcf.js b/ui/dist/assets/AuthRefreshDocs-532845f5.js similarity index 98% rename from ui/dist/assets/AuthRefreshDocs-eb689dcf.js rename to ui/dist/assets/AuthRefreshDocs-532845f5.js index 2974dbad..cd9ffdac 100644 --- a/ui/dist/assets/AuthRefreshDocs-eb689dcf.js +++ b/ui/dist/assets/AuthRefreshDocs-532845f5.js @@ -1,4 +1,4 @@ -import{S as ze,i as Ue,s as je,N as Ve,e as a,w as k,b as p,c as ae,f as b,g as c,h as o,m as ne,x as re,O as qe,P as xe,k as Je,Q as Ke,n as Qe,t as U,a as j,o as d,d as ie,R as Ie,C as He,p as We,r as x,u as Ge}from"./index-0b562d0f.js";import{S as Xe}from"./SdkTabs-69545b17.js";function Ee(r,l,s){const n=r.slice();return n[5]=l[s],n}function Fe(r,l,s){const n=r.slice();return n[5]=l[s],n}function Le(r,l){let s,n=l[5].code+"",m,_,i,f;function v(){return l[4](l[5])}return{key:r,first:null,c(){s=a("button"),m=k(n),_=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(g,w){c(g,s,w),o(s,m),o(s,_),i||(f=Ge(s,"click",v),i=!0)},p(g,w){l=g,w&4&&n!==(n=l[5].code+"")&&re(m,n),w&6&&x(s,"active",l[1]===l[5].code)},d(g){g&&d(s),i=!1,f()}}}function Ne(r,l){let s,n,m,_;return n=new Ve({props:{content:l[5].body}}),{key:r,first:null,c(){s=a("div"),ae(n.$$.fragment),m=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(i,f){c(i,s,f),ne(n,s,null),o(s,m),_=!0},p(i,f){l=i;const v={};f&4&&(v.content=l[5].body),n.$set(v),(!_||f&6)&&x(s,"active",l[1]===l[5].code)},i(i){_||(U(n.$$.fragment,i),_=!0)},o(i){j(n.$$.fragment,i),_=!1},d(i){i&&d(s),ie(n)}}}function Ye(r){var Be,Me;let l,s,n=r[0].name+"",m,_,i,f,v,g,w,B,J,S,F,ce,L,M,de,K,N=r[0].name+"",Q,ue,pe,V,I,D,W,T,G,fe,X,C,Y,he,Z,be,h,me,P,_e,ke,ve,ee,ge,te,ye,Se,$e,oe,we,le,O,se,R,q,$=[],Te=new Map,Ce,H,y=[],Re=new Map,A;g=new Xe({props:{js:` +import{S as ze,i as Ue,s as je,N as Ve,e as a,w as k,b as p,c as ae,f as b,g as c,h as o,m as ne,x as re,O as qe,P as xe,k as Je,Q as Ke,n as Qe,t as U,a as j,o as d,d as ie,R as Ie,C as He,p as We,r as x,u as Ge}from"./index-4bd199fb.js";import{S as Xe}from"./SdkTabs-fc1a80c5.js";function Ee(r,l,s){const n=r.slice();return n[5]=l[s],n}function Fe(r,l,s){const n=r.slice();return n[5]=l[s],n}function Le(r,l){let s,n=l[5].code+"",m,_,i,f;function v(){return l[4](l[5])}return{key:r,first:null,c(){s=a("button"),m=k(n),_=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(g,w){c(g,s,w),o(s,m),o(s,_),i||(f=Ge(s,"click",v),i=!0)},p(g,w){l=g,w&4&&n!==(n=l[5].code+"")&&re(m,n),w&6&&x(s,"active",l[1]===l[5].code)},d(g){g&&d(s),i=!1,f()}}}function Ne(r,l){let s,n,m,_;return n=new Ve({props:{content:l[5].body}}),{key:r,first:null,c(){s=a("div"),ae(n.$$.fragment),m=p(),b(s,"class","tab-item"),x(s,"active",l[1]===l[5].code),this.first=s},m(i,f){c(i,s,f),ne(n,s,null),o(s,m),_=!0},p(i,f){l=i;const v={};f&4&&(v.content=l[5].body),n.$set(v),(!_||f&6)&&x(s,"active",l[1]===l[5].code)},i(i){_||(U(n.$$.fragment,i),_=!0)},o(i){j(n.$$.fragment,i),_=!1},d(i){i&&d(s),ie(n)}}}function Ye(r){var Be,Me;let l,s,n=r[0].name+"",m,_,i,f,v,g,w,B,J,S,F,ce,L,M,de,K,N=r[0].name+"",Q,ue,pe,V,I,D,W,T,G,fe,X,C,Y,he,Z,be,h,me,P,_e,ke,ve,ee,ge,te,ye,Se,$e,oe,we,le,O,se,R,q,$=[],Te=new Map,Ce,H,y=[],Re=new Map,A;g=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-f0e2b261.js b/ui/dist/assets/AuthWithOAuth2Docs-80206fc8.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-f0e2b261.js rename to ui/dist/assets/AuthWithOAuth2Docs-80206fc8.js index a60c0ad0..dab2db50 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-f0e2b261.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-80206fc8.js @@ -1,4 +1,4 @@ -import{S as je,i as He,s as Je,N as We,e as s,w as v,b as p,c as re,f as h,g as r,h as a,m as ce,x as de,O as Ve,P as Ne,k as Qe,Q as ze,n as Ke,t as j,a as H,o as c,d as ue,R as Ye,C as Be,p as Ge,r as J,u as Xe}from"./index-0b562d0f.js";import{S as Ze}from"./SdkTabs-69545b17.js";function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function Le(i,l,o){const n=i.slice();return n[5]=l[o],n}function xe(i,l){let o,n=l[5].code+"",m,_,d,b;function g(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=v(n),_=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(k,R){r(k,o,R),a(o,m),a(o,_),d||(b=Xe(o,"click",g),d=!0)},p(k,R){l=k,R&4&&n!==(n=l[5].code+"")&&de(m,n),R&6&&J(o,"active",l[1]===l[5].code)},d(k){k&&c(o),d=!1,b()}}}function Me(i,l){let o,n,m,_;return n=new We({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),re(n.$$.fragment),m=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),ce(n,o,null),a(o,m),_=!0},p(d,b){l=d;const g={};b&4&&(g.content=l[5].body),n.$set(g),(!_||b&6)&&J(o,"active",l[1]===l[5].code)},i(d){_||(j(n.$$.fragment,d),_=!0)},o(d){H(n.$$.fragment,d),_=!1},d(d){d&&c(o),ue(n)}}}function et(i){var qe,Ie;let l,o,n=i[0].name+"",m,_,d,b,g,k,R,C,N,y,L,pe,x,D,he,Q,M=i[0].name+"",z,be,K,q,Y,I,G,P,X,O,Z,fe,ee,$,te,me,ae,_e,f,ve,E,ge,ke,we,le,Se,oe,Re,ye,Oe,se,$e,ne,U,ie,A,V,S=[],Ae=new Map,Ee,B,w=[],Te=new Map,T;k=new Ze({props:{js:` +import{S as je,i as He,s as Je,N as We,e as s,w as v,b as p,c as re,f as h,g as r,h as a,m as ce,x as de,O as Ve,P as Ne,k as Qe,Q as ze,n as Ke,t as j,a as H,o as c,d as ue,R as Ye,C as Be,p as Ge,r as J,u as Xe}from"./index-4bd199fb.js";import{S as Ze}from"./SdkTabs-fc1a80c5.js";function Fe(i,l,o){const n=i.slice();return n[5]=l[o],n}function Le(i,l,o){const n=i.slice();return n[5]=l[o],n}function xe(i,l){let o,n=l[5].code+"",m,_,d,b;function g(){return l[4](l[5])}return{key:i,first:null,c(){o=s("button"),m=v(n),_=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(k,R){r(k,o,R),a(o,m),a(o,_),d||(b=Xe(o,"click",g),d=!0)},p(k,R){l=k,R&4&&n!==(n=l[5].code+"")&&de(m,n),R&6&&J(o,"active",l[1]===l[5].code)},d(k){k&&c(o),d=!1,b()}}}function Me(i,l){let o,n,m,_;return n=new We({props:{content:l[5].body}}),{key:i,first:null,c(){o=s("div"),re(n.$$.fragment),m=p(),h(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(d,b){r(d,o,b),ce(n,o,null),a(o,m),_=!0},p(d,b){l=d;const g={};b&4&&(g.content=l[5].body),n.$set(g),(!_||b&6)&&J(o,"active",l[1]===l[5].code)},i(d){_||(j(n.$$.fragment,d),_=!0)},o(d){H(n.$$.fragment,d),_=!1},d(d){d&&c(o),ue(n)}}}function et(i){var qe,Ie;let l,o,n=i[0].name+"",m,_,d,b,g,k,R,C,N,y,L,pe,x,D,he,Q,M=i[0].name+"",z,be,K,q,Y,I,G,P,X,O,Z,fe,ee,$,te,me,ae,_e,f,ve,E,ge,ke,we,le,Se,oe,Re,ye,Oe,se,$e,ne,U,ie,A,V,S=[],Ae=new Map,Ee,B,w=[],Te=new Map,T;k=new Ze({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[3]}'); diff --git a/ui/dist/assets/AuthWithPasswordDocs-473d27cf.js b/ui/dist/assets/AuthWithPasswordDocs-1ef47ee7.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-473d27cf.js rename to ui/dist/assets/AuthWithPasswordDocs-1ef47ee7.js index 15c8d480..2dfe833b 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-473d27cf.js +++ b/ui/dist/assets/AuthWithPasswordDocs-1ef47ee7.js @@ -1,4 +1,4 @@ -import{S as Se,i as ve,s as we,N as ke,e as s,w as f,b as u,c as Ot,f as h,g as r,h as o,m as At,x as Tt,O as ce,P as ye,k as ge,Q as Pe,n as Re,t as tt,a as et,o as c,d as Ut,R as $e,C as de,p as Ce,r as lt,u as Oe}from"./index-0b562d0f.js";import{S as Ae}from"./SdkTabs-69545b17.js";function ue(n,e,l){const i=n.slice();return i[8]=e[l],i}function fe(n,e,l){const i=n.slice();return i[8]=e[l],i}function Te(n){let e;return{c(){e=f("email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Ue(n){let e;return{c(){e=f("username")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Me(n){let e;return{c(){e=f("username/email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function pe(n){let e;return{c(){e=s("strong"),e.textContent="username"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function be(n){let e;return{c(){e=f("or")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function me(n){let e;return{c(){e=s("strong"),e.textContent="email"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function he(n,e){let l,i=e[8].code+"",S,m,p,d;function _(){return e[7](e[8])}return{key:n,first:null,c(){l=s("button"),S=f(i),m=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m($,C){r($,l,C),o(l,S),o(l,m),p||(d=Oe(l,"click",_),p=!0)},p($,C){e=$,C&16&&i!==(i=e[8].code+"")&&Tt(S,i),C&24&<(l,"active",e[3]===e[8].code)},d($){$&&c(l),p=!1,d()}}}function _e(n,e){let l,i,S,m;return i=new ke({props:{content:e[8].body}}),{key:n,first:null,c(){l=s("div"),Ot(i.$$.fragment),S=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m(p,d){r(p,l,d),At(i,l,null),o(l,S),m=!0},p(p,d){e=p;const _={};d&16&&(_.content=e[8].body),i.$set(_),(!m||d&24)&<(l,"active",e[3]===e[8].code)},i(p){m||(tt(i.$$.fragment,p),m=!0)},o(p){et(i.$$.fragment,p),m=!1},d(p){p&&c(l),Ut(i)}}}function De(n){var se,ne;let e,l,i=n[0].name+"",S,m,p,d,_,$,C,O,B,Mt,ot,T,at,F,st,U,G,Dt,X,N,Et,nt,Z=n[0].name+"",it,Wt,rt,I,ct,M,dt,Lt,V,D,ut,Bt,ft,Ht,g,Yt,pt,bt,mt,qt,ht,_t,j,kt,E,St,Ft,vt,W,wt,Nt,yt,It,k,Vt,H,jt,Jt,Qt,gt,Kt,Pt,zt,Gt,Xt,Rt,Zt,$t,J,Ct,L,Q,A=[],xt=new Map,te,K,P=[],ee=new Map,Y;function le(t,a){if(t[1]&&t[2])return Me;if(t[1])return Ue;if(t[2])return Te}let q=le(n),R=q&&q(n);T=new Ae({props:{js:` +import{S as Se,i as ve,s as we,N as ke,e as s,w as f,b as u,c as Ot,f as h,g as r,h as o,m as At,x as Tt,O as ce,P as ye,k as ge,Q as Pe,n as Re,t as tt,a as et,o as c,d as Ut,R as $e,C as de,p as Ce,r as lt,u as Oe}from"./index-4bd199fb.js";import{S as Ae}from"./SdkTabs-fc1a80c5.js";function ue(n,e,l){const i=n.slice();return i[8]=e[l],i}function fe(n,e,l){const i=n.slice();return i[8]=e[l],i}function Te(n){let e;return{c(){e=f("email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Ue(n){let e;return{c(){e=f("username")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Me(n){let e;return{c(){e=f("username/email")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function pe(n){let e;return{c(){e=s("strong"),e.textContent="username"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function be(n){let e;return{c(){e=f("or")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function me(n){let e;return{c(){e=s("strong"),e.textContent="email"},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function he(n,e){let l,i=e[8].code+"",S,m,p,d;function _(){return e[7](e[8])}return{key:n,first:null,c(){l=s("button"),S=f(i),m=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m($,C){r($,l,C),o(l,S),o(l,m),p||(d=Oe(l,"click",_),p=!0)},p($,C){e=$,C&16&&i!==(i=e[8].code+"")&&Tt(S,i),C&24&<(l,"active",e[3]===e[8].code)},d($){$&&c(l),p=!1,d()}}}function _e(n,e){let l,i,S,m;return i=new ke({props:{content:e[8].body}}),{key:n,first:null,c(){l=s("div"),Ot(i.$$.fragment),S=u(),h(l,"class","tab-item"),lt(l,"active",e[3]===e[8].code),this.first=l},m(p,d){r(p,l,d),At(i,l,null),o(l,S),m=!0},p(p,d){e=p;const _={};d&16&&(_.content=e[8].body),i.$set(_),(!m||d&24)&<(l,"active",e[3]===e[8].code)},i(p){m||(tt(i.$$.fragment,p),m=!0)},o(p){et(i.$$.fragment,p),m=!1},d(p){p&&c(l),Ut(i)}}}function De(n){var se,ne;let e,l,i=n[0].name+"",S,m,p,d,_,$,C,O,B,Mt,ot,T,at,F,st,U,G,Dt,X,N,Et,nt,Z=n[0].name+"",it,Wt,rt,I,ct,M,dt,Lt,V,D,ut,Bt,ft,Ht,g,Yt,pt,bt,mt,qt,ht,_t,j,kt,E,St,Ft,vt,W,wt,Nt,yt,It,k,Vt,H,jt,Jt,Qt,gt,Kt,Pt,zt,Gt,Xt,Rt,Zt,$t,J,Ct,L,Q,A=[],xt=new Map,te,K,P=[],ee=new Map,Y;function le(t,a){if(t[1]&&t[2])return Me;if(t[1])return Ue;if(t[2])return Te}let q=le(n),R=q&&q(n);T=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[6]}'); diff --git a/ui/dist/assets/CodeEditor-26a8b39e.js b/ui/dist/assets/CodeEditor-26a8b39e.js deleted file mode 100644 index 169ac719..00000000 --- a/ui/dist/assets/CodeEditor-26a8b39e.js +++ /dev/null @@ -1,14 +0,0 @@ -import{S as dt,i as $t,s as gt,e as Pt,f as mt,T as I,g as bt,y as GO,o as Xt,I as Zt,J as yt,K as xt,L as kt,C as vt,M as Yt}from"./index-0b562d0f.js";import{P as wt,N as Tt,u as Wt,D as Vt,v as vO,T as B,I as YO,w as rO,x as l,y as Ut,L as iO,z as sO,A as R,B as nO,F as ke,G as lO,H as _,J as ve,K as Ye,M as we,E as w,O as z,Q as _t,R as Ct,U as Te,V as b,W as qt,X as jt,a as C,h as Gt,b as Rt,c as zt,d as At,e as It,s as Et,t as Nt,f as Bt,g as Dt,r as Lt,i as Jt,k as Mt,j as Ht,l as Ft,m as Kt,n as Oa,o as ea,p as ta,q as RO,C as E}from"./index-96653a6b.js";class M{constructor(O,a,t,r,i,s,n,o,Q,p=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=i,this.score=s,this.buffer=n,this.bufferBase=o,this.curContext=Q,this.lookAhead=p,this.parent=c}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new M(O,[],a,t,t,0,[],0,r?new zO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:i}=this.p,s=i.dynamicPrecedence(r);if(s&&(this.score+=s),t==0){this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(o==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,o)}storeNode(O,a,t,r=4,i=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[n-4]==0&&s.buffer[n-1]>-1){if(a==t)return;if(s.buffer[n-2]>=a){s.buffer[n-2]=t;return}}}if(!i||this.pos==t)this.buffer.push(O,a,t,r);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>t;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=O,this.buffer[s+1]=a,this.buffer[s+2]=t,this.buffer[s+3]=r}}shift(O,a,t){let r=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=t,this.shiftContext(a,r),a<=this.p.parser.maxNode&&this.buffer.push(a,r,t,4);else{let i=O,{parser:s}=this.p;(t>this.pos||a<=s.maxNode)&&(this.pos=t,s.stateFlag(i,1)||(this.reducePos=t)),this.pushState(i,r),this.shiftContext(a,r),a<=s.maxNode&&this.buffer.push(a,r,t,4)}}apply(O,a,t){O&65536?this.reduce(O):this.shift(O,a,t)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new M(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new aa(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>4<<1||this.stack.length>=120){let r=[];for(let i=0,s;io&1&&n==s)||r.push(a[i],s)}a=r}let t=[];for(let r=0;r>19,r=O&65535,i=this.stack.length-t*3;if(i<0||a.getGoto(this.stack[i],r,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(O),!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:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class zO{constructor(O,a){this.tracker=O,this.context=a,this.hash=O.strict?O.hash(a):0}}var AO;(function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth",e[e.MinBigReduction=2e3]="MinBigReduction"})(AO||(AO={}));class aa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let a=O&65535,t=O>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class H{constructor(O,a,t){this.stack=O,this.pos=a,this.index=t,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,a=O.bufferBase+O.buffer.length){return new H(O,a,a-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.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 H(this.stack,this.pos,this.index)}}function G(e,O=Uint16Array){if(typeof e!="string")return e;let a=null;for(let t=0,r=0;t=92&&s--,s>=34&&s--;let o=s-32;if(o>=46&&(o-=46,n=!0),i+=o,n)break;i*=46}a?a[r++]=i:a=new O(i)}return a}class D{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const IO=new D;class ra{constructor(O,a){this.input=O,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=IO,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(O,a){let t=this.range,r=this.rangeIndex,i=this.pos+O;for(;it.to:i>=t.to;){if(r==this.ranges.length-1)return null;let s=this.ranges[++r];i+=s.from-t.to,t=s}return i}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,a.from);return this.end}peek(O){let a=this.chunkOff+O,t,r;if(a>=0&&a=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(O,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,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(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,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(O,a){if(a?(this.token=a,a.start=O,a.lookAhead=O+1,a.value=a.extended=-1):this.token=IO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,a-this.chunkPos);if(O>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,a-this.chunk2Pos);if(O>=this.range.from&&a<=this.range.to)return this.input.read(O,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>O&&(t+=this.input.read(Math.max(r.from,O),Math.min(r.to,a)))}return t}}class V{constructor(O,a){this.data=O,this.id=a}token(O,a){let{parser:t}=a.p;We(this.data,O,a,this.id,t.data,t.tokenPrecTable)}}V.prototype.contextual=V.prototype.fallback=V.prototype.extend=!1;class bO{constructor(O,a,t){this.precTable=a,this.elseToken=t,this.data=typeof O=="string"?G(O):O}token(O,a){let t=O.pos,r;for(;r=O.pos,We(this.data,O,a,0,this.data,this.precTable),!(O.token.value>-1);){if(this.elseToken==null)return;if(O.next<0)break;O.advance(),O.reset(r+1,O.token)}r>t&&(O.reset(t,O.token),O.acceptToken(this.elseToken,r-t))}}bO.prototype.contextual=V.prototype.fallback=V.prototype.extend=!1;class Z{constructor(O,a={}){this.token=O,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function We(e,O,a,t,r,i){let s=0,n=1<0){let f=e[h];if(o.allows(f)&&(O.token.value==-1||O.token.value==f||ia(f,O.token.value,r,i))){O.acceptToken(f);break}}let p=O.next,c=0,u=e[s+2];if(O.next<0&&u>c&&e[Q+u*3-3]==65535&&e[Q+u*3-3]==65535){s=e[Q+u*3-1];continue O}for(;c>1,f=Q+h+(h<<1),P=e[f],$=e[f+1]||65536;if(p=$)c=h+1;else{s=e[f+2],O.advance();continue O}}break}}function EO(e,O,a){for(let t=O,r;(r=e[t])!=65535;t++)if(r==a)return t-O;return-1}function ia(e,O,a,t){let r=EO(a,t,O);return r<0||EO(a,t,e)O)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,O-25)):Math.min(e.length,Math.max(t.from+1,O+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:e.length}}class sa{constructor(O,a){this.fragments=O,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?BO(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?BO(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=s,null;if(i instanceof B){if(s==O){if(s=Math.max(this.safeFrom,O)&&(this.trees.push(i),this.start.push(s),this.index.push(0))}else this.index[a]++,this.nextStart=s+i.length}}}class na{constructor(O,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(t=>new D)}getActions(O){let a=0,t=null,{parser:r}=O.p,{tokenizers:i}=r,s=r.stateSlot(O.state,3),n=O.curContext?O.curContext.hash:0,o=0;for(let Q=0;Qc.end+25&&(o=Math.max(c.lookAhead,o)),c.value!=0)){let u=a;if(c.extended>-1&&(a=this.addActions(O,c.extended,c.end,a)),a=this.addActions(O,c.value,c.end,a),!p.extend&&(t=c,a>u))break}}for(;this.actions.length>a;)this.actions.pop();return o&&O.setLookAhead(o),!t&&O.pos==this.stream.end&&(t=new D,t.value=O.p.parser.eofTerm,t.start=t.end=O.pos,a=this.addActions(O,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let a=new D,{pos:t,p:r}=O;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(O,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,O),t),O.value>-1){let{parser:i}=t.p;for(let s=0;s=0&&t.p.parser.dialect.allows(n>>1)){n&1?O.extended=n>>1:O.value=n>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,a,t,r){for(let i=0;iO.bufferLength*4?new sa(t,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,a=this.minStackPos,t=this.stacks=[],r,i;if(this.bigReductionCount>300&&O.length==1){let[s]=O;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sa)t.push(n);else{if(this.advanceStack(n,t,O))continue;{r||(r=[],i=[]),r.push(n);let o=this.tokens.getMainToken(n);i.push(o.value,o.end)}}break}}if(!t.length){let s=r&&Qa(r);if(s)return this.stackToTree(s);if(this.parser.strict)throw X&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let s=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,t);if(s)return this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(t.length>s)for(t.sort((n,o)=>o.score-n.score);t.length>s;)t.pop();t.some(n=>n.reducePos>a)&&this.recovering--}else if(t.length>1){O:for(let s=0;s500&&Q.buffer.length>500)if((n.score-Q.score||n.buffer.length-Q.buffer.length)>0)t.splice(o--,1);else{t.splice(s--,1);continue O}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,p=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let u=this.parser.nodeSet.types[c.type.id]==c.type?i.getGoto(O.state,c.type.id):-1;if(u>-1&&c.length&&(!Q||(c.prop(vO.contextHash)||0)==p))return O.useNode(c,u),X&&console.log(s+this.stackID(O)+` (via reuse of ${i.getName(c.type.id)})`),!0;if(!(c instanceof B)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof B&&c.positions[0]==0)c=h;else break}}let n=i.stateSlot(O.state,4);if(n>0)return O.reduce(n),X&&console.log(s+this.stackID(O)+` (via always-reduce ${i.getName(n&65535)})`),!0;if(O.stack.length>=15e3)for(;O.stack.length>9e3&&O.forceReduce(););let o=this.tokens.getActions(O);for(let Q=0;Qr?a.push(f):t.push(f)}return!1}advanceFully(O,a){let t=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>t)return LO(O,a),!0}}runRecovery(O,a,t){let r=null,i=!1;for(let s=0;s ":"";if(n.deadEnd&&(i||(i=!0,n.restart(),X&&console.log(p+this.stackID(n)+" (restarted)"),this.advanceFully(n,t))))continue;let c=n.split(),u=p;for(let h=0;c.forceReduce()&&h<10&&(X&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));h++)X&&(u=this.stackID(c)+" -> ");for(let h of n.recoverByInsert(o))X&&console.log(p+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,t);this.stream.end>n.pos?(Q==n.pos&&(Q++,o=0),n.recoverByDelete(o,Q),X&&console.log(p+this.stackID(n)+` (via recover-delete ${this.parser.getName(o)})`),LO(n,t)):(!r||r.scoree;class Ve{constructor(O){this.start=O.start,this.shift=O.shift||pO,this.reduce=O.reduce||pO,this.reuse=O.reuse||pO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class T extends wt{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (${14})`);let a=O.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let n=0;nO.topRules[n][1]),r=[];for(let n=0;n=0)i(p,o,n[Q++]);else{let c=n[Q+-p];for(let u=-p;u>0;u--)i(n[Q++],o,c);Q++}}}this.nodeSet=new Tt(a.map((n,o)=>Wt.define({name:o>=this.minRepeatTerm?void 0:n,id:o,props:r[o],top:t.indexOf(o)>-1,error:o==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(o)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Vt;let s=G(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;ntypeof n=="number"?new V(s,n):n),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,a,t){let r=new la(this,O,a,t);for(let i of this.wrappers)r=i(r,O,a,t);return r}getGoto(O,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let i=r[a+1];;){let s=r[i++],n=s&1,o=r[i++];if(n&&t)return o;for(let Q=i+(s>>1);i0}validAction(O,a){if(a==this.stateSlot(O,4))return!0;for(let t=this.stateSlot(O,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=y(this.data,t+2);else return!1;if(a==y(this.data,t+1))return!0}}nextStates(O){let a=[];for(let t=this.stateSlot(O,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=y(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((i,s)=>s&1&&i==r)||a.push(this.data[t],r)}}return a}configure(O){let a=Object.assign(Object.create(T.prototype),this);if(O.props&&(a.nodeSet=this.nodeSet.extend(...O.props)),O.top){let t=this.topRules[O.top];if(!t)throw new RangeError(`Invalid top rule name ${O.top}`);a.top=t}return O.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=O.tokenizers.find(i=>i.from==t);return r?r.to:t})),O.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let i=O.specializers.find(n=>n.from==t.external);if(!i)return t;let s=Object.assign(Object.assign({},t),{external:i.to});return a.specializers[r]=JO(s),s})),O.contextTracker&&(a.context=O.contextTracker),O.dialect&&(a.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(a.strict=O.strict),O.wrap&&(a.wrappers=a.wrappers.concat(O.wrap)),O.bufferLength!=null&&(a.bufferLength=O.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let a=this.dynamicPrecedences;return a==null?0:a[O]||0}parseDialect(O){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(O)for(let i of O.split(" ")){let s=a.indexOf(i);s>=0&&(t[s]=!0)}let r=null;for(let i=0;it)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.scoree.external(a,t)<<1|O}return e.get}const ca=54,ha=1,pa=55,ua=2,Sa=56,fa=3,MO=4,da=5,F=6,Ue=7,_e=8,Ce=9,qe=10,$a=11,ga=12,Pa=13,uO=57,ma=14,HO=58,ba=20,Xa=22,je=23,Za=24,XO=26,Ge=27,ya=28,xa=31,ka=34,Re=36,va=37,Ya=0,wa=1,Ta={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},Wa={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},FO={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 Va(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function ze(e){return e==9||e==10||e==13||e==32}let KO=null,Oe=null,ee=0;function ZO(e,O){let a=e.pos+O;if(ee==a&&Oe==e)return KO;let t=e.peek(O);for(;ze(t);)t=e.peek(++O);let r="";for(;Va(t);)r+=String.fromCharCode(t),t=e.peek(++O);return Oe=e,ee=a,KO=r?r.toLowerCase():t==Ua||t==_a?void 0:null}const Ae=60,K=62,wO=47,Ua=63,_a=33,Ca=45;function te(e,O){this.name=e,this.parent=O,this.hash=O?O.hash:0;for(let a=0;a-1?new te(ZO(t,1)||"",e):e},reduce(e,O){return O==ba&&e?e.parent:e},reuse(e,O,a,t){let r=O.type.id;return r==F||r==Re?new te(ZO(t,1)||"",e):e},hash(e){return e?e.hash:0},strict:!1}),Ga=new Z((e,O)=>{if(e.next!=Ae){e.next<0&&O.context&&e.acceptToken(uO);return}e.advance();let a=e.next==wO;a&&e.advance();let t=ZO(e,0);if(t===void 0)return;if(!t)return e.acceptToken(a?ma:F);let r=O.context?O.context.name:null;if(a){if(t==r)return e.acceptToken($a);if(r&&Wa[r])return e.acceptToken(uO,-2);if(O.dialectEnabled(Ya))return e.acceptToken(ga);for(let i=O.context;i;i=i.parent)if(i.name==t)return;e.acceptToken(Pa)}else{if(t=="script")return e.acceptToken(Ue);if(t=="style")return e.acceptToken(_e);if(t=="textarea")return e.acceptToken(Ce);if(Ta.hasOwnProperty(t))return e.acceptToken(qe);r&&FO[r]&&FO[r][t]?e.acceptToken(uO,-1):e.acceptToken(F)}},{contextual:!0}),Ra=new Z(e=>{for(let O=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(HO);break}if(e.next==Ca)O++;else if(e.next==K&&O>=2){a>3&&e.acceptToken(HO,-2);break}else O=0;e.advance()}});function za(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Aa=new Z((e,O)=>{if(e.next==wO&&e.peek(1)==K){let a=O.dialectEnabled(wa)||za(O.context);e.acceptToken(a?da:MO,2)}else e.next==K&&e.acceptToken(MO,1)});function TO(e,O,a){let t=2+e.length;return new Z(r=>{for(let i=0,s=0,n=0;;n++){if(r.next<0){n&&r.acceptToken(O);break}if(i==0&&r.next==Ae||i==1&&r.next==wO||i>=2&&is?r.acceptToken(O,-s):r.acceptToken(a,-(s-2));break}else if((r.next==10||r.next==13)&&n){r.acceptToken(O,1);break}else i=s=0;r.advance()}})}const Ia=TO("script",ca,ha),Ea=TO("style",pa,ua),Na=TO("textarea",Sa,fa),Ba=rO({"Text RawText":l.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":l.angleBracket,TagName:l.tagName,"MismatchedCloseTag/TagName":[l.tagName,l.invalid],AttributeName:l.attributeName,"AttributeValue UnquotedAttributeValue":l.attributeValue,Is:l.definitionOperator,"EntityReference CharacterReference":l.character,Comment:l.blockComment,ProcessingInst:l.processingInstruction,DoctypeDecl:l.documentMeta}),Da=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!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 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:67,context:ja,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[Ba],skippedNodes:[0],repeatNodeCount:9,tokenData:"#%g!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs4ysv-_vw5iwxJ^x}-_}!OKP!O!P-_!P!Q$q!Q![-_![!]!!O!]!^-_!^!_!&W!_!`#$o!`!a&X!a!c-_!c!}!!O!}#R-_#R#S!!O#S#T3V#T#o!!O#o#s-_#s$f$q$f%W-_%W%o!!O%o%p-_%p&a!!O&a&b-_&b1p!!O1p4U-_4U4d!!O4d4e-_4e$IS!!O$IS$I`-_$I`$Ib!!O$Ib$Kh-_$Kh%#t!!O%#t&/x-_&/x&Et!!O&Et&FV-_&FV;'S!!O;'S;:j!&Q;:j;=`4s<%l?&r-_?&r?Ah!!O?Ah?BY$q?BY?Mn!!O?MnO$q!Z$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bX`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UV`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pT`POv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!cpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({W`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!a`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!a`!cpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYkWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]``P!a`!cp!^^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_1n!_!a&X!a#S-_#S#T3V#T#s-_#s$f$q$f;'S-_;'S;=`4s<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/echSkWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!^!_0p!a#S/^#S#T0p#T#s/^#s$f+P$f;'S/^;'S;=`1h<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0uXhSqr0psw0px!P0p!Q!_0p!a#s0p$f;'S0p;'S;=`1b<%l?Ah0p?BY?Mn0pS1eP;=`<%l0p[1kP;=`<%l/^!U1wbhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!U3SP;=`<%l1n!V3bchS`P!a`!cpOq&Xqr3Vrs&}sv3Vvw0pwx(tx!P3V!P!Q&X!Q!^3V!^!_1n!_!a&X!a#s3V#s$f&X$f;'S3V;'S;=`4m<%l?Ah3V?Ah?BY&X?BY?Mn3V?MnO&X!V4pP;=`<%l3V!_4vP;=`<%l-_!Z5SV!`h`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_5rjhSkWc!ROX7dXZ8qZ[7d[^8q^p7dqr:crs8qst@Ttw:cwx8qx!P:c!P!Q7d!Q!]:c!]!^/^!^!_=p!_!a8q!a#S:c#S#T=p#T#s:c#s$f7d$f;'S:c;'S;=`?}<%l?Ah:c?Ah?BY7d?BY?Mn:c?MnO7d!Z7ibkWOX7dXZ8qZ[7d[^8q^p7dqr7drs8qst+Ptw7dwx8qx!]7d!]!^9f!^!a8q!a#S7d#S#T8q#T;'S7d;'S;=`:]<%lO7d!R8tVOp8qqs8qt!]8q!]!^9Z!^;'S8q;'S;=`9`<%lO8q!R9`Oa!R!R9cP;=`<%l8q!Z9mYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z:`P;=`<%l7d!_:jjhSkWOX7dXZ8qZ[7d[^8q^p7dqr:crs8qst/^tw:cwx8qx!P:c!P!Q7d!Q!]:c!]!^<[!^!_=p!_!a8q!a#S:c#S#T=p#T#s:c#s$f7d$f;'S:c;'S;=`?}<%l?Ah:c?Ah?BY7d?BY?Mn:c?MnO7d!_b#d#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!>kdhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#V1n#V#W!?y#W#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!@SdhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#h1n#h#i!Ab#i#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!AkdhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#m1n#m#n!By#n#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!CSdhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#d1n#d#e!Db#e#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!DkdhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#X1n#X#Y!5]#Y#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!FSchS!a`!cpOq!G_qr!Eyrs!HUsv!Eyvw!Ncwx!Jvx!P!Ey!P!Q!G_!Q!_!Ey!_!a!G_!a!b##T!b#s!Ey#s$f!G_$f;'S!Ey;'S;=`#$i<%l?Ah!Ey?Ah?BY!G_?BY?Mn!Ey?MnO!G_!R!GfY!a`!cpOr!G_rs!HUsv!G_vw!Hpwx!Jvx!a!G_!a!b!Lv!b;'S!G_;'S;=`!N]<%lO!G_q!HZV!cpOv!HUvx!Hpx!a!HU!a!b!Iq!b;'S!HU;'S;=`!Jp<%lO!HUP!HsTO!a!Hp!a!b!IS!b;'S!Hp;'S;=`!Ik<%lO!HpP!IVTO!`!Hp!`!a!If!a;'S!Hp;'S;=`!Ik<%lO!HpP!IkOxPP!InP;=`<%l!Hpq!IvV!cpOv!HUvx!Hpx!`!HU!`!a!J]!a;'S!HU;'S;=`!Jp<%lO!HUq!JdS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!JsP;=`<%l!HUa!J{X!a`Or!Jvrs!Hpsv!Jvvw!Hpw!a!Jv!a!b!Kh!b;'S!Jv;'S;=`!Lp<%lO!Jva!KmX!a`Or!Jvrs!Hpsv!Jvvw!Hpw!`!Jv!`!a!LY!a;'S!Jv;'S;=`!Lp<%lO!Jva!LaT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!LsP;=`<%l!Jv!R!L}Y!a`!cpOr!G_rs!HUsv!G_vw!Hpwx!Jvx!`!G_!`!a!Mm!a;'S!G_;'S;=`!N]<%lO!G_!R!MvV!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!N`P;=`<%l!G_T!NhbhSOq!Hpqr!Ncrs!Hpsw!Ncwx!Hpx!P!Nc!P!Q!Hp!Q!_!Nc!_!a!Hp!a!b# p!b#s!Nc#s$f!Hp$f;'S!Nc;'S;=`#!}<%l?Ah!Nc?Ah?BY!Hp?BY?Mn!Nc?MnO!HpT# ubhSOq!Hpqr!Ncrs!Hpsw!Ncwx!Hpx!P!Nc!P!Q!Hp!Q!_!Nc!_!`!Hp!`!a!If!a#s!Nc#s$f!Hp$f;'S!Nc;'S;=`#!}<%l?Ah!Nc?Ah?BY!Hp?BY?Mn!Nc?MnO!HpT##QP;=`<%l!Nc!V##^chS!a`!cpOq!G_qr!Eyrs!HUsv!Eyvw!Ncwx!Jvx!P!Ey!P!Q!G_!Q!_!Ey!_!`!G_!`!a!Mm!a#s!Ey#s$f!G_$f;'S!Ey;'S;=`#$i<%l?Ah!Ey?Ah?BY!G_?BY?Mn!Ey?MnO!G_!V#$lP;=`<%l!Ey!V#$zXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[Ia,Ea,Na,Aa,Ga,Ra,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:485},tokenPrec:487});function Ie(e,O){let a=Object.create(null);for(let t of e.getChildren(je)){let r=t.getChild(Za),i=t.getChild(XO)||t.getChild(Ge);r&&(a[O.read(r.from,r.to)]=i?i.type.id==XO?O.read(i.from+1,i.to-1):O.read(i.from,i.to):"")}return a}function ae(e,O){let a=e.getChild(Xa);return a?O.read(a.from,a.to):" "}function SO(e,O,a){let t;for(let r of a)if(!r.attrs||r.attrs(t||(t=Ie(e.node.parent.firstChild,O))))return{parser:r.parser};return null}function Ee(e=[],O=[]){let a=[],t=[],r=[],i=[];for(let n of e)(n.tag=="script"?a:n.tag=="style"?t:n.tag=="textarea"?r:i).push(n);let s=O.length?Object.create(null):null;for(let n of O)(s[n.name]||(s[n.name]=[])).push(n);return Ut((n,o)=>{let Q=n.type.id;if(Q==ya)return SO(n,o,a);if(Q==xa)return SO(n,o,t);if(Q==ka)return SO(n,o,r);if(Q==Re&&i.length){let p=n.node,c=ae(p,o),u;for(let h of i)if(h.tag==c&&(!h.attrs||h.attrs(u||(u=Ie(p,o))))){let f=p.parent.lastChild;return{parser:h.parser,overlay:[{from:n.to,to:f.type.id==va?f.from:p.parent.to}]}}}if(s&&Q==je){let p=n.node,c;if(c=p.firstChild){let u=s[o.read(c.from,c.to)];if(u)for(let h of u){if(h.tagName&&h.tagName!=ae(p.parent,o))continue;let f=p.lastChild;if(f.type.id==XO){let P=f.from+1,$=f.lastChild,v=f.to-($&&$.isError?0:1);if(v>P)return{parser:h.parser,overlay:[{from:P,to:v}]}}else if(f.type.id==Ge)return{parser:h.parser,overlay:[{from:f.from,to:f.to}]}}}}return null})}const La=94,re=1,Ja=95,Ma=96,ie=2,Ne=[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],Ha=58,Fa=40,Be=95,Ka=91,L=45,Or=46,er=35,tr=37;function OO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function ar(e){return e>=48&&e<=57}const rr=new Z((e,O)=>{for(let a=!1,t=0,r=0;;r++){let{next:i}=e;if(OO(i)||i==L||i==Be||a&&ar(i))!a&&(i!=L||r>0)&&(a=!0),t===r&&i==L&&t++,e.advance();else{a&&e.acceptToken(i==Fa?Ja:t==2&&O.canShift(ie)?ie:Ma);break}}}),ir=new Z(e=>{if(Ne.includes(e.peek(-1))){let{next:O}=e;(OO(O)||O==Be||O==er||O==Or||O==Ka||O==Ha||O==L)&&e.acceptToken(La)}}),sr=new Z(e=>{if(!Ne.includes(e.peek(-1))){let{next:O}=e;if(O==tr&&(e.advance(),e.acceptToken(re)),OO(O)){do e.advance();while(OO(e.next));e.acceptToken(re)}}}),nr=rO({"AtKeyword import charset namespace keyframes media supports":l.definitionKeyword,"from to selector":l.keyword,NamespaceName:l.namespace,KeyframeName:l.labelName,TagName:l.tagName,ClassName:l.className,PseudoClassName:l.constant(l.className),IdName:l.labelName,"FeatureName PropertyName":l.propertyName,AttributeName:l.attributeName,NumberLiteral:l.number,KeywordQuery:l.keyword,UnaryQueryOp:l.operatorKeyword,"CallTag ValueName":l.atom,VariableName:l.variableName,Callee:l.operatorKeyword,Unit:l.unit,"UniversalSelector NestingSelector":l.definitionOperator,MatchOp:l.compareOperator,"ChildOp SiblingOp, LogicOp":l.logicOperator,BinOp:l.arithmeticOperator,Important:l.modifier,Comment:l.blockComment,ParenthesizedContent:l.special(l.name),ColorLiteral:l.color,StringLiteral:l.string,":":l.punctuation,"PseudoOp #":l.derefOperator,"; ,":l.separator,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace}),lr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},or={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},Qr={__proto__:null,not:128,only:128,from:158,to:160},cr=T.deserialize({version:14,states:"7WQYQ[OOO#_Q[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO#fQ[O'#CfO$YQXO'#CaO$aQ[O'#ChO$lQ[O'#DPO$qQ[O'#DTOOQP'#Ed'#EdO$vQdO'#DeO%bQ[O'#DrO$vQdO'#DtO%sQ[O'#DvO&OQ[O'#DyO&TQ[O'#EPO&cQ[O'#EROOQS'#Ec'#EcOOQS'#ET'#ETQYQ[OOO&jQXO'#CdO'_QWO'#DaO'dQWO'#EjO'oQ[O'#EjQOQWOOOOQP'#Cg'#CgOOQP,59Q,59QO#fQ[O,59QO'yQ[O'#EWO(eQWO,58{O(mQ[O,59SO$lQ[O,59kO$qQ[O,59oO'yQ[O,59sO'yQ[O,59uO'yQ[O,59vO(xQ[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)PQWO,59SO)UQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)ZQ`O,59oOOQS'#Cp'#CpO$vQdO'#CqO)cQvO'#CsO*pQtO,5:POOQO'#Cx'#CxO)UQWO'#CwO+UQWO'#CyOOQS'#Eg'#EgOOQO'#Dh'#DhO+ZQ[O'#DoO+iQWO'#EkO&TQ[O'#DmO+wQWO'#DpOOQO'#El'#ElO(hQWO,5:^O+|QpO,5:`OOQS'#Dx'#DxO,UQWO,5:bO,ZQ[O,5:bOOQO'#D{'#D{O,cQWO,5:eO,hQWO,5:kO,pQWO,5:mOOQS-E8R-E8RO$vQdO,59{O,xQ[O'#EYO-VQWO,5;UO-VQWO,5;UOOQP1G.l1G.lO-|QXO,5:rOOQO-E8U-E8UOOQS1G.g1G.gOOQP1G.n1G.nO)PQWO1G.nO)UQWO1G.nOOQP1G/V1G/VO.ZQ`O1G/ZO.tQXO1G/_O/[QXO1G/aO/rQXO1G/bO0YQWO,59zO0_Q[O'#DOO0fQdO'#CoOOQP1G/Z1G/ZO$vQdO1G/ZO0mQpO,59]OOQS,59_,59_O$vQdO,59aO0uQWO1G/kOOQS,59c,59cO0zQ!bO,59eO1SQWO'#DhO1_QWO,5:TO1dQWO,5:ZO&TQ[O,5:VO&TQ[O'#EZO1lQWO,5;VO1wQWO,5:XO'yQ[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2YQWO1G/|O2_QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO2mQtO1G/gOOQO,5:t,5:tO3TQ[O,5:tOOQO-E8W-E8WO3bQWO1G0pOOQP7+$Y7+$YOOQP7+$u7+$uO$vQdO7+$uOOQS1G/f1G/fO3mQXO'#EiO3tQWO,59jO3yQtO'#EUO4nQdO'#EfO4xQWO,59ZO4}QpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5VQWO1G/PO$vQdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5[QWO,5:uOOQO-E8X-E8XO5jQXO1G/vOOQS7+%h7+%hO5qQYO'#CsO(hQWO'#E[O5yQdO,5:hOOQS,5:h,5:hO6XQtO'#EXO$vQdO'#EXO7VQdO7+%ROOQO7+%R7+%ROOQO1G0`1G0`O7jQpO<T![;'S%^;'S;=`%o<%lO%^^;TUoWOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^^;nYoW#[UOy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^^[[oW#[UOy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^_?VSpVOy%^z;'S%^;'S;=`%o<%lO%^^?hWjSOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^_@VU#XPOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjSOy%^z{@}{;'S%^;'S;=`%o<%lO%^~ASUoWOy@}yzAfz{Bm{;'S@};'S;=`Co<%lO@}~AiTOzAfz{Ax{;'SAf;'S;=`Bg<%lOAf~A{VOzAfz{Ax{!PAf!P!QBb!Q;'SAf;'S;=`Bg<%lOAf~BgOR~~BjP;=`<%lAf~BrWoWOy@}yzAfz{Bm{!P@}!P!QC[!Q;'S@};'S;=`Co<%lO@}~CcSoWR~Oy%^z;'S%^;'S;=`%o<%lO%^~CrP;=`<%l@}^Cz[#[UOy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^XDuU]POy%^z![%^![!]EX!];'S%^;'S;=`%o<%lO%^XE`S^PoWOy%^z;'S%^;'S;=`%o<%lO%^_EqS!WVOy%^z;'S%^;'S;=`%o<%lO%^YFSSzQOy%^z;'S%^;'S;=`%o<%lO%^XFeU|POy%^z!`%^!`!aFw!a;'S%^;'S;=`%o<%lO%^XGOS|PoWOy%^z;'S%^;'S;=`%o<%lO%^XG_WOy%^z!c%^!c!}Gw!}#T%^#T#oGw#o;'S%^;'S;=`%o<%lO%^XHO[!YPoWOy%^z}%^}!OGw!O!Q%^!Q![Gw![!c%^!c!}Gw!}#T%^#T#oGw#o;'S%^;'S;=`%o<%lO%^XHySxPOy%^z;'S%^;'S;=`%o<%lO%^^I[SvUOy%^z;'S%^;'S;=`%o<%lO%^XIkUOy%^z#b%^#b#cI}#c;'S%^;'S;=`%o<%lO%^XJSUoWOy%^z#W%^#W#XJf#X;'S%^;'S;=`%o<%lO%^XJmS!`PoWOy%^z;'S%^;'S;=`%o<%lO%^XJ|UOy%^z#f%^#f#gJf#g;'S%^;'S;=`%o<%lO%^XKeS!RPOy%^z;'S%^;'S;=`%o<%lO%^_KvS!QVOy%^z;'S%^;'S;=`%o<%lO%^ZLXU!PPOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^WLnP;=`<%l$}",tokenizers:[ir,sr,rr,0,1,2,3],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:95,get:e=>lr[e]||-1},{term:56,get:e=>or[e]||-1},{term:96,get:e=>Qr[e]||-1}],tokenPrec:1123});let fO=null;function dO(){if(!fO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],a=new Set;for(let t in e)t!="cssText"&&t!="cssFloat"&&typeof e[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(O.push(t),a.add(t)));fO=O.sort().map(t=>({type:"property",label:t}))}return fO||[]}const se=["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(e=>({type:"class",label:e})),ne=["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(e=>({type:"keyword",label:e})).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(e=>({type:"constant",label:e}))),hr=["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(e=>({type:"type",label:e})),k=/^(\w[\w-]*|-\w[\w-]*|)$/,pr=/^-(-[\w-]*)?$/;function ur(e,O){var a;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let t=(a=e.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:O.sliceString(t.from,t.to)=="var"}const le=new ve,Sr=["Declaration"];function fr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function De(e,O){if(O.to-O.from>4096){let a=le.get(O);if(a)return a;let t=[],r=new Set,i=O.cursor(YO.IncludeAnonymous);if(i.firstChild())do for(let s of De(e,i.node))r.has(s.label)||(r.add(s.label),t.push(s));while(i.nextSibling());return le.set(O,t),t}else{let a=[],t=new Set;return O.cursor().iterate(r=>{var i;if(r.name=="VariableName"&&r.matchContext(Sr)&&((i=r.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let s=e.sliceString(r.from,r.to);t.has(s)||(t.add(s),a.push({label:s,type:"variable"}))}}),a}}const dr=e=>{let{state:O,pos:a}=e,t=_(O).resolveInner(a,-1),r=t.type.isError&&t.from==t.to-1&&O.doc.sliceString(t.from,t.to)=="-";if(t.name=="PropertyName"||(r||t.name=="TagName")&&/^(Block|Styles)$/.test(t.resolve(t.to).name))return{from:t.from,options:dO(),validFor:k};if(t.name=="ValueName")return{from:t.from,options:ne,validFor:k};if(t.name=="PseudoClassName")return{from:t.from,options:se,validFor:k};if(t.name=="VariableName"||(e.explicit||r)&&ur(t,O.doc))return{from:t.name=="VariableName"?t.from:a,options:De(O.doc,fr(t)),validFor:pr};if(t.name=="TagName"){for(let{parent:n}=t;n;n=n.parent)if(n.name=="Block")return{from:t.from,options:dO(),validFor:k};return{from:t.from,options:hr,validFor:k}}if(!e.explicit)return null;let i=t.resolve(a),s=i.childBefore(a);return s&&s.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:se,validFor:k}:s&&s.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:ne,validFor:k}:i.name=="Block"||i.name=="Styles"?{from:a,options:dO(),validFor:k}:null},eO=iO.define({name:"css",parser:cr.configure({props:[sO.add({Declaration:R()}),nO.add({Block:ke})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function $r(){return new lO(eO,eO.data.of({autocomplete:dr}))}const oe=301,Qe=1,gr=2,ce=302,Pr=304,mr=305,br=3,Xr=4,Zr=[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],Le=125,yr=59,he=47,xr=42,kr=43,vr=45,Yr=new Ve({start:!1,shift(e,O){return O==br||O==Xr||O==Pr?e:O==mr},strict:!1}),wr=new Z((e,O)=>{let{next:a}=e;(a==Le||a==-1||O.context)&&O.canShift(ce)&&e.acceptToken(ce)},{contextual:!0,fallback:!0}),Tr=new Z((e,O)=>{let{next:a}=e,t;Zr.indexOf(a)>-1||a==he&&((t=e.peek(1))==he||t==xr)||a!=Le&&a!=yr&&a!=-1&&!O.context&&O.canShift(oe)&&e.acceptToken(oe)},{contextual:!0}),Wr=new Z((e,O)=>{let{next:a}=e;if((a==kr||a==vr)&&(e.advance(),a==e.next)){e.advance();let t=!O.context&&O.canShift(Qe);e.acceptToken(t?Qe:gr)}},{contextual:!0}),Vr=rO({"get set async static":l.modifier,"for while do if else switch try catch finally return throw break continue default case":l.controlKeyword,"in of await yield void typeof delete instanceof":l.operatorKeyword,"let var const function class extends":l.definitionKeyword,"import export from":l.moduleKeyword,"with debugger as new":l.keyword,TemplateString:l.special(l.string),super:l.atom,BooleanLiteral:l.bool,this:l.self,null:l.null,Star:l.modifier,VariableName:l.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":l.function(l.variableName),VariableDefinition:l.definition(l.variableName),Label:l.labelName,PropertyName:l.propertyName,PrivatePropertyName:l.special(l.propertyName),"CallExpression/MemberExpression/PropertyName":l.function(l.propertyName),"FunctionDeclaration/VariableDefinition":l.function(l.definition(l.variableName)),"ClassDeclaration/VariableDefinition":l.definition(l.className),PropertyDefinition:l.definition(l.propertyName),PrivatePropertyDefinition:l.definition(l.special(l.propertyName)),UpdateOp:l.updateOperator,LineComment:l.lineComment,BlockComment:l.blockComment,Number:l.number,String:l.string,Escape:l.escape,ArithOp:l.arithmeticOperator,LogicOp:l.logicOperator,BitOp:l.bitwiseOperator,CompareOp:l.compareOperator,RegExp:l.regexp,Equals:l.definitionOperator,Arrow:l.function(l.punctuation),": Spread":l.punctuation,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace,"InterpolationStart InterpolationEnd":l.special(l.brace),".":l.derefOperator,", ;":l.separator,"@":l.meta,TypeName:l.typeName,TypeDefinition:l.definition(l.typeName),"type enum interface implements namespace module declare":l.definitionKeyword,"abstract global Privacy readonly override":l.modifier,"is keyof unique infer":l.operatorKeyword,JSXAttributeValue:l.attributeValue,JSXText:l.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":l.angleBracket,"JSXIdentifier JSXNameSpacedName":l.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":l.attributeName,"JSXBuiltin/JSXIdentifier":l.standard(l.tagName)}),Ur={__proto__:null,export:14,as:19,from:27,default:30,async:35,function:36,extends:46,this:50,true:58,false:58,null:70,void:74,typeof:78,super:96,new:130,delete:146,yield:155,await:159,class:164,public:219,private:219,protected:219,readonly:221,instanceof:240,satisfies:243,in:244,const:246,import:278,keyof:333,unique:337,infer:343,is:379,abstract:399,implements:401,type:403,let:406,var:408,interface:415,enum:419,namespace:425,module:427,declare:431,global:435,for:456,of:465,while:468,with:472,do:476,if:480,else:482,switch:486,case:492,try:498,catch:502,finally:506,return:510,throw:514,break:518,continue:522,debugger:526},_r={__proto__:null,async:117,get:119,set:121,public:181,private:181,protected:181,static:183,abstract:185,override:187,readonly:193,accessor:195,new:383},Cr={__proto__:null,"<":137},qr=T.deserialize({version:14,states:"$BhO`QUOOO%QQUOOO'TQWOOP(_OSOOO*mQ(CjO'#CfO*tOpO'#CgO+SO!bO'#CgO+bO07`O'#DZO-sQUO'#DaO.TQUO'#DlO%QQUO'#DvO0[QUO'#EOOOQ(CY'#EW'#EWO0rQSO'#ETOOQO'#I_'#I_O0zQSO'#GjOOQO'#Eh'#EhO1VQSO'#EgO1[QSO'#EgO3^Q(CjO'#JbO5}Q(CjO'#JcO6kQSO'#FVO6pQ#tO'#FnOOQ(CY'#F_'#F_O6{O&jO'#F_O7ZQ,UO'#FuO8qQSO'#FtOOQ(CY'#Jc'#JcOOQ(CW'#Jb'#JbOOQQ'#J|'#J|O8vQSO'#IOO8{Q(C[O'#IPOOQQ'#JO'#JOOOQQ'#IT'#ITQ`QUOOO%QQUO'#DnO9TQUO'#DzO%QQUO'#D|O9[QSO'#GjO9aQ,UO'#ClO9oQSO'#EfO9zQSO'#EqO:PQ,UO'#F^O:nQSO'#GjO:sQSO'#GnO;OQSO'#GnO;^QSO'#GqO;^QSO'#GrO;^QSO'#GtO9[QSO'#GwO;}QSO'#GzO=`QSO'#CbO=pQSO'#HXO=xQSO'#H_O=xQSO'#HaO`QUO'#HcO=xQSO'#HeO=xQSO'#HhO=}QSO'#HnO>SQ(C]O'#HtO%QQUO'#HvO>_Q(C]O'#HxO>jQ(C]O'#HzO8{Q(C[O'#H|O>uQ(CjO'#CfO?wQWO'#DfQOQSOOO@_QSO'#EPO9aQ,UO'#EfO@jQSO'#EfO@uQ`O'#F^OOQQ'#Cd'#CdOOQ(CW'#Dk'#DkOOQ(CW'#Jf'#JfO%QQUO'#JfOBOQWO'#E_OOQ(CW'#E^'#E^OBYQ(C`O'#E_OBtQWO'#ESOOQO'#Ji'#JiOCYQWO'#ESOCgQWO'#E_OC}QWO'#EeODQQWO'#E_O@}QWO'#E_OBtQWO'#E_PDkO?MpO'#C`POOO)CDm)CDmOOOO'#IU'#IUODvOpO,59ROOQ(CY,59R,59ROOOO'#IV'#IVOEUO!bO,59RO%QQUO'#D]OOOO'#IX'#IXOEdO07`O,59uOOQ(CY,59u,59uOErQUO'#IYOFVQSO'#JdOHXQbO'#JdO+pQUO'#JdOH`QSO,59{OHvQSO'#EhOITQSO'#JqOI`QSO'#JpOI`QSO'#JpOIhQSO,5;UOImQSO'#JoOOQ(CY,5:W,5:WOItQUO,5:WOKuQ(CjO,5:bOLfQSO,5:jOLkQSO'#JmOMeQ(C[O'#JnO:sQSO'#JmOMlQSO'#JmOMtQSO,5;TOMyQSO'#JmOOQ(CY'#Cf'#CfO%QQUO'#EOONmQ`O,5:oOOQO'#Jj'#JjOOQO-E<]-E<]O9[QSO,5=UO! TQSO,5=UO! YQUO,5;RO!#]Q,UO'#EcO!$pQSO,5;RO!&YQ,UO'#DpO!&aQUO'#DuO!&kQWO,5;[O!&sQWO,5;[O%QQUO,5;[OOQQ'#E}'#E}OOQQ'#FP'#FPO%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]OOQQ'#FT'#FTO!'RQUO,5;nOOQ(CY,5;s,5;sOOQ(CY,5;t,5;tO!)UQSO,5;tOOQ(CY,5;u,5;uO%QQUO'#IeO!)^Q(C[O,5jOOQQ'#JW'#JWOOQQ,5>k,5>kOOQQ-EgQWO'#EkOOQ(CW'#Jo'#JoO!>nQ(C[O'#J}O8{Q(C[O,5=YO;^QSO,5=`OOQO'#Cr'#CrO!>yQWO,5=]O!?RQ,UO,5=^O!?^QSO,5=`O!?cQ`O,5=cO=}QSO'#G|O9[QSO'#HOO!?kQSO'#HOO9aQ,UO'#HRO!?pQSO'#HROOQQ,5=f,5=fO!?uQSO'#HSO!?}QSO'#ClO!@SQSO,58|O!@^QSO,58|O!BfQUO,58|OOQQ,58|,58|O!BsQ(C[O,58|O%QQUO,58|O!COQUO'#HZOOQQ'#H['#H[OOQQ'#H]'#H]O`QUO,5=sO!C`QSO,5=sO`QUO,5=yO`QUO,5={O!CeQSO,5=}O`QUO,5>PO!CjQSO,5>SO!CoQUO,5>YOOQQ,5>`,5>`O%QQUO,5>`O8{Q(C[O,5>bOOQQ,5>d,5>dO!GvQSO,5>dOOQQ,5>f,5>fO!GvQSO,5>fOOQQ,5>h,5>hO!G{QWO'#DXO%QQUO'#JfO!HjQWO'#JfO!IXQWO'#DgO!IjQWO'#DgO!K{QUO'#DgO!LSQSO'#JeO!L[QSO,5:QO!LaQSO'#ElO!LoQSO'#JrO!LwQSO,5;VO!L|QWO'#DgO!MZQWO'#EROOQ(CY,5:k,5:kO%QQUO,5:kO!MbQSO,5:kO=}QSO,5;QO!;xQWO,5;QO!tO+pQUO,5>tOOQO,5>z,5>zO#$vQUO'#IYOOQO-EtO$8XQSO1G5jO$8aQSO1G5vO$8iQbO1G5wO:sQSO,5>zO$8sQSO1G5sO$8sQSO1G5sO:sQSO1G5sO$8{Q(CjO1G5tO%QQUO1G5tO$9]Q(C[O1G5tO$9nQSO,5>|O:sQSO,5>|OOQO,5>|,5>|O$:SQSO,5>|OOQO-E<`-E<`OOQO1G0]1G0]OOQO1G0_1G0_O!)XQSO1G0_OOQQ7+([7+([O!#]Q,UO7+([O%QQUO7+([O$:bQSO7+([O$:mQ,UO7+([O$:{Q(CjO,59nO$=TQ(CjO,5UOOQQ,5>U,5>UO%QQUO'#HkO%&qQSO'#HmOOQQ,5>[,5>[O:sQSO,5>[OOQQ,5>^,5>^OOQQ7+)`7+)`OOQQ7+)f7+)fOOQQ7+)j7+)jOOQQ7+)l7+)lO%&vQWO1G5lO%'[Q$IUO1G0rO%'fQSO1G0rOOQO1G/m1G/mO%'qQ$IUO1G/mO=}QSO1G/mO!'RQUO'#DgOOQO,5>u,5>uOOQO-E{,5>{OOQO-E<_-E<_O!;xQWO1G/mOOQO-E<[-E<[OOQ(CY1G0X1G0XOOQ(CY7+%q7+%qO!MeQSO7+%qOOQ(CY7+&W7+&WO=}QSO7+&WO!;xQWO7+&WOOQO7+%t7+%tO$7kQ(CjO7+&POOQO7+&P7+&PO%QQUO7+&PO%'{Q(C[O7+&PO=}QSO7+%tO!;xQWO7+%tO%(WQ(C[O7+&POBtQWO7+%tO%(fQ(C[O7+&PO%(zQ(C`O7+&PO%)UQWO7+%tOBtQWO7+&PO%)cQWO7+&PO%)yQSO7++_O%)yQSO7++_O%*RQ(CjO7++`O%QQUO7++`OOQO1G4h1G4hO:sQSO1G4hO%*cQSO1G4hOOQO7+%y7+%yO!MeQSO<vOOQO-EwO%QQUO,5>wOOQO-ESQ$IUO1G0wO%>ZQ$IUO1G0wO%@RQ$IUO1G0wO%@fQ(CjO<VOOQQ,5>X,5>XO&#WQSO1G3vO:sQSO7+&^O!'RQUO7+&^OOQO7+%X7+%XO&#]Q$IUO1G5wO=}QSO7+%XOOQ(CY<zAN>zO%QQUOAN?VO=}QSOAN>zO&<^Q(C[OAN?VO!;xQWOAN>zO&zO&RO!V+iO^(qX'j(qX~O#W+mO'|%OO~Og+pO!X$yO'|%OO~O!X+rO~Oy+tO!XXO~O!t+yO~Ob,OO~O's#jO!W(sP~Ob%lO~O%a!OO's%|O~PRO!V,yO!W(fa~O!W2SO~P'TO^%^O#W2]O'j%^O~O^%^O!a#rO#W2]O'j%^O~O^%^O!a#rO!h%ZO!l2aO#W2]O'j%^O'|%OO(`'dO~O!]2bO!^2bO't!iO~PBtO![2eO!]2bO!^2bO#S2fO#T2fO't!iO~PBtO![2eO!]2bO!^2bO#P2gO#S2fO#T2fO't!iO~PBtO^%^O!a#rO!l2aO#W2]O'j%^O(`'dO~O^%^O'j%^O~P!3jO!V$^Oo$ja~O!S&|i!V&|i~P!3jO!V'xO!S(Wi~O!V(PO!S(di~O!S(ei!V(ei~P!3jO!V(]O!g(ai~O!V(bi!g(bi^(bi'j(bi~P!3jO#W2kO!V(bi!g(bi^(bi'j(bi~O|%vO!X%wO!x]O#a2nO#b2mO's%eO~O|%vO!X%wO#b2mO's%eO~Og2uO!X'QO%`2tO~Og2uO!X'QO%`2tO'|%OO~O#cvaPvaXva^vakva!eva!fva!hva!lva#fva#gva#hva#iva#jva#kva#lva#mva#nva#pva#rva#tva#uva'jva(Qva(`va!gva!Sva'hvaova!Xva%`va!ava~P#M{O#c$kaP$kaX$ka^$kak$kaz$ka!e$ka!f$ka!h$ka!l$ka#f$ka#g$ka#h$ka#i$ka#j$ka#k$ka#l$ka#m$ka#n$ka#p$ka#r$ka#t$ka#u$ka'j$ka(Q$ka(`$ka!g$ka!S$ka'h$kao$ka!X$ka%`$ka!a$ka~P#NqO#c$maP$maX$ma^$mak$maz$ma!e$ma!f$ma!h$ma!l$ma#f$ma#g$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#p$ma#r$ma#t$ma#u$ma'j$ma(Q$ma(`$ma!g$ma!S$ma'h$mao$ma!X$ma%`$ma!a$ma~P$ dO#c${aP${aX${a^${ak${az${a!V${a!e${a!f${a!h${a!l${a#f${a#g${a#h${a#i${a#j${a#k${a#l${a#m${a#n${a#p${a#r${a#t${a#u${a'j${a(Q${a(`${a!g${a!S${a'h${a#W${ao${a!X${a%`${a!a${a~P#(yO^#Zq!V#Zq'j#Zq'h#Zq!S#Zq!g#Zqo#Zq!X#Zq%`#Zq!a#Zq~P!3jOd'OX!V'OX~P!$uO!V._Od(Za~O!U2}O!V'PX!g'PX~P%QO!V.bO!g([a~O!V.bO!g([a~P!3jO!S3QO~O#x!ja!W!ja~PI{O#x!ba!V!ba!W!ba~P#?dO#x!na!W!na~P!6TO#x!pa!W!pa~P!8nO!X3dO$TfO$^3eO~O!W3iO~Oo3jO~P#(yO^$gq!V$gq'j$gq'h$gq!S$gq!g$gqo$gq!X$gq%`$gq!a$gq~P!3jO!S3kO~Ol.}O'uTO'xUO~Oy)sO|)tO(h)xOg%Wi(g%Wi!V%Wi#W%Wi~Od%Wi#x%Wi~P$HbOy)sO|)tOg%Yi(g%Yi(h%Yi!V%Yi#W%Yi~Od%Yi#x%Yi~P$ITO(`$WO~P#(yO!U3nO's%eO!V'YX!g'YX~O!V/VO!g(ma~O!V/VO!a#rO!g(ma~O!V/VO!a#rO(`'dO!g(ma~Od$ti!V$ti#W$ti#x$ti~P!-jO!U3vO's*UO!S'[X!V'[X~P!.XO!V/_O!S(na~O!V/_O!S(na~P#(yO!a#rO~O!a#rO#n4OO~Ok4RO!a#rO(`'dO~Od(Oi!V(Oi~P!-jO#W4UOd(Oi!V(Oi~P!-jO!g4XO~O^$hq!V$hq'j$hq'h$hq!S$hq!g$hqo$hq!X$hq%`$hq!a$hq~P!3jO!V4]O!X(oX~P#(yO!f#tO~P3zO!X$rX%TYX^$rX!V$rX'j$rX~P!,aO%T4_OghXyhX|hX!XhX(ghX(hhX^hX!VhX'jhX~O%T4_O~O%a4fO's+WO'uTO'xUO!V'eX!W'eX~O!V0_O!W(ua~OX4jO~O]4kO~O!S4oO~O^%^O'j%^O~P#(yO!X$yO~P#(yO!V4tO#W4vO!W(rX~O!W4wO~Ol!kO|4yO![5WO!]4}O!^4}O!x;oO!|5VO!}5UO#O5UO#P5TO#S5SO#T!wO't!iO'uTO'xUO(T!jO(_!nO~O!W5RO~P%#XOg5]O!X0zO%`5[O~Og5]O!X0zO%`5[O'|%OO~O's#jO!V'dX!W'dX~O!V1VO!W(sa~O'uTO'xUO(T5fO~O]5jO~O!g5mO~P%QO^5oO~O^5oO~P%QO#n5qO&Q5rO~PMPO_1mO!W5vO&`1lO~P`O!a5xO~O!a5zO!V(Yi!W(Yi!a(Yi!h(Yi'|(Yi~O!V#`i!W#`i~P#?dO#W5{O!V#`i!W#`i~O!V!Zi!W!Zi~P#?dO^%^O#W6UO'j%^O~O^%^O!a#rO#W6UO'j%^O~O^%^O!a#rO!l6ZO#W6UO'j%^O(`'dO~O!h%ZO'|%OO~P%(fO!]6[O!^6[O't!iO~PBtO![6_O!]6[O!^6[O#S6`O#T6`O't!iO~PBtO!V(]O!g(aq~O!V(bq!g(bq^(bq'j(bq~P!3jO|%vO!X%wO#b6dO's%eO~O!X'QO%`6gO~Og6jO!X'QO%`6gO~O#c%WiP%WiX%Wi^%Wik%Wiz%Wi!e%Wi!f%Wi!h%Wi!l%Wi#f%Wi#g%Wi#h%Wi#i%Wi#j%Wi#k%Wi#l%Wi#m%Wi#n%Wi#p%Wi#r%Wi#t%Wi#u%Wi'j%Wi(Q%Wi(`%Wi!g%Wi!S%Wi'h%Wio%Wi!X%Wi%`%Wi!a%Wi~P$HbO#c%YiP%YiX%Yi^%Yik%Yiz%Yi!e%Yi!f%Yi!h%Yi!l%Yi#f%Yi#g%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#p%Yi#r%Yi#t%Yi#u%Yi'j%Yi(Q%Yi(`%Yi!g%Yi!S%Yi'h%Yio%Yi!X%Yi%`%Yi!a%Yi~P$ITO#c$tiP$tiX$ti^$tik$tiz$ti!V$ti!e$ti!f$ti!h$ti!l$ti#f$ti#g$ti#h$ti#i$ti#j$ti#k$ti#l$ti#m$ti#n$ti#p$ti#r$ti#t$ti#u$ti'j$ti(Q$ti(`$ti!g$ti!S$ti'h$ti#W$tio$ti!X$ti%`$ti!a$ti~P#(yOd'Oa!V'Oa~P!-jO!V'Pa!g'Pa~P!3jO!V.bO!g([i~O#x#Zi!V#Zi!W#Zi~P#?dOP$YOy#vOz#wO|#xO!f#tO!h#uO!l$YO(QVOX#eik#ei!e#ei#g#ei#h#ei#i#ei#j#ei#k#ei#l#ei#m#ei#n#ei#p#ei#r#ei#t#ei#u#ei#x#ei(`#ei(g#ei(h#ei!V#ei!W#ei~O#f#ei~P%2xO#f;wO~P%2xOP$YOy#vOz#wO|#xO!f#tO!h#uO!l$YO#f;wO#g;xO#h;xO#i;xO(QVOX#ei!e#ei#j#ei#k#ei#l#ei#m#ei#n#ei#p#ei#r#ei#t#ei#u#ei#x#ei(`#ei(g#ei(h#ei!V#ei!W#ei~Ok#ei~P%5TOk;yO~P%5TOP$YOk;yOy#vOz#wO|#xO!f#tO!h#uO!l$YO#f;wO#g;xO#h;xO#i;xO#j;zO(QVO#p#ei#r#ei#t#ei#u#ei#x#ei(`#ei(g#ei(h#ei!V#ei!W#ei~OX#ei!e#ei#k#ei#l#ei#m#ei#n#ei~P%7`OXbO^#vy!V#vy'j#vy'h#vy!S#vy!g#vyo#vy!X#vy%`#vy!a#vy~P!3jOg=jOy)sO|)tO(g)vO(h)xO~OP#eiX#eik#eiz#ei!e#ei!f#ei!h#ei!l#ei#f#ei#g#ei#h#ei#i#ei#j#ei#k#ei#l#ei#m#ei#n#ei#p#ei#r#ei#t#ei#u#ei#x#ei(Q#ei(`#ei!V#ei!W#ei~P%AYO!f#tOP(PXX(PXg(PXk(PXy(PXz(PX|(PX!e(PX!h(PX!l(PX#f(PX#g(PX#h(PX#i(PX#j(PX#k(PX#l(PX#m(PX#n(PX#p(PX#r(PX#t(PX#u(PX#x(PX(Q(PX(`(PX(g(PX(h(PX!V(PX!W(PX~O#x#yi!V#yi!W#yi~P#?dO#x!ni!W!ni~P$!qO!W6vO~O!V'Xa!W'Xa~P#?dO!a#rO(`'dO!V'Ya!g'Ya~O!V/VO!g(mi~O!V/VO!a#rO!g(mi~Od$tq!V$tq#W$tq#x$tq~P!-jO!S'[a!V'[a~P#(yO!a6}O~O!V/_O!S(ni~P#(yO!V/_O!S(ni~O!S7RO~O!a#rO#n7WO~Ok7XO!a#rO(`'dO~O!S7ZO~Od$vq!V$vq#W$vq#x$vq~P!-jO^$hy!V$hy'j$hy'h$hy!S$hy!g$hyo$hy!X$hy%`$hy!a$hy~P!3jO!V4]O!X(oa~O^#Zy!V#Zy'j#Zy'h#Zy!S#Zy!g#Zyo#Zy!X#Zy%`#Zy!a#Zy~P!3jOX7`O~O!V0_O!W(ui~O]7fO~O!a5zO~O(T(qO!V'aX!W'aX~O!V4tO!W(ra~O!h%ZO'|%OO^(YX!a(YX!l(YX#W(YX'j(YX(`(YX~O's7oO~P.[O!x;oO!|7rO!}7qO#O7qO#P7pO#S'bO#T'bO~PBtO^%^O!a#rO!l'hO#W'fO'j%^O(`'dO~O!W7vO~P%#XOl!kO'uTO'xUO(T!jO(_!nO~O|7wO~P%MdO![7{O!]7zO!^7zO#P7pO#S'bO#T'bO't!iO~PBtO![7{O!]7zO!^7zO!}7|O#O7|O#P7pO#S'bO#T'bO't!iO~PBtO!]7zO!^7zO't!iO(T!jO(_!nO~O!X0zO~O!X0zO%`8OO~Og8RO!X0zO%`8OO~OX8WO!V'da!W'da~O!V1VO!W(si~O!g8[O~O!g8]O~O!g8^O~O!g8^O~P%QO^8`O~O!a8cO~O!g8dO~O!V(ei!W(ei~P#?dO^%^O#W8lO'j%^O~O^%^O!a#rO#W8lO'j%^O~O^%^O!a#rO!l8pO#W8lO'j%^O(`'dO~O!h%ZO'|%OO~P&$QO!]8qO!^8qO't!iO~PBtO!V(]O!g(ay~O!V(by!g(by^(by'j(by~P!3jO!X'QO%`8uO~O#c$tqP$tqX$tq^$tqk$tqz$tq!V$tq!e$tq!f$tq!h$tq!l$tq#f$tq#g$tq#h$tq#i$tq#j$tq#k$tq#l$tq#m$tq#n$tq#p$tq#r$tq#t$tq#u$tq'j$tq(Q$tq(`$tq!g$tq!S$tq'h$tq#W$tqo$tq!X$tq%`$tq!a$tq~P#(yO#c$vqP$vqX$vq^$vqk$vqz$vq!V$vq!e$vq!f$vq!h$vq!l$vq#f$vq#g$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#p$vq#r$vq#t$vq#u$vq'j$vq(Q$vq(`$vq!g$vq!S$vq'h$vq#W$vqo$vq!X$vq%`$vq!a$vq~P#(yO!V'Pi!g'Pi~P!3jO#x#Zq!V#Zq!W#Zq~P#?dOy/yOz/yO|/zOPvaXvagvakva!eva!fva!hva!lva#fva#gva#hva#iva#jva#kva#lva#mva#nva#pva#rva#tva#uva#xva(Qva(`va(gva(hva!Vva!Wva~Oy)sO|)tOP$kaX$kag$kak$kaz$ka!e$ka!f$ka!h$ka!l$ka#f$ka#g$ka#h$ka#i$ka#j$ka#k$ka#l$ka#m$ka#n$ka#p$ka#r$ka#t$ka#u$ka#x$ka(Q$ka(`$ka(g$ka(h$ka!V$ka!W$ka~Oy)sO|)tOP$maX$mag$mak$maz$ma!e$ma!f$ma!h$ma!l$ma#f$ma#g$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#p$ma#r$ma#t$ma#u$ma#x$ma(Q$ma(`$ma(g$ma(h$ma!V$ma!W$ma~OP${aX${ak${az${a!e${a!f${a!h${a!l${a#f${a#g${a#h${a#i${a#j${a#k${a#l${a#m${a#n${a#p${a#r${a#t${a#u${a#x${a(Q${a(`${a!V${a!W${a~P%AYO#x$gq!V$gq!W$gq~P#?dO#x$hq!V$hq!W$hq~P#?dO!W9PO~O#x9QO~P!-jO!a#rO!V'Yi!g'Yi~O!a#rO(`'dO!V'Yi!g'Yi~O!V/VO!g(mq~O!S'[i!V'[i~P#(yO!V/_O!S(nq~O!S9WO~P#(yO!S9WO~Od(Oy!V(Oy~P!-jO!V'_a!X'_a~P#(yO!X%Sq^%Sq!V%Sq'j%Sq~P#(yOX9]O~O!V0_O!W(uq~O#W9aO!V'aa!W'aa~O!V4tO!W(ri~P#?dOPYXXYXkYXyYXzYX|YX!SYX!VYX!eYX!fYX!hYX!lYX#WYX#ccX#fYX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#pYX#rYX#tYX#uYX#zYX(QYX(`YX(gYX(hYX~O!a%QX#n%QX~P&6lO#S-cO#T-cO~PBtO#P9eO#S-cO#T-cO~PBtO!}9fO#O9fO#P9eO#S-cO#T-cO~PBtO!]9iO!^9iO't!iO(T!jO(_!nO~O![9lO!]9iO!^9iO#P9eO#S-cO#T-cO't!iO~PBtO!X0zO%`9oO~O'uTO'xUO(T9tO~O!V1VO!W(sq~O!g9wO~O!g9wO~P%QO!g9yO~O!g9zO~O#W9|O!V#`y!W#`y~O!V#`y!W#`y~P#?dO^%^O#W:QO'j%^O~O^%^O!a#rO#W:QO'j%^O~O^%^O!a#rO!l:UO#W:QO'j%^O(`'dO~O!X'QO%`:XO~O#x#vy!V#vy!W#vy~P#?dOP$tiX$tik$tiz$ti!e$ti!f$ti!h$ti!l$ti#f$ti#g$ti#h$ti#i$ti#j$ti#k$ti#l$ti#m$ti#n$ti#p$ti#r$ti#t$ti#u$ti#x$ti(Q$ti(`$ti!V$ti!W$ti~P%AYOy)sO|)tO(h)xOP%WiX%Wig%Wik%Wiz%Wi!e%Wi!f%Wi!h%Wi!l%Wi#f%Wi#g%Wi#h%Wi#i%Wi#j%Wi#k%Wi#l%Wi#m%Wi#n%Wi#p%Wi#r%Wi#t%Wi#u%Wi#x%Wi(Q%Wi(`%Wi(g%Wi!V%Wi!W%Wi~Oy)sO|)tOP%YiX%Yig%Yik%Yiz%Yi!e%Yi!f%Yi!h%Yi!l%Yi#f%Yi#g%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#p%Yi#r%Yi#t%Yi#u%Yi#x%Yi(Q%Yi(`%Yi(g%Yi(h%Yi!V%Yi!W%Yi~O#x$hy!V$hy!W$hy~P#?dO#x#Zy!V#Zy!W#Zy~P#?dO!a#rO!V'Yq!g'Yq~O!V/VO!g(my~O!S'[q!V'[q~P#(yO!S:`O~P#(yO!V0_O!W(uy~O!V4tO!W(rq~O#S2fO#T2fO~PBtO#P:gO#S2fO#T2fO~PBtO!]:kO!^:kO't!iO(T!jO(_!nO~O!X0zO%`:nO~O!g:qO~O^%^O#W:vO'j%^O~O^%^O!a#rO#W:vO'j%^O~O!X'QO%`:{O~OP$tqX$tqk$tqz$tq!e$tq!f$tq!h$tq!l$tq#f$tq#g$tq#h$tq#i$tq#j$tq#k$tq#l$tq#m$tq#n$tq#p$tq#r$tq#t$tq#u$tq#x$tq(Q$tq(`$tq!V$tq!W$tq~P%AYOP$vqX$vqk$vqz$vq!e$vq!f$vq!h$vq!l$vq#f$vq#g$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#p$vq#r$vq#t$vq#u$vq#x$vq(Q$vq(`$vq!V$vq!W$vq~P%AYOd%[!Z!V%[!Z#W%[!Z#x%[!Z~P!-jO!V'aq!W'aq~P#?dO#S6`O#T6`O~PBtO!V#`!Z!W#`!Z~P#?dO^%^O#W;ZO'j%^O~O#c%[!ZP%[!ZX%[!Z^%[!Zk%[!Zz%[!Z!V%[!Z!e%[!Z!f%[!Z!h%[!Z!l%[!Z#f%[!Z#g%[!Z#h%[!Z#i%[!Z#j%[!Z#k%[!Z#l%[!Z#m%[!Z#n%[!Z#p%[!Z#r%[!Z#t%[!Z#u%[!Z'j%[!Z(Q%[!Z(`%[!Z!g%[!Z!S%[!Z'h%[!Z#W%[!Zo%[!Z!X%[!Z%`%[!Z!a%[!Z~P#(yOP%[!ZX%[!Zk%[!Zz%[!Z!e%[!Z!f%[!Z!h%[!Z!l%[!Z#f%[!Z#g%[!Z#h%[!Z#i%[!Z#j%[!Z#k%[!Z#l%[!Z#m%[!Z#n%[!Z#p%[!Z#r%[!Z#t%[!Z#u%[!Z#x%[!Z(Q%[!Z(`%[!Z!V%[!Z!W%[!Z~P%AYOo(UX~P1dO't!iO~P!'RO!ScX!VcX#WcX~P&6lOPYXXYXkYXyYXzYX|YX!VYX!VcX!eYX!fYX!hYX!lYX#WYX#WcX#ccX#fYX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#pYX#rYX#tYX#uYX#zYX(QYX(`YX(gYX(hYX~O!acX!gYX!gcX(`cX~P'!sOP;nOQ;nOa=_Ob!fOikOk;nOlkOmkOskOu;nOw;nO|WO!QkO!RkO!XXO!c;qO!hZO!k;nO!l;nO!m;nO!o;rO!q;sO!t!eO$P!hO$TfO's)RO'uTO'xUO(QVO(_[O(l=]O~O!Vv!>v!BnPPP!BuHdPPPPPPPPPPP!FTP!GiPPHd!HyPHdPHdHdHdHdPHd!J`PP!MiP#!nP#!r#!|##Q##QP!MfP##U##UP#&ZP#&_HdHd#&e#)iAQPAQPAQAQP#*sAQAQ#,mAQ#.zAQ#0nAQAQ#1[#3W#3W#3[#3d#3W#3lP#3WPAQ#4hAQ#5pAQAQ6iPPP#6{PP#7e#7eP#7eP#7z#7ePP#8QP#7wP#7w#8d!1p#7w#9O#9U6f(}#9X(}P#9`#9`#9`P(}P(}P(}P(}PP(}P#9f#9iP#9i(}P#9mP#9pP(}P(}P(}P(}P(}P(}(}PP#9v#9|#:W#:^#:d#:j#:p#;O#;U#;[#;f#;l#b#?r#@Q#@W#@^#@d#@j#@t#@z#AQ#A[#An#AtPPPPPPPPPP#AzPPPPPPP#Bn#FYP#Gu#G|#HUPPPP#L`$ U$'t$'w$'z$)w$)z$)}$*UPP$*[$*`$+X$,X$,]$,qPP$,u$,{$-PP$-S$-W$-Z$.P$.g$.l$.o$.r$.x$.{$/P$/TR!yRmpOXr!X#a%]&d&f&g&i,^,c1g1jU!pQ'Q-OQ%ctQ%kwQ%rzQ&[!TS&x!c,vQ'W!f[']!m!r!s!t!u!vS*[$y*aQ+U%lQ+c%tQ+}&UQ,|'PQ-W'XW-`'^'_'`'aQ/p*cQ1U,OU2b-b-d-eS4}0z5QS6[2e2gU7z5U5V5WQ8q6_S9i7{7|Q:k9lR TypeParamList 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 : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression 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 in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody MethodDeclaration AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration 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:362,context:Yr,nodeProps:[["group",-26,6,14,16,62,198,202,205,206,208,211,214,225,227,233,235,237,239,242,248,254,256,258,260,262,264,265,"Statement",-32,10,11,25,28,29,35,45,48,49,51,56,64,72,76,78,80,81,102,103,112,113,130,133,135,136,137,138,140,141,161,162,164,"Expression",-23,24,26,30,34,36,38,165,167,169,170,172,173,174,176,177,178,180,181,182,192,194,196,197,"Type",-3,84,95,101,"ClassItem"],["openedBy",31,"InterpolationStart",50,"[",54,"{",69,"(",142,"JSXStartTag",154,"JSXStartTag JSXStartCloseTag"],["closedBy",33,"InterpolationEnd",44,"]",55,"}",70,")",143,"JSXSelfCloseEndTag JSXEndTag",159,"JSXEndTag"]],propSources:[Vr],skippedNodes:[0,3,4,268],repeatNodeCount:32,tokenData:"$>y(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tu>PuvBavwDxwxGgxyMvyz! Qz{!![{|!%O|}!&]}!O!%O!O!P!'g!P!Q!1w!Q!R#0t!R![#3T![!]#@T!]!^#Aa!^!_#Bk!_!`#GS!`!a#In!a!b#N{!b!c$$z!c!}>P!}#O$&U#O#P$'`#P#Q$,w#Q#R$.R#R#S>P#S#T$/`#T#o$0j#o#p$4z#p#q$5p#q#r$7Q#r#s$8^#s$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$I|>P$I|$I}$P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(n%d_$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$c&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$c&j'y!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'y!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$c&j'vpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'vpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'vp'y!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$c&j'vp'y!b'l(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST'w#S$c&j'm(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$c&j'vp'y!b'm(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$c&j!l$Ip'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#p$Id$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#p$Id$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'u$(n$c&j'y!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$c&j'y!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$c&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$^#t$c&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$^#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$^#t$c&j'y!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'y!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$^#t'y!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hg$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}st%Ztu`k$c&j'vp'y!b(T!LY's&;d$V#tOY%ZYZ&cZr%Zrs&}st%Ztu>Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$g%Z$g;'S>P;'S;=`BZ<%lO>P+d@`k$c&j'vp'y!b$V#tOY%ZYZ&cZr%Zrs&}st%Ztu@Tuw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![@T![!^%Z!^!_*g!_!c%Z!c!}@T!}#O%Z#O#P&c#P#R%Z#R#S@T#S#T%Z#T#o@T#o#p*g#p$g%Z$g;'S@T;'S;=`BT<%lO@T+dBWP;=`<%l@T(CSB^P;=`<%l>P%#SBl`$c&j'vp'y!b#h$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Cn!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#SCy_$c&j#z$Id'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%DfETa(h%Z![!^%Z!^!_*g!_!c%Z!c!i#>Z!i#O%Z#O#P&c#P#R%Z#R#S#>Z#S#T%Z#T#Z#>Z#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#>fi$c&j'vp'y!bl$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#>Z![!^%Z!^!_*g!_!c%Z!c!i#>Z!i#O%Z#O#P&c#P#R%Z#R#S#>Z#S#T%Z#T#Z#>Z#Z#b%Z#b#c#5T#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%Gh#@b_!a$b$c&j#x%Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$JT>P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(CS$=Uk$c&j'vp'y!b'm(;d(T!LY's&;d$V#tOY%ZYZ&cZr%Zrs&}st%Ztu>Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$g%Z$g;'S>P;'S;=`BZ<%lO>P",tokenizers:[Tr,Wr,2,3,4,5,6,7,8,9,10,11,12,13,wr,new bO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOq~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!O~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(S~~",141,325),new bO("j~RQYZXz{^~^O'p~~aP!P!Qd~iO'q~~",25,307)],topRules:{Script:[0,5],SingleExpression:[1,266],SingleClassItem:[2,267]},dialects:{jsx:13213,ts:13215},dynamicPrecedences:{76:1,78:1,162:1,190:1},specialized:[{term:311,get:e=>Ur[e]||-1},{term:327,get:e=>_r[e]||-1},{term:67,get:e=>Cr[e]||-1}],tokenPrec:13238}),jr=[b("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),b("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),b("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),b("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),b("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),b(`try { - \${} -} catch (\${error}) { - \${} -}`,{label:"try",detail:"/ catch block",type:"keyword"}),b("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),b(`if (\${}) { - \${} -} else { - \${} -}`,{label:"if",detail:"/ else block",type:"keyword"}),b(`class \${name} { - constructor(\${params}) { - \${} - } -}`,{label:"class",detail:"definition",type:"keyword"}),b('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),b('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],pe=new ve,Je=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function q(e){return(O,a)=>{let t=O.node.getChild("VariableDefinition");return t&&a(t,e),!0}}const Gr=["FunctionDeclaration"],Rr={FunctionDeclaration:q("function"),ClassDeclaration:q("class"),ClassExpression:()=>!0,EnumDeclaration:q("constant"),TypeAliasDeclaration:q("type"),NamespaceDeclaration:q("namespace"),VariableDefinition(e,O){e.matchContext(Gr)||O(e,"variable")},TypeDefinition(e,O){O(e,"type")},__proto__:null};function Me(e,O){let a=pe.get(O);if(a)return a;let t=[],r=!0;function i(s,n){let o=e.sliceString(s.from,s.to);t.push({label:o,type:n})}return O.cursor(YO.IncludeAnonymous).iterate(s=>{if(r)r=!1;else if(s.name){let n=Rr[s.name];if(n&&n(s,i)||Je.has(s.name))return!1}else if(s.to-s.from>8192){for(let n of Me(e,s.node))t.push(n);return!1}}),pe.set(O,t),t}const ue=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,He=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName"];function zr(e){let O=_(e.state).resolveInner(e.pos,-1);if(He.indexOf(O.name)>-1)return null;let a=O.name=="VariableName"||O.to-O.from<20&&ue.test(e.state.sliceDoc(O.from,O.to));if(!a&&!e.explicit)return null;let t=[];for(let r=O;r;r=r.parent)Je.has(r.name)&&(t=t.concat(Me(e.state.doc,r)));return{options:t,from:a?O.from:e.pos,validFor:ue}}const x=iO.define({name:"javascript",parser:qr.configure({props:[sO.add({IfStatement:R({except:/^\s*({|else\b)/}),TryStatement:R({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:_t,SwitchBody:e=>{let O=e.textAfter,a=/^\s*\}/.test(O),t=/^\s*(case|default)\b/.test(O);return e.baseIndent+(a?0:t?1:2)*e.unit},Block:Ct({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":R({except:/^{/}),JSXElement(e){let O=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},JSXEscape(e){let O=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),nO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression":ke,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Fe={test:e=>/^JSX/.test(e.name),facet:qt({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Ke=x.configure({dialect:"ts"},"typescript"),Ot=x.configure({dialect:"jsx",props:[Te.add(e=>e.isTop?[Fe]:void 0)]}),et=x.configure({dialect:"jsx ts",props:[Te.add(e=>e.isTop?[Fe]:void 0)]},"typescript"),Ar="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(e=>({label:e,type:"keyword"}));function tt(e={}){let O=e.jsx?e.typescript?et:Ot:e.typescript?Ke:x;return new lO(O,[x.data.of({autocomplete:Ye(He,we(jr.concat(Ar)))}),x.data.of({autocomplete:zr}),e.jsx?Nr:[]])}function Ir(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(!e.parent)return null;e=e.parent}}function Se(e,O,a=e.length){for(let t=O==null?void 0:O.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return e.sliceString(t.from,Math.min(t.to,a));return""}const Er=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Nr=w.inputHandler.of((e,O,a,t)=>{if((Er?e.composing:e.compositionStarted)||e.state.readOnly||O!=a||t!=">"&&t!="/"||!x.isActiveAt(e.state,O,-1))return!1;let{state:r}=e,i=r.changeByRange(s=>{var n,o;let{head:Q}=s,p=_(r).resolveInner(Q,-1),c;if(p.name=="JSXStartTag"&&(p=p.parent),t==">"&&p.name=="JSXFragmentTag")return{range:z.cursor(Q+1),changes:{from:Q,insert:">"}};if(t=="/"&&p.name=="JSXFragmentTag"){let u=p.parent,h=u==null?void 0:u.parent;if(u.from==Q-1&&((n=h.lastChild)===null||n===void 0?void 0:n.name)!="JSXEndTag"&&(c=Se(r.doc,h==null?void 0:h.firstChild,Q))){let f=`/${c}>`;return{range:z.cursor(Q+f.length),changes:{from:Q,insert:f}}}}else if(t==">"){let u=Ir(p);if(u&&((o=u.lastChild)===null||o===void 0?void 0:o.name)!="JSXEndTag"&&r.sliceDoc(Q,Q+2)!="`}}}return{range:s}});return i.changes.empty?!1:(e.dispatch(i,{userEvent:"input.type",scrollIntoView:!0}),!0)}),j=["_blank","_self","_top","_parent"],$O=["ascii","utf-8","utf-16","latin1","latin1"],gO=["get","post","put","delete"],PO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],m=["true","false"],S={},Br={a:{attrs:{href:null,ping:null,type:null,media:null,target:j,hreflang:null}},abbr:S,address:S,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:S,aside:S,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:S,base:{attrs:{href:null,target:j}},bdi:S,bdo:S,blockquote:{attrs:{cite:null}},body:S,br:S,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:PO,formmethod:gO,formnovalidate:["novalidate"],formtarget:j,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:S,center:S,cite:S,code:S,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:S,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:S,div:S,dl:S,dt:S,em:S,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:S,figure:S,footer:S,form:{attrs:{action:null,name:null,"accept-charset":$O,autocomplete:["on","off"],enctype:PO,method:gO,novalidate:["novalidate"],target:j}},h1:S,h2:S,h3:S,h4:S,h5:S,h6:S,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:S,hgroup:S,hr:S,html:{attrs:{manifest:null}},i:S,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:PO,formmethod:gO,formnovalidate:["novalidate"],formtarget:j,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:S,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:S,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:S,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:$O,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:S,noscript:S,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:S,param:{attrs:{name:null,value:null}},pre:S,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:S,rt:S,ruby:S,samp:S,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:$O}},section:S,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:S,source:{attrs:{src:null,type:null,media:null}},span:S,strong:S,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:S,summary:S,sup:S,table:S,tbody:S,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:S,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:S,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:S,time:{attrs:{datetime:null}},title:S,tr:S,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:S,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:S},at={accesskey:null,class:null,contenteditable:m,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:m,autocorrect:m,autocapitalize:m,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":m,"aria-autocomplete":["inline","list","both","none"],"aria-busy":m,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":m,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":m,"aria-hidden":m,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":m,"aria-multiselectable":m,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":m,"aria-relevant":null,"aria-required":m,"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},rt="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(e=>"on"+e);for(let e of rt)at[e]=null;class tO{constructor(O,a){this.tags=Object.assign(Object.assign({},Br),O),this.globalAttrs=Object.assign(Object.assign({},at),a),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}tO.default=new tO;function U(e,O,a=e.length){if(!O)return"";let t=O.firstChild,r=t&&t.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,a)):""}function oO(e,O=!1){for(let a=e.parent;a;a=a.parent)if(a.name=="Element")if(O)O=!1;else return a;return null}function it(e,O,a){let t=a.tags[U(e,oO(O,!0))];return(t==null?void 0:t.children)||a.allTags}function WO(e,O){let a=[];for(let t=O;t=oO(t);){let r=U(e,t);if(r&&t.lastChild.name=="CloseTag")break;r&&a.indexOf(r)<0&&(O.name=="EndTag"||O.from>=t.firstChild.to)&&a.push(r)}return a}const st=/^[:\-\.\w\u00b7-\uffff]*$/;function fe(e,O,a,t,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:t,to:r,options:it(e.doc,a,O).map(s=>({label:s,type:"type"})).concat(WO(e.doc,a).map((s,n)=>({label:"/"+s,apply:"/"+s+i,type:"type",boost:99-n}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function de(e,O,a,t){let r=/\s*>/.test(e.sliceDoc(t,t+5))?"":">";return{from:a,to:t,options:WO(e.doc,O).map((i,s)=>({label:i,apply:i+r,type:"type",boost:99-s})),validFor:st}}function Dr(e,O,a,t){let r=[],i=0;for(let s of it(e.doc,a,O))r.push({label:"<"+s,type:"type"});for(let s of WO(e.doc,a))r.push({label:"",type:"type",boost:99-i++});return{from:t,to:t,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Lr(e,O,a,t,r){let i=oO(a),s=i?O.tags[U(e.doc,i)]:null,n=s&&s.attrs?Object.keys(s.attrs):[],o=s&&s.globalAttrs===!1?n:n.length?n.concat(O.globalAttrNames):O.globalAttrNames;return{from:t,to:r,options:o.map(Q=>({label:Q,type:"property"})),validFor:st}}function Jr(e,O,a,t,r){var i;let s=(i=a.parent)===null||i===void 0?void 0:i.getChild("AttributeName"),n=[],o;if(s){let Q=e.sliceDoc(s.from,s.to),p=O.globalAttrs[Q];if(!p){let c=oO(a),u=c?O.tags[U(e.doc,c)]:null;p=(u==null?void 0:u.attrs)&&u.attrs[Q]}if(p){let c=e.sliceDoc(t,r).toLowerCase(),u='"',h='"';/^['"]/.test(c)?(o=c[0]=='"'?/^[^"]*$/:/^[^']*$/,u="",h=e.sliceDoc(r,r+1)==c[0]?"":c[0],c=c.slice(1),t++):o=/^[^\s<>='"]*$/;for(let f of p)n.push({label:f,apply:u+f+h,type:"constant"})}}return{from:t,to:r,options:n,validFor:o}}function Mr(e,O){let{state:a,pos:t}=O,r=_(a).resolveInner(t),i=r.resolve(t,-1);for(let s=t,n;r==i&&(n=i.childBefore(s));){let o=n.lastChild;if(!o||!o.type.isError||o.fromMr(t,r)}const nt=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Ke.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ot.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:et.parser},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:x.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:eO.parser}],lt=[{name:"style",parser:eO.parser.configure({top:"Styles"})}].concat(rt.map(e=>({name:e,parser:x.parser}))),J=iO.define({name:"html",parser:Da.configure({props:[sO.add({Element(e){let O=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+O[0].length?e.continue():e.lineIndent(e.node.from)+(O[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})],wrap:Ee(nt,lt)}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}});function Fr(e={}){let O="",a;e.matchClosingTags===!1&&(O="noMatch"),e.selfClosingTags===!0&&(O=(O?O+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(a=Ee((e.nestedLanguages||[]).concat(nt),(e.nestedAttributes||[]).concat(lt)));let t=a||O?J.configure({dialect:O,wrap:a}):J;return new lO(t,[J.data.of({autocomplete:Hr(e)}),e.autoCloseTags!==!1?Kr:[],tt().support,$r().support])}const $e=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Kr=w.inputHandler.of((e,O,a,t)=>{if(e.composing||e.state.readOnly||O!=a||t!=">"&&t!="/"||!J.isActiveAt(e.state,O,-1))return!1;let{state:r}=e,i=r.changeByRange(s=>{var n,o,Q;let{head:p}=s,c=_(r).resolveInner(p,-1),u;if((c.name=="TagName"||c.name=="StartTag")&&(c=c.parent),t==">"&&c.name=="OpenTag"){if(((o=(n=c.parent)===null||n===void 0?void 0:n.lastChild)===null||o===void 0?void 0:o.name)!="CloseTag"&&(u=U(r.doc,c.parent,p))&&!$e.has(u)){let h=e.state.doc.sliceString(p,p+1)===">",f=`${h?"":">"}`;return{range:z.cursor(p+1),changes:{from:p+(h?1:0),insert:f}}}}else if(t=="/"&&c.name=="OpenTag"){let h=c.parent,f=h==null?void 0:h.parent;if(h.from==p-1&&((Q=f.lastChild)===null||Q===void 0?void 0:Q.name)!="CloseTag"&&(u=U(r.doc,f,p))&&!$e.has(u)){let P=e.state.doc.sliceString(p,p+1)===">",$=`/${u}${P?"":">"}`,v=p+$.length+(P?1:0);return{range:z.cursor(v),changes:{from:p,insert:$}}}}return{range:s}});return i.changes.empty?!1:(e.dispatch(i,{userEvent:"input.type",scrollIntoView:!0}),!0)}),Oi=36,ge=1,ei=2,N=3,mO=4,ti=5,ai=6,ri=7,ii=8,si=9,ni=10,li=11,oi=12,Qi=13,ci=14,hi=15,pi=16,ui=17,Pe=18,Si=19,ot=20,Qt=21,me=22,fi=23,di=24;function yO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function $i(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Y(e,O,a){for(let t=!1;;){if(e.next<0)return;if(e.next==O&&!t){e.advance();return}t=a&&!t&&e.next==92,e.advance()}}function gi(e){for(;;){if(e.next<0||e.peek(1)<0)return;if(e.next==36&&e.peek(1)==36){e.advance(2);return}e.advance()}}function ct(e,O){for(;!(e.next!=95&&!yO(e.next));)O!=null&&(O+=String.fromCharCode(e.next)),e.advance();return O}function Pi(e){if(e.next==39||e.next==34||e.next==96){let O=e.next;e.advance(),Y(e,O,!1)}else ct(e)}function be(e,O){for(;e.next==48||e.next==49;)e.advance();O&&e.next==O&&e.advance()}function Xe(e,O){for(;;){if(e.next==46){if(O)break;O=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function Ze(e){for(;!(e.next<0||e.next==10);)e.advance()}function W(e,O){for(let a=0;a!=&|~^/",specialVar:"?",identifierQuotes:'"',words:ht(bi,mi)};function Xi(e,O,a,t){let r={};for(let i in xO)r[i]=(e.hasOwnProperty(i)?e:xO)[i];return O&&(r.words=ht(O,a||"",t)),r}function pt(e){return new Z(O=>{var a;let{next:t}=O;if(O.advance(),W(t,ye)){for(;W(O.next,ye);)O.advance();O.acceptToken(Oi)}else if(t==36&&O.next==36&&e.doubleDollarQuotedStrings)gi(O),O.acceptToken(N);else if(t==39||t==34&&e.doubleQuotedStrings)Y(O,t,e.backslashEscapes),O.acceptToken(N);else if(t==35&&e.hashComments||t==47&&O.next==47&&e.slashComments)Ze(O),O.acceptToken(ge);else if(t==45&&O.next==45&&(!e.spaceAfterDashes||O.peek(1)==32))Ze(O),O.acceptToken(ge);else if(t==47&&O.next==42){O.advance();for(let r=-1,i=1;!(O.next<0);)if(O.advance(),r==42&&O.next==47){if(i--,!i){O.advance();break}r=-1}else r==47&&O.next==42?(i++,r=-1):r=O.next;O.acceptToken(ei)}else if((t==101||t==69)&&O.next==39)O.advance(),Y(O,39,!0);else if((t==110||t==78)&&O.next==39&&e.charSetCasts)O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(N);else if(t==95&&e.charSetCasts)for(let r=0;;r++){if(O.next==39&&r>1){O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(N);break}if(!yO(O.next))break;O.advance()}else if(t==40)O.acceptToken(ri);else if(t==41)O.acceptToken(ii);else if(t==123)O.acceptToken(si);else if(t==125)O.acceptToken(ni);else if(t==91)O.acceptToken(li);else if(t==93)O.acceptToken(oi);else if(t==59)O.acceptToken(Qi);else if(e.unquotedBitLiterals&&t==48&&O.next==98)O.advance(),be(O),O.acceptToken(me);else if((t==98||t==66)&&(O.next==39||O.next==34)){const r=O.next;O.advance(),e.treatBitsAsBytes?(Y(O,r,e.backslashEscapes),O.acceptToken(fi)):(be(O,r),O.acceptToken(me))}else if(t==48&&(O.next==120||O.next==88)||(t==120||t==88)&&O.next==39){let r=O.next==39;for(O.advance();$i(O.next);)O.advance();r&&O.next==39&&O.advance(),O.acceptToken(mO)}else if(t==46&&O.next>=48&&O.next<=57)Xe(O,!0),O.acceptToken(mO);else if(t==46)O.acceptToken(ci);else if(t>=48&&t<=57)Xe(O,!1),O.acceptToken(mO);else if(W(t,e.operatorChars)){for(;W(O.next,e.operatorChars);)O.advance();O.acceptToken(hi)}else if(W(t,e.specialVar))O.next==t&&O.advance(),Pi(O),O.acceptToken(ui);else if(W(t,e.identifierQuotes))Y(O,t,!1),O.acceptToken(Si);else if(t==58||t==44)O.acceptToken(pi);else if(yO(t)){let r=ct(O,String.fromCharCode(t));O.acceptToken(O.next==46?Pe:(a=e.words[r.toLowerCase()])!==null&&a!==void 0?a:Pe)}})}const ut=pt(xO),Zi=T.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,ut],topRules:{Script:[0,25]},tokenPrec:0});function kO(e){let O=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(O.name);)O.moveTo(O.from,-1);return O.node}function A(e,O){let a=e.sliceString(O.from,O.to),t=/^([`'"])(.*)\1$/.exec(a);return t?t[2]:a}function aO(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function yi(e,O){if(O.name=="CompositeIdentifier"){let a=[];for(let t=O.firstChild;t;t=t.nextSibling)aO(t)&&a.push(A(e,t));return a}return[A(e,O)]}function xe(e,O){for(let a=[];;){if(!O||O.name!=".")return a;let t=kO(O);if(!aO(t))return a;a.unshift(A(e,t)),O=kO(t)}}function xi(e,O){let a=_(e).resolveInner(O,-1),t=vi(e.doc,a);return a.name=="Identifier"||a.name=="QuotedIdentifier"||a.name=="Keyword"?{from:a.from,quoted:a.name=="QuotedIdentifier"?e.doc.sliceString(a.from,a.from+1):null,parents:xe(e.doc,kO(a)),aliases:t}:a.name=="."?{from:O,quoted:null,parents:xe(e.doc,a),aliases:t}:{from:O,quoted:null,parents:[],empty:!0,aliases:t}}const ki=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function vi(e,O){let a;for(let r=O;!a;r=r.parent){if(!r)return null;r.name=="Statement"&&(a=r)}let t=null;for(let r=a.firstChild,i=!1,s=null;r;r=r.nextSibling){let n=r.name=="Keyword"?e.sliceString(r.from,r.to).toLowerCase():null,o=null;if(!i)i=n=="from";else if(n=="as"&&s&&aO(r.nextSibling))o=A(e,r.nextSibling);else{if(n&&ki.has(n))break;s&&aO(r)&&(o=A(e,r))}o&&(t||(t=Object.create(null)),t[o]=yi(e,s)),s=/Identifier$/.test(r.name)?r:null}return t}function Yi(e,O){return e?O.map(a=>Object.assign(Object.assign({},a),{label:e+a.label+e,apply:void 0})):O}const wi=/^\w*$/,Ti=/^[`'"]?\w*[`'"]?$/;class VO{constructor(){this.list=[],this.children=void 0}child(O){let a=this.children||(this.children=Object.create(null));return a[O]||(a[O]=new VO)}childCompletions(O){return this.children?Object.keys(this.children).filter(a=>a).map(a=>({label:a,type:O})):[]}}function Wi(e,O,a,t,r){let i=new VO,s=i.child(r||"");for(let n in e){let o=n.indexOf("."),p=(o>-1?i.child(n.slice(0,o)):s).child(o>-1?n.slice(o+1):n);p.list=e[n].map(c=>typeof c=="string"?{label:c,type:"property"}:c)}s.list=(O||s.childCompletions("type")).concat(t?s.child(t).list:[]);for(let n in i.children){let o=i.child(n);o.list.length||(o.list=o.childCompletions("type"))}return i.list=s.list.concat(a||i.childCompletions("type")),n=>{let{parents:o,from:Q,quoted:p,empty:c,aliases:u}=xi(n.state,n.pos);if(c&&!n.explicit)return null;u&&o.length==1&&(o=u[o[0]]||o);let h=i;for(let $ of o){for(;!h.children||!h.children[$];)if(h==i)h=s;else if(h==s&&t)h=h.child(t);else return null;h=h.child($)}let f=p&&n.state.sliceDoc(n.pos,n.pos+1)==p,P=h.list;return h==i&&u&&(P=P.concat(Object.keys(u).map($=>({label:$,type:"constant"})))),{from:Q,to:f?n.pos+1:void 0,options:Yi(p,P),validFor:p?Ti:wi}}}function Vi(e,O){let a=Object.keys(e).map(t=>({label:O?t.toUpperCase():t,type:e[t]==Qt?"type":e[t]==ot?"keyword":"variable",boost:-1}));return Ye(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],we(a))}let Ui=Zi.configure({props:[sO.add({Statement:R()}),nO.add({Statement(e){return{from:e.firstChild.to,to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),rO({Keyword:l.keyword,Type:l.typeName,Builtin:l.standard(l.name),Bits:l.number,Bytes:l.string,Bool:l.bool,Null:l.null,Number:l.number,String:l.string,Identifier:l.name,QuotedIdentifier:l.special(l.string),SpecialVar:l.special(l.name),LineComment:l.lineComment,BlockComment:l.blockComment,Operator:l.operator,"Semi Punctuation":l.punctuation,"( )":l.paren,"{ }":l.brace,"[ ]":l.squareBracket})]});class QO{constructor(O,a){this.dialect=O,this.language=a}get extension(){return this.language.extension}static define(O){let a=Xi(O,O.keywords,O.types,O.builtin),t=iO.define({name:"sql",parser:Ui.configure({tokenizers:[{from:ut,to:pt(a)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new QO(a,t)}}function _i(e,O=!1){return Vi(e.dialect.words,O)}function Ci(e,O=!1){return e.language.data.of({autocomplete:_i(e,O)})}function qi(e){return e.schema?Wi(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema):()=>null}function ji(e){return e.schema?(e.dialect||St).language.data.of({autocomplete:qi(e)}):[]}function Gi(e={}){let O=e.dialect||St;return new lO(O.language,[ji(e),Ci(O,!!e.upperCaseKeywords)])}const St=QO.define({});function Ri(e){let O;return{c(){O=Pt("div"),mt(O,"class","code-editor"),I(O,"min-height",e[0]?e[0]+"px":null),I(O,"max-height",e[1]?e[1]+"px":"auto")},m(a,t){bt(a,O,t),e[11](O)},p(a,[t]){t&1&&I(O,"min-height",a[0]?a[0]+"px":null),t&2&&I(O,"max-height",a[1]?a[1]+"px":"auto")},i:GO,o:GO,d(a){a&&Xt(O),e[11](null)}}}function zi(e,O,a){let t;Zt(e,yt,d=>a(12,t=d));const r=xt();let{id:i=""}=O,{value:s=""}=O,{minHeight:n=null}=O,{maxHeight:o=null}=O,{disabled:Q=!1}=O,{placeholder:p=""}=O,{language:c="javascript"}=O,{singleLine:u=!1}=O,h,f,P=new E,$=new E,v=new E,UO=new E;function cO(){h==null||h.focus()}function _O(){f==null||f.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0})),r("change",s)}function CO(){if(!i)return;const d=document.querySelectorAll('[for="'+i+'"]');for(let g of d)g.removeEventListener("click",cO)}function qO(){if(!i)return;CO();const d=document.querySelectorAll('[for="'+i+'"]');for(let g of d)g.addEventListener("click",cO)}function jO(){switch(c){case"html":return Fr();case"sql":let d={};for(let g of t)d[g.name]=vt.getAllCollectionIdentifiers(g);return Gi({dialect:QO.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:d,upperCaseKeywords:!0});default:return tt()}}kt(()=>{const d={key:"Enter",run:g=>{u&&r("submit",s)}};return qO(),a(10,h=new w({parent:f,state:C.create({doc:s,extensions:[Gt(),Rt(),zt(),At(),It(),C.allowMultipleSelections.of(!0),Et(Nt,{fallback:!0}),Bt(),Dt(),Lt(),Jt(),Mt.of([d,...Ht,...Ft,Kt.find(g=>g.key==="Mod-d"),...Oa,...ea]),w.lineWrapping,ta({icons:!1}),P.of(jO()),UO.of(RO(p)),$.of(w.editable.of(!0)),v.of(C.readOnly.of(!1)),C.transactionFilter.of(g=>u&&g.newDoc.lines>1?[]:g),w.updateListener.of(g=>{!g.docChanged||Q||(a(3,s=g.state.doc.toString()),_O())})]})})),()=>{CO(),h==null||h.destroy()}});function ft(d){Yt[d?"unshift":"push"](()=>{f=d,a(2,f)})}return e.$$set=d=>{"id"in d&&a(4,i=d.id),"value"in d&&a(3,s=d.value),"minHeight"in d&&a(0,n=d.minHeight),"maxHeight"in d&&a(1,o=d.maxHeight),"disabled"in d&&a(5,Q=d.disabled),"placeholder"in d&&a(6,p=d.placeholder),"language"in d&&a(7,c=d.language),"singleLine"in d&&a(8,u=d.singleLine)},e.$$.update=()=>{e.$$.dirty&16&&i&&qO(),e.$$.dirty&1152&&h&&c&&h.dispatch({effects:[P.reconfigure(jO())]}),e.$$.dirty&1056&&h&&typeof Q<"u"&&(h.dispatch({effects:[$.reconfigure(w.editable.of(!Q)),v.reconfigure(C.readOnly.of(Q))]}),_O()),e.$$.dirty&1032&&h&&s!=h.state.doc.toString()&&h.dispatch({changes:{from:0,to:h.state.doc.length,insert:s}}),e.$$.dirty&1088&&h&&typeof p<"u"&&h.dispatch({effects:[UO.reconfigure(RO(p))]})},[n,o,f,s,i,Q,p,c,u,cO,h,ft]}class Ei extends dt{constructor(O){super(),$t(this,O,zi,Ri,gt,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{Ei as default}; diff --git a/ui/dist/assets/CodeEditor-441745aa.js b/ui/dist/assets/CodeEditor-441745aa.js new file mode 100644 index 00000000..df8d1f02 --- /dev/null +++ b/ui/dist/assets/CodeEditor-441745aa.js @@ -0,0 +1,14 @@ +import{S as ut,i as St,s as ft,e as dt,f as $t,T as I,g as gt,y as jO,o as Pt,I as mt,J as bt,K as Xt,L as Zt,C as xt,M as yt}from"./index-4bd199fb.js";import{P as kt,N as vt,u as Yt,D as wt,v as vO,T as B,I as xe,w as rO,x as l,y as Tt,L as iO,z as sO,A as R,B as nO,F as ye,G as lO,H as _,J as ke,K as ve,E as w,M as z,O as Wt,Q as Vt,R as Ye,U as b,V as Ut,W as _t,X as Ct,a as C,h as qt,b as jt,c as Gt,d as Rt,e as zt,s as At,f as It,g as Et,i as Nt,r as Bt,j as Dt,k as Lt,l as Jt,m as Mt,n as Ht,o as Ft,p as Kt,q as Oa,t as GO,C as E}from"./index-a6ccb683.js";class M{constructor(O,a,t,r,i,s,n,o,Q,p=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=i,this.score=s,this.buffer=n,this.bufferBase=o,this.curContext=Q,this.lookAhead=p,this.parent=c}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new M(O,[],a,t,t,0,[],0,r?new RO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:i}=this.p,s=i.dynamicPrecedence(r);if(s&&(this.score+=s),t==0){this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(o==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,o)}storeNode(O,a,t,r=4,i=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[n-4]==0&&s.buffer[n-1]>-1){if(a==t)return;if(s.buffer[n-2]>=a){s.buffer[n-2]=t;return}}}if(!i||this.pos==t)this.buffer.push(O,a,t,r);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>t;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4);this.buffer[s]=O,this.buffer[s+1]=a,this.buffer[s+2]=t,this.buffer[s+3]=r}}shift(O,a,t){let r=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=t,this.shiftContext(a,r),a<=this.p.parser.maxNode&&this.buffer.push(a,r,t,4);else{let i=O,{parser:s}=this.p;(t>this.pos||a<=s.maxNode)&&(this.pos=t,s.stateFlag(i,1)||(this.reducePos=t)),this.pushState(i,r),this.shiftContext(a,r),a<=s.maxNode&&this.buffer.push(a,r,t,4)}}apply(O,a,t){O&65536?this.reduce(O):this.shift(O,a,t)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new M(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new ea(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>4<<1||this.stack.length>=120){let r=[];for(let i=0,s;io&1&&n==s)||r.push(a[i],s)}a=r}let t=[];for(let r=0;r>19,r=O&65535,i=this.stack.length-t*3;if(i<0||a.getGoto(this.stack[i],r,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(O),!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:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class RO{constructor(O,a){this.tracker=O,this.context=a,this.hash=O.strict?O.hash(a):0}}var zO;(function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth",e[e.MinBigReduction=2e3]="MinBigReduction"})(zO||(zO={}));class ea{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let a=O&65535,t=O>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class H{constructor(O,a,t){this.stack=O,this.pos=a,this.index=t,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,a=O.bufferBase+O.buffer.length){return new H(O,a,a-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.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 H(this.stack,this.pos,this.index)}}function G(e,O=Uint16Array){if(typeof e!="string")return e;let a=null;for(let t=0,r=0;t=92&&s--,s>=34&&s--;let o=s-32;if(o>=46&&(o-=46,n=!0),i+=o,n)break;i*=46}a?a[r++]=i:a=new O(i)}return a}class D{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const AO=new D;class ta{constructor(O,a){this.input=O,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=AO,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(O,a){let t=this.range,r=this.rangeIndex,i=this.pos+O;for(;it.to:i>=t.to;){if(r==this.ranges.length-1)return null;let s=this.ranges[++r];i+=s.from-t.to,t=s}return i}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,a.from);return this.end}peek(O){let a=this.chunkOff+O,t,r;if(a>=0&&a=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(O,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,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(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,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(O,a){if(a?(this.token=a,a.start=O,a.lookAhead=O+1,a.value=a.extended=-1):this.token=AO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,a-this.chunkPos);if(O>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,a-this.chunk2Pos);if(O>=this.range.from&&a<=this.range.to)return this.input.read(O,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>O&&(t+=this.input.read(Math.max(r.from,O),Math.min(r.to,a)))}return t}}class V{constructor(O,a){this.data=O,this.id=a}token(O,a){let{parser:t}=a.p;we(this.data,O,a,this.id,t.data,t.tokenPrecTable)}}V.prototype.contextual=V.prototype.fallback=V.prototype.extend=!1;class bO{constructor(O,a,t){this.precTable=a,this.elseToken=t,this.data=typeof O=="string"?G(O):O}token(O,a){let t=O.pos,r;for(;r=O.pos,we(this.data,O,a,0,this.data,this.precTable),!(O.token.value>-1);){if(this.elseToken==null)return;if(O.next<0)break;O.advance(),O.reset(r+1,O.token)}r>t&&(O.reset(t,O.token),O.acceptToken(this.elseToken,r-t))}}bO.prototype.contextual=V.prototype.fallback=V.prototype.extend=!1;class Z{constructor(O,a={}){this.token=O,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function we(e,O,a,t,r,i){let s=0,n=1<0){let f=e[h];if(o.allows(f)&&(O.token.value==-1||O.token.value==f||aa(f,O.token.value,r,i))){O.acceptToken(f);break}}let p=O.next,c=0,u=e[s+2];if(O.next<0&&u>c&&e[Q+u*3-3]==65535&&e[Q+u*3-3]==65535){s=e[Q+u*3-1];continue O}for(;c>1,f=Q+h+(h<<1),$=e[f],g=e[f+1]||65536;if(p<$)u=h;else if(p>=g)c=h+1;else{s=e[f+2],O.advance();continue O}}break}}function IO(e,O,a){for(let t=O,r;(r=e[t])!=65535;t++)if(r==a)return t-O;return-1}function aa(e,O,a,t){let r=IO(a,t,O);return r<0||IO(a,t,e)O)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,O-25)):Math.min(e.length,Math.max(t.from+1,O+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:e.length}}class ra{constructor(O,a){this.fragments=O,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?NO(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?NO(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=s,null;if(i instanceof B){if(s==O){if(s=Math.max(this.safeFrom,O)&&(this.trees.push(i),this.start.push(s),this.index.push(0))}else this.index[a]++,this.nextStart=s+i.length}}}class ia{constructor(O,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(t=>new D)}getActions(O){let a=0,t=null,{parser:r}=O.p,{tokenizers:i}=r,s=r.stateSlot(O.state,3),n=O.curContext?O.curContext.hash:0,o=0;for(let Q=0;Qc.end+25&&(o=Math.max(c.lookAhead,o)),c.value!=0)){let u=a;if(c.extended>-1&&(a=this.addActions(O,c.extended,c.end,a)),a=this.addActions(O,c.value,c.end,a),!p.extend&&(t=c,a>u))break}}for(;this.actions.length>a;)this.actions.pop();return o&&O.setLookAhead(o),!t&&O.pos==this.stream.end&&(t=new D,t.value=O.p.parser.eofTerm,t.start=t.end=O.pos,a=this.addActions(O,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let a=new D,{pos:t,p:r}=O;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(O,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,O),t),O.value>-1){let{parser:i}=t.p;for(let s=0;s=0&&t.p.parser.dialect.allows(n>>1)){n&1?O.extended=n>>1:O.value=n>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,a,t,r){for(let i=0;iO.bufferLength*4?new ra(t,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,a=this.minStackPos,t=this.stacks=[],r,i;if(this.bigReductionCount>300&&O.length==1){let[s]=O;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sa)t.push(n);else{if(this.advanceStack(n,t,O))continue;{r||(r=[],i=[]),r.push(n);let o=this.tokens.getMainToken(n);i.push(o.value,o.end)}}break}}if(!t.length){let s=r&&la(r);if(s)return this.stackToTree(s);if(this.parser.strict)throw X&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let s=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,t);if(s)return this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(t.length>s)for(t.sort((n,o)=>o.score-n.score);t.length>s;)t.pop();t.some(n=>n.reducePos>a)&&this.recovering--}else if(t.length>1){O:for(let s=0;s500&&Q.buffer.length>500)if((n.score-Q.score||n.buffer.length-Q.buffer.length)>0)t.splice(o--,1);else{t.splice(s--,1);continue O}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,p=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let u=this.parser.nodeSet.types[c.type.id]==c.type?i.getGoto(O.state,c.type.id):-1;if(u>-1&&c.length&&(!Q||(c.prop(vO.contextHash)||0)==p))return O.useNode(c,u),X&&console.log(s+this.stackID(O)+` (via reuse of ${i.getName(c.type.id)})`),!0;if(!(c instanceof B)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof B&&c.positions[0]==0)c=h;else break}}let n=i.stateSlot(O.state,4);if(n>0)return O.reduce(n),X&&console.log(s+this.stackID(O)+` (via always-reduce ${i.getName(n&65535)})`),!0;if(O.stack.length>=15e3)for(;O.stack.length>9e3&&O.forceReduce(););let o=this.tokens.getActions(O);for(let Q=0;Qr?a.push(f):t.push(f)}return!1}advanceFully(O,a){let t=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>t)return DO(O,a),!0}}runRecovery(O,a,t){let r=null,i=!1;for(let s=0;s ":"";if(n.deadEnd&&(i||(i=!0,n.restart(),X&&console.log(p+this.stackID(n)+" (restarted)"),this.advanceFully(n,t))))continue;let c=n.split(),u=p;for(let h=0;c.forceReduce()&&h<10&&(X&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));h++)X&&(u=this.stackID(c)+" -> ");for(let h of n.recoverByInsert(o))X&&console.log(p+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,t);this.stream.end>n.pos?(Q==n.pos&&(Q++,o=0),n.recoverByDelete(o,Q),X&&console.log(p+this.stackID(n)+` (via recover-delete ${this.parser.getName(o)})`),DO(n,t)):(!r||r.scoree;class Te{constructor(O){this.start=O.start,this.shift=O.shift||pO,this.reduce=O.reduce||pO,this.reuse=O.reuse||pO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class T extends kt{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (${14})`);let a=O.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let n=0;nO.topRules[n][1]),r=[];for(let n=0;n=0)i(p,o,n[Q++]);else{let c=n[Q+-p];for(let u=-p;u>0;u--)i(n[Q++],o,c);Q++}}}this.nodeSet=new vt(a.map((n,o)=>Yt.define({name:o>=this.minRepeatTerm?void 0:n,id:o,props:r[o],top:t.indexOf(o)>-1,error:o==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(o)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=wt;let s=G(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;ntypeof n=="number"?new V(s,n):n),this.topRules=O.topRules,this.dialects=O.dialects||{},this.dynamicPrecedences=O.dynamicPrecedences||null,this.tokenPrecTable=O.tokenPrec,this.termNames=O.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(O,a,t){let r=new sa(this,O,a,t);for(let i of this.wrappers)r=i(r,O,a,t);return r}getGoto(O,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let i=r[a+1];;){let s=r[i++],n=s&1,o=r[i++];if(n&&t)return o;for(let Q=i+(s>>1);i0}validAction(O,a){if(a==this.stateSlot(O,4))return!0;for(let t=this.stateSlot(O,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=x(this.data,t+2);else return!1;if(a==x(this.data,t+1))return!0}}nextStates(O){let a=[];for(let t=this.stateSlot(O,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=x(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((i,s)=>s&1&&i==r)||a.push(this.data[t],r)}}return a}configure(O){let a=Object.assign(Object.create(T.prototype),this);if(O.props&&(a.nodeSet=this.nodeSet.extend(...O.props)),O.top){let t=this.topRules[O.top];if(!t)throw new RangeError(`Invalid top rule name ${O.top}`);a.top=t}return O.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=O.tokenizers.find(i=>i.from==t);return r?r.to:t})),O.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let i=O.specializers.find(n=>n.from==t.external);if(!i)return t;let s=Object.assign(Object.assign({},t),{external:i.to});return a.specializers[r]=LO(s),s})),O.contextTracker&&(a.context=O.contextTracker),O.dialect&&(a.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(a.strict=O.strict),O.wrap&&(a.wrappers=a.wrappers.concat(O.wrap)),O.bufferLength!=null&&(a.bufferLength=O.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let a=this.dynamicPrecedences;return a==null?0:a[O]||0}parseDialect(O){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(O)for(let i of O.split(" ")){let s=a.indexOf(i);s>=0&&(t[s]=!0)}let r=null;for(let i=0;it)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.scoree.external(a,t)<<1|O}return e.get}const oa=54,Qa=1,ca=55,ha=2,pa=56,ua=3,JO=4,Sa=5,F=6,We=7,Ve=8,Ue=9,_e=10,fa=11,da=12,$a=13,uO=57,ga=14,MO=58,Pa=20,ma=22,Ce=23,ba=24,XO=26,qe=27,Xa=28,Za=31,xa=34,je=36,ya=37,ka=0,va=1,Ya={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},wa={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},HO={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 Ta(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function Ge(e){return e==9||e==10||e==13||e==32}let FO=null,KO=null,Oe=0;function ZO(e,O){let a=e.pos+O;if(Oe==a&&KO==e)return FO;let t=e.peek(O);for(;Ge(t);)t=e.peek(++O);let r="";for(;Ta(t);)r+=String.fromCharCode(t),t=e.peek(++O);return KO=e,Oe=a,FO=r?r.toLowerCase():t==Wa||t==Va?void 0:null}const Re=60,K=62,YO=47,Wa=63,Va=33,Ua=45;function ee(e,O){this.name=e,this.parent=O,this.hash=O?O.hash:0;for(let a=0;a-1?new ee(ZO(t,1)||"",e):e},reduce(e,O){return O==Pa&&e?e.parent:e},reuse(e,O,a,t){let r=O.type.id;return r==F||r==je?new ee(ZO(t,1)||"",e):e},hash(e){return e?e.hash:0},strict:!1}),qa=new Z((e,O)=>{if(e.next!=Re){e.next<0&&O.context&&e.acceptToken(uO);return}e.advance();let a=e.next==YO;a&&e.advance();let t=ZO(e,0);if(t===void 0)return;if(!t)return e.acceptToken(a?ga:F);let r=O.context?O.context.name:null;if(a){if(t==r)return e.acceptToken(fa);if(r&&wa[r])return e.acceptToken(uO,-2);if(O.dialectEnabled(ka))return e.acceptToken(da);for(let i=O.context;i;i=i.parent)if(i.name==t)return;e.acceptToken($a)}else{if(t=="script")return e.acceptToken(We);if(t=="style")return e.acceptToken(Ve);if(t=="textarea")return e.acceptToken(Ue);if(Ya.hasOwnProperty(t))return e.acceptToken(_e);r&&HO[r]&&HO[r][t]?e.acceptToken(uO,-1):e.acceptToken(F)}},{contextual:!0}),ja=new Z(e=>{for(let O=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(MO);break}if(e.next==Ua)O++;else if(e.next==K&&O>=2){a>3&&e.acceptToken(MO,-2);break}else O=0;e.advance()}});function Ga(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Ra=new Z((e,O)=>{if(e.next==YO&&e.peek(1)==K){let a=O.dialectEnabled(va)||Ga(O.context);e.acceptToken(a?Sa:JO,2)}else e.next==K&&e.acceptToken(JO,1)});function wO(e,O,a){let t=2+e.length;return new Z(r=>{for(let i=0,s=0,n=0;;n++){if(r.next<0){n&&r.acceptToken(O);break}if(i==0&&r.next==Re||i==1&&r.next==YO||i>=2&&is?r.acceptToken(O,-s):r.acceptToken(a,-(s-2));break}else if((r.next==10||r.next==13)&&n){r.acceptToken(O,1);break}else i=s=0;r.advance()}})}const za=wO("script",oa,Qa),Aa=wO("style",ca,ha),Ia=wO("textarea",pa,ua),Ea=rO({"Text RawText":l.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":l.angleBracket,TagName:l.tagName,"MismatchedCloseTag/TagName":[l.tagName,l.invalid],AttributeName:l.attributeName,"AttributeValue UnquotedAttributeValue":l.attributeValue,Is:l.definitionOperator,"EntityReference CharacterReference":l.character,Comment:l.blockComment,ProcessingInst:l.processingInstruction,DoctypeDecl:l.documentMeta}),Na=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!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 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:67,context:Ca,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[Ea],skippedNodes:[0],repeatNodeCount:9,tokenData:"#%g!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs4ysv-_vw5iwxJ^x}-_}!OKP!O!P-_!P!Q$q!Q![-_![!]!!O!]!^-_!^!_!&W!_!`#$o!`!a&X!a!c-_!c!}!!O!}#R-_#R#S!!O#S#T3V#T#o!!O#o#s-_#s$f$q$f%W-_%W%o!!O%o%p-_%p&a!!O&a&b-_&b1p!!O1p4U-_4U4d!!O4d4e-_4e$IS!!O$IS$I`-_$I`$Ib!!O$Ib$Kh-_$Kh%#t!!O%#t&/x-_&/x&Et!!O&Et&FV-_&FV;'S!!O;'S;:j!&Q;:j;=`4s<%l?&r-_?&r?Ah!!O?Ah?BY$q?BY?Mn!!O?MnO$q!Z$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bX`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UV`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pT`POv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!cpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({W`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!a`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!a`!cpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYkWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]``P!a`!cp!^^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_1n!_!a&X!a#S-_#S#T3V#T#s-_#s$f$q$f;'S-_;'S;=`4s<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/echSkWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!^!_0p!a#S/^#S#T0p#T#s/^#s$f+P$f;'S/^;'S;=`1h<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0uXhSqr0psw0px!P0p!Q!_0p!a#s0p$f;'S0p;'S;=`1b<%l?Ah0p?BY?Mn0pS1eP;=`<%l0p[1kP;=`<%l/^!U1wbhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!U3SP;=`<%l1n!V3bchS`P!a`!cpOq&Xqr3Vrs&}sv3Vvw0pwx(tx!P3V!P!Q&X!Q!^3V!^!_1n!_!a&X!a#s3V#s$f&X$f;'S3V;'S;=`4m<%l?Ah3V?Ah?BY&X?BY?Mn3V?MnO&X!V4pP;=`<%l3V!_4vP;=`<%l-_!Z5SV!`h`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_5rjhSkWc!ROX7dXZ8qZ[7d[^8q^p7dqr:crs8qst@Ttw:cwx8qx!P:c!P!Q7d!Q!]:c!]!^/^!^!_=p!_!a8q!a#S:c#S#T=p#T#s:c#s$f7d$f;'S:c;'S;=`?}<%l?Ah:c?Ah?BY7d?BY?Mn:c?MnO7d!Z7ibkWOX7dXZ8qZ[7d[^8q^p7dqr7drs8qst+Ptw7dwx8qx!]7d!]!^9f!^!a8q!a#S7d#S#T8q#T;'S7d;'S;=`:]<%lO7d!R8tVOp8qqs8qt!]8q!]!^9Z!^;'S8q;'S;=`9`<%lO8q!R9`Oa!R!R9cP;=`<%l8q!Z9mYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z:`P;=`<%l7d!_:jjhSkWOX7dXZ8qZ[7d[^8q^p7dqr:crs8qst/^tw:cwx8qx!P:c!P!Q7d!Q!]:c!]!^<[!^!_=p!_!a8q!a#S:c#S#T=p#T#s:c#s$f7d$f;'S:c;'S;=`?}<%l?Ah:c?Ah?BY7d?BY?Mn:c?MnO7d!_b#d#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!>kdhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#V1n#V#W!?y#W#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!@SdhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#h1n#h#i!Ab#i#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!AkdhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#m1n#m#n!By#n#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!CSdhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#d1n#d#e!Db#e#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!DkdhS!a`!cpOq*Vqr1nrs(Vsv1nvw0pwx)ex!P1n!P!Q*V!Q!_1n!_!a*V!a#X1n#X#Y!5]#Y#s1n#s$f*V$f;'S1n;'S;=`3P<%l?Ah1n?Ah?BY*V?BY?Mn1n?MnO*V!V!FSchS!a`!cpOq!G_qr!Eyrs!HUsv!Eyvw!Ncwx!Jvx!P!Ey!P!Q!G_!Q!_!Ey!_!a!G_!a!b##T!b#s!Ey#s$f!G_$f;'S!Ey;'S;=`#$i<%l?Ah!Ey?Ah?BY!G_?BY?Mn!Ey?MnO!G_!R!GfY!a`!cpOr!G_rs!HUsv!G_vw!Hpwx!Jvx!a!G_!a!b!Lv!b;'S!G_;'S;=`!N]<%lO!G_q!HZV!cpOv!HUvx!Hpx!a!HU!a!b!Iq!b;'S!HU;'S;=`!Jp<%lO!HUP!HsTO!a!Hp!a!b!IS!b;'S!Hp;'S;=`!Ik<%lO!HpP!IVTO!`!Hp!`!a!If!a;'S!Hp;'S;=`!Ik<%lO!HpP!IkOxPP!InP;=`<%l!Hpq!IvV!cpOv!HUvx!Hpx!`!HU!`!a!J]!a;'S!HU;'S;=`!Jp<%lO!HUq!JdS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!JsP;=`<%l!HUa!J{X!a`Or!Jvrs!Hpsv!Jvvw!Hpw!a!Jv!a!b!Kh!b;'S!Jv;'S;=`!Lp<%lO!Jva!KmX!a`Or!Jvrs!Hpsv!Jvvw!Hpw!`!Jv!`!a!LY!a;'S!Jv;'S;=`!Lp<%lO!Jva!LaT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!LsP;=`<%l!Jv!R!L}Y!a`!cpOr!G_rs!HUsv!G_vw!Hpwx!Jvx!`!G_!`!a!Mm!a;'S!G_;'S;=`!N]<%lO!G_!R!MvV!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!N`P;=`<%l!G_T!NhbhSOq!Hpqr!Ncrs!Hpsw!Ncwx!Hpx!P!Nc!P!Q!Hp!Q!_!Nc!_!a!Hp!a!b# p!b#s!Nc#s$f!Hp$f;'S!Nc;'S;=`#!}<%l?Ah!Nc?Ah?BY!Hp?BY?Mn!Nc?MnO!HpT# ubhSOq!Hpqr!Ncrs!Hpsw!Ncwx!Hpx!P!Nc!P!Q!Hp!Q!_!Nc!_!`!Hp!`!a!If!a#s!Nc#s$f!Hp$f;'S!Nc;'S;=`#!}<%l?Ah!Nc?Ah?BY!Hp?BY?Mn!Nc?MnO!HpT##QP;=`<%l!Nc!V##^chS!a`!cpOq!G_qr!Eyrs!HUsv!Eyvw!Ncwx!Jvx!P!Ey!P!Q!G_!Q!_!Ey!_!`!G_!`!a!Mm!a#s!Ey#s$f!G_$f;'S!Ey;'S;=`#$i<%l?Ah!Ey?Ah?BY!G_?BY?Mn!Ey?MnO!G_!V#$lP;=`<%l!Ey!V#$zXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[za,Aa,Ia,Ra,qa,ja,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:485},tokenPrec:487});function ze(e,O){let a=Object.create(null);for(let t of e.getChildren(Ce)){let r=t.getChild(ba),i=t.getChild(XO)||t.getChild(qe);r&&(a[O.read(r.from,r.to)]=i?i.type.id==XO?O.read(i.from+1,i.to-1):O.read(i.from,i.to):"")}return a}function te(e,O){let a=e.getChild(ma);return a?O.read(a.from,a.to):" "}function SO(e,O,a){let t;for(let r of a)if(!r.attrs||r.attrs(t||(t=ze(e.node.parent.firstChild,O))))return{parser:r.parser};return null}function Ae(e=[],O=[]){let a=[],t=[],r=[],i=[];for(let n of e)(n.tag=="script"?a:n.tag=="style"?t:n.tag=="textarea"?r:i).push(n);let s=O.length?Object.create(null):null;for(let n of O)(s[n.name]||(s[n.name]=[])).push(n);return Tt((n,o)=>{var p;let Q=n.type.id;if(Q==Xa)return SO(n,o,a);if(Q==Za)return SO(n,o,t);if(Q==xa)return SO(n,o,r);if(Q==je&&i.length){let c=n.node,u=te(c,o),h;for(let f of i)if(f.tag==u&&(!f.attrs||f.attrs(h||(h=ze(c,o))))){let $=c.parent.lastChild;return{parser:f.parser,overlay:[{from:n.to,to:$.type.id==ya?$.from:c.parent.to}]}}}if(s&&Q==Ce){let c=n.node,u;if(u=c.firstChild){let h=s[o.read(u.from,u.to)];if(h)for(let f of h){if(f.tagName&&f.tagName!=te(c.parent,o))continue;let $=c.lastChild;if($.type.id==XO){let g=$.from+1,v=$.to-((p=$.lastChild)!=null&&p.isError?0:1);if(v>g)return{parser:f.parser,overlay:[{from:g,to:v}]}}else if($.type.id==qe)return{parser:f.parser,overlay:[{from:$.from,to:$.to}]}}}}return null})}const Ba=94,ae=1,Da=95,La=96,re=2,Ie=[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],Ja=58,Ma=40,Ee=95,Ha=91,L=45,Fa=46,Ka=35,Or=37;function OO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function er(e){return e>=48&&e<=57}const tr=new Z((e,O)=>{for(let a=!1,t=0,r=0;;r++){let{next:i}=e;if(OO(i)||i==L||i==Ee||a&&er(i))!a&&(i!=L||r>0)&&(a=!0),t===r&&i==L&&t++,e.advance();else{a&&e.acceptToken(i==Ma?Da:t==2&&O.canShift(re)?re:La);break}}}),ar=new Z(e=>{if(Ie.includes(e.peek(-1))){let{next:O}=e;(OO(O)||O==Ee||O==Ka||O==Fa||O==Ha||O==Ja||O==L)&&e.acceptToken(Ba)}}),rr=new Z(e=>{if(!Ie.includes(e.peek(-1))){let{next:O}=e;if(O==Or&&(e.advance(),e.acceptToken(ae)),OO(O)){do e.advance();while(OO(e.next));e.acceptToken(ae)}}}),ir=rO({"AtKeyword import charset namespace keyframes media supports":l.definitionKeyword,"from to selector":l.keyword,NamespaceName:l.namespace,KeyframeName:l.labelName,TagName:l.tagName,ClassName:l.className,PseudoClassName:l.constant(l.className),IdName:l.labelName,"FeatureName PropertyName":l.propertyName,AttributeName:l.attributeName,NumberLiteral:l.number,KeywordQuery:l.keyword,UnaryQueryOp:l.operatorKeyword,"CallTag ValueName":l.atom,VariableName:l.variableName,Callee:l.operatorKeyword,Unit:l.unit,"UniversalSelector NestingSelector":l.definitionOperator,MatchOp:l.compareOperator,"ChildOp SiblingOp, LogicOp":l.logicOperator,BinOp:l.arithmeticOperator,Important:l.modifier,Comment:l.blockComment,ParenthesizedContent:l.special(l.name),ColorLiteral:l.color,StringLiteral:l.string,":":l.punctuation,"PseudoOp #":l.derefOperator,"; ,":l.separator,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace}),sr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},nr={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},lr={__proto__:null,not:128,only:128,from:158,to:160},or=T.deserialize({version:14,states:"7WQYQ[OOO#_Q[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO#fQ[O'#CfO$YQXO'#CaO$aQ[O'#ChO$lQ[O'#DPO$qQ[O'#DTOOQP'#Ed'#EdO$vQdO'#DeO%bQ[O'#DrO$vQdO'#DtO%sQ[O'#DvO&OQ[O'#DyO&TQ[O'#EPO&cQ[O'#EROOQS'#Ec'#EcOOQS'#ET'#ETQYQ[OOO&jQXO'#CdO'_QWO'#DaO'dQWO'#EjO'oQ[O'#EjQOQWOOOOQP'#Cg'#CgOOQP,59Q,59QO#fQ[O,59QO'yQ[O'#EWO(eQWO,58{O(mQ[O,59SO$lQ[O,59kO$qQ[O,59oO'yQ[O,59sO'yQ[O,59uO'yQ[O,59vO(xQ[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)PQWO,59SO)UQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)ZQ`O,59oOOQS'#Cp'#CpO$vQdO'#CqO)cQvO'#CsO*pQtO,5:POOQO'#Cx'#CxO)UQWO'#CwO+UQWO'#CyOOQS'#Eg'#EgOOQO'#Dh'#DhO+ZQ[O'#DoO+iQWO'#EkO&TQ[O'#DmO+wQWO'#DpOOQO'#El'#ElO(hQWO,5:^O+|QpO,5:`OOQS'#Dx'#DxO,UQWO,5:bO,ZQ[O,5:bOOQO'#D{'#D{O,cQWO,5:eO,hQWO,5:kO,pQWO,5:mOOQS-E8R-E8RO$vQdO,59{O,xQ[O'#EYO-VQWO,5;UO-VQWO,5;UOOQP1G.l1G.lO-|QXO,5:rOOQO-E8U-E8UOOQS1G.g1G.gOOQP1G.n1G.nO)PQWO1G.nO)UQWO1G.nOOQP1G/V1G/VO.ZQ`O1G/ZO.tQXO1G/_O/[QXO1G/aO/rQXO1G/bO0YQWO,59zO0_Q[O'#DOO0fQdO'#CoOOQP1G/Z1G/ZO$vQdO1G/ZO0mQpO,59]OOQS,59_,59_O$vQdO,59aO0uQWO1G/kOOQS,59c,59cO0zQ!bO,59eO1SQWO'#DhO1_QWO,5:TO1dQWO,5:ZO&TQ[O,5:VO&TQ[O'#EZO1lQWO,5;VO1wQWO,5:XO'yQ[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2YQWO1G/|O2_QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO2mQtO1G/gOOQO,5:t,5:tO3TQ[O,5:tOOQO-E8W-E8WO3bQWO1G0pOOQP7+$Y7+$YOOQP7+$u7+$uO$vQdO7+$uOOQS1G/f1G/fO3mQXO'#EiO3tQWO,59jO3yQtO'#EUO4nQdO'#EfO4xQWO,59ZO4}QpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5VQWO1G/PO$vQdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5[QWO,5:uOOQO-E8X-E8XO5jQXO1G/vOOQS7+%h7+%hO5qQYO'#CsO(hQWO'#E[O5yQdO,5:hOOQS,5:h,5:hO6XQtO'#EXO$vQdO'#EXO7VQdO7+%ROOQO7+%R7+%ROOQO1G0`1G0`O7jQpO<T![;'S%^;'S;=`%o<%lO%^^;TUoWOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^^;nYoW#[UOy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^^[[oW#[UOy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^_?VSpVOy%^z;'S%^;'S;=`%o<%lO%^^?hWjSOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^_@VU#XPOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjSOy%^z{@}{;'S%^;'S;=`%o<%lO%^~ASUoWOy@}yzAfz{Bm{;'S@};'S;=`Co<%lO@}~AiTOzAfz{Ax{;'SAf;'S;=`Bg<%lOAf~A{VOzAfz{Ax{!PAf!P!QBb!Q;'SAf;'S;=`Bg<%lOAf~BgOR~~BjP;=`<%lAf~BrWoWOy@}yzAfz{Bm{!P@}!P!QC[!Q;'S@};'S;=`Co<%lO@}~CcSoWR~Oy%^z;'S%^;'S;=`%o<%lO%^~CrP;=`<%l@}^Cz[#[UOy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^XDuU]POy%^z![%^![!]EX!];'S%^;'S;=`%o<%lO%^XE`S^PoWOy%^z;'S%^;'S;=`%o<%lO%^_EqS!WVOy%^z;'S%^;'S;=`%o<%lO%^YFSSzQOy%^z;'S%^;'S;=`%o<%lO%^XFeU|POy%^z!`%^!`!aFw!a;'S%^;'S;=`%o<%lO%^XGOS|PoWOy%^z;'S%^;'S;=`%o<%lO%^XG_WOy%^z!c%^!c!}Gw!}#T%^#T#oGw#o;'S%^;'S;=`%o<%lO%^XHO[!YPoWOy%^z}%^}!OGw!O!Q%^!Q![Gw![!c%^!c!}Gw!}#T%^#T#oGw#o;'S%^;'S;=`%o<%lO%^XHySxPOy%^z;'S%^;'S;=`%o<%lO%^^I[SvUOy%^z;'S%^;'S;=`%o<%lO%^XIkUOy%^z#b%^#b#cI}#c;'S%^;'S;=`%o<%lO%^XJSUoWOy%^z#W%^#W#XJf#X;'S%^;'S;=`%o<%lO%^XJmS!`PoWOy%^z;'S%^;'S;=`%o<%lO%^XJ|UOy%^z#f%^#f#gJf#g;'S%^;'S;=`%o<%lO%^XKeS!RPOy%^z;'S%^;'S;=`%o<%lO%^_KvS!QVOy%^z;'S%^;'S;=`%o<%lO%^ZLXU!PPOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^WLnP;=`<%l$}",tokenizers:[ar,rr,tr,0,1,2,3],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:95,get:e=>sr[e]||-1},{term:56,get:e=>nr[e]||-1},{term:96,get:e=>lr[e]||-1}],tokenPrec:1123});let fO=null;function dO(){if(!fO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],a=new Set;for(let t in e)t!="cssText"&&t!="cssFloat"&&typeof e[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(O.push(t),a.add(t)));fO=O.sort().map(t=>({type:"property",label:t}))}return fO||[]}const ie=["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(e=>({type:"class",label:e})),se=["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(e=>({type:"keyword",label:e})).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(e=>({type:"constant",label:e}))),Qr=["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(e=>({type:"type",label:e})),k=/^[\w-]*/,cr=e=>{let{state:O,pos:a}=e,t=_(O).resolveInner(a,-1);if(t.name=="PropertyName")return{from:t.from,options:dO(),validFor:k};if(t.name=="ValueName")return{from:t.from,options:se,validFor:k};if(t.name=="PseudoClassName")return{from:t.from,options:ie,validFor:k};if(t.name=="TagName"){for(let{parent:s}=t;s;s=s.parent)if(s.name=="Block")return{from:t.from,options:dO(),validFor:k};return{from:t.from,options:Qr,validFor:k}}if(!e.explicit)return null;let r=t.resolve(a),i=r.childBefore(a);return i&&i.name==":"&&r.name=="PseudoClassSelector"?{from:a,options:ie,validFor:k}:i&&i.name==":"&&r.name=="Declaration"||r.name=="ArgList"?{from:a,options:se,validFor:k}:r.name=="Block"?{from:a,options:dO(),validFor:k}:null},eO=iO.define({name:"css",parser:or.configure({props:[sO.add({Declaration:R()}),nO.add({Block:ye})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function hr(){return new lO(eO,eO.data.of({autocomplete:cr}))}const ne=301,le=1,pr=2,oe=302,ur=304,Sr=305,fr=3,dr=4,$r=[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],Ne=125,gr=59,Qe=47,Pr=42,mr=43,br=45,Xr=new Te({start:!1,shift(e,O){return O==fr||O==dr||O==ur?e:O==Sr},strict:!1}),Zr=new Z((e,O)=>{let{next:a}=e;(a==Ne||a==-1||O.context)&&O.canShift(oe)&&e.acceptToken(oe)},{contextual:!0,fallback:!0}),xr=new Z((e,O)=>{let{next:a}=e,t;$r.indexOf(a)>-1||a==Qe&&((t=e.peek(1))==Qe||t==Pr)||a!=Ne&&a!=gr&&a!=-1&&!O.context&&O.canShift(ne)&&e.acceptToken(ne)},{contextual:!0}),yr=new Z((e,O)=>{let{next:a}=e;if((a==mr||a==br)&&(e.advance(),a==e.next)){e.advance();let t=!O.context&&O.canShift(le);e.acceptToken(t?le:pr)}},{contextual:!0}),kr=rO({"get set async static":l.modifier,"for while do if else switch try catch finally return throw break continue default case":l.controlKeyword,"in of await yield void typeof delete instanceof":l.operatorKeyword,"let var const function class extends":l.definitionKeyword,"import export from":l.moduleKeyword,"with debugger as new":l.keyword,TemplateString:l.special(l.string),super:l.atom,BooleanLiteral:l.bool,this:l.self,null:l.null,Star:l.modifier,VariableName:l.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":l.function(l.variableName),VariableDefinition:l.definition(l.variableName),Label:l.labelName,PropertyName:l.propertyName,PrivatePropertyName:l.special(l.propertyName),"CallExpression/MemberExpression/PropertyName":l.function(l.propertyName),"FunctionDeclaration/VariableDefinition":l.function(l.definition(l.variableName)),"ClassDeclaration/VariableDefinition":l.definition(l.className),PropertyDefinition:l.definition(l.propertyName),PrivatePropertyDefinition:l.definition(l.special(l.propertyName)),UpdateOp:l.updateOperator,LineComment:l.lineComment,BlockComment:l.blockComment,Number:l.number,String:l.string,Escape:l.escape,ArithOp:l.arithmeticOperator,LogicOp:l.logicOperator,BitOp:l.bitwiseOperator,CompareOp:l.compareOperator,RegExp:l.regexp,Equals:l.definitionOperator,Arrow:l.function(l.punctuation),": Spread":l.punctuation,"( )":l.paren,"[ ]":l.squareBracket,"{ }":l.brace,"InterpolationStart InterpolationEnd":l.special(l.brace),".":l.derefOperator,", ;":l.separator,"@":l.meta,TypeName:l.typeName,TypeDefinition:l.definition(l.typeName),"type enum interface implements namespace module declare":l.definitionKeyword,"abstract global Privacy readonly override":l.modifier,"is keyof unique infer":l.operatorKeyword,JSXAttributeValue:l.attributeValue,JSXText:l.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":l.angleBracket,"JSXIdentifier JSXNameSpacedName":l.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":l.attributeName,"JSXBuiltin/JSXIdentifier":l.standard(l.tagName)}),vr={__proto__:null,export:14,as:19,from:27,default:30,async:35,function:36,extends:46,this:50,true:58,false:58,null:70,void:74,typeof:78,super:96,new:130,delete:146,yield:155,await:159,class:164,public:219,private:219,protected:219,readonly:221,instanceof:240,satisfies:243,in:244,const:246,import:278,keyof:333,unique:337,infer:343,is:379,abstract:399,implements:401,type:403,let:406,var:408,interface:415,enum:419,namespace:425,module:427,declare:431,global:435,for:456,of:465,while:468,with:472,do:476,if:480,else:482,switch:486,case:492,try:498,catch:502,finally:506,return:510,throw:514,break:518,continue:522,debugger:526},Yr={__proto__:null,async:117,get:119,set:121,public:181,private:181,protected:181,static:183,abstract:185,override:187,readonly:193,accessor:195,new:383},wr={__proto__:null,"<":137},Tr=T.deserialize({version:14,states:"$BhO`QUOOO%QQUOOO'TQWOOP(_OSOOO*mQ(CjO'#CfO*tOpO'#CgO+SO!bO'#CgO+bO07`O'#DZO-sQUO'#DaO.TQUO'#DlO%QQUO'#DvO0[QUO'#EOOOQ(CY'#EW'#EWO0rQSO'#ETOOQO'#I_'#I_O0zQSO'#GjOOQO'#Eh'#EhO1VQSO'#EgO1[QSO'#EgO3^Q(CjO'#JbO5}Q(CjO'#JcO6kQSO'#FVO6pQ#tO'#FnOOQ(CY'#F_'#F_O6{O&jO'#F_O7ZQ,UO'#FuO8qQSO'#FtOOQ(CY'#Jc'#JcOOQ(CW'#Jb'#JbOOQQ'#J|'#J|O8vQSO'#IOO8{Q(C[O'#IPOOQQ'#JO'#JOOOQQ'#IT'#ITQ`QUOOO%QQUO'#DnO9TQUO'#DzO%QQUO'#D|O9[QSO'#GjO9aQ,UO'#ClO9oQSO'#EfO9zQSO'#EqO:PQ,UO'#F^O:nQSO'#GjO:sQSO'#GnO;OQSO'#GnO;^QSO'#GqO;^QSO'#GrO;^QSO'#GtO9[QSO'#GwO;}QSO'#GzO=`QSO'#CbO=pQSO'#HXO=xQSO'#H_O=xQSO'#HaO`QUO'#HcO=xQSO'#HeO=xQSO'#HhO=}QSO'#HnO>SQ(C]O'#HtO%QQUO'#HvO>_Q(C]O'#HxO>jQ(C]O'#HzO8{Q(C[O'#H|O>uQ(CjO'#CfO?wQWO'#DfQOQSOOO@_QSO'#EPO9aQ,UO'#EfO@jQSO'#EfO@uQ`O'#F^OOQQ'#Cd'#CdOOQ(CW'#Dk'#DkOOQ(CW'#Jf'#JfO%QQUO'#JfOBOQWO'#E_OOQ(CW'#E^'#E^OBYQ(C`O'#E_OBtQWO'#ESOOQO'#Ji'#JiOCYQWO'#ESOCgQWO'#E_OC}QWO'#EeODQQWO'#E_O@}QWO'#E_OBtQWO'#E_PDkO?MpO'#C`POOO)CDm)CDmOOOO'#IU'#IUODvOpO,59ROOQ(CY,59R,59ROOOO'#IV'#IVOEUO!bO,59RO%QQUO'#D]OOOO'#IX'#IXOEdO07`O,59uOOQ(CY,59u,59uOErQUO'#IYOFVQSO'#JdOHXQbO'#JdO+pQUO'#JdOH`QSO,59{OHvQSO'#EhOITQSO'#JqOI`QSO'#JpOI`QSO'#JpOIhQSO,5;UOImQSO'#JoOOQ(CY,5:W,5:WOItQUO,5:WOKuQ(CjO,5:bOLfQSO,5:jOLkQSO'#JmOMeQ(C[O'#JnO:sQSO'#JmOMlQSO'#JmOMtQSO,5;TOMyQSO'#JmOOQ(CY'#Cf'#CfO%QQUO'#EOONmQ`O,5:oOOQO'#Jj'#JjOOQO-E<]-E<]O9[QSO,5=UO! TQSO,5=UO! YQUO,5;RO!#]Q,UO'#EcO!$pQSO,5;RO!&YQ,UO'#DpO!&aQUO'#DuO!&kQWO,5;[O!&sQWO,5;[O%QQUO,5;[OOQQ'#E}'#E}OOQQ'#FP'#FPO%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]OOQQ'#FT'#FTO!'RQUO,5;nOOQ(CY,5;s,5;sOOQ(CY,5;t,5;tO!)UQSO,5;tOOQ(CY,5;u,5;uO%QQUO'#IeO!)^Q(C[O,5jOOQQ'#JW'#JWOOQQ,5>k,5>kOOQQ-EgQWO'#EkOOQ(CW'#Jo'#JoO!>nQ(C[O'#J}O8{Q(C[O,5=YO;^QSO,5=`OOQO'#Cr'#CrO!>yQWO,5=]O!?RQ,UO,5=^O!?^QSO,5=`O!?cQ`O,5=cO=}QSO'#G|O9[QSO'#HOO!?kQSO'#HOO9aQ,UO'#HRO!?pQSO'#HROOQQ,5=f,5=fO!?uQSO'#HSO!?}QSO'#ClO!@SQSO,58|O!@^QSO,58|O!BfQUO,58|OOQQ,58|,58|O!BsQ(C[O,58|O%QQUO,58|O!COQUO'#HZOOQQ'#H['#H[OOQQ'#H]'#H]O`QUO,5=sO!C`QSO,5=sO`QUO,5=yO`QUO,5={O!CeQSO,5=}O`QUO,5>PO!CjQSO,5>SO!CoQUO,5>YOOQQ,5>`,5>`O%QQUO,5>`O8{Q(C[O,5>bOOQQ,5>d,5>dO!GvQSO,5>dOOQQ,5>f,5>fO!GvQSO,5>fOOQQ,5>h,5>hO!G{QWO'#DXO%QQUO'#JfO!HjQWO'#JfO!IXQWO'#DgO!IjQWO'#DgO!K{QUO'#DgO!LSQSO'#JeO!L[QSO,5:QO!LaQSO'#ElO!LoQSO'#JrO!LwQSO,5;VO!L|QWO'#DgO!MZQWO'#EROOQ(CY,5:k,5:kO%QQUO,5:kO!MbQSO,5:kO=}QSO,5;QO!;xQWO,5;QO!tO+pQUO,5>tOOQO,5>z,5>zO#$vQUO'#IYOOQO-EtO$8XQSO1G5jO$8aQSO1G5vO$8iQbO1G5wO:sQSO,5>zO$8sQSO1G5sO$8sQSO1G5sO:sQSO1G5sO$8{Q(CjO1G5tO%QQUO1G5tO$9]Q(C[O1G5tO$9nQSO,5>|O:sQSO,5>|OOQO,5>|,5>|O$:SQSO,5>|OOQO-E<`-E<`OOQO1G0]1G0]OOQO1G0_1G0_O!)XQSO1G0_OOQQ7+([7+([O!#]Q,UO7+([O%QQUO7+([O$:bQSO7+([O$:mQ,UO7+([O$:{Q(CjO,59nO$=TQ(CjO,5UOOQQ,5>U,5>UO%QQUO'#HkO%&qQSO'#HmOOQQ,5>[,5>[O:sQSO,5>[OOQQ,5>^,5>^OOQQ7+)`7+)`OOQQ7+)f7+)fOOQQ7+)j7+)jOOQQ7+)l7+)lO%&vQWO1G5lO%'[Q$IUO1G0rO%'fQSO1G0rOOQO1G/m1G/mO%'qQ$IUO1G/mO=}QSO1G/mO!'RQUO'#DgOOQO,5>u,5>uOOQO-E{,5>{OOQO-E<_-E<_O!;xQWO1G/mOOQO-E<[-E<[OOQ(CY1G0X1G0XOOQ(CY7+%q7+%qO!MeQSO7+%qOOQ(CY7+&W7+&WO=}QSO7+&WO!;xQWO7+&WOOQO7+%t7+%tO$7kQ(CjO7+&POOQO7+&P7+&PO%QQUO7+&PO%'{Q(C[O7+&PO=}QSO7+%tO!;xQWO7+%tO%(WQ(C[O7+&POBtQWO7+%tO%(fQ(C[O7+&PO%(zQ(C`O7+&PO%)UQWO7+%tOBtQWO7+&PO%)cQWO7+&PO%)yQSO7++_O%)yQSO7++_O%*RQ(CjO7++`O%QQUO7++`OOQO1G4h1G4hO:sQSO1G4hO%*cQSO1G4hOOQO7+%y7+%yO!MeQSO<vOOQO-EwO%QQUO,5>wOOQO-ESQ$IUO1G0wO%>ZQ$IUO1G0wO%@RQ$IUO1G0wO%@fQ(CjO<VOOQQ,5>X,5>XO&#WQSO1G3vO:sQSO7+&^O!'RQUO7+&^OOQO7+%X7+%XO&#]Q$IUO1G5wO=}QSO7+%XOOQ(CY<zAN>zO%QQUOAN?VO=}QSOAN>zO&<^Q(C[OAN?VO!;xQWOAN>zO&zO&RO!V+iO^(qX'j(qX~O#W+mO'|%OO~Og+pO!X$yO'|%OO~O!X+rO~Oy+tO!XXO~O!t+yO~Ob,OO~O's#jO!W(sP~Ob%lO~O%a!OO's%|O~PRO!V,yO!W(fa~O!W2SO~P'TO^%^O#W2]O'j%^O~O^%^O!a#rO#W2]O'j%^O~O^%^O!a#rO!h%ZO!l2aO#W2]O'j%^O'|%OO(`'dO~O!]2bO!^2bO't!iO~PBtO![2eO!]2bO!^2bO#S2fO#T2fO't!iO~PBtO![2eO!]2bO!^2bO#P2gO#S2fO#T2fO't!iO~PBtO^%^O!a#rO!l2aO#W2]O'j%^O(`'dO~O^%^O'j%^O~P!3jO!V$^Oo$ja~O!S&|i!V&|i~P!3jO!V'xO!S(Wi~O!V(PO!S(di~O!S(ei!V(ei~P!3jO!V(]O!g(ai~O!V(bi!g(bi^(bi'j(bi~P!3jO#W2kO!V(bi!g(bi^(bi'j(bi~O|%vO!X%wO!x]O#a2nO#b2mO's%eO~O|%vO!X%wO#b2mO's%eO~Og2uO!X'QO%`2tO~Og2uO!X'QO%`2tO'|%OO~O#cvaPvaXva^vakva!eva!fva!hva!lva#fva#gva#hva#iva#jva#kva#lva#mva#nva#pva#rva#tva#uva'jva(Qva(`va!gva!Sva'hvaova!Xva%`va!ava~P#M{O#c$kaP$kaX$ka^$kak$kaz$ka!e$ka!f$ka!h$ka!l$ka#f$ka#g$ka#h$ka#i$ka#j$ka#k$ka#l$ka#m$ka#n$ka#p$ka#r$ka#t$ka#u$ka'j$ka(Q$ka(`$ka!g$ka!S$ka'h$kao$ka!X$ka%`$ka!a$ka~P#NqO#c$maP$maX$ma^$mak$maz$ma!e$ma!f$ma!h$ma!l$ma#f$ma#g$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#p$ma#r$ma#t$ma#u$ma'j$ma(Q$ma(`$ma!g$ma!S$ma'h$mao$ma!X$ma%`$ma!a$ma~P$ dO#c${aP${aX${a^${ak${az${a!V${a!e${a!f${a!h${a!l${a#f${a#g${a#h${a#i${a#j${a#k${a#l${a#m${a#n${a#p${a#r${a#t${a#u${a'j${a(Q${a(`${a!g${a!S${a'h${a#W${ao${a!X${a%`${a!a${a~P#(yO^#Zq!V#Zq'j#Zq'h#Zq!S#Zq!g#Zqo#Zq!X#Zq%`#Zq!a#Zq~P!3jOd'OX!V'OX~P!$uO!V._Od(Za~O!U2}O!V'PX!g'PX~P%QO!V.bO!g([a~O!V.bO!g([a~P!3jO!S3QO~O#x!ja!W!ja~PI{O#x!ba!V!ba!W!ba~P#?dO#x!na!W!na~P!6TO#x!pa!W!pa~P!8nO!X3dO$TfO$^3eO~O!W3iO~Oo3jO~P#(yO^$gq!V$gq'j$gq'h$gq!S$gq!g$gqo$gq!X$gq%`$gq!a$gq~P!3jO!S3kO~Ol.}O'uTO'xUO~Oy)sO|)tO(h)xOg%Wi(g%Wi!V%Wi#W%Wi~Od%Wi#x%Wi~P$HbOy)sO|)tOg%Yi(g%Yi(h%Yi!V%Yi#W%Yi~Od%Yi#x%Yi~P$ITO(`$WO~P#(yO!U3nO's%eO!V'YX!g'YX~O!V/VO!g(ma~O!V/VO!a#rO!g(ma~O!V/VO!a#rO(`'dO!g(ma~Od$ti!V$ti#W$ti#x$ti~P!-jO!U3vO's*UO!S'[X!V'[X~P!.XO!V/_O!S(na~O!V/_O!S(na~P#(yO!a#rO~O!a#rO#n4OO~Ok4RO!a#rO(`'dO~Od(Oi!V(Oi~P!-jO#W4UOd(Oi!V(Oi~P!-jO!g4XO~O^$hq!V$hq'j$hq'h$hq!S$hq!g$hqo$hq!X$hq%`$hq!a$hq~P!3jO!V4]O!X(oX~P#(yO!f#tO~P3zO!X$rX%TYX^$rX!V$rX'j$rX~P!,aO%T4_OghXyhX|hX!XhX(ghX(hhX^hX!VhX'jhX~O%T4_O~O%a4fO's+WO'uTO'xUO!V'eX!W'eX~O!V0_O!W(ua~OX4jO~O]4kO~O!S4oO~O^%^O'j%^O~P#(yO!X$yO~P#(yO!V4tO#W4vO!W(rX~O!W4wO~Ol!kO|4yO![5WO!]4}O!^4}O!x;oO!|5VO!}5UO#O5UO#P5TO#S5SO#T!wO't!iO'uTO'xUO(T!jO(_!nO~O!W5RO~P%#XOg5]O!X0zO%`5[O~Og5]O!X0zO%`5[O'|%OO~O's#jO!V'dX!W'dX~O!V1VO!W(sa~O'uTO'xUO(T5fO~O]5jO~O!g5mO~P%QO^5oO~O^5oO~P%QO#n5qO&Q5rO~PMPO_1mO!W5vO&`1lO~P`O!a5xO~O!a5zO!V(Yi!W(Yi!a(Yi!h(Yi'|(Yi~O!V#`i!W#`i~P#?dO#W5{O!V#`i!W#`i~O!V!Zi!W!Zi~P#?dO^%^O#W6UO'j%^O~O^%^O!a#rO#W6UO'j%^O~O^%^O!a#rO!l6ZO#W6UO'j%^O(`'dO~O!h%ZO'|%OO~P%(fO!]6[O!^6[O't!iO~PBtO![6_O!]6[O!^6[O#S6`O#T6`O't!iO~PBtO!V(]O!g(aq~O!V(bq!g(bq^(bq'j(bq~P!3jO|%vO!X%wO#b6dO's%eO~O!X'QO%`6gO~Og6jO!X'QO%`6gO~O#c%WiP%WiX%Wi^%Wik%Wiz%Wi!e%Wi!f%Wi!h%Wi!l%Wi#f%Wi#g%Wi#h%Wi#i%Wi#j%Wi#k%Wi#l%Wi#m%Wi#n%Wi#p%Wi#r%Wi#t%Wi#u%Wi'j%Wi(Q%Wi(`%Wi!g%Wi!S%Wi'h%Wio%Wi!X%Wi%`%Wi!a%Wi~P$HbO#c%YiP%YiX%Yi^%Yik%Yiz%Yi!e%Yi!f%Yi!h%Yi!l%Yi#f%Yi#g%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#p%Yi#r%Yi#t%Yi#u%Yi'j%Yi(Q%Yi(`%Yi!g%Yi!S%Yi'h%Yio%Yi!X%Yi%`%Yi!a%Yi~P$ITO#c$tiP$tiX$ti^$tik$tiz$ti!V$ti!e$ti!f$ti!h$ti!l$ti#f$ti#g$ti#h$ti#i$ti#j$ti#k$ti#l$ti#m$ti#n$ti#p$ti#r$ti#t$ti#u$ti'j$ti(Q$ti(`$ti!g$ti!S$ti'h$ti#W$tio$ti!X$ti%`$ti!a$ti~P#(yOd'Oa!V'Oa~P!-jO!V'Pa!g'Pa~P!3jO!V.bO!g([i~O#x#Zi!V#Zi!W#Zi~P#?dOP$YOy#vOz#wO|#xO!f#tO!h#uO!l$YO(QVOX#eik#ei!e#ei#g#ei#h#ei#i#ei#j#ei#k#ei#l#ei#m#ei#n#ei#p#ei#r#ei#t#ei#u#ei#x#ei(`#ei(g#ei(h#ei!V#ei!W#ei~O#f#ei~P%2xO#f;wO~P%2xOP$YOy#vOz#wO|#xO!f#tO!h#uO!l$YO#f;wO#g;xO#h;xO#i;xO(QVOX#ei!e#ei#j#ei#k#ei#l#ei#m#ei#n#ei#p#ei#r#ei#t#ei#u#ei#x#ei(`#ei(g#ei(h#ei!V#ei!W#ei~Ok#ei~P%5TOk;yO~P%5TOP$YOk;yOy#vOz#wO|#xO!f#tO!h#uO!l$YO#f;wO#g;xO#h;xO#i;xO#j;zO(QVO#p#ei#r#ei#t#ei#u#ei#x#ei(`#ei(g#ei(h#ei!V#ei!W#ei~OX#ei!e#ei#k#ei#l#ei#m#ei#n#ei~P%7`OXbO^#vy!V#vy'j#vy'h#vy!S#vy!g#vyo#vy!X#vy%`#vy!a#vy~P!3jOg=jOy)sO|)tO(g)vO(h)xO~OP#eiX#eik#eiz#ei!e#ei!f#ei!h#ei!l#ei#f#ei#g#ei#h#ei#i#ei#j#ei#k#ei#l#ei#m#ei#n#ei#p#ei#r#ei#t#ei#u#ei#x#ei(Q#ei(`#ei!V#ei!W#ei~P%AYO!f#tOP(PXX(PXg(PXk(PXy(PXz(PX|(PX!e(PX!h(PX!l(PX#f(PX#g(PX#h(PX#i(PX#j(PX#k(PX#l(PX#m(PX#n(PX#p(PX#r(PX#t(PX#u(PX#x(PX(Q(PX(`(PX(g(PX(h(PX!V(PX!W(PX~O#x#yi!V#yi!W#yi~P#?dO#x!ni!W!ni~P$!qO!W6vO~O!V'Xa!W'Xa~P#?dO!a#rO(`'dO!V'Ya!g'Ya~O!V/VO!g(mi~O!V/VO!a#rO!g(mi~Od$tq!V$tq#W$tq#x$tq~P!-jO!S'[a!V'[a~P#(yO!a6}O~O!V/_O!S(ni~P#(yO!V/_O!S(ni~O!S7RO~O!a#rO#n7WO~Ok7XO!a#rO(`'dO~O!S7ZO~Od$vq!V$vq#W$vq#x$vq~P!-jO^$hy!V$hy'j$hy'h$hy!S$hy!g$hyo$hy!X$hy%`$hy!a$hy~P!3jO!V4]O!X(oa~O^#Zy!V#Zy'j#Zy'h#Zy!S#Zy!g#Zyo#Zy!X#Zy%`#Zy!a#Zy~P!3jOX7`O~O!V0_O!W(ui~O]7fO~O!a5zO~O(T(qO!V'aX!W'aX~O!V4tO!W(ra~O!h%ZO'|%OO^(YX!a(YX!l(YX#W(YX'j(YX(`(YX~O's7oO~P.[O!x;oO!|7rO!}7qO#O7qO#P7pO#S'bO#T'bO~PBtO^%^O!a#rO!l'hO#W'fO'j%^O(`'dO~O!W7vO~P%#XOl!kO'uTO'xUO(T!jO(_!nO~O|7wO~P%MdO![7{O!]7zO!^7zO#P7pO#S'bO#T'bO't!iO~PBtO![7{O!]7zO!^7zO!}7|O#O7|O#P7pO#S'bO#T'bO't!iO~PBtO!]7zO!^7zO't!iO(T!jO(_!nO~O!X0zO~O!X0zO%`8OO~Og8RO!X0zO%`8OO~OX8WO!V'da!W'da~O!V1VO!W(si~O!g8[O~O!g8]O~O!g8^O~O!g8^O~P%QO^8`O~O!a8cO~O!g8dO~O!V(ei!W(ei~P#?dO^%^O#W8lO'j%^O~O^%^O!a#rO#W8lO'j%^O~O^%^O!a#rO!l8pO#W8lO'j%^O(`'dO~O!h%ZO'|%OO~P&$QO!]8qO!^8qO't!iO~PBtO!V(]O!g(ay~O!V(by!g(by^(by'j(by~P!3jO!X'QO%`8uO~O#c$tqP$tqX$tq^$tqk$tqz$tq!V$tq!e$tq!f$tq!h$tq!l$tq#f$tq#g$tq#h$tq#i$tq#j$tq#k$tq#l$tq#m$tq#n$tq#p$tq#r$tq#t$tq#u$tq'j$tq(Q$tq(`$tq!g$tq!S$tq'h$tq#W$tqo$tq!X$tq%`$tq!a$tq~P#(yO#c$vqP$vqX$vq^$vqk$vqz$vq!V$vq!e$vq!f$vq!h$vq!l$vq#f$vq#g$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#p$vq#r$vq#t$vq#u$vq'j$vq(Q$vq(`$vq!g$vq!S$vq'h$vq#W$vqo$vq!X$vq%`$vq!a$vq~P#(yO!V'Pi!g'Pi~P!3jO#x#Zq!V#Zq!W#Zq~P#?dOy/yOz/yO|/zOPvaXvagvakva!eva!fva!hva!lva#fva#gva#hva#iva#jva#kva#lva#mva#nva#pva#rva#tva#uva#xva(Qva(`va(gva(hva!Vva!Wva~Oy)sO|)tOP$kaX$kag$kak$kaz$ka!e$ka!f$ka!h$ka!l$ka#f$ka#g$ka#h$ka#i$ka#j$ka#k$ka#l$ka#m$ka#n$ka#p$ka#r$ka#t$ka#u$ka#x$ka(Q$ka(`$ka(g$ka(h$ka!V$ka!W$ka~Oy)sO|)tOP$maX$mag$mak$maz$ma!e$ma!f$ma!h$ma!l$ma#f$ma#g$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#p$ma#r$ma#t$ma#u$ma#x$ma(Q$ma(`$ma(g$ma(h$ma!V$ma!W$ma~OP${aX${ak${az${a!e${a!f${a!h${a!l${a#f${a#g${a#h${a#i${a#j${a#k${a#l${a#m${a#n${a#p${a#r${a#t${a#u${a#x${a(Q${a(`${a!V${a!W${a~P%AYO#x$gq!V$gq!W$gq~P#?dO#x$hq!V$hq!W$hq~P#?dO!W9PO~O#x9QO~P!-jO!a#rO!V'Yi!g'Yi~O!a#rO(`'dO!V'Yi!g'Yi~O!V/VO!g(mq~O!S'[i!V'[i~P#(yO!V/_O!S(nq~O!S9WO~P#(yO!S9WO~Od(Oy!V(Oy~P!-jO!V'_a!X'_a~P#(yO!X%Sq^%Sq!V%Sq'j%Sq~P#(yOX9]O~O!V0_O!W(uq~O#W9aO!V'aa!W'aa~O!V4tO!W(ri~P#?dOPYXXYXkYXyYXzYX|YX!SYX!VYX!eYX!fYX!hYX!lYX#WYX#ccX#fYX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#pYX#rYX#tYX#uYX#zYX(QYX(`YX(gYX(hYX~O!a%QX#n%QX~P&6lO#S-cO#T-cO~PBtO#P9eO#S-cO#T-cO~PBtO!}9fO#O9fO#P9eO#S-cO#T-cO~PBtO!]9iO!^9iO't!iO(T!jO(_!nO~O![9lO!]9iO!^9iO#P9eO#S-cO#T-cO't!iO~PBtO!X0zO%`9oO~O'uTO'xUO(T9tO~O!V1VO!W(sq~O!g9wO~O!g9wO~P%QO!g9yO~O!g9zO~O#W9|O!V#`y!W#`y~O!V#`y!W#`y~P#?dO^%^O#W:QO'j%^O~O^%^O!a#rO#W:QO'j%^O~O^%^O!a#rO!l:UO#W:QO'j%^O(`'dO~O!X'QO%`:XO~O#x#vy!V#vy!W#vy~P#?dOP$tiX$tik$tiz$ti!e$ti!f$ti!h$ti!l$ti#f$ti#g$ti#h$ti#i$ti#j$ti#k$ti#l$ti#m$ti#n$ti#p$ti#r$ti#t$ti#u$ti#x$ti(Q$ti(`$ti!V$ti!W$ti~P%AYOy)sO|)tO(h)xOP%WiX%Wig%Wik%Wiz%Wi!e%Wi!f%Wi!h%Wi!l%Wi#f%Wi#g%Wi#h%Wi#i%Wi#j%Wi#k%Wi#l%Wi#m%Wi#n%Wi#p%Wi#r%Wi#t%Wi#u%Wi#x%Wi(Q%Wi(`%Wi(g%Wi!V%Wi!W%Wi~Oy)sO|)tOP%YiX%Yig%Yik%Yiz%Yi!e%Yi!f%Yi!h%Yi!l%Yi#f%Yi#g%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#p%Yi#r%Yi#t%Yi#u%Yi#x%Yi(Q%Yi(`%Yi(g%Yi(h%Yi!V%Yi!W%Yi~O#x$hy!V$hy!W$hy~P#?dO#x#Zy!V#Zy!W#Zy~P#?dO!a#rO!V'Yq!g'Yq~O!V/VO!g(my~O!S'[q!V'[q~P#(yO!S:`O~P#(yO!V0_O!W(uy~O!V4tO!W(rq~O#S2fO#T2fO~PBtO#P:gO#S2fO#T2fO~PBtO!]:kO!^:kO't!iO(T!jO(_!nO~O!X0zO%`:nO~O!g:qO~O^%^O#W:vO'j%^O~O^%^O!a#rO#W:vO'j%^O~O!X'QO%`:{O~OP$tqX$tqk$tqz$tq!e$tq!f$tq!h$tq!l$tq#f$tq#g$tq#h$tq#i$tq#j$tq#k$tq#l$tq#m$tq#n$tq#p$tq#r$tq#t$tq#u$tq#x$tq(Q$tq(`$tq!V$tq!W$tq~P%AYOP$vqX$vqk$vqz$vq!e$vq!f$vq!h$vq!l$vq#f$vq#g$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#p$vq#r$vq#t$vq#u$vq#x$vq(Q$vq(`$vq!V$vq!W$vq~P%AYOd%[!Z!V%[!Z#W%[!Z#x%[!Z~P!-jO!V'aq!W'aq~P#?dO#S6`O#T6`O~PBtO!V#`!Z!W#`!Z~P#?dO^%^O#W;ZO'j%^O~O#c%[!ZP%[!ZX%[!Z^%[!Zk%[!Zz%[!Z!V%[!Z!e%[!Z!f%[!Z!h%[!Z!l%[!Z#f%[!Z#g%[!Z#h%[!Z#i%[!Z#j%[!Z#k%[!Z#l%[!Z#m%[!Z#n%[!Z#p%[!Z#r%[!Z#t%[!Z#u%[!Z'j%[!Z(Q%[!Z(`%[!Z!g%[!Z!S%[!Z'h%[!Z#W%[!Zo%[!Z!X%[!Z%`%[!Z!a%[!Z~P#(yOP%[!ZX%[!Zk%[!Zz%[!Z!e%[!Z!f%[!Z!h%[!Z!l%[!Z#f%[!Z#g%[!Z#h%[!Z#i%[!Z#j%[!Z#k%[!Z#l%[!Z#m%[!Z#n%[!Z#p%[!Z#r%[!Z#t%[!Z#u%[!Z#x%[!Z(Q%[!Z(`%[!Z!V%[!Z!W%[!Z~P%AYOo(UX~P1dO't!iO~P!'RO!ScX!VcX#WcX~P&6lOPYXXYXkYXyYXzYX|YX!VYX!VcX!eYX!fYX!hYX!lYX#WYX#WcX#ccX#fYX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#pYX#rYX#tYX#uYX#zYX(QYX(`YX(gYX(hYX~O!acX!gYX!gcX(`cX~P'!sOP;nOQ;nOa=_Ob!fOikOk;nOlkOmkOskOu;nOw;nO|WO!QkO!RkO!XXO!c;qO!hZO!k;nO!l;nO!m;nO!o;rO!q;sO!t!eO$P!hO$TfO's)RO'uTO'xUO(QVO(_[O(l=]O~O!Vv!>v!BnPPP!BuHdPPPPPPPPPPP!FTP!GiPPHd!HyPHdPHdHdHdHdPHd!J`PP!MiP#!nP#!r#!|##Q##QP!MfP##U##UP#&ZP#&_HdHd#&e#)iAQPAQPAQAQP#*sAQAQ#,mAQ#.zAQ#0nAQAQ#1[#3W#3W#3[#3d#3W#3lP#3WPAQ#4hAQ#5pAQAQ6iPPP#6{PP#7e#7eP#7eP#7z#7ePP#8QP#7wP#7w#8d!1p#7w#9O#9U6f(}#9X(}P#9`#9`#9`P(}P(}P(}P(}PP(}P#9f#9iP#9i(}P#9mP#9pP(}P(}P(}P(}P(}P(}(}PP#9v#9|#:W#:^#:d#:j#:p#;O#;U#;[#;f#;l#b#?r#@Q#@W#@^#@d#@j#@t#@z#AQ#A[#An#AtPPPPPPPPPP#AzPPPPPPP#Bn#FYP#Gu#G|#HUPPPP#L`$ U$'t$'w$'z$)w$)z$)}$*UPP$*[$*`$+X$,X$,]$,qPP$,u$,{$-PP$-S$-W$-Z$.P$.g$.l$.o$.r$.x$.{$/P$/TR!yRmpOXr!X#a%]&d&f&g&i,^,c1g1jU!pQ'Q-OQ%ctQ%kwQ%rzQ&[!TS&x!c,vQ'W!f[']!m!r!s!t!u!vS*[$y*aQ+U%lQ+c%tQ+}&UQ,|'PQ-W'XW-`'^'_'`'aQ/p*cQ1U,OU2b-b-d-eS4}0z5QS6[2e2gU7z5U5V5WQ8q6_S9i7{7|Q:k9lR TypeParamList 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 : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression 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 in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody MethodDeclaration AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration 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:362,context:Xr,nodeProps:[["group",-26,6,14,16,62,198,202,205,206,208,211,214,225,227,233,235,237,239,242,248,254,256,258,260,262,264,265,"Statement",-32,10,11,25,28,29,35,45,48,49,51,56,64,72,76,78,80,81,102,103,112,113,130,133,135,136,137,138,140,141,161,162,164,"Expression",-23,24,26,30,34,36,38,165,167,169,170,172,173,174,176,177,178,180,181,182,192,194,196,197,"Type",-3,84,95,101,"ClassItem"],["openedBy",31,"InterpolationStart",50,"[",54,"{",69,"(",142,"JSXStartTag",154,"JSXStartTag JSXStartCloseTag"],["closedBy",33,"InterpolationEnd",44,"]",55,"}",70,")",143,"JSXSelfCloseEndTag JSXEndTag",159,"JSXEndTag"]],propSources:[kr],skippedNodes:[0,3,4,268],repeatNodeCount:32,tokenData:"$>y(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tu>PuvBavwDxwxGgxyMvyz! Qz{!![{|!%O|}!&]}!O!%O!O!P!'g!P!Q!1w!Q!R#0t!R![#3T![!]#@T!]!^#Aa!^!_#Bk!_!`#GS!`!a#In!a!b#N{!b!c$$z!c!}>P!}#O$&U#O#P$'`#P#Q$,w#Q#R$.R#R#S>P#S#T$/`#T#o$0j#o#p$4z#p#q$5p#q#r$7Q#r#s$8^#s$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$I|>P$I|$I}$P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(n%d_$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$c&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$c&j'y!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'y!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$c&j'vpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'vpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'vp'y!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$c&j'vp'y!b'l(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST'w#S$c&j'm(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$c&j'vp'y!b'm(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$c&j!l$Ip'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#p$Id$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#p$Id$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'u$(n$c&j'y!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$c&j'y!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$c&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$^#t$c&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$^#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$^#t$c&j'y!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'y!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$^#t'y!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hg$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}st%Ztu`k$c&j'vp'y!b(T!LY's&;d$V#tOY%ZYZ&cZr%Zrs&}st%Ztu>Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$g%Z$g;'S>P;'S;=`BZ<%lO>P+d@`k$c&j'vp'y!b$V#tOY%ZYZ&cZr%Zrs&}st%Ztu@Tuw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![@T![!^%Z!^!_*g!_!c%Z!c!}@T!}#O%Z#O#P&c#P#R%Z#R#S@T#S#T%Z#T#o@T#o#p*g#p$g%Z$g;'S@T;'S;=`BT<%lO@T+dBWP;=`<%l@T(CSB^P;=`<%l>P%#SBl`$c&j'vp'y!b#h$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Cn!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#SCy_$c&j#z$Id'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%DfETa(h%Z![!^%Z!^!_*g!_!c%Z!c!i#>Z!i#O%Z#O#P&c#P#R%Z#R#S#>Z#S#T%Z#T#Z#>Z#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#>fi$c&j'vp'y!bl$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#>Z![!^%Z!^!_*g!_!c%Z!c!i#>Z!i#O%Z#O#P&c#P#R%Z#R#S#>Z#S#T%Z#T#Z#>Z#Z#b%Z#b#c#5T#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%Gh#@b_!a$b$c&j#x%Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$JT>P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(CS$=Uk$c&j'vp'y!b'm(;d(T!LY's&;d$V#tOY%ZYZ&cZr%Zrs&}st%Ztu>Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$g%Z$g;'S>P;'S;=`BZ<%lO>P",tokenizers:[xr,yr,2,3,4,5,6,7,8,9,10,11,12,13,Zr,new bO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOq~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!O~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(S~~",141,325),new bO("j~RQYZXz{^~^O'p~~aP!P!Qd~iO'q~~",25,307)],topRules:{Script:[0,5],SingleExpression:[1,266],SingleClassItem:[2,267]},dialects:{jsx:13213,ts:13215},dynamicPrecedences:{76:1,78:1,162:1,190:1},specialized:[{term:311,get:e=>vr[e]||-1},{term:327,get:e=>Yr[e]||-1},{term:67,get:e=>wr[e]||-1}],tokenPrec:13238}),Wr=[b("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),b("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),b("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),b("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),b("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),b(`try { + \${} +} catch (\${error}) { + \${} +}`,{label:"try",detail:"/ catch block",type:"keyword"}),b("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),b(`if (\${}) { + \${} +} else { + \${} +}`,{label:"if",detail:"/ else block",type:"keyword"}),b(`class \${name} { + constructor(\${params}) { + \${} + } +}`,{label:"class",detail:"definition",type:"keyword"}),b('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),b('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],ce=new _t,Be=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function q(e){return(O,a)=>{let t=O.node.getChild("VariableDefinition");return t&&a(t,e),!0}}const Vr=["FunctionDeclaration"],Ur={FunctionDeclaration:q("function"),ClassDeclaration:q("class"),ClassExpression:()=>!0,EnumDeclaration:q("constant"),TypeAliasDeclaration:q("type"),NamespaceDeclaration:q("namespace"),VariableDefinition(e,O){e.matchContext(Vr)||O(e,"variable")},TypeDefinition(e,O){O(e,"type")},__proto__:null};function De(e,O){let a=ce.get(O);if(a)return a;let t=[],r=!0;function i(s,n){let o=e.sliceString(s.from,s.to);t.push({label:o,type:n})}return O.cursor(xe.IncludeAnonymous).iterate(s=>{if(r)r=!1;else if(s.name){let n=Ur[s.name];if(n&&n(s,i)||Be.has(s.name))return!1}else if(s.to-s.from>8192){for(let n of De(e,s.node))t.push(n);return!1}}),ce.set(O,t),t}const he=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Le=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName"];function _r(e){let O=_(e.state).resolveInner(e.pos,-1);if(Le.indexOf(O.name)>-1)return null;let a=O.name=="VariableName"||O.to-O.from<20&&he.test(e.state.sliceDoc(O.from,O.to));if(!a&&!e.explicit)return null;let t=[];for(let r=O;r;r=r.parent)Be.has(r.name)&&(t=t.concat(De(e.state.doc,r)));return{options:t,from:a?O.from:e.pos,validFor:he}}const y=iO.define({name:"javascript",parser:Tr.configure({props:[sO.add({IfStatement:R({except:/^\s*({|else\b)/}),TryStatement:R({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Wt,SwitchBody:e=>{let O=e.textAfter,a=/^\s*\}/.test(O),t=/^\s*(case|default)\b/.test(O);return e.baseIndent+(a?0:t?1:2)*e.unit},Block:Vt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":R({except:/^{/}),JSXElement(e){let O=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},JSXEscape(e){let O=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),nO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression":ye,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Je={test:e=>/^JSX/.test(e.name),facet:Ut({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Me=y.configure({dialect:"ts"},"typescript"),He=y.configure({dialect:"jsx",props:[Ye.add(e=>e.isTop?[Je]:void 0)]}),Fe=y.configure({dialect:"jsx ts",props:[Ye.add(e=>e.isTop?[Je]:void 0)]},"typescript"),Cr="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(e=>({label:e,type:"keyword"}));function Ke(e={}){let O=e.jsx?e.typescript?Fe:He:e.typescript?Me:y;return new lO(O,[y.data.of({autocomplete:ke(Le,ve(Wr.concat(Cr)))}),y.data.of({autocomplete:_r}),e.jsx?Gr:[]])}function qr(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(!e.parent)return null;e=e.parent}}function pe(e,O,a=e.length){for(let t=O==null?void 0:O.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return e.sliceString(t.from,Math.min(t.to,a));return""}const jr=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Gr=w.inputHandler.of((e,O,a,t)=>{if((jr?e.composing:e.compositionStarted)||e.state.readOnly||O!=a||t!=">"&&t!="/"||!y.isActiveAt(e.state,O,-1))return!1;let{state:r}=e,i=r.changeByRange(s=>{var n,o;let{head:Q}=s,p=_(r).resolveInner(Q,-1),c;if(p.name=="JSXStartTag"&&(p=p.parent),t==">"&&p.name=="JSXFragmentTag")return{range:z.cursor(Q+1),changes:{from:Q,insert:">"}};if(t=="/"&&p.name=="JSXFragmentTag"){let u=p.parent,h=u==null?void 0:u.parent;if(u.from==Q-1&&((n=h.lastChild)===null||n===void 0?void 0:n.name)!="JSXEndTag"&&(c=pe(r.doc,h==null?void 0:h.firstChild,Q))){let f=`/${c}>`;return{range:z.cursor(Q+f.length),changes:{from:Q,insert:f}}}}else if(t==">"){let u=qr(p);if(u&&((o=u.lastChild)===null||o===void 0?void 0:o.name)!="JSXEndTag"&&r.sliceDoc(Q,Q+2)!="`}}}return{range:s}});return i.changes.empty?!1:(e.dispatch(i,{userEvent:"input.type",scrollIntoView:!0}),!0)}),j=["_blank","_self","_top","_parent"],$O=["ascii","utf-8","utf-16","latin1","latin1"],gO=["get","post","put","delete"],PO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],m=["true","false"],S={},Rr={a:{attrs:{href:null,ping:null,type:null,media:null,target:j,hreflang:null}},abbr:S,address:S,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:S,aside:S,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:S,base:{attrs:{href:null,target:j}},bdi:S,bdo:S,blockquote:{attrs:{cite:null}},body:S,br:S,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:PO,formmethod:gO,formnovalidate:["novalidate"],formtarget:j,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:S,center:S,cite:S,code:S,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:S,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:S,div:S,dl:S,dt:S,em:S,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:S,figure:S,footer:S,form:{attrs:{action:null,name:null,"accept-charset":$O,autocomplete:["on","off"],enctype:PO,method:gO,novalidate:["novalidate"],target:j}},h1:S,h2:S,h3:S,h4:S,h5:S,h6:S,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:S,hgroup:S,hr:S,html:{attrs:{manifest:null}},i:S,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:PO,formmethod:gO,formnovalidate:["novalidate"],formtarget:j,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:S,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:S,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:S,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:$O,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:S,noscript:S,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:S,param:{attrs:{name:null,value:null}},pre:S,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:S,rt:S,ruby:S,samp:S,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:$O}},section:S,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:S,source:{attrs:{src:null,type:null,media:null}},span:S,strong:S,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:S,summary:S,sup:S,table:S,tbody:S,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:S,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:S,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:S,time:{attrs:{datetime:null}},title:S,tr:S,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:S,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:S},Ot={accesskey:null,class:null,contenteditable:m,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:m,autocorrect:m,autocapitalize:m,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":m,"aria-autocomplete":["inline","list","both","none"],"aria-busy":m,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":m,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":m,"aria-hidden":m,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":m,"aria-multiselectable":m,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":m,"aria-relevant":null,"aria-required":m,"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},et="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(e=>"on"+e);for(let e of et)Ot[e]=null;class tO{constructor(O,a){this.tags=Object.assign(Object.assign({},Rr),O),this.globalAttrs=Object.assign(Object.assign({},Ot),a),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}tO.default=new tO;function U(e,O,a=e.length){if(!O)return"";let t=O.firstChild,r=t&&t.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,a)):""}function oO(e,O=!1){for(let a=e.parent;a;a=a.parent)if(a.name=="Element")if(O)O=!1;else return a;return null}function tt(e,O,a){let t=a.tags[U(e,oO(O,!0))];return(t==null?void 0:t.children)||a.allTags}function TO(e,O){let a=[];for(let t=O;t=oO(t);){let r=U(e,t);if(r&&t.lastChild.name=="CloseTag")break;r&&a.indexOf(r)<0&&(O.name=="EndTag"||O.from>=t.firstChild.to)&&a.push(r)}return a}const at=/^[:\-\.\w\u00b7-\uffff]*$/;function ue(e,O,a,t,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:t,to:r,options:tt(e.doc,a,O).map(s=>({label:s,type:"type"})).concat(TO(e.doc,a).map((s,n)=>({label:"/"+s,apply:"/"+s+i,type:"type",boost:99-n}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Se(e,O,a,t){let r=/\s*>/.test(e.sliceDoc(t,t+5))?"":">";return{from:a,to:t,options:TO(e.doc,O).map((i,s)=>({label:i,apply:i+r,type:"type",boost:99-s})),validFor:at}}function zr(e,O,a,t){let r=[],i=0;for(let s of tt(e.doc,a,O))r.push({label:"<"+s,type:"type"});for(let s of TO(e.doc,a))r.push({label:"",type:"type",boost:99-i++});return{from:t,to:t,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Ar(e,O,a,t,r){let i=oO(a),s=i?O.tags[U(e.doc,i)]:null,n=s&&s.attrs?Object.keys(s.attrs):[],o=s&&s.globalAttrs===!1?n:n.length?n.concat(O.globalAttrNames):O.globalAttrNames;return{from:t,to:r,options:o.map(Q=>({label:Q,type:"property"})),validFor:at}}function Ir(e,O,a,t,r){var i;let s=(i=a.parent)===null||i===void 0?void 0:i.getChild("AttributeName"),n=[],o;if(s){let Q=e.sliceDoc(s.from,s.to),p=O.globalAttrs[Q];if(!p){let c=oO(a),u=c?O.tags[U(e.doc,c)]:null;p=(u==null?void 0:u.attrs)&&u.attrs[Q]}if(p){let c=e.sliceDoc(t,r).toLowerCase(),u='"',h='"';/^['"]/.test(c)?(o=c[0]=='"'?/^[^"]*$/:/^[^']*$/,u="",h=e.sliceDoc(r,r+1)==c[0]?"":c[0],c=c.slice(1),t++):o=/^[^\s<>='"]*$/;for(let f of p)n.push({label:f,apply:u+f+h,type:"constant"})}}return{from:t,to:r,options:n,validFor:o}}function Er(e,O){let{state:a,pos:t}=O,r=_(a).resolveInner(t),i=r.resolve(t,-1);for(let s=t,n;r==i&&(n=i.childBefore(s));){let o=n.lastChild;if(!o||!o.type.isError||o.fromEr(t,r)}const rt=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Me.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:He.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:Fe.parser},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:y.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:eO.parser}],it=[{name:"style",parser:eO.parser.configure({top:"Styles"})}].concat(et.map(e=>({name:e,parser:y.parser}))),J=iO.define({name:"html",parser:Na.configure({props:[sO.add({Element(e){let O=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+O[0].length?e.continue():e.lineIndent(e.node.from)+(O[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})],wrap:Ae(rt,it)}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}});function Br(e={}){let O="",a;e.matchClosingTags===!1&&(O="noMatch"),e.selfClosingTags===!0&&(O=(O?O+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(a=Ae((e.nestedLanguages||[]).concat(rt),(e.nestedAttributes||[]).concat(it)));let t=a||O?J.configure({dialect:O,wrap:a}):J;return new lO(t,[J.data.of({autocomplete:Nr(e)}),e.autoCloseTags!==!1?Dr:[],Ke().support,hr().support])}const fe=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Dr=w.inputHandler.of((e,O,a,t)=>{if(e.composing||e.state.readOnly||O!=a||t!=">"&&t!="/"||!J.isActiveAt(e.state,O,-1))return!1;let{state:r}=e,i=r.changeByRange(s=>{var n,o,Q;let{head:p}=s,c=_(r).resolveInner(p,-1),u;if((c.name=="TagName"||c.name=="StartTag")&&(c=c.parent),t==">"&&c.name=="OpenTag"){if(((o=(n=c.parent)===null||n===void 0?void 0:n.lastChild)===null||o===void 0?void 0:o.name)!="CloseTag"&&(u=U(r.doc,c.parent,p))&&!fe.has(u)){let h=e.state.doc.sliceString(p,p+1)===">",f=`${h?"":">"}`;return{range:z.cursor(p+1),changes:{from:p+(h?1:0),insert:f}}}}else if(t=="/"&&c.name=="OpenTag"){let h=c.parent,f=h==null?void 0:h.parent;if(h.from==p-1&&((Q=f.lastChild)===null||Q===void 0?void 0:Q.name)!="CloseTag"&&(u=U(r.doc,f,p))&&!fe.has(u)){let $=e.state.doc.sliceString(p,p+1)===">",g=`/${u}${$?"":">"}`,v=p+g.length+($?1:0);return{range:z.cursor(v),changes:{from:p,insert:g}}}}return{range:s}});return i.changes.empty?!1:(e.dispatch(i,{userEvent:"input.type",scrollIntoView:!0}),!0)}),Lr=36,de=1,Jr=2,N=3,mO=4,Mr=5,Hr=6,Fr=7,Kr=8,Oi=9,ei=10,ti=11,ai=12,ri=13,ii=14,si=15,ni=16,li=17,$e=18,oi=19,st=20,nt=21,ge=22,Qi=23,ci=24;function xO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function hi(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Y(e,O,a){for(let t=!1;;){if(e.next<0)return;if(e.next==O&&!t){e.advance();return}t=a&&!t&&e.next==92,e.advance()}}function pi(e){for(;;){if(e.next<0||e.peek(1)<0)return;if(e.next==36&&e.peek(1)==36){e.advance(2);return}e.advance()}}function lt(e,O){for(;!(e.next!=95&&!xO(e.next));)O!=null&&(O+=String.fromCharCode(e.next)),e.advance();return O}function ui(e){if(e.next==39||e.next==34||e.next==96){let O=e.next;e.advance(),Y(e,O,!1)}else lt(e)}function Pe(e,O){for(;e.next==48||e.next==49;)e.advance();O&&e.next==O&&e.advance()}function me(e,O){for(;;){if(e.next==46){if(O)break;O=!0}else if(e.next<48||e.next>57)break;e.advance()}if(e.next==69||e.next==101)for(e.advance(),(e.next==43||e.next==45)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function be(e){for(;!(e.next<0||e.next==10);)e.advance()}function W(e,O){for(let a=0;a!=&|~^/",specialVar:"?",identifierQuotes:'"',words:ot(fi,Si)};function di(e,O,a,t){let r={};for(let i in yO)r[i]=(e.hasOwnProperty(i)?e:yO)[i];return O&&(r.words=ot(O,a||"",t)),r}function Qt(e){return new Z(O=>{var a;let{next:t}=O;if(O.advance(),W(t,Xe)){for(;W(O.next,Xe);)O.advance();O.acceptToken(Lr)}else if(t==36&&O.next==36&&e.doubleDollarQuotedStrings)pi(O),O.acceptToken(N);else if(t==39||t==34&&e.doubleQuotedStrings)Y(O,t,e.backslashEscapes),O.acceptToken(N);else if(t==35&&e.hashComments||t==47&&O.next==47&&e.slashComments)be(O),O.acceptToken(de);else if(t==45&&O.next==45&&(!e.spaceAfterDashes||O.peek(1)==32))be(O),O.acceptToken(de);else if(t==47&&O.next==42){O.advance();for(let r=-1,i=1;!(O.next<0);)if(O.advance(),r==42&&O.next==47){if(i--,!i){O.advance();break}r=-1}else r==47&&O.next==42?(i++,r=-1):r=O.next;O.acceptToken(Jr)}else if((t==101||t==69)&&O.next==39)O.advance(),Y(O,39,!0);else if((t==110||t==78)&&O.next==39&&e.charSetCasts)O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(N);else if(t==95&&e.charSetCasts)for(let r=0;;r++){if(O.next==39&&r>1){O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(N);break}if(!xO(O.next))break;O.advance()}else if(t==40)O.acceptToken(Fr);else if(t==41)O.acceptToken(Kr);else if(t==123)O.acceptToken(Oi);else if(t==125)O.acceptToken(ei);else if(t==91)O.acceptToken(ti);else if(t==93)O.acceptToken(ai);else if(t==59)O.acceptToken(ri);else if(e.unquotedBitLiterals&&t==48&&O.next==98)O.advance(),Pe(O),O.acceptToken(ge);else if((t==98||t==66)&&(O.next==39||O.next==34)){const r=O.next;O.advance(),e.treatBitsAsBytes?(Y(O,r,e.backslashEscapes),O.acceptToken(Qi)):(Pe(O,r),O.acceptToken(ge))}else if(t==48&&(O.next==120||O.next==88)||(t==120||t==88)&&O.next==39){let r=O.next==39;for(O.advance();hi(O.next);)O.advance();r&&O.next==39&&O.advance(),O.acceptToken(mO)}else if(t==46&&O.next>=48&&O.next<=57)me(O,!0),O.acceptToken(mO);else if(t==46)O.acceptToken(ii);else if(t>=48&&t<=57)me(O,!1),O.acceptToken(mO);else if(W(t,e.operatorChars)){for(;W(O.next,e.operatorChars);)O.advance();O.acceptToken(si)}else if(W(t,e.specialVar))O.next==t&&O.advance(),ui(O),O.acceptToken(li);else if(W(t,e.identifierQuotes))Y(O,t,!1),O.acceptToken(oi);else if(t==58||t==44)O.acceptToken(ni);else if(xO(t)){let r=lt(O,String.fromCharCode(t));O.acceptToken(O.next==46?$e:(a=e.words[r.toLowerCase()])!==null&&a!==void 0?a:$e)}})}const ct=Qt(yO),$i=T.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,ct],topRules:{Script:[0,25]},tokenPrec:0});function kO(e){let O=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(O.name);)O.moveTo(O.from,-1);return O.node}function A(e,O){let a=e.sliceString(O.from,O.to),t=/^([`'"])(.*)\1$/.exec(a);return t?t[2]:a}function aO(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function gi(e,O){if(O.name=="CompositeIdentifier"){let a=[];for(let t=O.firstChild;t;t=t.nextSibling)aO(t)&&a.push(A(e,t));return a}return[A(e,O)]}function Ze(e,O){for(let a=[];;){if(!O||O.name!=".")return a;let t=kO(O);if(!aO(t))return a;a.unshift(A(e,t)),O=kO(t)}}function Pi(e,O){let a=_(e).resolveInner(O,-1),t=bi(e.doc,a);return a.name=="Identifier"||a.name=="QuotedIdentifier"||a.name=="Keyword"?{from:a.from,quoted:a.name=="QuotedIdentifier"?e.doc.sliceString(a.from,a.from+1):null,parents:Ze(e.doc,kO(a)),aliases:t}:a.name=="."?{from:O,quoted:null,parents:Ze(e.doc,a),aliases:t}:{from:O,quoted:null,parents:[],empty:!0,aliases:t}}const mi=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function bi(e,O){let a;for(let r=O;!a;r=r.parent){if(!r)return null;r.name=="Statement"&&(a=r)}let t=null;for(let r=a.firstChild,i=!1,s=null;r;r=r.nextSibling){let n=r.name=="Keyword"?e.sliceString(r.from,r.to).toLowerCase():null,o=null;if(!i)i=n=="from";else if(n=="as"&&s&&aO(r.nextSibling))o=A(e,r.nextSibling);else{if(n&&mi.has(n))break;s&&aO(r)&&(o=A(e,r))}o&&(t||(t=Object.create(null)),t[o]=gi(e,s)),s=/Identifier$/.test(r.name)?r:null}return t}function Xi(e,O){return e?O.map(a=>Object.assign(Object.assign({},a),{label:e+a.label+e,apply:void 0})):O}const Zi=/^\w*$/,xi=/^[`'"]?\w*[`'"]?$/;class WO{constructor(){this.list=[],this.children=void 0}child(O){let a=this.children||(this.children=Object.create(null));return a[O]||(a[O]=new WO)}childCompletions(O){return this.children?Object.keys(this.children).filter(a=>a).map(a=>({label:a,type:O})):[]}}function yi(e,O,a,t,r){let i=new WO,s=i.child(r||"");for(let n in e){let o=n.indexOf("."),p=(o>-1?i.child(n.slice(0,o)):s).child(o>-1?n.slice(o+1):n);p.list=e[n].map(c=>typeof c=="string"?{label:c,type:"property"}:c)}s.list=(O||s.childCompletions("type")).concat(t?s.child(t).list:[]);for(let n in i.children){let o=i.child(n);o.list.length||(o.list=o.childCompletions("type"))}return i.list=s.list.concat(a||i.childCompletions("type")),n=>{let{parents:o,from:Q,quoted:p,empty:c,aliases:u}=Pi(n.state,n.pos);if(c&&!n.explicit)return null;u&&o.length==1&&(o=u[o[0]]||o);let h=i;for(let g of o){for(;!h.children||!h.children[g];)if(h==i)h=s;else if(h==s&&t)h=h.child(t);else return null;h=h.child(g)}let f=p&&n.state.sliceDoc(n.pos,n.pos+1)==p,$=h.list;return h==i&&u&&($=$.concat(Object.keys(u).map(g=>({label:g,type:"constant"})))),{from:Q,to:f?n.pos+1:void 0,options:Xi(p,$),validFor:p?xi:Zi}}}function ki(e,O){let a=Object.keys(e).map(t=>({label:O?t.toUpperCase():t,type:e[t]==nt?"type":e[t]==st?"keyword":"variable",boost:-1}));return ke(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],ve(a))}let vi=$i.configure({props:[sO.add({Statement:R()}),nO.add({Statement(e){return{from:e.firstChild.to,to:e.to}},BlockComment(e){return{from:e.from+2,to:e.to-2}}}),rO({Keyword:l.keyword,Type:l.typeName,Builtin:l.standard(l.name),Bits:l.number,Bytes:l.string,Bool:l.bool,Null:l.null,Number:l.number,String:l.string,Identifier:l.name,QuotedIdentifier:l.special(l.string),SpecialVar:l.special(l.name),LineComment:l.lineComment,BlockComment:l.blockComment,Operator:l.operator,"Semi Punctuation":l.punctuation,"( )":l.paren,"{ }":l.brace,"[ ]":l.squareBracket})]});class QO{constructor(O,a){this.dialect=O,this.language=a}get extension(){return this.language.extension}static define(O){let a=di(O,O.keywords,O.types,O.builtin),t=iO.define({name:"sql",parser:vi.configure({tokenizers:[{from:ct,to:Qt(a)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new QO(a,t)}}function Yi(e,O=!1){return ki(e.dialect.words,O)}function wi(e,O=!1){return e.language.data.of({autocomplete:Yi(e,O)})}function Ti(e){return e.schema?yi(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema):()=>null}function Wi(e){return e.schema?(e.dialect||ht).language.data.of({autocomplete:Ti(e)}):[]}function Vi(e={}){let O=e.dialect||ht;return new lO(O.language,[Wi(e),wi(O,!!e.upperCaseKeywords)])}const ht=QO.define({});function Ui(e){let O;return{c(){O=dt("div"),$t(O,"class","code-editor"),I(O,"min-height",e[0]?e[0]+"px":null),I(O,"max-height",e[1]?e[1]+"px":"auto")},m(a,t){gt(a,O,t),e[11](O)},p(a,[t]){t&1&&I(O,"min-height",a[0]?a[0]+"px":null),t&2&&I(O,"max-height",a[1]?a[1]+"px":"auto")},i:jO,o:jO,d(a){a&&Pt(O),e[11](null)}}}function _i(e,O,a){let t;mt(e,bt,d=>a(12,t=d));const r=Xt();let{id:i=""}=O,{value:s=""}=O,{minHeight:n=null}=O,{maxHeight:o=null}=O,{disabled:Q=!1}=O,{placeholder:p=""}=O,{language:c="javascript"}=O,{singleLine:u=!1}=O,h,f,$=new E,g=new E,v=new E,VO=new E;function cO(){h==null||h.focus()}function UO(){f==null||f.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0})),r("change",s)}function _O(){if(!i)return;const d=document.querySelectorAll('[for="'+i+'"]');for(let P of d)P.removeEventListener("click",cO)}function CO(){if(!i)return;_O();const d=document.querySelectorAll('[for="'+i+'"]');for(let P of d)P.addEventListener("click",cO)}function qO(){switch(c){case"html":return Br();case"sql":let d={};for(let P of t)d[P.name]=xt.getAllCollectionIdentifiers(P);return Vi({dialect:QO.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:d,upperCaseKeywords:!0});default:return Ke()}}Zt(()=>{const d={key:"Enter",run:P=>{u&&r("submit",s)}};return CO(),a(10,h=new w({parent:f,state:C.create({doc:s,extensions:[qt(),jt(),Gt(),Rt(),zt(),C.allowMultipleSelections.of(!0),At(It,{fallback:!0}),Et(),Nt(),Bt(),Dt(),Lt.of([d,...Jt,...Mt,Ht.find(P=>P.key==="Mod-d"),...Ft,...Kt]),w.lineWrapping,Oa({icons:!1}),$.of(qO()),VO.of(GO(p)),g.of(w.editable.of(!0)),v.of(C.readOnly.of(!1)),C.transactionFilter.of(P=>u&&P.newDoc.lines>1?[]:P),w.updateListener.of(P=>{!P.docChanged||Q||(a(3,s=P.state.doc.toString()),UO())})]})})),()=>{_O(),h==null||h.destroy()}});function pt(d){yt[d?"unshift":"push"](()=>{f=d,a(2,f)})}return e.$$set=d=>{"id"in d&&a(4,i=d.id),"value"in d&&a(3,s=d.value),"minHeight"in d&&a(0,n=d.minHeight),"maxHeight"in d&&a(1,o=d.maxHeight),"disabled"in d&&a(5,Q=d.disabled),"placeholder"in d&&a(6,p=d.placeholder),"language"in d&&a(7,c=d.language),"singleLine"in d&&a(8,u=d.singleLine)},e.$$.update=()=>{e.$$.dirty&16&&i&&CO(),e.$$.dirty&1152&&h&&c&&h.dispatch({effects:[$.reconfigure(qO())]}),e.$$.dirty&1056&&h&&typeof Q<"u"&&(h.dispatch({effects:[g.reconfigure(w.editable.of(!Q)),v.reconfigure(C.readOnly.of(Q))]}),UO()),e.$$.dirty&1032&&h&&s!=h.state.doc.toString()&&h.dispatch({changes:{from:0,to:h.state.doc.length,insert:s}}),e.$$.dirty&1088&&h&&typeof p<"u"&&h.dispatch({effects:[VO.reconfigure(GO(p))]})},[n,o,f,s,i,Q,p,c,u,cO,h,pt]}class ji extends ut{constructor(O){super(),St(this,O,_i,Ui,ft,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{ji as default}; diff --git a/ui/dist/assets/ConfirmEmailChangeDocs-b6b425ff.js b/ui/dist/assets/ConfirmEmailChangeDocs-4c95097d.js similarity index 97% rename from ui/dist/assets/ConfirmEmailChangeDocs-b6b425ff.js rename to ui/dist/assets/ConfirmEmailChangeDocs-4c95097d.js index 719a200e..4b67b570 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-b6b425ff.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-4c95097d.js @@ -1,4 +1,4 @@ -import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n,m as ve,x as Y,O as pe,P as Pe,k as Se,Q as Oe,n as Re,t as Z,a as x,o as f,d as ge,R as Te,C as Ee,p as ye,r as j,u as Be,N as qe}from"./index-0b562d0f.js";import{S as Ae}from"./SdkTabs-69545b17.js";function ue(o,l,s){const a=o.slice();return a[5]=l[s],a}function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l){let s,a=l[5].code+"",_,u,i,d;function p(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=v(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){r(C,s,$),n(s,_),n(s,u),i||(d=Be(s,"click",p),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&Y(_,a),$&6&&j(s,"active",l[1]===l[5].code)},d(C){C&&f(s),i=!1,d()}}}function ke(o,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){r(i,s,d),ve(a,s,null),n(s,_),u=!0},p(i,d){l=i;const p={};d&4&&(p.content=l[5].body),a.$set(p),(!u||d&6)&&j(s,"active",l[1]===l[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&f(s),ge(a)}}}function Ue(o){var re,fe;let l,s,a=o[0].name+"",_,u,i,d,p,C,$,D=o[0].name+"",H,ee,F,w,I,R,L,P,N,te,K,T,le,Q,M=o[0].name+"",z,se,G,E,J,y,V,B,X,S,q,g=[],ae=new Map,oe,A,k=[],ne=new Map,O;w=new Ae({props:{js:` +import{S as Ce,i as $e,s as we,e as c,w as v,b as h,c as he,f as b,g as r,h as n,m as ve,x as Y,O as pe,P as Pe,k as Se,Q as Oe,n as Re,t as Z,a as x,o as f,d as ge,R as Te,C as Ee,p as ye,r as j,u as Be,N as qe}from"./index-4bd199fb.js";import{S as Ae}from"./SdkTabs-fc1a80c5.js";function ue(o,l,s){const a=o.slice();return a[5]=l[s],a}function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l){let s,a=l[5].code+"",_,u,i,d;function p(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=v(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){r(C,s,$),n(s,_),n(s,u),i||(d=Be(s,"click",p),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&Y(_,a),$&6&&j(s,"active",l[1]===l[5].code)},d(C){C&&f(s),i=!1,d()}}}function ke(o,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){r(i,s,d),ve(a,s,null),n(s,_),u=!0},p(i,d){l=i;const p={};d&4&&(p.content=l[5].body),a.$set(p),(!u||d&6)&&j(s,"active",l[1]===l[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&f(s),ge(a)}}}function Ue(o){var re,fe;let l,s,a=o[0].name+"",_,u,i,d,p,C,$,D=o[0].name+"",H,ee,F,w,I,R,L,P,N,te,K,T,le,Q,M=o[0].name+"",z,se,G,E,J,y,V,B,X,S,q,g=[],ae=new Map,oe,A,k=[],ne=new Map,O;w=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmPasswordResetDocs-1b980177.js b/ui/dist/assets/ConfirmPasswordResetDocs-6a316d79.js similarity index 98% rename from ui/dist/assets/ConfirmPasswordResetDocs-1b980177.js rename to ui/dist/assets/ConfirmPasswordResetDocs-6a316d79.js index 56f021c3..200bf647 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-1b980177.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-6a316d79.js @@ -1,4 +1,4 @@ -import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as K,O as me,P as Oe,k as Ne,Q as Ce,n as We,t as Z,a as x,o as d,d as Pe,R as $e,C as Ee,p as Te,r as U,u as ge,N as Ae}from"./index-0b562d0f.js";import{S as De}from"./SdkTabs-69545b17.js";function ue(o,s,l){const a=o.slice();return a[5]=s[l],a}function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s){let l,a=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=c("button"),_=w(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){r(S,l,h),n(l,_),n(l,u),i||(p=ge(l,"click",m),i=!0)},p(S,h){s=S,h&4&&a!==(a=s[5].code+"")&&K(_,a),h&6&&U(l,"active",s[1]===s[5].code)},d(S){S&&d(l),i=!1,p()}}}function ke(o,s){let l,a,_,u;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=c("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(i,l,p),we(a,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),a.$set(m),(!u||p&6)&&U(l,"active",s[1]===s[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&d(l),Pe(a)}}}function ye(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,q=o[0].name+"",j,ee,H,R,L,W,Q,O,B,te,M,$,se,z,F=o[0].name+"",G,le,J,E,V,T,X,g,Y,N,A,P=[],ae=new Map,oe,D,k=[],ne=new Map,C;R=new De({props:{js:` +import{S as Se,i as he,s as Re,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as K,O as me,P as Oe,k as Ne,Q as Ce,n as We,t as Z,a as x,o as d,d as Pe,R as $e,C as Ee,p as Te,r as U,u as ge,N as Ae}from"./index-4bd199fb.js";import{S as De}from"./SdkTabs-fc1a80c5.js";function ue(o,s,l){const a=o.slice();return a[5]=s[l],a}function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s){let l,a=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=c("button"),_=w(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){r(S,l,h),n(l,_),n(l,u),i||(p=ge(l,"click",m),i=!0)},p(S,h){s=S,h&4&&a!==(a=s[5].code+"")&&K(_,a),h&6&&U(l,"active",s[1]===s[5].code)},d(S){S&&d(l),i=!1,p()}}}function ke(o,s){let l,a,_,u;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=c("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(i,l,p),we(a,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),a.$set(m),(!u||p&6)&&U(l,"active",s[1]===s[5].code)},i(i){u||(Z(a.$$.fragment,i),u=!0)},o(i){x(a.$$.fragment,i),u=!1},d(i){i&&d(l),Pe(a)}}}function ye(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,q=o[0].name+"",j,ee,H,R,L,W,Q,O,B,te,M,$,se,z,F=o[0].name+"",G,le,J,E,V,T,X,g,Y,N,A,P=[],ae=new Map,oe,D,k=[],ne=new Map,C;R=new De({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmVerificationDocs-c714b7fc.js b/ui/dist/assets/ConfirmVerificationDocs-07e93c01.js similarity index 97% rename from ui/dist/assets/ConfirmVerificationDocs-c714b7fc.js rename to ui/dist/assets/ConfirmVerificationDocs-07e93c01.js index 3c0cf346..1859d1ea 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-c714b7fc.js +++ b/ui/dist/assets/ConfirmVerificationDocs-07e93c01.js @@ -1,4 +1,4 @@ -import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n,m as he,x as D,O as de,P as Te,k as ge,Q as ye,n as Be,t as Z,a as x,o as f,d as $e,R as qe,C as Oe,p as Se,r as H,u as Ee,N as Ne}from"./index-0b562d0f.js";import{S as Ve}from"./SdkTabs-69545b17.js";function ue(i,l,s){const o=i.slice();return o[5]=l[s],o}function be(i,l,s){const o=i.slice();return o[5]=l[s],o}function _e(i,l){let s,o=l[5].code+"",_,u,a,p;function d(){return l[4](l[5])}return{key:i,first:null,c(){s=c("button"),_=h(o),u=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(w,C){r(w,s,C),n(s,_),n(s,u),a||(p=Ee(s,"click",d),a=!0)},p(w,C){l=w,C&4&&o!==(o=l[5].code+"")&&D(_,o),C&6&&H(s,"active",l[1]===l[5].code)},d(w){w&&f(s),a=!1,p()}}}function ke(i,l){let s,o,_,u;return o=new Ne({props:{content:l[5].body}}),{key:i,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(a,p){r(a,s,p),he(o,s,null),n(s,_),u=!0},p(a,p){l=a;const d={};p&4&&(d.content=l[5].body),o.$set(d),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(a){u||(Z(o.$$.fragment,a),u=!0)},o(a){x(o.$$.fragment,a),u=!1},d(a){a&&f(s),$e(o)}}}function Ke(i){var re,fe;let l,s,o=i[0].name+"",_,u,a,p,d,w,C,M=i[0].name+"",F,ee,I,P,L,B,Q,T,A,te,R,q,le,z,U=i[0].name+"",G,se,J,O,W,S,X,E,Y,g,N,$=[],oe=new Map,ie,V,k=[],ne=new Map,y;P=new Ve({props:{js:` +import{S as we,i as Ce,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as n,m as he,x as D,O as de,P as Te,k as ge,Q as ye,n as Be,t as Z,a as x,o as f,d as $e,R as qe,C as Oe,p as Se,r as H,u as Ee,N as Ne}from"./index-4bd199fb.js";import{S as Ve}from"./SdkTabs-fc1a80c5.js";function ue(i,l,s){const o=i.slice();return o[5]=l[s],o}function be(i,l,s){const o=i.slice();return o[5]=l[s],o}function _e(i,l){let s,o=l[5].code+"",_,u,a,p;function d(){return l[4](l[5])}return{key:i,first:null,c(){s=c("button"),_=h(o),u=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(w,C){r(w,s,C),n(s,_),n(s,u),a||(p=Ee(s,"click",d),a=!0)},p(w,C){l=w,C&4&&o!==(o=l[5].code+"")&&D(_,o),C&6&&H(s,"active",l[1]===l[5].code)},d(w){w&&f(s),a=!1,p()}}}function ke(i,l){let s,o,_,u;return o=new Ne({props:{content:l[5].body}}),{key:i,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(a,p){r(a,s,p),he(o,s,null),n(s,_),u=!0},p(a,p){l=a;const d={};p&4&&(d.content=l[5].body),o.$set(d),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(a){u||(Z(o.$$.fragment,a),u=!0)},o(a){x(o.$$.fragment,a),u=!1},d(a){a&&f(s),$e(o)}}}function Ke(i){var re,fe;let l,s,o=i[0].name+"",_,u,a,p,d,w,C,M=i[0].name+"",F,ee,I,P,L,B,Q,T,A,te,R,q,le,z,U=i[0].name+"",G,se,J,O,W,S,X,E,Y,g,N,$=[],oe=new Map,ie,V,k=[],ne=new Map,y;P=new Ve({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[3]}'); diff --git a/ui/dist/assets/CreateApiDocs-a41f2055.js b/ui/dist/assets/CreateApiDocs-0395f23e.js similarity index 99% rename from ui/dist/assets/CreateApiDocs-a41f2055.js rename to ui/dist/assets/CreateApiDocs-0395f23e.js index 7326e5f7..ebe77136 100644 --- a/ui/dist/assets/CreateApiDocs-a41f2055.js +++ b/ui/dist/assets/CreateApiDocs-0395f23e.js @@ -1,4 +1,4 @@ -import{S as Ht,i as Lt,s as Pt,C as Q,N as At,e as a,w as k,b as m,c as Pe,f as h,g as r,h as n,m as Re,x,O as Le,P as ht,k as Rt,Q as Bt,n as Ft,t as fe,a as pe,o as d,d as Be,R as gt,p as jt,r as ue,u as Dt,y as le}from"./index-0b562d0f.js";import{S as Nt}from"./SdkTabs-69545b17.js";function wt(o,e,l){const s=o.slice();return s[7]=e[l],s}function Ct(o,e,l){const s=o.slice();return s[7]=e[l],s}function St(o,e,l){const s=o.slice();return s[12]=e[l],s}function $t(o){let e;return{c(){e=a("p"),e.innerHTML="Requires admin Authorization:TOKEN header",h(e,"class","txt-hint txt-sm txt-right")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Tt(o){let e,l,s,b,p,c,f,y,T,w,O,g,D,V,L,J,j,B,S,N,q,C,_;function M(u,$){var ee,K;return(K=(ee=u[0])==null?void 0:ee.options)!=null&&K.requireEmail?Jt:Vt}let z=M(o),P=z(o);return{c(){e=a("tr"),e.innerHTML='Auth fields',l=m(),s=a("tr"),s.innerHTML=`
Optional +import{S as Ht,i as Lt,s as Pt,C as Q,N as At,e as a,w as k,b as m,c as Pe,f as h,g as r,h as n,m as Re,x,O as Le,P as ht,k as Rt,Q as Bt,n as Ft,t as fe,a as pe,o as d,d as Be,R as gt,p as jt,r as ue,u as Dt,y as le}from"./index-4bd199fb.js";import{S as Nt}from"./SdkTabs-fc1a80c5.js";function wt(o,e,l){const s=o.slice();return s[7]=e[l],s}function Ct(o,e,l){const s=o.slice();return s[7]=e[l],s}function St(o,e,l){const s=o.slice();return s[12]=e[l],s}function $t(o){let e;return{c(){e=a("p"),e.innerHTML="Requires admin Authorization:TOKEN header",h(e,"class","txt-hint txt-sm txt-right")},m(l,s){r(l,e,s)},d(l){l&&d(e)}}}function Tt(o){let e,l,s,b,p,c,f,y,T,w,O,g,D,V,L,J,j,B,S,N,q,C,_;function M(u,$){var ee,K;return(K=(ee=u[0])==null?void 0:ee.options)!=null&&K.requireEmail?Jt:Vt}let z=M(o),P=z(o);return{c(){e=a("tr"),e.innerHTML='Auth fields',l=m(),s=a("tr"),s.innerHTML=`
Optional username
String The username of the auth record. diff --git a/ui/dist/assets/DeleteApiDocs-e45b6da5.js b/ui/dist/assets/DeleteApiDocs-bf7bc019.js similarity index 97% rename from ui/dist/assets/DeleteApiDocs-e45b6da5.js rename to ui/dist/assets/DeleteApiDocs-bf7bc019.js index b35e14af..48b4d279 100644 --- a/ui/dist/assets/DeleteApiDocs-e45b6da5.js +++ b/ui/dist/assets/DeleteApiDocs-bf7bc019.js @@ -1,4 +1,4 @@ -import{S as Ce,i as Re,s as Pe,e as c,w as D,b as k,c as $e,f as m,g as d,h as n,m as we,x,O as _e,P as Ee,k as Oe,Q as Te,n as Be,t as ee,a as te,o as f,d as ge,R as Ie,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-0b562d0f.js";import{S as He}from"./SdkTabs-69545b17.js";function ke(o,l,s){const a=o.slice();return a[6]=l[s],a}function he(o,l,s){const a=o.slice();return a[6]=l[s],a}function ve(o){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,a){d(s,l,a)},d(s){s&&f(l)}}}function ye(o,l){let s,a=l[6].code+"",h,i,r,u;function $(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),h=D(a),i=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){d(b,s,g),n(s,h),n(s,i),r||(u=Se(s,"click",$),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&f(s),r=!1,u()}}}function De(o,l){let s,a,h,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,u){d(r,s,u),we(a,s,null),n(s,h),i=!0},p(r,u){l=r,(!i||u&20)&&N(s,"active",l[2]===l[6].code)},i(r){i||(ee(a.$$.fragment,r),i=!0)},o(r){te(a.$$.fragment,r),i=!1},d(r){r&&f(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",h,i,r,u,$,b,g,q=o[0].name+"",z,le,F,C,K,O,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,T,X,B,Y,I,Z,R,A,w=[],ie=new Map,re,M,v=[],ce=new Map,P;C=new He({props:{js:` +import{S as Ce,i as Re,s as Pe,e as c,w as D,b as k,c as $e,f as m,g as d,h as n,m as we,x,O as _e,P as Ee,k as Oe,Q as Te,n as Be,t as ee,a as te,o as f,d as ge,R as Ie,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-4bd199fb.js";import{S as He}from"./SdkTabs-fc1a80c5.js";function ke(o,l,s){const a=o.slice();return a[6]=l[s],a}function he(o,l,s){const a=o.slice();return a[6]=l[s],a}function ve(o){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,a){d(s,l,a)},d(s){s&&f(l)}}}function ye(o,l){let s,a=l[6].code+"",h,i,r,u;function $(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),h=D(a),i=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){d(b,s,g),n(s,h),n(s,i),r||(u=Se(s,"click",$),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&f(s),r=!1,u()}}}function De(o,l){let s,a,h,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,u){d(r,s,u),we(a,s,null),n(s,h),i=!0},p(r,u){l=r,(!i||u&20)&&N(s,"active",l[2]===l[6].code)},i(r){i||(ee(a.$$.fragment,r),i=!0)},o(r){te(a.$$.fragment,r),i=!1},d(r){r&&f(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",h,i,r,u,$,b,g,q=o[0].name+"",z,le,F,C,K,O,Q,y,H,se,L,E,oe,G,U=o[0].name+"",J,ae,V,ne,W,T,X,B,Y,I,Z,R,A,w=[],ie=new Map,re,M,v=[],ce=new Map,P;C=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/FilterAutocompleteInput-8a4f87de.js b/ui/dist/assets/FilterAutocompleteInput-efafd316.js similarity index 93% rename from ui/dist/assets/FilterAutocompleteInput-8a4f87de.js rename to ui/dist/assets/FilterAutocompleteInput-efafd316.js index 03790289..8295131c 100644 --- a/ui/dist/assets/FilterAutocompleteInput-8a4f87de.js +++ b/ui/dist/assets/FilterAutocompleteInput-efafd316.js @@ -1 +1 @@ -import{S as oe,i as ae,s as le,e as ue,f as ce,g as fe,y as M,o as de,I as he,J as ge,K as pe,L as ye,C as S,M as me}from"./index-0b562d0f.js";import{E as q,a as w,h as be,b as ke,c as xe,d as Ke,e as Ce,s as Se,f as qe,g as we,r as Le,i as Ie,k as Ee,j as Re,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Y,C as E,S as Me,t as De}from"./index-96653a6b.js";function He(e){Z(e,"start");var i={},n=e.languageData||{},g=!1;for(var p in e)if(p!=n&&e.hasOwnProperty(p))for(var d=i[p]=[],o=e[p],s=0;s2&&o.token&&typeof o.token!="string"){n.pending=[];for(var a=2;a-1)return null;var p=n.indent.length-1,d=e[n.state];e:for(;;){for(var o=0;on(21,g=t));const p=pe();let{id:d=""}=i,{value:o=""}=i,{disabled:s=!1}=i,{placeholder:l=""}=i,{baseCollection:a=null}=i,{singleLine:b=!1}=i,{extraAutocompleteKeys:R=[]}=i,{disableRequestKeys:x=!1}=i,{disableIndirectCollectionsKeys:K=!1}=i,f,k,A=s,D=new E,H=new E,F=new E,T=new E,L=[],U=[],W=[],N=[],I="",B="";function O(){f==null||f.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{L=$(g),N=ee(),U=x?[]:te(),W=K?[]:ne()},300)}function $(t){let r=t.slice();return a&&S.pushOrReplaceByKey(r,a,"id"),r}function J(){k==null||k.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function P(){if(!d)return;const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.removeEventListener("click",O)}function V(){if(!d)return;P();const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.addEventListener("click",O)}function C(t,r="",c=0){var m,z,Q;let h=L.find(y=>y.name==t||y.id==t);if(!h||c>=4)return[];let u=S.getAllCollectionIdentifiers(h,r);for(const y of h.schema){const v=r+y.name;if(y.type==="relation"&&((m=y.options)!=null&&m.collectionId)){const X=C(y.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}y.type==="select"&&((z=y.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=y.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(y.type)&&u.push(v+":length")}return u}function ee(){return C(a==null?void 0:a.name)}function te(){const t=[];t.push("@request.method"),t.push("@request.query."),t.push("@request.data."),t.push("@request.auth.id"),t.push("@request.auth.collectionId"),t.push("@request.auth.collectionName"),t.push("@request.auth.verified"),t.push("@request.auth.username"),t.push("@request.auth.email"),t.push("@request.auth.emailVisibility"),t.push("@request.auth.created"),t.push("@request.auth.updated");const r=L.filter(h=>h.isAuth);for(const h of r){const u=C(h.id,"@request.auth.");for(const m of u)S.pushUnique(t,m)}const c=["created","updated"];if(a!=null&&a.id){const h=C(a.name,"@request.data.");for(const u of h){t.push(u);const m=u.split(".");m.length===3&&m[2].indexOf(":")===-1&&!c.includes(m[2])&&t.push(u+":isset")}}return t}function ne(){const t=[];for(const r of L){const c="@collection."+r.name+".",h=C(r.name,c);for(const u of h)t.push(u)}return t}function ie(t=!0,r=!0){let c=[].concat(R);return c=c.concat(N||[]),t&&(c=c.concat(U||[])),r&&(c=c.concat(W||[])),c.sort(function(h,u){return u.length-h.length}),c}function se(t){let r=t.matchBefore(/[\'\"\@\w\.]*/);if(r&&r.from==r.to&&!t.explicit)return null;let c=[{label:"false"},{label:"true"},{label:"@now"}];K||c.push({label:"@collection.*",apply:"@collection."});const h=ie(!x,!x&&r.text.startsWith("@c"));for(const u of h)c.push({label:u.endsWith(".")?u+"*":u,apply:u});return{from:r.from,options:c}}function G(){return Me.define(He({start:[{regex:/true|false|null/,token:"atom"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:S.escapeRegExp("@now"),token:"keyword"},{regex:S.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:r=>{b&&p("submit",o)}};return V(),n(11,f=new q({parent:k,state:w.create({doc:o,extensions:[be(),ke(),xe(),Ke(),Ce(),w.allowMultipleSelections.of(!0),Se(De,{fallback:!0}),qe(),we(),Le(),Ie(),Ee.of([t,...Re,...Ae,Be.find(r=>r.key==="Mod-d"),...Oe,..._e]),q.lineWrapping,ve({override:[se],icons:!1}),T.of(Y(l)),H.of(q.editable.of(!s)),F.of(w.readOnly.of(s)),D.of(G()),w.transactionFilter.of(r=>b&&r.newDoc.lines>1?[]:r),q.updateListener.of(r=>{!r.docChanged||s||(n(1,o=r.state.doc.toString()),J())})]})})),()=>{clearTimeout(_),P(),f==null||f.destroy()}});function re(t){me[t?"unshift":"push"](()=>{k=t,n(0,k)})}return e.$$set=t=>{"id"in t&&n(2,d=t.id),"value"in t&&n(1,o=t.value),"disabled"in t&&n(3,s=t.disabled),"placeholder"in t&&n(4,l=t.placeholder),"baseCollection"in t&&n(5,a=t.baseCollection),"singleLine"in t&&n(6,b=t.singleLine),"extraAutocompleteKeys"in t&&n(7,R=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,x=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,K=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,I=Pe(a)),e.$$.dirty[0]&25352&&!s&&(B!=I||x!==-1||K!==-1)&&(n(14,B=I),j()),e.$$.dirty[0]&4&&d&&V(),e.$$.dirty[0]&2080&&f&&a!=null&&a.schema&&f.dispatch({effects:[D.reconfigure(G())]}),e.$$.dirty[0]&6152&&f&&A!=s&&(f.dispatch({effects:[H.reconfigure(q.editable.of(!s)),F.reconfigure(w.readOnly.of(s))]}),n(12,A=s),J()),e.$$.dirty[0]&2050&&f&&o!=f.state.doc.toString()&&f.dispatch({changes:{from:0,to:f.state.doc.length,insert:o}}),e.$$.dirty[0]&2064&&f&&typeof l<"u"&&f.dispatch({effects:[T.reconfigure(Y(l))]})},[k,o,d,s,l,a,b,R,x,K,O,f,A,I,B,re]}class Qe extends oe{constructor(i){super(),ae(this,i,Ve,Je,le,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Qe as default}; +import{S as oe,i as ae,s as le,e as ue,f as ce,g as fe,y as M,o as de,I as he,J as ge,K as pe,L as ye,C as S,M as me}from"./index-4bd199fb.js";import{C as E,E as q,a as w,h as be,b as ke,c as xe,d as Ke,e as Ce,s as Se,f as qe,g as we,i as Le,r as Ie,j as Ee,k as Re,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Me,t as Y,S as De}from"./index-a6ccb683.js";function He(e){Z(e,"start");var i={},n=e.languageData||{},g=!1;for(var p in e)if(p!=n&&e.hasOwnProperty(p))for(var d=i[p]=[],o=e[p],s=0;s2&&o.token&&typeof o.token!="string"){n.pending=[];for(var a=2;a-1)return null;var p=n.indent.length-1,d=e[n.state];e:for(;;){for(var o=0;on(21,g=t));const p=pe();let{id:d=""}=i,{value:o=""}=i,{disabled:s=!1}=i,{placeholder:l=""}=i,{baseCollection:a=null}=i,{singleLine:b=!1}=i,{extraAutocompleteKeys:R=[]}=i,{disableRequestKeys:x=!1}=i,{disableIndirectCollectionsKeys:K=!1}=i,f,k,A=s,D=new E,H=new E,F=new E,T=new E,L=[],U=[],W=[],N=[],I="",B="";function O(){f==null||f.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{L=$(g),N=ee(),U=x?[]:te(),W=K?[]:ne()},300)}function $(t){let r=t.slice();return a&&S.pushOrReplaceByKey(r,a,"id"),r}function J(){k==null||k.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0}))}function P(){if(!d)return;const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.removeEventListener("click",O)}function V(){if(!d)return;P();const t=document.querySelectorAll('[for="'+d+'"]');for(let r of t)r.addEventListener("click",O)}function C(t,r="",c=0){var m,z,Q;let h=L.find(y=>y.name==t||y.id==t);if(!h||c>=4)return[];let u=S.getAllCollectionIdentifiers(h,r);for(const y of h.schema){const v=r+y.name;if(y.type==="relation"&&((m=y.options)!=null&&m.collectionId)){const X=C(y.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}y.type==="select"&&((z=y.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=y.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(y.type)&&u.push(v+":length")}return u}function ee(){return C(a==null?void 0:a.name)}function te(){const t=[];t.push("@request.method"),t.push("@request.query."),t.push("@request.data."),t.push("@request.auth.id"),t.push("@request.auth.collectionId"),t.push("@request.auth.collectionName"),t.push("@request.auth.verified"),t.push("@request.auth.username"),t.push("@request.auth.email"),t.push("@request.auth.emailVisibility"),t.push("@request.auth.created"),t.push("@request.auth.updated");const r=L.filter(h=>h.isAuth);for(const h of r){const u=C(h.id,"@request.auth.");for(const m of u)S.pushUnique(t,m)}const c=["created","updated"];if(a!=null&&a.id){const h=C(a.name,"@request.data.");for(const u of h){t.push(u);const m=u.split(".");m.length===3&&m[2].indexOf(":")===-1&&!c.includes(m[2])&&t.push(u+":isset")}}return t}function ne(){const t=[];for(const r of L){const c="@collection."+r.name+".",h=C(r.name,c);for(const u of h)t.push(u)}return t}function ie(t=!0,r=!0){let c=[].concat(R);return c=c.concat(N||[]),t&&(c=c.concat(U||[])),r&&(c=c.concat(W||[])),c.sort(function(h,u){return u.length-h.length}),c}function se(t){let r=t.matchBefore(/[\'\"\@\w\.]*/);if(r&&r.from==r.to&&!t.explicit)return null;let c=[{label:"false"},{label:"true"},{label:"@now"}];K||c.push({label:"@collection.*",apply:"@collection."});const h=ie(!x,!x&&r.text.startsWith("@c"));for(const u of h)c.push({label:u.endsWith(".")?u+"*":u,apply:u});return{from:r.from,options:c}}function G(){return De.define(He({start:[{regex:/true|false|null/,token:"atom"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:S.escapeRegExp("@now"),token:"keyword"},{regex:S.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:r=>{b&&p("submit",o)}};return V(),n(11,f=new q({parent:k,state:w.create({doc:o,extensions:[be(),ke(),xe(),Ke(),Ce(),w.allowMultipleSelections.of(!0),Se(qe,{fallback:!0}),we(),Le(),Ie(),Ee(),Re.of([t,...Ae,...Be,Oe.find(r=>r.key==="Mod-d"),..._e,...ve]),q.lineWrapping,Me({override:[se],icons:!1}),T.of(Y(l)),H.of(q.editable.of(!s)),F.of(w.readOnly.of(s)),D.of(G()),w.transactionFilter.of(r=>b&&r.newDoc.lines>1?[]:r),q.updateListener.of(r=>{!r.docChanged||s||(n(1,o=r.state.doc.toString()),J())})]})})),()=>{clearTimeout(_),P(),f==null||f.destroy()}});function re(t){me[t?"unshift":"push"](()=>{k=t,n(0,k)})}return e.$$set=t=>{"id"in t&&n(2,d=t.id),"value"in t&&n(1,o=t.value),"disabled"in t&&n(3,s=t.disabled),"placeholder"in t&&n(4,l=t.placeholder),"baseCollection"in t&&n(5,a=t.baseCollection),"singleLine"in t&&n(6,b=t.singleLine),"extraAutocompleteKeys"in t&&n(7,R=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,x=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,K=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,I=Pe(a)),e.$$.dirty[0]&25352&&!s&&(B!=I||x!==-1||K!==-1)&&(n(14,B=I),j()),e.$$.dirty[0]&4&&d&&V(),e.$$.dirty[0]&2080&&f&&a!=null&&a.schema&&f.dispatch({effects:[D.reconfigure(G())]}),e.$$.dirty[0]&6152&&f&&A!=s&&(f.dispatch({effects:[H.reconfigure(q.editable.of(!s)),F.reconfigure(w.readOnly.of(s))]}),n(12,A=s),J()),e.$$.dirty[0]&2050&&f&&o!=f.state.doc.toString()&&f.dispatch({changes:{from:0,to:f.state.doc.length,insert:o}}),e.$$.dirty[0]&2064&&f&&typeof l<"u"&&f.dispatch({effects:[T.reconfigure(Y(l))]})},[k,o,d,s,l,a,b,R,x,K,O,f,A,I,B,re]}class Qe extends oe{constructor(i){super(),ae(this,i,Ve,Je,le,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Qe as default}; diff --git a/ui/dist/assets/ListApiDocs-b8585ec1.js b/ui/dist/assets/ListApiDocs-af7ae428.js similarity index 99% rename from ui/dist/assets/ListApiDocs-b8585ec1.js rename to ui/dist/assets/ListApiDocs-af7ae428.js index f826ec75..c825ae12 100644 --- a/ui/dist/assets/ListApiDocs-b8585ec1.js +++ b/ui/dist/assets/ListApiDocs-af7ae428.js @@ -1,4 +1,4 @@ -import{S as Se,i as Ne,s as qe,e,b as s,E as He,f as o,g as u,u as De,y as Fe,o as m,w as _,h as t,N as he,c as Yt,m as Zt,x as we,O as Le,P as Me,k as Be,Q as Ie,n as Ge,t as Bt,a as It,d as te,R as Ue,C as _e,p as je,r as xe}from"./index-0b562d0f.js";import{S as Qe}from"./SdkTabs-69545b17.js";function ze(d){let n,a,r;return{c(){n=e("span"),n.textContent="Show details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-down-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Je(d){let n,a,r;return{c(){n=e("span"),n.textContent="Hide details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-up-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Ae(d){let n,a,r,f,p,b,x,$,h,w,c,V,bt,Gt,R,Ut,q,it,F,W,ee,I,G,le,at,ht,X,xt,se,rt,ct,Y,O,jt,wt,y,Z,_t,Qt,$t,U,tt,Ct,zt,kt,L,dt,gt,ne,ft,oe,D,vt,et,yt,j,pt,ie,H,Ft,lt,Lt,st,At,nt,Q,E,Jt,Tt,Kt,Pt,C,z,M,ae,Rt,re,ut,ce,B,Ot,de,Et,Vt,St,Wt,A,mt,J,K,S,Nt,fe,T,k,pe,N,v,ot,ue,P,qt,me,Dt,be,Ht,Xt,Mt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Se,i as Ne,s as qe,e,b as s,E as He,f as o,g as u,u as De,y as Fe,o as m,w as _,h as t,N as he,c as Yt,m as Zt,x as we,O as Le,P as Me,k as Be,Q as Ie,n as Ge,t as Bt,a as It,d as te,R as Ue,C as _e,p as je,r as xe}from"./index-4bd199fb.js";import{S as Qe}from"./SdkTabs-fc1a80c5.js";function ze(d){let n,a,r;return{c(){n=e("span"),n.textContent="Show details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-down-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Je(d){let n,a,r;return{c(){n=e("span"),n.textContent="Hide details",a=s(),r=e("i"),o(n,"class","txt"),o(r,"class","ri-arrow-up-s-line")},m(f,p){u(f,n,p),u(f,a,p),u(f,r,p)},d(f){f&&m(n),f&&m(a),f&&m(r)}}}function Ae(d){let n,a,r,f,p,b,x,$,h,w,c,V,bt,Gt,R,Ut,q,it,F,W,ee,I,G,le,at,ht,X,xt,se,rt,ct,Y,O,jt,wt,y,Z,_t,Qt,$t,U,tt,Ct,zt,kt,L,dt,gt,ne,ft,oe,D,vt,et,yt,j,pt,ie,H,Ft,lt,Lt,st,At,nt,Q,E,Jt,Tt,Kt,Pt,C,z,M,ae,Rt,re,ut,ce,B,Ot,de,Et,Vt,St,Wt,A,mt,J,K,S,Nt,fe,T,k,pe,N,v,ot,ue,P,qt,me,Dt,be,Ht,Xt,Mt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,a=s(),r=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single diff --git a/ui/dist/assets/ListExternalAuthsDocs-bad32919.js b/ui/dist/assets/ListExternalAuthsDocs-c14f16c9.js similarity index 98% rename from ui/dist/assets/ListExternalAuthsDocs-bad32919.js rename to ui/dist/assets/ListExternalAuthsDocs-c14f16c9.js index 214c4ee0..53f16545 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-bad32919.js +++ b/ui/dist/assets/ListExternalAuthsDocs-c14f16c9.js @@ -1,4 +1,4 @@ -import{S as Be,i as qe,s as Oe,e as i,w as v,b as _,c as Se,f as b,g as r,h as s,m as Ee,x as U,O as Pe,P as Le,k as Me,Q as Re,n as We,t as te,a as le,o as d,d as Ie,R as ze,C as De,p as He,r as j,u as Ue,N as je}from"./index-0b562d0f.js";import{S as Ne}from"./SdkTabs-69545b17.js";function ye(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ae(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ce(a,l){let o,n=l[5].code+"",f,h,c,u;function m(){return l[4](l[5])}return{key:a,first:null,c(){o=i("button"),f=v(n),h=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(g,P){r(g,o,P),s(o,f),s(o,h),c||(u=Ue(o,"click",m),c=!0)},p(g,P){l=g,P&4&&n!==(n=l[5].code+"")&&U(f,n),P&6&&j(o,"active",l[1]===l[5].code)},d(g){g&&d(o),c=!1,u()}}}function Te(a,l){let o,n,f,h;return n=new je({props:{content:l[5].body}}),{key:a,first:null,c(){o=i("div"),Se(n.$$.fragment),f=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Ee(n,o,null),s(o,f),h=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),n.$set(m),(!h||u&6)&&j(o,"active",l[1]===l[5].code)},i(c){h||(te(n.$$.fragment,c),h=!0)},o(c){le(n.$$.fragment,c),h=!1},d(c){c&&d(o),Ie(n)}}}function Ge(a){var be,he,_e,ke;let l,o,n=a[0].name+"",f,h,c,u,m,g,P,M=a[0].name+"",N,oe,se,G,K,y,Q,S,F,w,R,ae,W,A,ne,J,z=a[0].name+"",V,ie,X,ce,re,D,Y,E,Z,I,x,B,ee,C,q,$=[],de=new Map,ue,O,k=[],pe=new Map,T;y=new Ne({props:{js:` +import{S as Be,i as qe,s as Oe,e as i,w as v,b as _,c as Se,f as b,g as r,h as s,m as Ee,x as U,O as Pe,P as Le,k as Me,Q as Re,n as We,t as te,a as le,o as d,d as Ie,R as ze,C as De,p as He,r as j,u as Ue,N as je}from"./index-4bd199fb.js";import{S as Ne}from"./SdkTabs-fc1a80c5.js";function ye(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ae(a,l,o){const n=a.slice();return n[5]=l[o],n}function Ce(a,l){let o,n=l[5].code+"",f,h,c,u;function m(){return l[4](l[5])}return{key:a,first:null,c(){o=i("button"),f=v(n),h=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(g,P){r(g,o,P),s(o,f),s(o,h),c||(u=Ue(o,"click",m),c=!0)},p(g,P){l=g,P&4&&n!==(n=l[5].code+"")&&U(f,n),P&6&&j(o,"active",l[1]===l[5].code)},d(g){g&&d(o),c=!1,u()}}}function Te(a,l){let o,n,f,h;return n=new je({props:{content:l[5].body}}),{key:a,first:null,c(){o=i("div"),Se(n.$$.fragment),f=_(),b(o,"class","tab-item"),j(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Ee(n,o,null),s(o,f),h=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),n.$set(m),(!h||u&6)&&j(o,"active",l[1]===l[5].code)},i(c){h||(te(n.$$.fragment,c),h=!0)},o(c){le(n.$$.fragment,c),h=!1},d(c){c&&d(o),Ie(n)}}}function Ge(a){var be,he,_e,ke;let l,o,n=a[0].name+"",f,h,c,u,m,g,P,M=a[0].name+"",N,oe,se,G,K,y,Q,S,F,w,R,ae,W,A,ne,J,z=a[0].name+"",V,ie,X,ce,re,D,Y,E,Z,I,x,B,ee,C,q,$=[],de=new Map,ue,O,k=[],pe=new Map,T;y=new Ne({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset-a8627fa6.js b/ui/dist/assets/PageAdminConfirmPasswordReset-cfe9e164.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset-a8627fa6.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-cfe9e164.js index 82290b35..863c600d 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-a8627fa6.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-cfe9e164.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as C,f as u,r as L,g as b,h as _,u as h,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index-0b562d0f.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,P,v,k,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password +import{S as E,i as G,s as I,F as K,c as A,m as B,t as H,a as N,d as T,C as M,q as J,e as c,w as q,b as C,f as u,r as L,g as b,h as _,u as h,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as S}from"./index-4bd199fb.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=C(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,P,v,k,F,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password `),m&&m.c(),t=C(),A(r.$$.fragment),p=C(),A(d.$$.fragment),n=C(),i=c("button"),g=c("span"),g.textContent="Set new password",R=C(),P=c("div"),v=c("a"),v.textContent="Back to login",u(s,"class","m-b-xs"),u(o,"class","content txt-center m-b-sm"),u(g,"class","txt"),u(i,"type","submit"),u(i,"class","btn btn-lg btn-block"),i.disabled=f[2],L(i,"btn-loading",f[2]),u(e,"class","m-b-base"),u(v,"href","/login"),u(v,"class","link-hint"),u(P,"class","content txt-center")},m(a,$){b(a,e,$),_(e,o),_(o,s),_(s,l),m&&m.m(s,null),_(e,t),B(r,e,null),_(e,p),B(d,e,null),_(e,n),_(e,i),_(i,g),b(a,R,$),b(a,P,$),_(P,v),k=!0,F||(j=[h(e,"submit",O(f[4])),Q(U.call(null,v))],F=!0)},p(a,$){a[3]?m?m.p(a,$):(m=y(a),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const z={};$&769&&(z.$$scope={dirty:$,ctx:a}),r.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:a}),d.$set(D),(!k||$&4)&&(i.disabled=a[2]),(!k||$&4)&&L(i,"btn-loading",a[2])},i(a){k||(H(r.$$.fragment,a),H(d.$$.fragment,a),k=!0)},o(a){N(r.$$.fragment,a),N(d.$$.fragment,a),k=!1},d(a){a&&w(e),m&&m.d(),T(r),T(d),a&&w(R),a&&w(P),F=!1,V(j)}}}function se(f){let e,o;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){A(e.$$.fragment)},m(s,l){B(e,s,l),o=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){o||(H(e.$$.fragment,s),o=!0)},o(s){N(e.$$.fragment,s),o=!1},d(s){T(e,s)}}}function le(f,e,o){let s,{params:l}=e,t="",r="",p=!1;async function d(){if(!p){o(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,r),X("Successfully set a new admin password."),Y("/")}catch(g){W.errorResponseHandler(g)}o(2,p=!1)}}function n(){t=this.value,o(0,t)}function i(){r=this.value,o(1,r)}return f.$$set=g=>{"params"in g&&o(5,l=g.params)},f.$$.update=()=>{f.$$.dirty&32&&o(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,r,p,s,d,l,n,i]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset-caf75d16.js b/ui/dist/assets/PageAdminRequestPasswordReset-a3fb07bb.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset-caf75d16.js rename to ui/dist/assets/PageAdminRequestPasswordReset-a3fb07bb.js index 8f2779de..0a62e73d 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset-caf75d16.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset-a3fb07bb.js @@ -1,2 +1,2 @@ -import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index-0b562d0f.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`

Forgotten admin password

+import{S as M,i as T,s as j,F as z,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as A,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as E,v as I,w as h,x as J,y as P,z as R}from"./index-4bd199fb.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`

Forgotten admin password

Enter the email associated with your account and we’ll send you a recovery link:

`,n=g(),H(l.$$.fragment),t=g(),o=_("button"),f=_("i"),m=g(),i=_("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(f,"class","ri-mail-send-line"),p(i,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=c[1],F(o,"btn-loading",c[1]),p(e,"class","m-b-base")},m(r,$){k(r,e,$),d(e,s),d(e,n),L(l,e,null),d(e,t),d(e,o),d(o,f),d(o,m),d(o,i),a=!0,b||(u=E(e,"submit",I(c[3])),b=!0)},p(r,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:r}),l.$set(q),(!a||$&2)&&(o.disabled=r[1]),(!a||$&2)&&F(o,"btn-loading",r[1])},i(r){a||(w(l.$$.fragment,r),a=!0)},o(r){y(l.$$.fragment,r),a=!1},d(r){r&&v(e),S(l),b=!1,u()}}}function O(c){let e,s,n,l,t,o,f,m,i;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=g(),l=_("div"),t=_("p"),o=h("Check "),f=_("strong"),m=h(c[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(f,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){k(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,f),d(f,m),d(t,i)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&v(e)}}}function Q(c){let e,s,n,l,t,o,f,m;return{c(){e=_("label"),s=h("Email"),l=g(),t=_("input"),p(e,"for",n=c[5]),p(t,"type","email"),p(t,"id",o=c[5]),t.required=!0,t.autofocus=!0},m(i,a){k(i,e,a),d(e,s),k(i,l,a),k(i,t,a),R(t,c[0]),t.focus(),f||(m=E(t,"input",c[4]),f=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&o!==(o=i[5])&&p(t,"id",o),a&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&v(e),i&&v(l),i&&v(t),f=!1,m()}}}function U(c){let e,s,n,l,t,o,f,m;const i=[O,K],a=[];function b(u,r){return u[2]?0:1}return e=b(c),s=a[e]=i[e](c),{c(){s.c(),n=g(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(u,r){a[e].m(u,r),k(u,n,r),k(u,l,r),d(l,t),o=!0,f||(m=A(B.call(null,t)),f=!0)},p(u,r){let $=e;e=b(u),e===$?a[e].p(u,r):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(u,r):(s=a[e]=i[e](u),s.c()),w(s,1),s.m(n.parentNode,n))},i(u){o||(w(s),o=!0)},o(u){y(s),o=!1},d(u){a[e].d(u),u&&v(n),u&&v(l),f=!1,m()}}}function V(c){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:c}}}),{c(){H(e.$$.fragment)},m(n,l){L(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){S(e,n)}}}function W(c,e,s){let n="",l=!1,t=!1;async function o(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.errorResponseHandler(m)}s(1,l=!1)}}function f(){n=this.value,s(0,n)}return[n,l,t,o,f]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; diff --git a/ui/dist/assets/PageRecordConfirmEmailChange-e9ff1996.js b/ui/dist/assets/PageRecordConfirmEmailChange-92497cc2.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmEmailChange-e9ff1996.js rename to ui/dist/assets/PageRecordConfirmEmailChange-92497cc2.js index 7afc20cb..cd58f008 100644 --- a/ui/dist/assets/PageRecordConfirmEmailChange-e9ff1996.js +++ b/ui/dist/assets/PageRecordConfirmEmailChange-92497cc2.js @@ -1,4 +1,4 @@ -import{S as z,i as G,s as I,F as J,c as S,m as L,t as v,a as y,d as R,C as M,E as N,g as _,k as W,n as Y,o as b,G as j,H as A,p as B,q as D,e as m,w as C,b as h,f as d,r as H,h as k,u as P,v as K,y as E,x as O,z as T}from"./index-0b562d0f.js";function Q(r){let e,t,l,s,n,o,c,a,i,u,g,$,p=r[3]&&F(r);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),t=m("div"),l=m("h5"),s=C(`Type your password to confirm changing your email address +import{S as z,i as G,s as I,F as J,c as S,m as L,t as v,a as y,d as R,C as M,E as N,g as _,k as W,n as Y,o as b,G as j,H as A,p as B,q as D,e as m,w as C,b as h,f as d,r as H,h as k,u as P,v as K,y as E,x as O,z as T}from"./index-4bd199fb.js";function Q(r){let e,t,l,s,n,o,c,a,i,u,g,$,p=r[3]&&F(r);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),t=m("div"),l=m("h5"),s=C(`Type your password to confirm changing your email address `),p&&p.c(),n=h(),S(o.$$.fragment),c=h(),a=m("button"),i=m("span"),i.textContent="Confirm new email",d(t,"class","content txt-center m-b-base"),d(i,"class","txt"),d(a,"type","submit"),d(a,"class","btn btn-lg btn-block"),a.disabled=r[1],H(a,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,t),k(t,l),k(l,s),p&&p.m(l,null),k(e,n),L(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||($=P(e,"submit",K(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=F(f),p.c(),p.m(l,null)):p&&(p.d(1),p=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:f}),o.$set(q),(!u||w&2)&&(a.disabled=f[1]),(!u||w&2)&&H(a,"btn-loading",f[1])},i(f){u||(v(o.$$.fragment,f),u=!0)},o(f){y(o.$$.fragment,f),u=!1},d(f){f&&b(e),p&&p.d(),R(o),g=!1,$()}}}function U(r){let e,t,l,s,n;return{c(){e=m("div"),e.innerHTML=`

Successfully changed the user email address.

You can now sign in with your new email address.

`,t=h(),l=m("button"),l.textContent="Close",d(e,"class","alert alert-success"),d(l,"type","button"),d(l,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,t,c),_(o,l,c),s||(n=P(l,"click",r[6]),s=!0)},p:E,i:E,o:E,d(o){o&&b(e),o&&b(t),o&&b(l),s=!1,n()}}}function F(r){let e,t,l;return{c(){e=C("to "),t=m("strong"),l=C(r[3]),d(t,"class","txt-nowrap")},m(s,n){_(s,e,n),_(s,t,n),k(t,l)},p(s,n){n&8&&O(l,s[3])},d(s){s&&b(e),s&&b(t)}}}function V(r){let e,t,l,s,n,o,c,a;return{c(){e=m("label"),t=C("Password"),s=h(),n=m("input"),d(e,"for",l=r[8]),d(n,"type","password"),d(n,"id",o=r[8]),n.required=!0,n.autofocus=!0},m(i,u){_(i,e,u),k(e,t),_(i,s,u),_(i,n,u),T(n,r[0]),n.focus(),c||(a=P(n,"input",r[7]),c=!0)},p(i,u){u&256&&l!==(l=i[8])&&d(e,"for",l),u&256&&o!==(o=i[8])&&d(n,"id",o),u&1&&n.value!==i[0]&&T(n,i[0])},d(i){i&&b(e),i&&b(s),i&&b(n),c=!1,a()}}}function X(r){let e,t,l,s;const n=[U,Q],o=[];function c(a,i){return a[2]?0:1}return e=c(r),t=o[e]=n[e](r),{c(){t.c(),l=N()},m(a,i){o[e].m(a,i),_(a,l,i),s=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(W(),y(o[u],1,1,()=>{o[u]=null}),Y(),t=o[e],t?t.p(a,i):(t=o[e]=n[e](a),t.c()),v(t,1),t.m(l.parentNode,l))},i(a){s||(v(t),s=!0)},o(a){y(t),s=!1},d(a){o[e].d(a),a&&b(l)}}}function Z(r){let e,t;return e=new J({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},m(l,s){L(e,l,s),t=!0},p(l,[s]){const n={};s&527&&(n.$$scope={dirty:s,ctx:l}),e.$set(n)},i(l){t||(v(e.$$.fragment,l),t=!0)},o(l){y(e.$$.fragment,l),t=!1},d(l){R(e,l)}}}function x(r,e,t){let l,{params:s}=e,n="",o=!1,c=!1;async function a(){if(o)return;t(1,o=!0);const g=new j("../");try{const $=A(s==null?void 0:s.token);await g.collection($.collectionId).confirmEmailChange(s==null?void 0:s.token,n),t(2,c=!0)}catch($){B.errorResponseHandler($)}t(1,o=!1)}const i=()=>window.close();function u(){n=this.value,t(0,n)}return r.$$set=g=>{"params"in g&&t(5,s=g.params)},r.$$.update=()=>{r.$$.dirty&32&&t(3,l=M.getJWTPayload(s==null?void 0:s.token).newEmail||"")},[n,o,c,l,a,s,i,u]}class te extends z{constructor(e){super(),G(this,e,x,Z,I,{params:5})}}export{te as default}; diff --git a/ui/dist/assets/PageRecordConfirmPasswordReset-ae243296.js b/ui/dist/assets/PageRecordConfirmPasswordReset-c400898d.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmPasswordReset-ae243296.js rename to ui/dist/assets/PageRecordConfirmPasswordReset-c400898d.js index 6674ef3a..d82dba67 100644 --- a/ui/dist/assets/PageRecordConfirmPasswordReset-ae243296.js +++ b/ui/dist/assets/PageRecordConfirmPasswordReset-c400898d.js @@ -1,4 +1,4 @@ -import{S as J,i as M,s as W,F as Y,c as F,m as N,t as y,a as q,d as T,C as j,E as A,g as _,k as B,n as D,o as m,G as K,H as O,p as Q,q as E,e as b,w as R,b as P,f as p,r as G,h as w,u as H,v as U,y as S,x as V,z as h}from"./index-0b562d0f.js";function X(r){let e,l,s,n,t,o,c,a,i,u,v,k,g,C,d=r[4]&&I(r);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),a=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=R(`Reset your user password +import{S as J,i as M,s as W,F as Y,c as F,m as N,t as y,a as q,d as T,C as j,E as A,g as _,k as B,n as D,o as m,G as K,H as O,p as Q,q as E,e as b,w as R,b as P,f as p,r as G,h as w,u as H,v as U,y as S,x as V,z as h}from"./index-4bd199fb.js";function X(r){let e,l,s,n,t,o,c,a,i,u,v,k,g,C,d=r[4]&&I(r);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),a=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:r}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=R(`Reset your user password `),d&&d.c(),t=P(),F(o.$$.fragment),c=P(),F(a.$$.fragment),i=P(),u=b("button"),v=b("span"),v.textContent="Set new password",p(l,"class","content txt-center m-b-base"),p(v,"class","txt"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block"),u.disabled=r[2],G(u,"btn-loading",r[2])},m(f,$){_(f,e,$),w(e,l),w(l,s),w(s,n),d&&d.m(s,null),w(e,t),N(o,e,null),w(e,c),N(a,e,null),w(e,i),w(e,u),w(u,v),k=!0,g||(C=H(e,"submit",U(r[5])),g=!0)},p(f,$){f[4]?d?d.p(f,$):(d=I(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const L={};$&3073&&(L.$$scope={dirty:$,ctx:f}),o.$set(L);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),a.$set(z),(!k||$&4)&&(u.disabled=f[2]),(!k||$&4)&&G(u,"btn-loading",f[2])},i(f){k||(y(o.$$.fragment,f),y(a.$$.fragment,f),k=!0)},o(f){q(o.$$.fragment,f),q(a.$$.fragment,f),k=!1},d(f){f&&m(e),d&&d.d(),T(o),T(a),g=!1,C()}}}function Z(r){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML=`

Successfully changed the user password.

You can now sign in with your new password.

`,l=P(),s=b("button"),s.textContent="Close",p(e,"class","alert alert-success"),p(s,"type","button"),p(s,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,l,c),_(o,s,c),n||(t=H(s,"click",r[7]),n=!0)},p:S,i:S,o:S,d(o){o&&m(e),o&&m(l),o&&m(s),n=!1,t()}}}function I(r){let e,l,s;return{c(){e=R("for "),l=b("strong"),s=R(r[4])},m(n,t){_(n,e,t),_(n,l,t),w(l,s)},p(n,t){t&16&&V(s,n[4])},d(n){n&&m(e),n&&m(l)}}}function x(r){let e,l,s,n,t,o,c,a;return{c(){e=b("label"),l=R("New password"),n=P(),t=b("input"),p(e,"for",s=r[10]),p(t,"type","password"),p(t,"id",o=r[10]),t.required=!0,t.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),h(t,r[0]),t.focus(),c||(a=H(t,"input",r[8]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&1&&t.value!==i[0]&&h(t,i[0])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,a()}}}function ee(r){let e,l,s,n,t,o,c,a;return{c(){e=b("label"),l=R("New password confirm"),n=P(),t=b("input"),p(e,"for",s=r[10]),p(t,"type","password"),p(t,"id",o=r[10]),t.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),h(t,r[1]),c||(a=H(t,"input",r[9]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&2&&t.value!==i[1]&&h(t,i[1])},d(i){i&&m(e),i&&m(n),i&&m(t),c=!1,a()}}}function te(r){let e,l,s,n;const t=[Z,X],o=[];function c(a,i){return a[3]?0:1}return e=c(r),l=o[e]=t[e](r),{c(){l.c(),s=A()},m(a,i){o[e].m(a,i),_(a,s,i),n=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(B(),q(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(a,i):(l=o[e]=t[e](a),l.c()),y(l,1),l.m(s.parentNode,s))},i(a){n||(y(l),n=!0)},o(a){q(l),n=!1},d(a){o[e].d(a),a&&m(s)}}}function se(r){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){F(e.$$.fragment)},m(s,n){N(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(y(e.$$.fragment,s),l=!0)},o(s){q(e.$$.fragment,s),l=!1},d(s){T(e,s)}}}function le(r,e,l){let s,{params:n}=e,t="",o="",c=!1,a=!1;async function i(){if(c)return;l(2,c=!0);const g=new K("../");try{const C=O(n==null?void 0:n.token);await g.collection(C.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,a=!0)}catch(C){Q.errorResponseHandler(C)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function k(){o=this.value,l(1,o)}return r.$$set=g=>{"params"in g&&l(6,n=g.params)},r.$$.update=()=>{r.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,a,s,i,n,u,v,k]}class oe extends J{constructor(e){super(),M(this,e,le,se,W,{params:6})}}export{oe as default}; diff --git a/ui/dist/assets/PageRecordConfirmVerification-e6772423.js b/ui/dist/assets/PageRecordConfirmVerification-31a028ed.js similarity index 97% rename from ui/dist/assets/PageRecordConfirmVerification-e6772423.js rename to ui/dist/assets/PageRecordConfirmVerification-31a028ed.js index 1fe3e049..a1590069 100644 --- a/ui/dist/assets/PageRecordConfirmVerification-e6772423.js +++ b/ui/dist/assets/PageRecordConfirmVerification-31a028ed.js @@ -1,3 +1,3 @@ -import{S as v,i as y,s as w,F as C,c as g,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as r,o as a,e as u,b as _,f,u as b,y as p}from"./index-0b562d0f.js";function S(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`
+import{S as v,i as y,s as w,F as C,c as g,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as r,o as a,e as u,b as _,f,u as b,y as p}from"./index-4bd199fb.js";function S(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`

Invalid or expired verification token.

`,s=_(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-danger"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(i,c){r(i,t,c),r(i,s,c),r(i,e,c),n||(l=b(e,"click",o[4]),n=!0)},p,d(i){i&&a(t),i&&a(s),i&&a(e),n=!1,l()}}}function F(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`

Successfully verified email address.

`,s=_(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-success"),f(e,"type","button"),f(e,"class","btn btn-transparent btn-block")},m(i,c){r(i,t,c),r(i,s,c),r(i,e,c),n||(l=b(e,"click",o[3]),n=!0)},p,d(i){i&&a(t),i&&a(s),i&&a(e),n=!1,l()}}}function I(o){let t;return{c(){t=u("div"),t.innerHTML='
Please wait...
',f(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function V(o){let t;function s(l,i){return l[1]?I:l[0]?F:S}let e=s(o),n=e(o);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),r(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){n.d(l),l&&a(t)}}}function q(o){let t,s;return t=new C({props:{nobranding:!0,$$slots:{default:[V]},$$scope:{ctx:o}}}),{c(){g(t.$$.fragment)},m(e,n){x(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function E(o,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const d=new P("../");try{const m=T(e==null?void 0:e.token);await d.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const c=()=>window.close(),k=()=>window.close();return o.$$set=d=>{"params"in d&&s(2,e=d.params)},[n,l,e,c,k]}class N extends v{constructor(t){super(),y(this,t,E,q,w,{params:2})}}export{N as default}; diff --git a/ui/dist/assets/RealtimeApiDocs-d08a8d9d.js b/ui/dist/assets/RealtimeApiDocs-1d12f17f.js similarity index 98% rename from ui/dist/assets/RealtimeApiDocs-d08a8d9d.js rename to ui/dist/assets/RealtimeApiDocs-1d12f17f.js index 2b1e89a4..22536d45 100644 --- a/ui/dist/assets/RealtimeApiDocs-d08a8d9d.js +++ b/ui/dist/assets/RealtimeApiDocs-1d12f17f.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,N as ue,C as P,e as u,w as y,b as a,c as te,f as p,g as t,h as I,m as ne,x as pe,t as ie,a as le,o as n,d as ce,R as me,p as de}from"./index-0b562d0f.js";import{S as fe}from"./SdkTabs-69545b17.js";function $e(o){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,l=o[0].name+"",b,d,h,f,_,$,k,c,S,v,w,R,C,g,E,r,D;return c=new fe({props:{js:` +import{S as re,i as ae,s as be,N as ue,C as P,e as u,w as y,b as a,c as te,f as p,g as t,h as I,m as ne,x as pe,t as ie,a as le,o as n,d as ce,R as me,p as de}from"./index-4bd199fb.js";import{S as fe}from"./SdkTabs-fc1a80c5.js";function $e(o){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,l=o[0].name+"",b,d,h,f,_,$,k,c,S,v,w,R,C,g,E,r,D;return c=new fe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[1]}'); diff --git a/ui/dist/assets/RequestEmailChangeDocs-b73bbbd4.js b/ui/dist/assets/RequestEmailChangeDocs-e906139a.js similarity index 98% rename from ui/dist/assets/RequestEmailChangeDocs-b73bbbd4.js rename to ui/dist/assets/RequestEmailChangeDocs-e906139a.js index e74a1a65..2ec64fa4 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-b73bbbd4.js +++ b/ui/dist/assets/RequestEmailChangeDocs-e906139a.js @@ -1,4 +1,4 @@ -import{S as Te,i as Ee,s as Be,e as c,w as v,b as h,c as Pe,f,g as r,h as n,m as Ce,x as L,O as ve,P as Se,k as Re,Q as Me,n as Ae,t as x,a as ee,o as m,d as ye,R as We,C as ze,p as He,r as N,u as Oe,N as Ue}from"./index-0b562d0f.js";import{S as je}from"./SdkTabs-69545b17.js";function we(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function $e(o,l){let s,a=l[5].code+"",_,b,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=v(a),b=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m($,q){r($,s,q),n(s,_),n(s,b),i||(p=Oe(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&L(_,a),q&6&&N(s,"active",l[1]===l[5].code)},d($){$&&m(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Pe(a.$$.fragment),_=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m(i,p){r(i,s,p),Ce(a,s,null),n(s,_),b=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!b||p&6)&&N(s,"active",l[1]===l[5].code)},i(i){b||(x(a.$$.fragment,i),b=!0)},o(i){ee(a.$$.fragment,i),b=!1},d(i){i&&m(s),ye(a)}}}function De(o){var de,pe,ue,fe;let l,s,a=o[0].name+"",_,b,i,p,u,$,q,z=o[0].name+"",F,te,I,P,K,T,Q,w,H,le,O,E,se,G,U=o[0].name+"",J,ae,oe,j,V,B,X,S,Y,R,Z,C,M,g=[],ne=new Map,ie,A,k=[],ce=new Map,y;P=new je({props:{js:` +import{S as Te,i as Ee,s as Be,e as c,w as v,b as h,c as Pe,f,g as r,h as n,m as Ce,x as L,O as ve,P as Se,k as Re,Q as Me,n as Ae,t as x,a as ee,o as m,d as ye,R as We,C as ze,p as He,r as N,u as Oe,N as Ue}from"./index-4bd199fb.js";import{S as je}from"./SdkTabs-fc1a80c5.js";function we(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function $e(o,l){let s,a=l[5].code+"",_,b,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=c("button"),_=v(a),b=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m($,q){r($,s,q),n(s,_),n(s,b),i||(p=Oe(s,"click",u),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&L(_,a),q&6&&N(s,"active",l[1]===l[5].code)},d($){$&&m(s),i=!1,p()}}}function qe(o,l){let s,a,_,b;return a=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){s=c("div"),Pe(a.$$.fragment),_=h(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m(i,p){r(i,s,p),Ce(a,s,null),n(s,_),b=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!b||p&6)&&N(s,"active",l[1]===l[5].code)},i(i){b||(x(a.$$.fragment,i),b=!0)},o(i){ee(a.$$.fragment,i),b=!1},d(i){i&&m(s),ye(a)}}}function De(o){var de,pe,ue,fe;let l,s,a=o[0].name+"",_,b,i,p,u,$,q,z=o[0].name+"",F,te,I,P,K,T,Q,w,H,le,O,E,se,G,U=o[0].name+"",J,ae,oe,j,V,B,X,S,Y,R,Z,C,M,g=[],ne=new Map,ie,A,k=[],ce=new Map,y;P=new je({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestPasswordResetDocs-59f65298.js b/ui/dist/assets/RequestPasswordResetDocs-a201cc14.js similarity index 97% rename from ui/dist/assets/RequestPasswordResetDocs-59f65298.js rename to ui/dist/assets/RequestPasswordResetDocs-a201cc14.js index 792f8eaa..9997718c 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-59f65298.js +++ b/ui/dist/assets/RequestPasswordResetDocs-a201cc14.js @@ -1,4 +1,4 @@ -import{S as Pe,i as $e,s as qe,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as I,O as me,P as Re,k as ge,Q as ye,n as Be,t as Z,a as x,o as d,d as he,R as Ce,C as Se,p as Te,r as L,u as Me,N as Ae}from"./index-0b562d0f.js";import{S as Ue}from"./SdkTabs-69545b17.js";function ue(a,s,l){const o=a.slice();return o[5]=s[l],o}function be(a,s,l){const o=a.slice();return o[5]=s[l],o}function _e(a,s){let l,o=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:a,first:null,c(){l=c("button"),_=w(o),u=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(P,$){r(P,l,$),n(l,_),n(l,u),i||(p=Me(l,"click",m),i=!0)},p(P,$){s=P,$&4&&o!==(o=s[5].code+"")&&I(_,o),$&6&&L(l,"active",s[1]===s[5].code)},d(P){P&&d(l),i=!1,p()}}}function ke(a,s){let l,o,_,u;return o=new Ae({props:{content:s[5].body}}),{key:a,first:null,c(){l=c("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(i,l,p),we(o,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),o.$set(m),(!u||p&6)&&L(l,"active",s[1]===s[5].code)},i(i){u||(Z(o.$$.fragment,i),u=!0)},o(i){x(o.$$.fragment,i),u=!1},d(i){i&&d(l),he(o)}}}function je(a){var re,de;let s,l,o=a[0].name+"",_,u,i,p,m,P,$,D=a[0].name+"",N,ee,Q,q,z,B,G,R,H,te,O,C,se,J,E=a[0].name+"",K,le,V,S,W,T,X,M,Y,g,A,h=[],oe=new Map,ae,U,k=[],ne=new Map,y;q=new Ue({props:{js:` +import{S as Pe,i as $e,s as qe,e as c,w,b as v,c as ve,f as b,g as r,h as n,m as we,x as I,O as me,P as Re,k as ge,Q as ye,n as Be,t as Z,a as x,o as d,d as he,R as Ce,C as Se,p as Te,r as L,u as Me,N as Ae}from"./index-4bd199fb.js";import{S as Ue}from"./SdkTabs-fc1a80c5.js";function ue(a,s,l){const o=a.slice();return o[5]=s[l],o}function be(a,s,l){const o=a.slice();return o[5]=s[l],o}function _e(a,s){let l,o=s[5].code+"",_,u,i,p;function m(){return s[4](s[5])}return{key:a,first:null,c(){l=c("button"),_=w(o),u=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(P,$){r(P,l,$),n(l,_),n(l,u),i||(p=Me(l,"click",m),i=!0)},p(P,$){s=P,$&4&&o!==(o=s[5].code+"")&&I(_,o),$&6&&L(l,"active",s[1]===s[5].code)},d(P){P&&d(l),i=!1,p()}}}function ke(a,s){let l,o,_,u;return o=new Ae({props:{content:s[5].body}}),{key:a,first:null,c(){l=c("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(i,p){r(i,l,p),we(o,l,null),n(l,_),u=!0},p(i,p){s=i;const m={};p&4&&(m.content=s[5].body),o.$set(m),(!u||p&6)&&L(l,"active",s[1]===s[5].code)},i(i){u||(Z(o.$$.fragment,i),u=!0)},o(i){x(o.$$.fragment,i),u=!1},d(i){i&&d(l),he(o)}}}function je(a){var re,de;let s,l,o=a[0].name+"",_,u,i,p,m,P,$,D=a[0].name+"",N,ee,Q,q,z,B,G,R,H,te,O,C,se,J,E=a[0].name+"",K,le,V,S,W,T,X,M,Y,g,A,h=[],oe=new Map,ae,U,k=[],ne=new Map,y;q=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/RequestVerificationDocs-17a2a686.js b/ui/dist/assets/RequestVerificationDocs-54380679.js similarity index 97% rename from ui/dist/assets/RequestVerificationDocs-17a2a686.js rename to ui/dist/assets/RequestVerificationDocs-54380679.js index 58322c53..53daa305 100644 --- a/ui/dist/assets/RequestVerificationDocs-17a2a686.js +++ b/ui/dist/assets/RequestVerificationDocs-54380679.js @@ -1,4 +1,4 @@ -import{S as qe,i as we,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as i,m as he,x as F,O as de,P as ge,k as ye,Q as Be,n as Ce,t as Z,a as x,o as f,d as $e,R as Se,C as Te,p as Re,r as I,u as Ve,N as Me}from"./index-0b562d0f.js";import{S as Ae}from"./SdkTabs-69545b17.js";function pe(a,l,s){const o=a.slice();return o[5]=l[s],o}function be(a,l,s){const o=a.slice();return o[5]=l[s],o}function _e(a,l){let s,o=l[5].code+"",_,p,n,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){s=c("button"),_=h(o),p=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(q,w){r(q,s,w),i(s,_),i(s,p),n||(u=Ve(s,"click",d),n=!0)},p(q,w){l=q,w&4&&o!==(o=l[5].code+"")&&F(_,o),w&6&&I(s,"active",l[1]===l[5].code)},d(q){q&&f(s),n=!1,u()}}}function ke(a,l){let s,o,_,p;return o=new Me({props:{content:l[5].body}}),{key:a,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(n,u){r(n,s,u),he(o,s,null),i(s,_),p=!0},p(n,u){l=n;const d={};u&4&&(d.content=l[5].body),o.$set(d),(!p||u&6)&&I(s,"active",l[1]===l[5].code)},i(n){p||(Z(o.$$.fragment,n),p=!0)},o(n){x(o.$$.fragment,n),p=!1},d(n){n&&f(s),$e(o)}}}function Ue(a){var re,fe;let l,s,o=a[0].name+"",_,p,n,u,d,q,w,j=a[0].name+"",L,ee,N,P,Q,C,z,g,D,te,H,S,le,G,O=a[0].name+"",J,se,K,T,W,R,X,V,Y,y,M,$=[],oe=new Map,ae,A,k=[],ie=new Map,B;P=new Ae({props:{js:` +import{S as qe,i as we,s as Pe,e as c,w as h,b as v,c as ve,f as b,g as r,h as i,m as he,x as F,O as de,P as ge,k as ye,Q as Be,n as Ce,t as Z,a as x,o as f,d as $e,R as Se,C as Te,p as Re,r as I,u as Ve,N as Me}from"./index-4bd199fb.js";import{S as Ae}from"./SdkTabs-fc1a80c5.js";function pe(a,l,s){const o=a.slice();return o[5]=l[s],o}function be(a,l,s){const o=a.slice();return o[5]=l[s],o}function _e(a,l){let s,o=l[5].code+"",_,p,n,u;function d(){return l[4](l[5])}return{key:a,first:null,c(){s=c("button"),_=h(o),p=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(q,w){r(q,s,w),i(s,_),i(s,p),n||(u=Ve(s,"click",d),n=!0)},p(q,w){l=q,w&4&&o!==(o=l[5].code+"")&&F(_,o),w&6&&I(s,"active",l[1]===l[5].code)},d(q){q&&f(s),n=!1,u()}}}function ke(a,l){let s,o,_,p;return o=new Me({props:{content:l[5].body}}),{key:a,first:null,c(){s=c("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(n,u){r(n,s,u),he(o,s,null),i(s,_),p=!0},p(n,u){l=n;const d={};u&4&&(d.content=l[5].body),o.$set(d),(!p||u&6)&&I(s,"active",l[1]===l[5].code)},i(n){p||(Z(o.$$.fragment,n),p=!0)},o(n){x(o.$$.fragment,n),p=!1},d(n){n&&f(s),$e(o)}}}function Ue(a){var re,fe;let l,s,o=a[0].name+"",_,p,n,u,d,q,w,j=a[0].name+"",L,ee,N,P,Q,C,z,g,D,te,H,S,le,G,O=a[0].name+"",J,se,K,T,W,R,X,V,Y,y,M,$=[],oe=new Map,ae,A,k=[],ie=new Map,B;P=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/SdkTabs-69545b17.js b/ui/dist/assets/SdkTabs-fc1a80c5.js similarity index 98% rename from ui/dist/assets/SdkTabs-69545b17.js rename to ui/dist/assets/SdkTabs-fc1a80c5.js index bc65c270..90fc23b0 100644 --- a/ui/dist/assets/SdkTabs-69545b17.js +++ b/ui/dist/assets/SdkTabs-fc1a80c5.js @@ -1 +1 @@ -import{S as q,i as B,s as F,e as v,b as j,f as h,g as y,h as m,O as C,P as J,k as O,Q,n as Y,t as N,a as P,o as w,w as E,r as S,u as z,x as R,N as A,c as G,m as H,d as L}from"./index-0b562d0f.js";function D(o,e,l){const s=o.slice();return s[6]=e[l],s}function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function T(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=E(g),i=j(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(u,_){y(u,l,_),m(l,s),m(s,r),m(l,i),n||(k=z(l,"click",c),n=!0)},p(u,_){e=u,_&4&&g!==(g=e[6].title+"")&&R(r,g),_&6&&S(l,"active",e[1]===e[6].language)},d(u){u&&w(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,u,_,p,f;return s=new A({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),G(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),u=E(" SDK"),p=j(),h(n,"href",_=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),H(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,u),m(l,p),f=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!f||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!f||t&4&&_!==(_=e[6].url))&&h(n,"href",_),(!f||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){f||(N(s.$$.fragment,b),f=!0)},o(b){P(s.$$.fragment,b),f=!1},d(b){b&&w(l),L(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,u,_=o[2];const p=t=>t[6].language;for(let t=0;t<_.length;t+=1){let a=K(o,_,t),d=p(a);g.set(d,s[t]=T(d,a))}let f=o[2];const b=t=>t[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class X extends q{constructor(e){super(),B(this,e,V,U,F,{class:0,js:3,dart:4})}}export{X as S}; +import{S as q,i as B,s as F,e as v,b as j,f as h,g as y,h as m,O as C,P as J,k as O,Q,n as Y,t as N,a as P,o as w,w as E,r as S,u as z,x as R,N as A,c as G,m as H,d as L}from"./index-4bd199fb.js";function D(o,e,l){const s=o.slice();return s[6]=e[l],s}function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function T(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=E(g),i=j(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(u,_){y(u,l,_),m(l,s),m(s,r),m(l,i),n||(k=z(l,"click",c),n=!0)},p(u,_){e=u,_&4&&g!==(g=e[6].title+"")&&R(r,g),_&6&&S(l,"active",e[1]===e[6].language)},d(u){u&&w(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,u,_,p,f;return s=new A({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),G(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),u=E(" SDK"),p=j(),h(n,"href",_=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),S(l,"active",e[1]===e[6].language),this.first=l},m(b,t){y(b,l,t),H(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,u),m(l,p),f=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!f||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!f||t&4&&_!==(_=e[6].url))&&h(n,"href",_),(!f||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){f||(N(s.$$.fragment,b),f=!0)},o(b){P(s.$$.fragment,b),f=!1},d(b){b&&w(l),L(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,u,_=o[2];const p=t=>t[6].language;for(let t=0;t<_.length;t+=1){let a=K(o,_,t),d=p(a);g.set(d,s[t]=T(d,a))}let f=o[2];const b=t=>t[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class X extends q{constructor(e){super(),B(this,e,V,U,F,{class:0,js:3,dart:4})}}export{X as S}; diff --git a/ui/dist/assets/UnlinkExternalAuthDocs-ac0e82b6.js b/ui/dist/assets/UnlinkExternalAuthDocs-e72d2f56.js similarity index 98% rename from ui/dist/assets/UnlinkExternalAuthDocs-ac0e82b6.js rename to ui/dist/assets/UnlinkExternalAuthDocs-e72d2f56.js index 2bd245ca..c0d6ccd5 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs-ac0e82b6.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-e72d2f56.js @@ -1,4 +1,4 @@ -import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as Be,x as j,O as ye,P as Me,k as We,Q as ze,n as He,t as le,a as oe,o as d,d as Ue,R as Le,C as Re,p as je,r as I,u as Ie,N as Ne}from"./index-0b562d0f.js";import{S as Ke}from"./SdkTabs-69545b17.js";function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l,o){const a=n.slice();return a[5]=l[o],a}function Te(n,l){let o,a=l[5].code+"",_,b,c,u;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m($,P){r($,o,P),s(o,_),s(o,b),c||(u=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&j(_,a),P&6&&I(o,"active",l[1]===l[5].code)},d($){$&&d(o),c=!1,u()}}}function Ee(n,l){let o,a,_,b;return a=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Se(a.$$.fragment),_=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Be(a,o,null),s(o,_),b=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!b||u&6)&&I(o,"active",l[1]===l[5].code)},i(c){b||(le(a.$$.fragment,c),b=!0)},o(c){oe(a.$$.fragment,c),b=!1},d(c){c&&d(o),Ue(a)}}}function Qe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,u,m,$,P,M=n[0].name+"",N,se,ae,K,Q,A,F,E,G,g,W,ne,z,y,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,C,q,w=[],ue=new Map,pe,O,k=[],me=new Map,T;A=new Ke({props:{js:` +import{S as qe,i as Oe,s as De,e as i,w as v,b as h,c as Se,f,g as r,h as s,m as Be,x as j,O as ye,P as Me,k as We,Q as ze,n as He,t as le,a as oe,o as d,d as Ue,R as Le,C as Re,p as je,r as I,u as Ie,N as Ne}from"./index-4bd199fb.js";import{S as Ke}from"./SdkTabs-fc1a80c5.js";function Ae(n,l,o){const a=n.slice();return a[5]=l[o],a}function Ce(n,l,o){const a=n.slice();return a[5]=l[o],a}function Te(n,l){let o,a=l[5].code+"",_,b,c,u;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=v(a),b=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m($,P){r($,o,P),s(o,_),s(o,b),c||(u=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&a!==(a=l[5].code+"")&&j(_,a),P&6&&I(o,"active",l[1]===l[5].code)},d($){$&&d(o),c=!1,u()}}}function Ee(n,l){let o,a,_,b;return a=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Se(a.$$.fragment),_=h(),f(o,"class","tab-item"),I(o,"active",l[1]===l[5].code),this.first=o},m(c,u){r(c,o,u),Be(a,o,null),s(o,_),b=!0},p(c,u){l=c;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!b||u&6)&&I(o,"active",l[1]===l[5].code)},i(c){b||(le(a.$$.fragment,c),b=!0)},o(c){oe(a.$$.fragment,c),b=!1},d(c){c&&d(o),Ue(a)}}}function Qe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,u,m,$,P,M=n[0].name+"",N,se,ae,K,Q,A,F,E,G,g,W,ne,z,y,ie,J,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,C,q,w=[],ue=new Map,pe,O,k=[],me=new Map,T;A=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/UpdateApiDocs-64dc39ef.js b/ui/dist/assets/UpdateApiDocs-b844f565.js similarity index 99% rename from ui/dist/assets/UpdateApiDocs-64dc39ef.js rename to ui/dist/assets/UpdateApiDocs-b844f565.js index 56d68b50..75fd0b3f 100644 --- a/ui/dist/assets/UpdateApiDocs-64dc39ef.js +++ b/ui/dist/assets/UpdateApiDocs-b844f565.js @@ -1,4 +1,4 @@ -import{S as Ct,i as St,s as Ot,C as U,N as Tt,e as r,w as y,b as m,c as Ae,f as T,g as a,h as i,m as Be,x as I,O as Pe,P as ut,k as Mt,Q as $t,n as Rt,t as pe,a as fe,o,d as Fe,R as qt,p as Dt,r as ce,u as Ht,y as G}from"./index-0b562d0f.js";import{S as Lt}from"./SdkTabs-69545b17.js";function bt(p,t,l){const s=p.slice();return s[7]=t[l],s}function mt(p,t,l){const s=p.slice();return s[7]=t[l],s}function _t(p,t,l){const s=p.slice();return s[12]=t[l],s}function yt(p){let t;return{c(){t=r("p"),t.innerHTML="Requires admin Authorization:TOKEN header",T(t,"class","txt-hint txt-sm txt-right")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function kt(p){let t,l,s,b,u,d,f,k,C,v,O,D,A,F,M,N,B;return{c(){t=r("tr"),t.innerHTML='Auth fields',l=m(),s=r("tr"),s.innerHTML=`
Optional +import{S as Ct,i as St,s as Ot,C as U,N as Tt,e as r,w as y,b as m,c as Ae,f as T,g as a,h as i,m as Be,x as I,O as Pe,P as ut,k as Mt,Q as $t,n as Rt,t as pe,a as fe,o,d as Fe,R as qt,p as Dt,r as ce,u as Ht,y as G}from"./index-4bd199fb.js";import{S as Lt}from"./SdkTabs-fc1a80c5.js";function bt(p,t,l){const s=p.slice();return s[7]=t[l],s}function mt(p,t,l){const s=p.slice();return s[7]=t[l],s}function _t(p,t,l){const s=p.slice();return s[12]=t[l],s}function yt(p){let t;return{c(){t=r("p"),t.innerHTML="Requires admin Authorization:TOKEN header",T(t,"class","txt-hint txt-sm txt-right")},m(l,s){a(l,t,s)},d(l){l&&o(t)}}}function kt(p){let t,l,s,b,u,d,f,k,C,v,O,D,A,F,M,N,B;return{c(){t=r("tr"),t.innerHTML='Auth fields',l=m(),s=r("tr"),s.innerHTML=`
Optional username
String The username of the auth record.`,b=m(),u=r("tr"),u.innerHTML=`
Optional diff --git a/ui/dist/assets/ViewApiDocs-1c059d66.js b/ui/dist/assets/ViewApiDocs-2e37ac86.js similarity index 98% rename from ui/dist/assets/ViewApiDocs-1c059d66.js rename to ui/dist/assets/ViewApiDocs-2e37ac86.js index 2b564656..93e02265 100644 --- a/ui/dist/assets/ViewApiDocs-1c059d66.js +++ b/ui/dist/assets/ViewApiDocs-2e37ac86.js @@ -1,4 +1,4 @@ -import{S as Ze,i as et,s as tt,N as Ye,e as o,w as m,b as f,c as _e,f as _,g as r,h as l,m as ke,x as me,O as Ve,P as lt,k as st,Q as nt,n as ot,t as z,a as G,o as d,d as he,R as it,C as ze,p as at,r as J,u as rt}from"./index-0b562d0f.js";import{S as dt}from"./SdkTabs-69545b17.js";function Ge(i,s,n){const a=i.slice();return a[6]=s[n],a}function Je(i,s,n){const a=i.slice();return a[6]=s[n],a}function Ke(i){let s;return{c(){s=o("p"),s.innerHTML="Requires admin Authorization:TOKEN header",_(s,"class","txt-hint txt-sm txt-right")},m(n,a){r(n,s,a)},d(n){n&&d(s)}}}function We(i,s){let n,a=s[6].code+"",w,c,p,u;function C(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),w=m(a),c=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(h,F){r(h,n,F),l(n,w),l(n,c),p||(u=rt(n,"click",C),p=!0)},p(h,F){s=h,F&20&&J(n,"active",s[2]===s[6].code)},d(h){h&&d(n),p=!1,u()}}}function Xe(i,s){let n,a,w,c;return a=new Ye({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),_e(a.$$.fragment),w=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(p,u){r(p,n,u),ke(a,n,null),l(n,w),c=!0},p(p,u){s=p,(!c||u&20)&&J(n,"active",s[2]===s[6].code)},i(p){c||(z(a.$$.fragment,p),c=!0)},o(p){G(a.$$.fragment,p),c=!1},d(p){p&&d(n),he(a)}}}function ct(i){var Ne,Ue;let s,n,a=i[0].name+"",w,c,p,u,C,h,F,N=i[0].name+"",K,ve,W,g,X,B,Y,$,U,we,j,E,ye,Z,Q=i[0].name+"",ee,$e,te,Ce,le,x,se,A,ne,I,oe,O,ie,Re,ae,D,re,Fe,de,ge,k,Oe,S,De,Pe,Te,ce,Ee,pe,Se,Be,xe,fe,Ae,ue,M,be,P,H,R=[],Ie=new Map,Me,q,y=[],He=new Map,T;g=new dt({props:{js:` +import{S as Ze,i as et,s as tt,N as Ye,e as o,w as m,b as f,c as _e,f as _,g as r,h as l,m as ke,x as me,O as Ve,P as lt,k as st,Q as nt,n as ot,t as z,a as G,o as d,d as he,R as it,C as ze,p as at,r as J,u as rt}from"./index-4bd199fb.js";import{S as dt}from"./SdkTabs-fc1a80c5.js";function Ge(i,s,n){const a=i.slice();return a[6]=s[n],a}function Je(i,s,n){const a=i.slice();return a[6]=s[n],a}function Ke(i){let s;return{c(){s=o("p"),s.innerHTML="Requires admin Authorization:TOKEN header",_(s,"class","txt-hint txt-sm txt-right")},m(n,a){r(n,s,a)},d(n){n&&d(s)}}}function We(i,s){let n,a=s[6].code+"",w,c,p,u;function C(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),w=m(a),c=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(h,F){r(h,n,F),l(n,w),l(n,c),p||(u=rt(n,"click",C),p=!0)},p(h,F){s=h,F&20&&J(n,"active",s[2]===s[6].code)},d(h){h&&d(n),p=!1,u()}}}function Xe(i,s){let n,a,w,c;return a=new Ye({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),_e(a.$$.fragment),w=f(),_(n,"class","tab-item"),J(n,"active",s[2]===s[6].code),this.first=n},m(p,u){r(p,n,u),ke(a,n,null),l(n,w),c=!0},p(p,u){s=p,(!c||u&20)&&J(n,"active",s[2]===s[6].code)},i(p){c||(z(a.$$.fragment,p),c=!0)},o(p){G(a.$$.fragment,p),c=!1},d(p){p&&d(n),he(a)}}}function ct(i){var Ne,Ue;let s,n,a=i[0].name+"",w,c,p,u,C,h,F,N=i[0].name+"",K,ve,W,g,X,B,Y,$,U,we,j,E,ye,Z,Q=i[0].name+"",ee,$e,te,Ce,le,x,se,A,ne,I,oe,O,ie,Re,ae,D,re,Fe,de,ge,k,Oe,S,De,Pe,Te,ce,Ee,pe,Se,Be,xe,fe,Ae,ue,M,be,P,H,R=[],Ie=new Map,Me,q,y=[],He=new Map,T;g=new dt({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[3]}'); diff --git a/ui/dist/assets/index-0b562d0f.js b/ui/dist/assets/index-4bd199fb.js similarity index 85% rename from ui/dist/assets/index-0b562d0f.js rename to ui/dist/assets/index-4bd199fb.js index 35d585f3..4eb6c612 100644 --- a/ui/dist/assets/index-0b562d0f.js +++ b/ui/dist/assets/index-4bd199fb.js @@ -1,14 +1,14 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function G(){}const kl=n=>n;function Je(n,e){for(const t in e)n[t]=e[t];return n}function Xb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function d_(n){return n()}function ou(){return Object.create(null)}function Pe(n){n.forEach(d_)}function Bt(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function Hn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function Qb(n){return Object.keys(n).length===0}function p_(n,...e){if(n==null)return G;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ye(n,e,t){n.$$.on_destroy.push(p_(e,t))}function Nt(n,e,t,i){if(n){const s=m_(n,e,t,i);return n[0](s)}}function m_(n,e,t,i){return n[1]&&i?Je(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),da=h_?n=>requestAnimationFrame(n):G;const bs=new Set;function __(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&da(__)}function Fo(n){let e;return bs.size===0&&da(__),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function g(n,e){n.appendChild(e)}function g_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function xb(n){const e=b("style");return e1(g_(n),e),e.sheet}function e1(n,e){return g(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function dt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function kn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Xn(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function pt(n){return n===""?null:+n}function t1(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function fe(n,e){n.value=e??""}function Lr(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function x(n,e,t){n.classList[t?"add":"remove"](e)}function b_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function jt(n,e){return new n(e)}const po=new Map;let mo=0;function n1(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function i1(n,e){const t={stylesheet:xb(e),rules:{}};return po.set(n,t),t}function rl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function G(){}const kl=n=>n;function Je(n,e){for(const t in e)n[t]=e[t];return n}function X1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function d_(n){return n()}function ou(){return Object.create(null)}function Pe(n){n.forEach(d_)}function Bt(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function Hn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function Q1(n){return Object.keys(n).length===0}function p_(n,...e){if(n==null)return G;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ye(n,e,t){n.$$.on_destroy.push(p_(e,t))}function Nt(n,e,t,i){if(n){const s=m_(n,e,t,i);return n[0](s)}}function m_(n,e,t,i){return n[1]&&i?Je(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),da=h_?n=>requestAnimationFrame(n):G;const bs=new Set;function __(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&da(__)}function Fo(n){let e;return bs.size===0&&da(__),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function g(n,e){n.appendChild(e)}function g_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function x1(n){const e=b("style");return eb(g_(n),e),e.sheet}function eb(n,e){return g(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function dt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function kn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Xn(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function pt(n){return n===""?null:+n}function tb(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function fe(n,e){n.value=e??""}function Lr(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function x(n,e,t){n.classList[t?"add":"remove"](e)}function b_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function jt(n,e){return new n(e)}const po=new Map;let mo=0;function nb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function ib(n,e){const t={stylesheet:x1(e),rules:{}};return po.set(n,t),t}function rl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ `;for(let v=0;v<=1;v+=a){const k=e+(t-e)*l(v);u+=v*100+`%{${o(k,1-k)}} `}const f=u+`100% {${o(t,1-t)}} -}`,c=`__svelte_${n1(f)}_${r}`,d=g_(n),{stylesheet:m,rules:h}=po.get(d)||i1(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${s}ms 1 both`,mo+=1,c}function al(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),mo-=s,mo||s1())}function s1(){da(()=>{mo||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),po.clear())})}function l1(n,e,t,i){if(!e)return G;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return G;const{delay:l=0,duration:o=300,easing:r=kl,start:a=No()+l,end:u=a+o,tick:f=G,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,h;function _(){c&&(h=rl(n,0,1,o,l,r,c)),l||(m=!0)}function v(){c&&al(n,h),d=!1}return Fo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),v()),!d)return!1;if(m){const y=k-a,T=0+1*r(y/o);f(T,1-T)}return!0}),_(),f(0,1),v}function o1(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,v_(n,s)}}function v_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let ul;function oi(n){ul=n}function wl(){if(!ul)throw new Error("Function called outside component initialization");return ul}function Zt(n){wl().$$.on_mount.push(n)}function r1(n){wl().$$.after_update.push(n)}function y_(n){wl().$$.on_destroy.push(n)}function $t(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=b_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function ze(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _s=[],se=[],oo=[],Nr=[],k_=Promise.resolve();let Fr=!1;function w_(){Fr||(Fr=!0,k_.then(pa))}function sn(){return w_(),k_}function xe(n){oo.push(n)}function ke(n){Nr.push(n)}const er=new Set;let fs=0;function pa(){if(fs!==0)return;const n=ul;do{try{for(;fs<_s.length;){const e=_s[fs];fs++,oi(e),a1(e.$$)}}catch(e){throw _s.length=0,fs=0,e}for(oi(null),_s.length=0,fs=0;se.length;)se.pop()();for(let e=0;e{Rs=null})),Rs}function Ki(n,e,t){n.dispatchEvent(b_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Jn;function re(){Jn={r:0,c:[],p:Jn}}function ae(){Jn.r||Pe(Jn.c),Jn=Jn.p}function E(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Jn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ha={duration:0};function S_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&al(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=kl,tick:_=G,css:v}=s||ha;v&&(o=rl(n,0,1,m,d,h,v,a++)),_(0,1);const k=No()+d,y=k+m;r&&r.abort(),l=!0,xe(()=>Ki(n,!0,"start")),r=Fo(T=>{if(l){if(T>=y)return _(1,0),Ki(n,!0,"end"),u(),l=!1;if(T>=k){const C=h((T-k)/m);_(C,1-C)}}return l})}let c=!1;return{start(){c||(c=!0,al(n),Bt(s)?(s=s(i),ma().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function T_(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Jn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=kl,tick:d=G,css:m}=s||ha;m&&(o=rl(n,1,0,f,u,c,m));const h=No()+u,_=h+f;xe(()=>Ki(n,!1,"start")),Fo(v=>{if(l){if(v>=_)return d(0,1),Ki(n,!1,"end"),--r.r||Pe(r.c),!1;if(v>=h){const k=c((v-h)/f);d(1-k,k)}}return l})}return Bt(s)?ma().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&al(n,o),l=!1)}}}function je(n,e,t,i){const s={direction:"both"};let l=e(n,t,s),o=i?0:1,r=null,a=null,u=null;function f(){u&&al(n,u)}function c(m,h){const _=m.b-o;return h*=Math.abs(_),{a:o,b:m.b,d:_,duration:h,start:m.start,end:m.start+h,group:m.group}}function d(m){const{delay:h=0,duration:_=300,easing:v=kl,tick:k=G,css:y}=l||ha,T={start:No()+h,b:m};m||(T.group=Jn,Jn.r+=1),r||a?a=T:(y&&(f(),u=rl(n,o,m,_,h,v,y)),m&&k(0,1),r=c(T,_),xe(()=>Ki(n,m,"start")),Fo(C=>{if(a&&C>a.start&&(r=c(a,_),a=null,Ki(n,r.b,"start"),y&&(f(),u=rl(n,o,r.b,r.duration,0,v,l.css))),r){if(C>=r.end)k(o=r.b,1-o),Ki(n,r.b,"end"),a||(r.b?f():--r.group.r||Pe(r.group.c)),r=null;else if(C>=r.start){const M=C-r.start;o=r.a+r.d*v(M/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(m){Bt(l)?ma().then(()=>{l=l(s),d(m)}):d(m)},end(){f(),r=a=null}}}function ru(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(re(),P(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ae())}):e.block.d(1),u.c(),E(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&pa()}if(Xb(n)){const s=wl();if(n.then(l=>{oi(s),i(e.then,1,e.value,l),oi(null)},l=>{if(oi(s),i(e.catch,2,e.error,l),oi(null),!e.hasCatch)throw l}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function u1(n,e,t){const i=e.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,t)}function es(n,e){n.d(1),e.delete(n.key)}function ln(n,e){P(n,1,1,()=>{e.delete(n.key)})}function f1(n,e){n.f(),ln(n,e)}function wt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,m=l.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const v=[],k=new Map,y=new Map;for(h=m;h--;){const $=c(s,l,h),D=t($);let A=o.get(D);A?i&&A.p($,e):(A=u(D,$),A.c()),k.set(D,v[h]=A),D in _&&y.set(D,Math.abs(h-_[D]))}const T=new Set,C=new Set;function M($){E($,1),$.m(r,f),o.set($.key,$),f=$.first,m--}for(;d&&m;){const $=v[m-1],D=n[d-1],A=$.key,I=D.key;$===D?(f=$.first,d--,m--):k.has(I)?!o.has(A)||T.has(A)?M($):C.has(I)?d--:y.get(A)>y.get(I)?(C.add(A),M($)):(T.add(I),d--):(a(D,o),d--)}for(;d--;){const $=n[d];k.has($.key)||a($,o)}for(;m;)M(v[m-1]);return v}function on(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function xn(n){return typeof n=="object"&&n!==null?n:{}}function _e(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function V(n){n&&n.c()}function q(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||xe(()=>{const o=n.$$.on_mount.map(d_).filter(Bt);n.$$.on_destroy?n.$$.on_destroy.push(...o):Pe(o),n.$$.on_mount=[]}),l.forEach(xe)}function j(n,e){const t=n.$$;t.fragment!==null&&(Pe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function c1(n,e){n.$$.dirty[0]===-1&&(_s.push(n),w_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=h)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](h),f&&c1(n,c)),d}):[],u.update(),f=!0,Pe(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=t1(e.target);u.fragment&&u.fragment.l(c),c.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&E(n.$$.fragment),q(n,e.target,e.anchor,e.customElement),pa()}oi(a)}class ye{$destroy(){j(this,1),this.$destroy=G}$on(e,t){if(!Bt(t))return G;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!Qb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Mt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t{i.delete(u),i.size===0&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function $_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return C_(t,o=>{let r=!1;const a=[];let u=0,f=G;const c=()=>{if(u)return;f();const m=e(i?a[0]:a,o);l?o(m):f=Bt(m)?m:G},d=s.map((m,h)=>p_(m,_=>{a[h]=_,u&=~(1<{u|=1<{j(f,1)}),ae()}l?(e=jt(l,o()),e.$on("routeEvent",r[7]),V(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function p1(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r){let a={};for(let u=0;u{j(f,1)}),ae()}l?(e=jt(l,o()),e.$on("routeEvent",r[6]),V(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function m1(n){let e,t,i,s;const l=[p1,d1],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=$e()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),P(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function au(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Ro=C_(null,function(e){e(au());const t=()=>{e(au())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});$_(Ro,n=>n.location);const _a=$_(Ro,n=>n.querystring),uu=Ln(void 0);async function Oi(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await sn();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function xt(n,e){if(e=cu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return fu(n,e),{update(t){t=cu(t),fu(n,t)}}}function h1(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function fu(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||_1(i.currentTarget.getAttribute("href"))})}function cu(n){return n&&typeof n=="string"?{href:n}:n||{}}function _1(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function g1(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(M,$){if(!$||typeof $!="function"&&(typeof $!="object"||$._sveltesparouter!==!0))throw Error("Invalid component object");if(!M||typeof M=="string"&&(M.length<1||M.charAt(0)!="/"&&M.charAt(0)!="*")||typeof M=="object"&&!(M instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:A}=M_(M);this.path=M,typeof $=="object"&&$._sveltesparouter===!0?(this.component=$.component,this.conditions=$.conditions||[],this.userData=$.userData,this.props=$.props||{}):(this.component=()=>Promise.resolve($),this.conditions=[],this.props={}),this._pattern=D,this._keys=A}match(M){if(s){if(typeof s=="string")if(M.startsWith(s))M=M.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const I=M.match(s);if(I&&I[0])M=M.substr(I[0].length)||"/";else return null}}const $=this._pattern.exec(M);if($===null)return null;if(this._keys===!1)return $;const D={};let A=0;for(;A{r.push(new o(M,C))}):Object.keys(i).forEach(C=>{r.push(new o(C,i[C]))});let a=null,u=null,f={};const c=$t();async function d(C,M){await sn(),c(C,M)}let m=null,h=null;l&&(h=C=>{C.state&&(C.state.__svelte_spa_router_scrollY||C.state.__svelte_spa_router_scrollX)?m=C.state:m=null},window.addEventListener("popstate",h),r1(()=>{h1(m)}));let _=null,v=null;const k=Ro.subscribe(async C=>{_=C;let M=0;for(;M{uu.set(u)});return}t(0,a=null),v=null,uu.set(void 0)});y_(()=>{k(),h&&window.removeEventListener("popstate",h)});function y(C){ze.call(this,n,C)}function T(C){ze.call(this,n,C)}return n.$$set=C=>{"routes"in C&&t(3,i=C.routes),"prefix"in C&&t(4,s=C.prefix),"restoreScrollState"in C&&t(5,l=C.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,y,T]}class b1 extends ye{constructor(e){super(),ve(this,e,g1,m1,he,{routes:3,prefix:4,restoreScrollState:5})}}const ao=[];let O_;function D_(n){const e=n.pattern.test(O_);du(n,n.className,e),du(n,n.inactiveClassName,!e)}function du(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ro.subscribe(n=>{O_=n.location+(n.querystring?"?"+n.querystring:""),ao.map(D_)});function qn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?M_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ao.push(i),D_(i),{destroy(){ao.splice(ao.indexOf(i),1)}}}const v1="modulepreload",y1=function(n,e){return new URL(n,e).href},pu={},rt=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=y1(l,i),l in pu)return;pu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const c=s[f];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":v1,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e())};var Rr=function(n,e){return Rr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},Rr(n,e)};function Jt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}Rr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var qr=function(){return qr=Object.assign||function(e){for(var t,i=1,s=arguments.length;i0&&s[s.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};var Sl=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(e){for(var t=0,i=Object.entries(e);t0&&(!s.exp||s.exp-i>Date.now()/1e3))}(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this.baseToken=e||"",this.baseModel=t!==null&&typeof t=="object"?t.collectionId!==void 0?new Ti(t):new Xi(t):null,this.triggerChange()},n.prototype.clear=function(){this.baseToken="",this.baseModel=null,this.triggerChange()},n.prototype.loadFromCookie=function(e,t){t===void 0&&(t="pb_auth");var i=function(o,r){var a={};if(typeof o!="string")return a;for(var u=Object.assign({},r||{}).decode||k1,f=0;f4096&&(a.model={id:(s=a==null?void 0:a.model)===null||s===void 0?void 0:s.id,email:(l=a==null?void 0:a.model)===null||l===void 0?void 0:l.email},this.model instanceof Ti&&(a.model.username=this.model.username,a.model.verified=this.model.verified,a.model.collectionId=this.model.collectionId),u=mu(t,JSON.stringify(a),e)),u},n.prototype.onChange=function(e,t){var i=this;return t===void 0&&(t=!1),this._onChangeCallbacks.push(e),t&&e(this.token,this.model),function(){for(var s=i._onChangeCallbacks.length-1;s>=0;s--)if(i._onChangeCallbacks[s]==e)return delete i._onChangeCallbacks[s],void i._onChangeCallbacks.splice(s,1)}},n.prototype.triggerChange=function(){for(var e=0,t=this._onChangeCallbacks;e0?e:1,this.perPage=t>=0?t:0,this.totalItems=i>=0?i:0,this.totalPages=s>=0?s:0,this.items=l||[]},ga=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.getFullList=function(t,i){if(typeof t=="number")return this._getFullList(this.baseCrudPath,t,i);var s=Object.assign({},t,i);return this._getFullList(this.baseCrudPath,s.batch||200,s)},e.prototype.getList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),this._getList(this.baseCrudPath,t,i,s)},e.prototype.getFirstListItem=function(t,i){return i===void 0&&(i={}),this._getFirstListItem(this.baseCrudPath,t,i)},e.prototype.getOne=function(t,i){return i===void 0&&(i={}),this._getOne(this.baseCrudPath,t,i)},e.prototype.create=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this._create(this.baseCrudPath,t,i)},e.prototype.update=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),this._update(this.baseCrudPath,t,i,s)},e.prototype.delete=function(t,i){return i===void 0&&(i={}),this._delete(this.baseCrudPath,t,i)},e}(function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=200),s===void 0&&(s={});var o=[],r=function(a){return en(l,void 0,void 0,function(){return tn(this,function(u){return[2,this._getList(t,a,i||200,s).then(function(f){var c=f,d=c.items,m=c.totalItems;return o=o.concat(d),d.length&&m>o.length?r(a+1):o})]})})};return r(1)},e.prototype._getList=function(t,i,s,l){var o=this;return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),l=Object.assign({page:i,perPage:s},l),this.client.send(t,{method:"GET",params:l}).then(function(r){var a=[];if(r!=null&&r.items){r.items=r.items||[];for(var u=0,f=r.items;u=0;o--)this.subscriptions[t][o]===i&&(l=!0,delete this.subscriptions[t][o],this.subscriptions[t].splice(o,1),(s=this.eventSource)===null||s===void 0||s.removeEventListener(t,i));return l?(this.subscriptions[t].length||delete this.subscriptions[t],this.hasSubscriptionListeners()?[3,1]:(this.disconnect(),[3,3])):[2];case 1:return this.hasSubscriptionListeners(t)?[3,3]:[4,this.submitSubscriptions()];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.hasSubscriptionListeners=function(t){var i,s;if(this.subscriptions=this.subscriptions||{},t)return!!(!((i=this.subscriptions[t])===null||i===void 0)&&i.length);for(var l in this.subscriptions)if(!((s=this.subscriptions[l])===null||s===void 0)&&s.length)return!0;return!1},e.prototype.submitSubscriptions=function(){return en(this,void 0,void 0,function(){return tn(this,function(t){return this.clientId?(this.addAllSubscriptionListeners(),this.lastSentTopics=this.getNonEmptySubscriptionTopics(),[2,this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentTopics},params:{$cancelKey:"realtime_"+this.clientId}}).catch(function(i){if(!(i!=null&&i.isAbort))throw i})]):[2]})})},e.prototype.getNonEmptySubscriptionTopics=function(){var t=[];for(var i in this.subscriptions)this.subscriptions[i].length&&t.push(i);return t},e.prototype.addAllSubscriptionListeners=function(){if(this.eventSource)for(var t in this.removeAllSubscriptionListeners(),this.subscriptions)for(var i=0,s=this.subscriptions[t];i0?[2]:[2,new Promise(function(s,l){t.pendingConnects.push({resolve:s,reject:l}),t.pendingConnects.length>1||t.initConnect()})]})})},e.prototype.initConnect=function(){var t=this;this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(function(){t.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=function(i){t.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",function(i){var s=i;t.clientId=s==null?void 0:s.lastEventId,t.submitSubscriptions().then(function(){return en(t,void 0,void 0,function(){var l;return tn(this,function(o){switch(o.label){case 0:l=3,o.label=1;case 1:return this.hasUnsentSubscriptions()&&l>0?(l--,[4,this.submitSubscriptions()]):[3,3];case 2:return o.sent(),[3,1];case 3:return[2]}})})}).then(function(){for(var l=0,o=t.pendingConnects;lthis.maxReconnectAttempts){for(var s=0,l=this.pendingConnects;s=400)throw new fl({url:T.url,status:T.status,data:C});return[2,C]}})})}).catch(function(T){throw new fl(T)})]})})},n.prototype.getFileUrl=function(e,t,i){i===void 0&&(i={});var s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));var l=this.buildUrl(s.join("/"));if(Object.keys(i).length){var o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l},n.prototype.buildUrl=function(e){var t=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return e&&(t+=e.startsWith("/")?e.substring(1):e),t},n.prototype.isFormData=function(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)},n.prototype.serializeQueryParams=function(e){var t=[];for(var i in e)if(e[i]!==null){var s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(var o=0,r=s;o"u"}function Ji(n){return typeof n=="number"}function qo(n){return typeof n=="number"&&n%1===0}function R1(n){return typeof n=="string"}function q1(n){return Object.prototype.toString.call(n)==="[object Date]"}function x_(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function j1(n){return Array.isArray(n)?n:[n]}function _u(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function V1(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Cs(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ri(n,e,t){return qo(n)&&n>=e&&n<=t}function H1(n,e){return n-e*Math.floor(n/e)}function Ot(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function _i(n){if(!(Ge(n)||n===null||n===""))return parseInt(n,10)}function Fi(n){if(!(Ge(n)||n===null||n===""))return parseFloat(n)}function va(n){if(!(Ge(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ya(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Cl(n){return n%4===0&&(n%100!==0||n%400===0)}function xs(n){return Cl(n)?366:365}function ho(n,e){const t=H1(e-1,12)+1,i=n+(e-t)/12;return t===2?Cl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function ka(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function _o(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Hr(n){return n>99?n:n>60?1900+n:2e3+n}function eg(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function jo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function tg(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new On(`Invalid unit value ${n}`);return e}function go(n,e){const t={};for(const i in n)if(Cs(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=tg(s)}return t}function el(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Ot(t,2)}:${Ot(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Ot(t,2)}${Ot(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Vo(n){return V1(n,["hour","minute","second","millisecond"])}const ng=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,z1=["January","February","March","April","May","June","July","August","September","October","November","December"],ig=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B1=["J","F","M","A","M","J","J","A","S","O","N","D"];function sg(n){switch(n){case"narrow":return[...B1];case"short":return[...ig];case"long":return[...z1];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const lg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],og=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],U1=["M","T","W","T","F","S","S"];function rg(n){switch(n){case"narrow":return[...U1];case"short":return[...og];case"long":return[...lg];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ag=["AM","PM"],W1=["Before Christ","Anno Domini"],Y1=["BC","AD"],K1=["B","A"];function ug(n){switch(n){case"narrow":return[...K1];case"short":return[...Y1];case"long":return[...W1];default:return null}}function J1(n){return ag[n.hour<12?0:1]}function Z1(n,e){return rg(e)[n.weekday-1]}function G1(n,e){return sg(e)[n.month-1]}function X1(n,e){return ug(e)[n.year<0?0:1]}function Q1(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function gu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const x1={D:Vr,DD:L_,DDD:N_,DDDD:F_,t:R_,tt:q_,ttt:j_,tttt:V_,T:H_,TT:z_,TTT:B_,TTTT:U_,f:W_,ff:K_,fff:Z_,ffff:X_,F:Y_,FF:J_,FFF:G_,FFFF:Q_};class dn{static create(e,t={}){return new dn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return x1[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Ot(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?J1(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?G1(e,m):l(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?Z1(e,m):l(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=dn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?X1(e,m):l({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(m)}};return gu(dn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=dn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return gu(l,s(r))}}class jn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class $l{get type(){throw new mi}get name(){throw new mi}get ianaName(){return this.name}get isUniversal(){throw new mi}offsetName(e,t){throw new mi}formatOffset(e,t){throw new mi}offset(e){throw new mi}equals(e){throw new mi}get isValid(){throw new mi}}let tr=null;class wa extends $l{static get instance(){return tr===null&&(tr=new wa),tr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return eg(e,t,i)}formatOffset(e,t){return el(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let uo={};function e0(n){return uo[n]||(uo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),uo[n]}const t0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function n0(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function i0(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let nr=null;class nn extends $l{static get utcInstance(){return nr===null&&(nr=new nn(0)),nr}static instance(e){return e===0?nn.utcInstance:new nn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new nn(jo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${el(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${el(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return el(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class s0 extends $l{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function gi(n,e){if(Ge(n)||n===null)return e;if(n instanceof $l)return n;if(R1(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?nn.utcInstance:nn.parseSpecifier(t)||ai.create(n)}else return Ji(n)?nn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new s0(n)}let bu=()=>Date.now(),vu="system",yu=null,ku=null,wu=null,Su;class Lt{static get now(){return bu}static set now(e){bu=e}static set defaultZone(e){vu=e}static get defaultZone(){return gi(vu,wa.instance)}static get defaultLocale(){return yu}static set defaultLocale(e){yu=e}static get defaultNumberingSystem(){return ku}static set defaultNumberingSystem(e){ku=e}static get defaultOutputCalendar(){return wu}static set defaultOutputCalendar(e){wu=e}static get throwOnInvalid(){return Su}static set throwOnInvalid(e){Su=e}static resetCaches(){gt.resetCache(),ai.resetCache()}}let Tu={};function l0(n,e={}){const t=JSON.stringify([n,e]);let i=Tu[t];return i||(i=new Intl.ListFormat(n,e),Tu[t]=i),i}let zr={};function Br(n,e={}){const t=JSON.stringify([n,e]);let i=zr[t];return i||(i=new Intl.DateTimeFormat(n,e),zr[t]=i),i}let Ur={};function o0(n,e={}){const t=JSON.stringify([n,e]);let i=Ur[t];return i||(i=new Intl.NumberFormat(n,e),Ur[t]=i),i}let Wr={};function r0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Wr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Wr[s]=l),l}let Gs=null;function a0(){return Gs||(Gs=new Intl.DateTimeFormat().resolvedOptions().locale,Gs)}function u0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Br(n).resolvedOptions()}catch{t=Br(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function f0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function c0(n){const e=[];for(let t=1;t<=12;t++){const i=qe.utc(2016,t,1);e.push(n(i))}return e}function d0(n){const e=[];for(let t=1;t<=7;t++){const i=qe.utc(2016,11,13+t);e.push(n(i))}return e}function Vl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function p0(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class m0{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=o0(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):ya(e,3);return Ot(t,this.padTo)}}}class h0{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&ai.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:qe.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Br(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class _0{constructor(e,t,i){this.opts={style:"long",...i},!t&&x_()&&(this.rtf=r0(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Q1(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class gt{static fromOpts(e){return gt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Lt.defaultLocale,o=l||(s?"en-US":a0()),r=t||Lt.defaultNumberingSystem,a=i||Lt.defaultOutputCalendar;return new gt(o,r,a,l)}static resetCache(){Gs=null,zr={},Ur={},Wr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return gt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=u0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=f0(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=p0(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:gt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Vl(this,e,i,sg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=c0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Vl(this,e,i,rg,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=d0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Vl(this,void 0,e,()=>ag,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[qe.utc(2016,11,13,9),qe.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Vl(this,e,t,ug,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[qe.utc(-40,1,1),qe.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new m0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new h0(e,this.intl,t)}relFormatter(e={}){return new _0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return l0(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function As(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Is(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Ps(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function fg(...n){return(e,t)=>{const i={};let s;for(s=0;sm!==void 0&&(h||m&&f)?-m:m;return[{years:d(Fi(t)),months:d(Fi(i)),weeks:d(Fi(s)),days:d(Fi(l)),hours:d(Fi(o)),minutes:d(Fi(r)),seconds:d(Fi(a),a==="-0"),milliseconds:d(va(u),c)}]}const D0={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ca(n,e,t,i,s,l,o){const r={year:e.length===2?Hr(_i(e)):_i(e),month:ig.indexOf(t)+1,day:_i(i),hour:_i(s),minute:_i(l)};return o&&(r.second=_i(o)),n&&(r.weekday=n.length>3?lg.indexOf(n)+1:og.indexOf(n)+1),r}const E0=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function A0(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Ca(e,s,i,t,l,o,r);let m;return a?m=D0[a]:u?m=0:m=jo(f,c),[d,new nn(m)]}function I0(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const P0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,L0=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,N0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Cu(n){const[,e,t,i,s,l,o,r]=n;return[Ca(e,s,i,t,l,o,r),nn.utcInstance]}function F0(n){const[,e,t,i,s,l,o,r]=n;return[Ca(e,r,t,i,s,l,o),nn.utcInstance]}const R0=As(b0,Ta),q0=As(v0,Ta),j0=As(y0,Ta),V0=As(dg),mg=Is(C0,Ls,Ml,Ol),H0=Is(k0,Ls,Ml,Ol),z0=Is(w0,Ls,Ml,Ol),B0=Is(Ls,Ml,Ol);function U0(n){return Ps(n,[R0,mg],[q0,H0],[j0,z0],[V0,B0])}function W0(n){return Ps(I0(n),[E0,A0])}function Y0(n){return Ps(n,[P0,Cu],[L0,Cu],[N0,F0])}function K0(n){return Ps(n,[M0,O0])}const J0=Is(Ls);function Z0(n){return Ps(n,[$0,J0])}const G0=As(S0,T0),X0=As(pg),Q0=Is(Ls,Ml,Ol);function x0(n){return Ps(n,[G0,mg],[X0,Q0])}const ev="Invalid Duration",hg={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},tv={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...hg},Sn=146097/400,ds=146097/4800,nv={years:{quarters:4,months:12,weeks:Sn/7,days:Sn,hours:Sn*24,minutes:Sn*24*60,seconds:Sn*24*60*60,milliseconds:Sn*24*60*60*1e3},quarters:{months:3,weeks:Sn/28,days:Sn/4,hours:Sn*24/4,minutes:Sn*24*60/4,seconds:Sn*24*60*60/4,milliseconds:Sn*24*60*60*1e3/4},months:{weeks:ds/7,days:ds,hours:ds*24,minutes:ds*24*60,seconds:ds*24*60*60,milliseconds:ds*24*60*60*1e3},...hg},zi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],iv=zi.slice(0).reverse();function Ri(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new tt(i)}function sv(n){return n<0?Math.floor(n):Math.ceil(n)}function _g(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?sv(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function lv(n,e){iv.reduce((t,i)=>Ge(e[i])?t:(t&&_g(n,e,t,e,i),i),null)}class tt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||gt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?nv:tv,this.isLuxonDuration=!0}static fromMillis(e,t){return tt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new On(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new tt({values:go(e,tt.normalizeUnit),loc:gt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(Ji(e))return tt.fromMillis(e);if(tt.isDuration(e))return e;if(typeof e=="object")return tt.fromObject(e);throw new On(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=K0(e);return i?tt.fromObject(i,t):tt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Z0(e);return i?tt.fromObject(i,t):tt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new On("need to specify a reason the Duration is invalid");const i=e instanceof jn?e:new jn(e,t);if(Lt.throwOnInvalid)throw new L1(i);return new tt({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new P_(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?dn.create(this.loc,i).formatDurationFromString(this,e):ev}toHuman(e={}){const t=zi.map(i=>{const s=this.values[i];return Ge(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=ya(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e),i={};for(const s of zi)(Cs(t.values,s)||Cs(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Ri(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=tg(e(this.values[i],i));return Ri(this,{values:t},!0)}get(e){return this[tt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...go(e,tt.normalizeUnit)};return Ri(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Ri(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return lv(this.matrix,e),Ri(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>tt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of zi)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;Ji(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)zi.indexOf(u)>zi.indexOf(o)&&_g(this.matrix,s,u,t,o)}else Ji(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Ri(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Ri(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of zi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const qs="Invalid Interval";function ov(n,e){return!n||!n.isValid?vt.invalid("missing or invalid start"):!e||!e.isValid?vt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?vt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Hs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(vt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=tt.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(vt.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:vt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return vt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(vt.fromDateTimes(t,a.time)),t=null);return vt.merge(s)}difference(...e){return vt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:qs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:qs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:qs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:qs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:qs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):tt.invalid(this.invalidReason)}mapEndpoints(e){return vt.fromDateTimes(e(this.s),e(this.e))}}class Hl{static hasDST(e=Lt.defaultZone){const t=qe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ai.isValidZone(e)}static normalizeZone(e){return gi(e,Lt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||gt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||gt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||gt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||gt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return gt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return gt.create(t,null,"gregory").eras(e)}static features(){return{relative:x_()}}}function $u(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(tt.fromMillis(i).as("days"))}function rv(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=$u(r,a);return(u-u%7)/7}],["days",$u]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function av(n,e,t,i){let[s,l,o,r]=rv(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?tt.fromMillis(a,i).shiftTo(...u).plus(f):f}const $a={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Mu={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},uv=$a.hanidec.replace(/[\[|\]]/g,"").split("");function fv(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Fn({numberingSystem:n},e=""){return new RegExp(`${$a[n||"latn"]}${e}`)}const cv="missing Intl.DateTimeFormat.formatToParts support";function it(n,e=t=>t){return{regex:n,deser:([t])=>e(fv(t))}}const dv=String.fromCharCode(160),gg=`[ ${dv}]`,bg=new RegExp(gg,"g");function pv(n){return n.replace(/\./g,"\\.?").replace(bg,gg)}function Ou(n){return n.replace(/\./g,"").replace(bg," ").toLowerCase()}function Rn(n,e){return n===null?null:{regex:RegExp(n.map(pv).join("|")),deser:([t])=>n.findIndex(i=>Ou(t)===Ou(i))+e}}function Du(n,e){return{regex:n,deser:([,t,i])=>jo(t,i),groups:e}}function ir(n){return{regex:n,deser:([e])=>e}}function mv(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hv(n,e){const t=Fn(e),i=Fn(e,"{2}"),s=Fn(e,"{3}"),l=Fn(e,"{4}"),o=Fn(e,"{6}"),r=Fn(e,"{1,2}"),a=Fn(e,"{1,3}"),u=Fn(e,"{1,6}"),f=Fn(e,"{1,9}"),c=Fn(e,"{2,4}"),d=Fn(e,"{4,6}"),m=v=>({regex:RegExp(mv(v.val)),deser:([k])=>k,literal:!0}),_=(v=>{if(n.literal)return m(v);switch(v.val){case"G":return Rn(e.eras("short",!1),0);case"GG":return Rn(e.eras("long",!1),0);case"y":return it(u);case"yy":return it(c,Hr);case"yyyy":return it(l);case"yyyyy":return it(d);case"yyyyyy":return it(o);case"M":return it(r);case"MM":return it(i);case"MMM":return Rn(e.months("short",!0,!1),1);case"MMMM":return Rn(e.months("long",!0,!1),1);case"L":return it(r);case"LL":return it(i);case"LLL":return Rn(e.months("short",!1,!1),1);case"LLLL":return Rn(e.months("long",!1,!1),1);case"d":return it(r);case"dd":return it(i);case"o":return it(a);case"ooo":return it(s);case"HH":return it(i);case"H":return it(r);case"hh":return it(i);case"h":return it(r);case"mm":return it(i);case"m":return it(r);case"q":return it(r);case"qq":return it(i);case"s":return it(r);case"ss":return it(i);case"S":return it(a);case"SSS":return it(s);case"u":return ir(f);case"uu":return ir(r);case"uuu":return it(t);case"a":return Rn(e.meridiems(),0);case"kkkk":return it(l);case"kk":return it(c,Hr);case"W":return it(r);case"WW":return it(i);case"E":case"c":return it(t);case"EEE":return Rn(e.weekdays("short",!1,!1),1);case"EEEE":return Rn(e.weekdays("long",!1,!1),1);case"ccc":return Rn(e.weekdays("short",!0,!1),1);case"cccc":return Rn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Du(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Du(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return ir(/[a-z_+-/]{1,256}?/i);default:return m(v)}})(n)||{invalidReason:cv};return _.token=n,_}const _v={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function gv(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=_v[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function bv(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function vv(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Cs(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function yv(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return Ge(n.z)||(t=ai.create(n.z)),Ge(n.Z)||(t||(t=new nn(n.Z)),i=n.Z),Ge(n.q)||(n.M=(n.q-1)*3+1),Ge(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),Ge(n.u)||(n.S=va(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let sr=null;function kv(){return sr||(sr=qe.fromMillis(1555555555555)),sr}function wv(n,e){if(n.literal)return n;const t=dn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=dn.create(e,t).formatDateTimeParts(kv()).map(o=>gv(o,e,t));return l.includes(void 0)?n:l}function Sv(n,e){return Array.prototype.concat(...n.map(t=>wv(t,e)))}function vg(n,e,t){const i=Sv(dn.parseFormat(t),n),s=i.map(o=>hv(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=bv(s),a=RegExp(o,"i"),[u,f]=vv(e,a,r),[c,d,m]=f?yv(f):[null,null,void 0];if(Cs(f,"a")&&Cs(f,"H"))throw new Zs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:m}}}function Tv(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=vg(n,e,t);return[i,s,l,o]}const yg=[0,31,59,90,120,151,181,212,243,273,304,334],kg=[0,31,60,91,121,152,182,213,244,274,305,335];function En(n,e){return new jn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function wg(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function Sg(n,e,t){return t+(Cl(n)?kg:yg)[e-1]}function Tg(n,e){const t=Cl(n)?kg:yg,i=t.findIndex(l=>l_o(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Vo(n)}}function Eu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=wg(e,1,4),l=xs(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=xs(r)):o>l?(r=e+1,o-=xs(e)):r=e;const{month:a,day:u}=Tg(r,o);return{year:r,month:a,day:u,...Vo(n)}}function lr(n){const{year:e,month:t,day:i}=n,s=Sg(e,t,i);return{year:e,ordinal:s,...Vo(n)}}function Au(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Tg(e,t);return{year:e,month:i,day:s,...Vo(n)}}function Cv(n){const e=qo(n.weekYear),t=ri(n.weekNumber,1,_o(n.weekYear)),i=ri(n.weekday,1,7);return e?t?i?!1:En("weekday",n.weekday):En("week",n.week):En("weekYear",n.weekYear)}function $v(n){const e=qo(n.year),t=ri(n.ordinal,1,xs(n.year));return e?t?!1:En("ordinal",n.ordinal):En("year",n.year)}function Cg(n){const e=qo(n.year),t=ri(n.month,1,12),i=ri(n.day,1,ho(n.year,n.month));return e?t?i?!1:En("day",n.day):En("month",n.month):En("year",n.year)}function $g(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ri(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ri(t,0,59),r=ri(i,0,59),a=ri(s,0,999);return l?o?r?a?!1:En("millisecond",s):En("second",i):En("minute",t):En("hour",e)}const or="Invalid DateTime",Iu=864e13;function zl(n){return new jn("unsupported zone",`the zone "${n.name}" is not supported`)}function rr(n){return n.weekData===null&&(n.weekData=Yr(n.c)),n.weekData}function js(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new qe({...t,...e,old:t})}function Mg(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function Pu(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function fo(n,e,t){return Mg(ka(n),e,t)}function Lu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,ho(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=tt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=ka(l);let[a,u]=Mg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Vs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=qe.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return qe.invalid(new jn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Bl(n,e,t=!0){return n.isValid?dn.create(gt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ar(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Ot(n.c.year,t?6:4),e?(i+="-",i+=Ot(n.c.month),i+="-",i+=Ot(n.c.day)):(i+=Ot(n.c.month),i+=Ot(n.c.day)),i}function Nu(n,e,t,i,s,l){let o=Ot(n.c.hour);return e?(o+=":",o+=Ot(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Ot(n.c.minute),(n.c.second!==0||!t)&&(o+=Ot(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Ot(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Ot(Math.trunc(-n.o/60)),o+=":",o+=Ot(Math.trunc(-n.o%60))):(o+="+",o+=Ot(Math.trunc(n.o/60)),o+=":",o+=Ot(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Og={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Mv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Ov={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Dg=["year","month","day","hour","minute","second","millisecond"],Dv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Ev=["year","ordinal","hour","minute","second","millisecond"];function Fu(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new P_(n);return e}function Ru(n,e){const t=gi(e.zone,Lt.defaultZone),i=gt.fromObject(e),s=Lt.now();let l,o;if(Ge(n.year))l=s;else{for(const u of Dg)Ge(n[u])&&(n[u]=Og[u]);const r=Cg(n)||$g(n);if(r)return qe.invalid(r);const a=t.offset(s);[l,o]=fo(n,a,t)}return new qe({ts:l,zone:t,loc:i,o})}function qu(n,e,t){const i=Ge(t.round)?!0:t.round,s=(o,r)=>(o=ya(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function ju(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class qe{constructor(e){const t=e.zone||Lt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new jn("invalid input"):null)||(t.isValid?null:zl(t));this.ts=Ge(e.ts)?Lt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=Pu(this.ts,r),i=Number.isNaN(s.year)?new jn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||gt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new qe({})}static local(){const[e,t]=ju(arguments),[i,s,l,o,r,a,u]=t;return Ru({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=ju(arguments),[i,s,l,o,r,a,u]=t;return e.zone=nn.utcInstance,Ru({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=q1(e)?e.valueOf():NaN;if(Number.isNaN(i))return qe.invalid("invalid input");const s=gi(t.zone,Lt.defaultZone);return s.isValid?new qe({ts:i,zone:s,loc:gt.fromObject(t)}):qe.invalid(zl(s))}static fromMillis(e,t={}){if(Ji(e))return e<-Iu||e>Iu?qe.invalid("Timestamp out of range"):new qe({ts:e,zone:gi(t.zone,Lt.defaultZone),loc:gt.fromObject(t)});throw new On(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ji(e))return new qe({ts:e*1e3,zone:gi(t.zone,Lt.defaultZone),loc:gt.fromObject(t)});throw new On("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=gi(t.zone,Lt.defaultZone);if(!i.isValid)return qe.invalid(zl(i));const s=Lt.now(),l=Ge(t.specificOffset)?i.offset(s):t.specificOffset,o=go(e,Fu),r=!Ge(o.ordinal),a=!Ge(o.year),u=!Ge(o.month)||!Ge(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=gt.fromObject(t);if((f||r)&&c)throw new Zs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Zs("Can't mix ordinal dates with month/day");const m=c||o.weekday&&!f;let h,_,v=Pu(s,l);m?(h=Dv,_=Mv,v=Yr(v)):r?(h=Ev,_=Ov,v=lr(v)):(h=Dg,_=Og);let k=!1;for(const A of h){const I=o[A];Ge(I)?k?o[A]=_[A]:o[A]=v[A]:k=!0}const y=m?Cv(o):r?$v(o):Cg(o),T=y||$g(o);if(T)return qe.invalid(T);const C=m?Eu(o):r?Au(o):o,[M,$]=fo(C,l,i),D=new qe({ts:M,zone:i,o:$,loc:d});return o.weekday&&f&&e.weekday!==D.weekday?qe.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${D.toISO()}`):D}static fromISO(e,t={}){const[i,s]=U0(e);return Vs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=W0(e);return Vs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=Y0(e);return Vs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(Ge(e)||Ge(t))throw new On("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=gt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=Tv(o,e,t);return f?qe.invalid(f):Vs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return qe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=x0(e);return Vs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new On("need to specify a reason the DateTime is invalid");const i=e instanceof jn?e:new jn(e,t);if(Lt.throwOnInvalid)throw new I1(i);return new qe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?rr(this).weekYear:NaN}get weekNumber(){return this.isValid?rr(this).weekNumber:NaN}get weekday(){return this.isValid?rr(this).weekday:NaN}get ordinal(){return this.isValid?lr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Hl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Hl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Hl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Hl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Cl(this.year)}get daysInMonth(){return ho(this.year,this.month)}get daysInYear(){return this.isValid?xs(this.year):NaN}get weeksInWeekYear(){return this.isValid?_o(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=dn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(nn.instance(e),t)}toLocal(){return this.setZone(Lt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=gi(e,Lt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=fo(o,l,e)}return js(this,{ts:s,zone:e})}else return qe.invalid(zl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return js(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=go(e,Fu),i=!Ge(t.weekYear)||!Ge(t.weekNumber)||!Ge(t.weekday),s=!Ge(t.ordinal),l=!Ge(t.year),o=!Ge(t.month)||!Ge(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Zs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Zs("Can't mix ordinal dates with month/day");let u;i?u=Eu({...Yr(this.c),...t}):Ge(t.ordinal)?(u={...this.toObject(),...t},Ge(t.day)&&(u.day=Math.min(ho(u.year,u.month),u.day))):u=Au({...lr(this.c),...t});const[f,c]=fo(u,this.o,this.zone);return js(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e);return js(this,Lu(this,t))}minus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e).negate();return js(this,Lu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=tt.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?dn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):or}toLocaleString(e=Vr,t={}){return this.isValid?dn.create(this.loc.clone(t),e).formatDateTime(this):or}toLocaleParts(e={}){return this.isValid?dn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=ar(this,o);return r+="T",r+=Nu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?ar(this,e==="extended"):null}toISOWeekDate(){return Bl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+Nu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Bl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Bl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ar(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Bl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():or}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return tt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=j1(t).map(tt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=av(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(qe.now(),e,t)}until(e){return this.isValid?vt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||qe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(qe.isDateTime))throw new On("max requires all arguments be DateTimes");return _u(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=gt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return vg(o,e,t)}static fromStringExplain(e,t,i={}){return qe.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Vr}static get DATE_MED(){return L_}static get DATE_MED_WITH_WEEKDAY(){return N1}static get DATE_FULL(){return N_}static get DATE_HUGE(){return F_}static get TIME_SIMPLE(){return R_}static get TIME_WITH_SECONDS(){return q_}static get TIME_WITH_SHORT_OFFSET(){return j_}static get TIME_WITH_LONG_OFFSET(){return V_}static get TIME_24_SIMPLE(){return H_}static get TIME_24_WITH_SECONDS(){return z_}static get TIME_24_WITH_SHORT_OFFSET(){return B_}static get TIME_24_WITH_LONG_OFFSET(){return U_}static get DATETIME_SHORT(){return W_}static get DATETIME_SHORT_WITH_SECONDS(){return Y_}static get DATETIME_MED(){return K_}static get DATETIME_MED_WITH_SECONDS(){return J_}static get DATETIME_MED_WITH_WEEKDAY(){return F1}static get DATETIME_FULL(){return Z_}static get DATETIME_FULL_WITH_SECONDS(){return G_}static get DATETIME_HUGE(){return X_}static get DATETIME_HUGE_WITH_SECONDS(){return Q_}}function Hs(n){if(qe.isDateTime(n))return n;if(n&&n.valueOf&&Ji(n.valueOf()))return qe.fromJSDate(n);if(n&&typeof n=="object")return qe.fromObject(n);throw new On(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Av=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Iv=[".mp4",".avi",".mov",".3gp",".wmv"],Pv=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Lv=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class H{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||H.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||e.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return H.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!H.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!H.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){H.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=H.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!H.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!H.isObject(l)&&!Array.isArray(l)||!H.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!H.isObject(s)&&!Array.isArray(s)||!H.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):H.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||H.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||H.isObject(e)&&Object.keys(e).length>0)&&H.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ssZ",24:"yyyy-MM-dd HH:mm:ss.SSSZ"},i=t[e.length]||t[19];return qe.fromFormat(e,i,{zone:"UTC"})}return qe.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return H.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return H.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2)),s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download",t+".json"),s.click(),s.remove()}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return!!Av.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!Iv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!Pv.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!Lv.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return H.hasImageExtension(e)?"image":H.hasDocumentExtension(e)?"document":H.hasVideoExtension(e)?"video":H.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(H.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)H.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):H.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var o,r,a,u,f,c,d;const t=(e==null?void 0:e.schema)||[],i={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};e!=null&&e.isAuth&&(i.username="username123",i.verified=!1,i.emailVisibility=!0,i.email="test@example.com"),(!(e!=null&&e.isView)||H.extractColumnsFromQuery((o=e==null?void 0:e.options)==null?void 0:o.query).includes("created"))&&(i.created="2022-01-01 01:00:00.123Z"),(!(e!=null&&e.isView)||H.extractColumnsFromQuery((r=e==null?void 0:e.options)==null?void 0:r.query).includes("updated"))&&(i.updated="2022-01-01 23:59:59.456Z");for(const m of t){let h=null;m.type==="number"?h=123:m.type==="date"?h="2022-01-01 10:00:00.123Z":m.type==="bool"?h=!0:m.type==="email"?h="test@example.com":m.type==="url"?h="https://example.com":m.type==="json"?h="JSON":m.type==="file"?(h="filename.jpg",((a=m.options)==null?void 0:a.maxSelect)!==1&&(h=[h])):m.type==="select"?(h=(f=(u=m.options)==null?void 0:u.values)==null?void 0:f[0],((c=m.options)==null?void 0:c.maxSelect)!==1&&(h=[h])):m.type==="relation"?(h="RELATION_RECORD_ID",((d=m.options)==null?void 0:d.maxSelect)!==1&&(h=[h])):h="test",i[m.name]=h}return i}static dummyCollectionSchemaData(e){var s,l,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!H.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!H.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=H.isObject(u)&&H.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const l of e)l.type==="auth"?t.push(l):l.type==="base"?i.push(l):s.push(l);return[].concat(t,i,s)}static yieldToMain(){return new Promise(e=>{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample"],toolbar:"undo redo | styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image table codesample | code fullscreen",file_picker_types:"image",file_picker_callback:(e,t,i)=>{const s=document.createElement("input");s.setAttribute("type","file"),s.setAttribute("accept","image/*"),s.addEventListener("change",l=>{const o=l.target.files[0],r=new FileReader;r.addEventListener("load",()=>{if(!tinymce)return;const a="blobid"+new Date().getTime(),u=tinymce.activeEditor.editorUpload.blobCache,f=r.result.split(",")[1],c=u.create(a,o,f);u.add(c),e(c.blobUri(),{title:o.name})}),r.readAsDataURL(o)}),s.click()}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(H.isEmpty(r)?s.push(i):typeof r=="boolean"?s.push(r?"True":"False"):typeof r=="string"?(r=r.indexOf("<")>=0?H.plainText(r):r,s.push(H.truncate(r))):s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","email","username","heading","label","key","id"];for(const o of l)if(!H.isEmpty(e[o]))return e[o];return i}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return;let i=[t+"id"];if(e.isView)for(let l of H.extractColumnsFromQuery(e.options.query))H.pushUnique(i,t+l);else e.isAuth?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const s=e.schema||[];for(const l of s)H.pushUnique(i,t+l.name);return i}}const Ho=Ln([]);function Eg(n,e=4e3){return zo(n,"info",e)}function zt(n,e=3e3){return zo(n,"success",e)}function cl(n,e=4500){return zo(n,"error",e)}function Nv(n,e=4500){return zo(n,"warning",e)}function zo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Ag(i)},t)};Ho.update(s=>(Oa(s,i.message),H.pushOrReplaceByKey(s,i,"message"),s))}function Ag(n){Ho.update(e=>(Oa(e,n),e))}function Ma(){Ho.update(n=>{for(let e of n)Oa(n,e);return[]})}function Oa(n,e){let t;typeof e=="string"?t=H.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),H.removeByKey(n,"message",t.message))}const fi=Ln({});function Bn(n){fi.set(n||{})}function Qi(n){fi.update(e=>(H.deleteByPath(e,n),e))}const Da=Ln({});function Kr(n){Da.set(n||{})}ba.prototype.logout=function(n=!0){this.authStore.clear(),n&&Oi("/login")};ba.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&cl(l)}if(H.isEmpty(s.data)||Bn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Oi("/")};class Fv extends A_{save(e,t){super.save(e,t),t instanceof Xi&&Kr(t)}clear(){super.clear(),Kr(null)}}const pe=new ba("../",new Fv("pb_admin_auth"));pe.authStore.model instanceof Xi&&Kr(pe.authStore.model);function Rv(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=n[3].default,h=Nt(m,n,n[2],null);return{c(){e=b("div"),t=b("main"),h&&h.c(),i=O(),s=b("footer"),l=b("a"),l.innerHTML='Docs',o=O(),r=b("span"),r.textContent="|",a=O(),u=b("a"),f=b("span"),f.textContent="PocketBase v0.13.3",p(t,"class","page-content"),p(l,"href","https://pocketbase.io/docs/"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(r,"class","delimiter"),p(f,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(s,"class","page-footer"),p(e,"class",c="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(_,v){S(_,e,v),g(e,t),h&&h.m(t,null),g(e,i),g(e,s),g(s,l),g(s,o),g(s,r),g(s,a),g(s,u),g(u,f),d=!0},p(_,[v]){h&&h.p&&(!d||v&4)&&Rt(h,m,_,_[2],d?Ft(m,_[2],v,null):qt(_[2]),null),(!d||v&2&&c!==(c="page-wrapper "+_[1]))&&p(e,"class",c),(!d||v&3)&&x(e,"center-content",_[0])},i(_){d||(E(h,_),d=!0)},o(_){P(h,_),d=!1},d(_){_&&w(e),h&&h.d(_)}}}function qv(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class wn extends ye{constructor(e){super(),ve(this,e,qv,Rv,he,{center:0,class:1})}}function Vu(n){let e,t,i;return{c(){e=b("div"),e.innerHTML=`
+ Delete`,p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[23]),Y(i,"click",kn(dt(n[24])))],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function Hd(n){let e,t,i,s;return i=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[G$]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=O(),V(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function zd(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[26](n[47])}return{c(){e=b("button"),t=b("i"),s=O(),l=b("span"),r=B(o),a=B(" collection"),u=O(),p(t,"class",i=Si(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),x(e,"selected",n[47]==n[2].type)},m(m,h){S(m,e,h),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),g(e,u),f||(c=Y(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Si(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[48]+"")&&le(r,o),h[0]&68&&x(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,c()}}}function G$(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s{F=null}),ae()),(!A||K[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&p(d,"class",C),(!A||K[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?N||(N=Bd(),N.c(),N.m(D.parentNode,D)):N&&(N.d(1),N=null)},i(R){A||(E(F),A=!0)},o(R){P(F),A=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(c),F&&F.d(),R&&w($),N&&N.d(R),R&&w(D),I=!1,L()}}}function Ud(n){let e,t,i,s,l,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ie(t=Ue.call(null,e,n[11])),l=!0)},p(r,a){t&&Bt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&xe(()=>{i||(i=je(e,It,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=je(e,It,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function Wd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Yd(n){var a,u,f;let e,t,i,s=!H.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),l,o,r=s&&Kd();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=O(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Es)},m(c,d){S(c,e,d),g(e,t),g(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[30]),l=!0)},p(c,d){var m,h,_;d[0]&32&&(s=!H.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),s?r?d[0]&32&&E(r,1):(r=Kd(),r.c(),E(r,1),r.m(e,null)):r&&(re(),P(r,1,1,()=>{r=null}),ae()),d[0]&8&&x(e,"active",c[3]===Es)},d(c){c&&w(e),r&&r.d(),l=!1,o()}}}function Kd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Q$(n){var Q,U,X,ne,J,ue,Z,de;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,m,h=(Q=n[2])!=null&&Q.isView?"Query":"Fields",_,v,k=!H.isEmpty(n[11]),y,T,C,M,$=!H.isEmpty((U=n[5])==null?void 0:U.listRule)||!H.isEmpty((X=n[5])==null?void 0:X.viewRule)||!H.isEmpty((ne=n[5])==null?void 0:ne.createRule)||!H.isEmpty((J=n[5])==null?void 0:J.updateRule)||!H.isEmpty((ue=n[5])==null?void 0:ue.deleteRule)||!H.isEmpty((de=(Z=n[5])==null?void 0:Z.options)==null?void 0:de.manageRule),D,A,I,L,F=!n[2].isNew&&!n[2].system&&Vd(n);r=new me({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[X$,({uniqueId:ge})=>({46:ge}),({uniqueId:ge})=>[0,ge?32768:0]]},$$scope:{ctx:n}}});let N=k&&Ud(n),R=$&&Wd(),K=n[2].isAuth&&Yd(n);return{c(){e=b("h4"),i=B(t),s=O(),F&&F.c(),l=O(),o=b("form"),V(r.$$.fragment),a=O(),u=b("input"),f=O(),c=b("div"),d=b("button"),m=b("span"),_=B(h),v=O(),N&&N.c(),y=O(),T=b("button"),C=b("span"),C.textContent="API Rules",M=O(),R&&R.c(),D=O(),K&&K.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===yi),p(C,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===bl),p(c,"class","tabs-header stretched")},m(ge,Ce){S(ge,e,Ce),g(e,i),S(ge,s,Ce),F&&F.m(ge,Ce),S(ge,l,Ce),S(ge,o,Ce),q(r,o,null),g(o,a),g(o,u),S(ge,f,Ce),S(ge,c,Ce),g(c,d),g(d,m),g(m,_),g(d,v),N&&N.m(d,null),g(c,y),g(c,T),g(T,C),g(T,M),R&&R.m(T,null),g(c,D),K&&K.m(c,null),A=!0,I||(L=[Y(o,"submit",dt(n[27])),Y(d,"click",n[28]),Y(T,"click",n[29])],I=!0)},p(ge,Ce){var Re,be,Se,We,lt,ce,He,te;(!A||Ce[0]&4)&&t!==(t=ge[2].isNew?"New collection":"Edit collection")&&le(i,t),!ge[2].isNew&&!ge[2].system?F?(F.p(ge,Ce),Ce[0]&4&&E(F,1)):(F=Vd(ge),F.c(),E(F,1),F.m(l.parentNode,l)):F&&(re(),P(F,1,1,()=>{F=null}),ae());const Ne={};Ce[0]&8192&&(Ne.class="form-field collection-field-name required m-b-0 "+(ge[13]?"disabled":"")),Ce[0]&8260|Ce[1]&1081344&&(Ne.$$scope={dirty:Ce,ctx:ge}),r.$set(Ne),(!A||Ce[0]&4)&&h!==(h=(Re=ge[2])!=null&&Re.isView?"Query":"Fields")&&le(_,h),Ce[0]&2048&&(k=!H.isEmpty(ge[11])),k?N?(N.p(ge,Ce),Ce[0]&2048&&E(N,1)):(N=Ud(ge),N.c(),E(N,1),N.m(d,null)):N&&(re(),P(N,1,1,()=>{N=null}),ae()),(!A||Ce[0]&8)&&x(d,"active",ge[3]===yi),Ce[0]&32&&($=!H.isEmpty((be=ge[5])==null?void 0:be.listRule)||!H.isEmpty((Se=ge[5])==null?void 0:Se.viewRule)||!H.isEmpty((We=ge[5])==null?void 0:We.createRule)||!H.isEmpty((lt=ge[5])==null?void 0:lt.updateRule)||!H.isEmpty((ce=ge[5])==null?void 0:ce.deleteRule)||!H.isEmpty((te=(He=ge[5])==null?void 0:He.options)==null?void 0:te.manageRule)),$?R?Ce[0]&32&&E(R,1):(R=Wd(),R.c(),E(R,1),R.m(T,null)):R&&(re(),P(R,1,1,()=>{R=null}),ae()),(!A||Ce[0]&8)&&x(T,"active",ge[3]===bl),ge[2].isAuth?K?K.p(ge,Ce):(K=Yd(ge),K.c(),K.m(c,null)):K&&(K.d(1),K=null)},i(ge){A||(E(F),E(r.$$.fragment,ge),E(N),E(R),A=!0)},o(ge){P(F),P(r.$$.fragment,ge),P(N),P(R),A=!1},d(ge){ge&&w(e),ge&&w(s),F&&F.d(ge),ge&&w(l),ge&&w(o),j(r),ge&&w(f),ge&&w(c),N&&N.d(),R&&R.d(),K&&K.d(),I=!1,Pe(L)}}}function x$(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),r=B(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],x(s,"btn-loading",n[9])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(l,r),u||(f=[Y(e,"click",n[21]),Y(s,"click",n[22])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(s.disabled=a),d[0]&512&&x(s,"btn-loading",c[9])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function e4(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",beforeHide:n[35],$$slots:{footer:[x$],header:[Q$],default:[J$]},$$scope:{ctx:n}};e=new Nn({props:l}),n[36](e),e.$on("hide",n[37]),e.$on("show",n[38]);let o={};return i=new W$({props:o}),n[39](i),i.$on("confirm",n[40]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,a){const u={};a[0]&1040&&(u.beforeHide=r[35]),a[0]&14956|a[1]&1048576&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(E(e.$$.fragment,r),E(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[36](null),j(e,r),r&&w(t),n[39](null),j(i,r)}}}const yi="schema",bl="api_rules",Es="options",t4="base",Jd="auth",Zd="view";function Dr(n){return JSON.stringify(n)}function n4(n,e,t){let i,s,l,o;Ye(n,fi,te=>t(5,o=te));const r={};r[t4]="Base",r[Zd]="View",r[Jd]="Auth";const a=$t();let u,f,c=null,d=new pn,m=!1,h=!1,_=yi,v=Dr(d),k="";function y(te){t(3,_=te)}function T(te){return M(te),t(10,h=!0),y(yi),u==null?void 0:u.show()}function C(){return u==null?void 0:u.hide()}async function M(te){Bn({}),typeof te<"u"?(c=te,t(2,d=te==null?void 0:te.clone())):(c=null,t(2,d=new pn)),t(2,d.schema=d.schema||[],d),t(2,d.originalName=d.name||"",d),await sn(),t(20,v=Dr(d))}function $(){if(d.isNew)return D();f==null||f.show(d)}function D(){if(m)return;t(9,m=!0);const te=A();let Fe;d.isNew?Fe=pe.collections.create(te):Fe=pe.collections.update(d.id,te),Fe.then(ot=>{Ma(),P1(ot.id),t(10,h=!1),C(),zt(d.isNew?"Successfully created collection.":"Successfully updated collection."),a("save",{isNew:d.isNew,collection:ot})}).catch(ot=>{pe.errorResponseHandler(ot)}).finally(()=>{t(9,m=!1)})}function A(){const te=d.export();te.schema=te.schema.slice(0);for(let Fe=te.schema.length-1;Fe>=0;Fe--)te.schema[Fe].toDelete&&te.schema.splice(Fe,1);return te}function I(){c!=null&&c.id&&cn(`Do you really want to delete collection "${c==null?void 0:c.name}" and all its records?`,()=>pe.collections.delete(c==null?void 0:c.id).then(()=>{C(),zt(`Successfully deleted collection "${c==null?void 0:c.name}".`),a("delete",c),R3(c)}).catch(te=>{pe.errorResponseHandler(te)}))}function L(te){t(2,d.type=te,d),Qi("schema")}function F(){s?cn("You have unsaved changes. Do you really want to discard them?",()=>{N()}):N()}async function N(){const te=c==null?void 0:c.clone();if(te&&(te.id="",te.created="",te.updated="",te.name+="_duplicate",!H.isEmpty(te.schema)))for(const Fe of te.schema)Fe.id="";T(te),await sn(),t(20,v="")}const R=()=>C(),K=()=>$(),Q=()=>F(),U=()=>I(),X=te=>{t(2,d.name=H.slugify(te.target.value),d),te.target.value=d.name},ne=te=>L(te),J=()=>{l&&$()},ue=()=>y(yi),Z=()=>y(bl),de=()=>y(Es);function ge(te){d=te,t(2,d)}function Ce(te){d=te,t(2,d)}function Ne(te){d=te,t(2,d)}function Re(te){d=te,t(2,d)}const be=()=>s&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,h=!1),C()}),!1):!0;function Se(te){se[te?"unshift":"push"](()=>{u=te,t(7,u)})}function We(te){ze.call(this,n,te)}function lt(te){ze.call(this,n,te)}function ce(te){se[te?"unshift":"push"](()=>{f=te,t(8,f)})}const He=()=>D();return n.$$.update=()=>{var te;n.$$.dirty[0]&32&&(o.schema||(te=o.options)!=null&&te.query?t(11,k=H.getNestedVal(o,"schema.message")||"Has errors"):t(11,k="")),n.$$.dirty[0]&4&&d.type===Zd&&(t(2,d.createRule=null,d),t(2,d.updateRule=null,d),t(2,d.deleteRule=null,d)),n.$$.dirty[0]&4&&t(13,i=!d.isNew&&d.system),n.$$.dirty[0]&1048580&&t(4,s=v!=Dr(d)),n.$$.dirty[0]&20&&t(12,l=d.isNew||s),n.$$.dirty[0]&12&&_===Es&&d.type!==Jd&&y(yi)},[y,C,d,_,s,o,r,u,f,m,h,k,l,i,$,D,I,L,F,T,v,R,K,Q,U,X,ne,J,ue,Z,de,ge,Ce,Ne,Re,be,Se,We,lt,ce,He]}class iu extends ye{constructor(e){super(),ve(this,e,n4,e4,he,{changeTab:0,show:19,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function Gd(n,e,t){const i=n.slice();return i[15]=e[t],i}function Xd(n){let e,t=n[1].length&&Qd();return{c(){t&&t.c(),e=$e()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1].length?t||(t=Qd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Qd(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function xd(n,e){let t,i,s,l,o,r=e[15].name+"",a,u,f,c,d;return{key:n,first:null,c(){var m;t=b("a"),i=b("i"),l=O(),o=b("span"),a=B(r),u=O(),p(i,"class",s=H.getCollectionTypeIcon(e[15].type)),p(o,"class","txt"),p(t,"href",f="/collections?collectionId="+e[15].id),p(t,"class","sidebar-list-item"),x(t,"active",((m=e[5])==null?void 0:m.id)===e[15].id),this.first=t},m(m,h){S(m,t,h),g(t,i),g(t,l),g(t,o),g(o,a),g(t,u),c||(d=Ie(xt.call(null,t)),c=!0)},p(m,h){var _;e=m,h&8&&s!==(s=H.getCollectionTypeIcon(e[15].type))&&p(i,"class",s),h&8&&r!==(r=e[15].name+"")&&le(a,r),h&8&&f!==(f="/collections?collectionId="+e[15].id)&&p(t,"href",f),h&40&&x(t,"active",((_=e[5])==null?void 0:_.id)===e[15].id)},d(m){m&&w(t),c=!1,d()}}}function ep(n){let e,t,i,s;return{c(){e=b("footer"),t=b("button"),t.innerHTML=` + New collection`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){S(l,e,o),g(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:G,d(l){l&&w(e),i=!1,s()}}}function i4(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,h,_,v,k,y,T,C=n[3];const M=I=>I[15].id;for(let I=0;I',o=O(),r=b("input"),a=O(),u=b("hr"),f=O(),c=b("div");for(let I=0;I20),p(e,"class","page-sidebar collection-sidebar")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(i,s),g(s,l),g(i,o),g(i,r),fe(r,n[0]),g(e,a),g(e,u),g(e,f),g(e,c);for(let F=0;F20),I[7]?D&&(D.d(1),D=null):D?D.p(I,L):(D=ep(I),D.c(),D.m(e,null));const F={};v.$set(F)},i(I){k||(E(v.$$.fragment,I),k=!0)},o(I){P(v.$$.fragment,I),k=!1},d(I){I&&w(e);for(let L=0;L{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function l4(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,y=>t(5,o=y)),Ye(n,Ai,y=>t(9,r=y)),Ye(n,Po,y=>t(6,a=y)),Ye(n,$s,y=>t(7,u=y));let f,c="";function d(y){Kt(Mi,o=y,o)}const m=()=>t(0,c="");function h(){c=this.value,t(0,c)}const _=()=>f==null?void 0:f.show();function v(y){se[y?"unshift":"push"](()=>{f=y,t(2,f)})}const k=y=>{var T;(T=y.detail)!=null&&T.isNew&&y.detail.collection&&d(y.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&s4(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(y=>y.id==c||y.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,m,h,_,v,k]}class o4 extends ye{constructor(e){super(),ve(this,e,l4,i4,he,{})}}function tp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function np(n){n[18]=n[19].default}function ip(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function sp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function lp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&sp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=$e(),c&&c.c(),s=O(),l=b("button"),r=B(o),a=O(),p(l,"type","button"),p(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(m,h){S(m,t,h),c&&c.m(m,h),S(m,s,h),S(m,l,h),g(l,r),g(l,a),u||(f=Y(l,"click",d),u=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=sp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&x(l,"active",e[5]===e[14])},d(m){m&&w(t),c&&c.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function op(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:u4,then:a4,catch:r4,value:19,blocks:[,,,]};return ru(t=n[15].component,s),{c(){e=$e(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&ru(t,s)||ub(s,n,o)},i(l){i||(E(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];P(r)}i=!1},d(l){l&&w(e),s.block.d(l),s.token=null,s=null}}}function r4(n){return{c:G,m:G,p:G,i:G,o:G,d:G}}function a4(n){np(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){V(e.$$.fragment),t=O()},m(s,l){q(e,s,l),S(s,t,l),i=!0},p(s,l){np(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(E(e.$$.fragment,s),i=!0)},o(s){P(e.$$.fragment,s),i=!1},d(s){j(e,s),s&&w(t)}}}function u4(n){return{c:G,m:G,p:G,i:G,o:G,d:G}}function rp(n,e){let t,i,s,l=e[5]===e[14]&&op(e);return{key:n,first:null,c(){t=$e(),l&&l.c(),i=$e(),this.first=t},m(o,r){S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&E(l,1)):(l=op(e),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(E(l),s=!0)},o(o){P(l),s=!1},d(o){o&&w(t),l&&l.d(o),o&&w(i)}}}function f4(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=Object.entries(n[3]);const d=_=>_[14];for(let _=0;__[14];for(let _=0;_Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function d4(n){let e,t,i={class:"docs-panel",$$slots:{footer:[c4],default:[f4]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function p4(n,e,t){const i={list:{label:"List/Search",component:rt(()=>import("./ListApiDocs-af7ae428.js"),["./ListApiDocs-af7ae428.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:rt(()=>import("./ViewApiDocs-2e37ac86.js"),["./ViewApiDocs-2e37ac86.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},create:{label:"Create",component:rt(()=>import("./CreateApiDocs-0395f23e.js"),["./CreateApiDocs-0395f23e.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},update:{label:"Update",component:rt(()=>import("./UpdateApiDocs-b844f565.js"),["./UpdateApiDocs-b844f565.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},delete:{label:"Delete",component:rt(()=>import("./DeleteApiDocs-bf7bc019.js"),["./DeleteApiDocs-bf7bc019.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:rt(()=>import("./RealtimeApiDocs-1d12f17f.js"),["./RealtimeApiDocs-1d12f17f.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:rt(()=>import("./AuthWithPasswordDocs-1ef47ee7.js"),["./AuthWithPasswordDocs-1ef47ee7.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:rt(()=>import("./AuthWithOAuth2Docs-80206fc8.js"),["./AuthWithOAuth2Docs-80206fc8.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},refresh:{label:"Auth refresh",component:rt(()=>import("./AuthRefreshDocs-532845f5.js"),["./AuthRefreshDocs-532845f5.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-verification":{label:"Request verification",component:rt(()=>import("./RequestVerificationDocs-54380679.js"),["./RequestVerificationDocs-54380679.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:rt(()=>import("./ConfirmVerificationDocs-07e93c01.js"),["./ConfirmVerificationDocs-07e93c01.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:rt(()=>import("./RequestPasswordResetDocs-a201cc14.js"),["./RequestPasswordResetDocs-a201cc14.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:rt(()=>import("./ConfirmPasswordResetDocs-6a316d79.js"),["./ConfirmPasswordResetDocs-6a316d79.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:rt(()=>import("./RequestEmailChangeDocs-e906139a.js"),["./RequestEmailChangeDocs-e906139a.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:rt(()=>import("./ConfirmEmailChangeDocs-4c95097d.js"),["./ConfirmEmailChangeDocs-4c95097d.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:rt(()=>import("./AuthMethodsDocs-595e4af6.js"),["./AuthMethodsDocs-595e4af6.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:rt(()=>import("./ListExternalAuthsDocs-c14f16c9.js"),["./ListExternalAuthsDocs-c14f16c9.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:rt(()=>import("./UnlinkExternalAuthDocs-e72d2f56.js"),["./UnlinkExternalAuthDocs-e72d2f56.js","./SdkTabs-fc1a80c5.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o=new pn,r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function h(k){se[k?"unshift":"push"](()=>{l=k,t(4,l)})}function _(k){ze.call(this,n,k)}function v(k){ze.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.isAuth?(t(3,a=Object.assign({},i,s)),!(o!=null&&o.options.allowUsernameAuth)&&!(o!=null&&o.options.allowEmailAuth)&&delete a["auth-with-password"],o!=null&&o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.isView?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[f,c,o,a,l,r,i,u,d,m,h,_,v]}class m4 extends ye{constructor(e){super(),ve(this,e,p4,d4,he,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function h4(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Username",o=O(),r=b("input"),p(t,"class",H.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","text"),p(r,"requried",a=!n[0].isNew),p(r,"placeholder",u=n[0].isNew?"Leave empty to auto generate...":n[3]),p(r,"id",f=n[12])},m(m,h){S(m,e,h),g(e,t),g(e,i),g(e,s),S(m,o,h),S(m,r,h),fe(r,n[0].username),c||(d=Y(r,"input",n[4]),c=!0)},p(m,h){h&4096&&l!==(l=m[12])&&p(e,"for",l),h&1&&a!==(a=!m[0].isNew)&&p(r,"requried",a),h&1&&u!==(u=m[0].isNew?"Leave empty to auto generate...":m[3])&&p(r,"placeholder",u),h&4096&&f!==(f=m[12])&&p(r,"id",f),h&1&&r.value!==m[0].username&&fe(r,m[0].username)},d(m){m&&w(e),m&&w(o),m&&w(r),c=!1,d()}}}function _4(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,m,h,_,v,k,y,T,C;return{c(){var M;e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Email",o=O(),r=b("div"),a=b("button"),u=b("span"),f=B("Public: "),d=B(c),h=O(),_=b("input"),p(t,"class",H.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[12]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=v=n[0].isNew,p(_,"autocomplete","off"),p(_,"id",k=n[12]),_.required=y=(M=n[1].options)==null?void 0:M.requireEmail,p(_,"class","svelte-1751a4d")},m(M,$){S(M,e,$),g(e,t),g(e,i),g(e,s),S(M,o,$),S(M,r,$),g(r,a),g(a,u),g(u,f),g(u,d),S(M,h,$),S(M,_,$),fe(_,n[0].email),n[0].isNew&&_.focus(),T||(C=[Ie(Ue.call(null,a,{text:"Make email public or private",position:"top-right"})),Y(a,"click",n[5]),Y(_,"input",n[6])],T=!0)},p(M,$){var D;$&4096&&l!==(l=M[12])&&p(e,"for",l),$&1&&c!==(c=M[0].emailVisibility?"On":"Off")&&le(d,c),$&1&&m!==(m="btn btn-sm btn-transparent "+(M[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),$&1&&v!==(v=M[0].isNew)&&(_.autofocus=v),$&4096&&k!==(k=M[12])&&p(_,"id",k),$&2&&y!==(y=(D=M[1].options)==null?void 0:D.requireEmail)&&(_.required=y),$&1&&_.value!==M[0].email&&fe(_,M[0].email)},d(M){M&&w(e),M&&w(o),M&&w(r),M&&w(h),M&&w(_),T=!1,Pe(C)}}}function ap(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[g4,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12292&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function g4(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[2],S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[7]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function up(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[b4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[v4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){S(f,e,c),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&12289&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c&12289&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&4)&&x(t,"p-t-xs",f[2])},i(f){u||(E(s.$$.fragment,f),E(r.$$.fragment,f),f&&xe(()=>{a||(a=je(e,At,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=je(e,At,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function b4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[12]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),fe(r,n[0].password),u||(f=Y(r,"input",n[8]),u=!0)},p(c,d){d&4096&&l!==(l=c[12])&&p(e,"for",l),d&4096&&a!==(a=c[12])&&p(r,"id",a),d&1&&r.value!==c[0].password&&fe(r,c[0].password)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function v4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="Password confirm",o=O(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[12]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),fe(r,n[0].passwordConfirm),u||(f=Y(r,"input",n[9]),u=!0)},p(c,d){d&4096&&l!==(l=c[12])&&p(e,"for",l),d&4096&&a!==(a=c[12])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&fe(r,c[0].passwordConfirm)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function y4(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].verified,S(u,i,f),S(u,s,f),g(s,l),r||(a=[Y(e,"change",n[10]),Y(e,"change",dt(n[11]))],r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Pe(a)}}}function k4(n){var v;let e,t,i,s,l,o,r,a,u,f,c,d,m;i=new me({props:{class:"form-field "+(n[0].isNew?"":"required"),name:"username",$$slots:{default:[h4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+((v=n[1].options)!=null&&v.requireEmail?"required":""),name:"email",$$slots:{default:[_4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}});let h=!n[0].isNew&&ap(n),_=(n[0].isNew||n[2])&&up(n);return d=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[y4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),h&&h.c(),u=O(),_&&_.c(),f=O(),c=b("div"),V(d.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(k,y){S(k,e,y),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),h&&h.m(a,null),g(a,u),_&&_.m(a,null),g(e,f),g(e,c),q(d,c,null),m=!0},p(k,[y]){var $;const T={};y&1&&(T.class="form-field "+(k[0].isNew?"":"required")),y&12289&&(T.$$scope={dirty:y,ctx:k}),i.$set(T);const C={};y&2&&(C.class="form-field "+(($=k[1].options)!=null&&$.requireEmail?"required":"")),y&12291&&(C.$$scope={dirty:y,ctx:k}),o.$set(C),k[0].isNew?h&&(re(),P(h,1,1,()=>{h=null}),ae()):h?(h.p(k,y),y&1&&E(h,1)):(h=ap(k),h.c(),E(h,1),h.m(a,u)),k[0].isNew||k[2]?_?(_.p(k,y),y&5&&E(_,1)):(_=up(k),_.c(),E(_,1),_.m(a,null)):_&&(re(),P(_,1,1,()=>{_=null}),ae());const M={};y&12289&&(M.$$scope={dirty:y,ctx:k}),d.$set(M)},i(k){m||(E(i.$$.fragment,k),E(o.$$.fragment,k),E(h),E(_),E(d.$$.fragment,k),m=!0)},o(k){P(i.$$.fragment,k),P(o.$$.fragment,k),P(h),P(_),P(d.$$.fragment,k),m=!1},d(k){k&&w(e),j(i),j(o),h&&h.d(),_&&_.d(),j(d)}}}function w4(n,e,t){let{collection:i=new pn}=e,{record:s=new Ti}=e,l=s.username||null,o=!1;function r(){s.username=this.value,t(0,s),t(2,o)}const a=()=>t(0,s.emailVisibility=!s.emailVisibility,s);function u(){s.email=this.value,t(0,s),t(2,o)}function f(){o=this.checked,t(2,o)}function c(){s.password=this.value,t(0,s),t(2,o)}function d(){s.passwordConfirm=this.value,t(0,s),t(2,o)}function m(){s.verified=this.checked,t(0,s),t(2,o)}const h=_=>{s.isNew||cn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,s.verified=!_.target.checked,s)})};return n.$$set=_=>{"collection"in _&&t(1,i=_.collection),"record"in _&&t(0,s=_.record)},n.$$.update=()=>{n.$$.dirty&1&&!s.username&&s.username!==null&&t(0,s.username=null,s),n.$$.dirty&4&&(o||(t(0,s.password=null,s),t(0,s.passwordConfirm=null,s),Qi("password"),Qi("passwordConfirm")))},[s,i,o,l,r,a,u,f,c,d,m,h]}class S4 extends ye{constructor(e){super(),ve(this,e,w4,k4,he,{collection:1,record:0})}}function T4(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight+2,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Zt(()=>(u(),()=>clearTimeout(a)));function c(m){se[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Je(Je({},e),Qn(m)),t(3,s=Et(e,i)),"value"in m&&t(0,l=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class $4 extends ye{constructor(e){super(),ve(this,e,C4,T4,he,{value:0,maxHeight:4})}}function M4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),f=new $4({props:h}),se.push(()=>_e(f,"value",m)),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),V(f.$$.fragment),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),q(f,_,v),d=!0},p(_,v){(!d||v&2&&i!==(i=H.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||v&2)&&o!==(o=_[1].name+"")&&le(r,o),(!d||v&8&&a!==(a=_[3]))&&p(e,"for",a);const k={};v&8&&(k.id=_[3]),v&2&&(k.required=_[1].required),!c&&v&1&&(c=!0,k.value=_[0],ke(()=>c=!1)),f.$set(k)},i(_){d||(E(f.$$.fragment,_),d=!0)},o(_){P(f.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(u),j(f,_)}}}function O4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[M4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function D4(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class E4 extends ye{constructor(e){super(),ve(this,e,D4,O4,he,{field:1,value:0})}}function A4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h,_,v;return{c(){var k,y;e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("input"),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",m=(k=n[1].options)==null?void 0:k.min),p(f,"max",h=(y=n[1].options)==null?void 0:y.max),p(f,"step","any")},m(k,y){S(k,e,y),g(e,t),g(e,s),g(e,l),g(l,r),S(k,u,y),S(k,f,y),fe(f,n[0]),_||(v=Y(f,"input",n[2]),_=!0)},p(k,y){var T,C;y&2&&i!==(i=H.getFieldTypeIcon(k[1].type))&&p(t,"class",i),y&2&&o!==(o=k[1].name+"")&&le(r,o),y&8&&a!==(a=k[3])&&p(e,"for",a),y&8&&c!==(c=k[3])&&p(f,"id",c),y&2&&d!==(d=k[1].required)&&(f.required=d),y&2&&m!==(m=(T=k[1].options)==null?void 0:T.min)&&p(f,"min",m),y&2&&h!==(h=(C=k[1].options)==null?void 0:C.max)&&p(f,"max",h),y&1&&pt(f.value)!==k[0]&&fe(f,k[0])},d(k){k&&w(e),k&&w(u),k&&w(f),_=!1,v()}}}function I4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[A4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function P4(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e;function l(){s=pt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class L4 extends ye{constructor(e){super(),ve(this,e,P4,I4,he,{field:1,value:0})}}function N4(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=b("input"),i=O(),s=b("label"),o=B(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){S(f,e,c),e.checked=n[0],S(f,i,c),S(f,s,c),g(s,o),a||(u=Y(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&le(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&w(e),f&&w(i),f&&w(s),a=!1,u()}}}function F4(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[N4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function R4(n,e,t){let{field:i=new mn}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class q4 extends ye{constructor(e){super(),ve(this,e,R4,F4,he,{field:1,value:0})}}function j4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("input"),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),S(_,f,v),fe(f,n[0]),m||(h=Y(f,"input",n[2]),m=!0)},p(_,v){v&2&&i!==(i=H.getFieldTypeIcon(_[1].type))&&p(t,"class",i),v&2&&o!==(o=_[1].name+"")&&le(r,o),v&8&&a!==(a=_[3])&&p(e,"for",a),v&8&&c!==(c=_[3])&&p(f,"id",c),v&2&&d!==(d=_[1].required)&&(f.required=d),v&1&&f.value!==_[0]&&fe(f,_[0])},d(_){_&&w(e),_&&w(u),_&&w(f),m=!1,h()}}}function V4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[j4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function H4(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class z4 extends ye{constructor(e){super(),ve(this,e,H4,V4,he,{field:1,value:0})}}function B4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("input"),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),S(_,f,v),fe(f,n[0]),m||(h=Y(f,"input",n[2]),m=!0)},p(_,v){v&2&&i!==(i=H.getFieldTypeIcon(_[1].type))&&p(t,"class",i),v&2&&o!==(o=_[1].name+"")&&le(r,o),v&8&&a!==(a=_[3])&&p(e,"for",a),v&8&&c!==(c=_[3])&&p(f,"id",c),v&2&&d!==(d=_[1].required)&&(f.required=d),v&1&&fe(f,_[0])},d(_){_&&w(e),_&&w(u),_&&w(f),m=!1,h()}}}function U4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[B4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function W4(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class Y4 extends ye{constructor(e){super(),ve(this,e,W4,U4,he,{field:1,value:0})}}function fp(n){let e,t,i,s;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){S(l,e,o),g(e,t),i||(s=[Ie(Ue.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:G,d(l){l&&w(e),i=!1,Pe(s)}}}function K4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h,_,v=n[0]&&!n[1].required&&fp(n);function k(C){n[6](C)}function y(C){n[7](C)}let T={id:n[8],options:H.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new nu({props:T}),se.push(()=>_e(d,"value",k)),se.push(()=>_e(d,"formattedValue",y)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),a=B(" (UTC)"),f=O(),v&&v.c(),c=O(),V(d.$$.fragment),p(t,"class",i=Si(H.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(l,"class","txt"),p(e,"for",u=n[8])},m(C,M){S(C,e,M),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),S(C,f,M),v&&v.m(C,M),S(C,c,M),q(d,C,M),_=!0},p(C,M){(!_||M&2&&i!==(i=Si(H.getFieldTypeIcon(C[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||M&2)&&o!==(o=C[1].name+"")&&le(r,o),(!_||M&256&&u!==(u=C[8]))&&p(e,"for",u),C[0]&&!C[1].required?v?v.p(C,M):(v=fp(C),v.c(),v.m(c.parentNode,c)):v&&(v.d(1),v=null);const $={};M&256&&($.id=C[8]),!m&&M&4&&(m=!0,$.value=C[2],ke(()=>m=!1)),!h&&M&1&&(h=!0,$.formattedValue=C[0],ke(()=>h=!1)),d.$set($)},i(C){_||(E(d.$$.fragment,C),_=!0)},o(C){P(d.$$.fragment,C),_=!1},d(C){C&&w(e),C&&w(f),v&&v.d(C),C&&w(c),j(d,C)}}}function J4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[K4,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Z4(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(c){l=c,t(2,l),t(0,s)}function f(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,u,f]}class G4 extends ye{constructor(e){super(),ve(this,e,Z4,J4,he,{field:1,value:0})}}function cp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=b("div"),t=B("Select up to "),s=B(i),l=B(" items."),p(e,"class","help-block")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&w(e)}}}function X4(n){var y,T,C,M,$;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;function _(D){n[3](D)}let v={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((y=n[0])==null?void 0:y.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:(C=n[1].options)==null?void 0:C.values,searchable:((M=n[1].options)==null?void 0:M.values)>5};n[0]!==void 0&&(v.selected=n[0]),f=new tu({props:v}),se.push(()=>_e(f,"selected",_));let k=(($=n[1].options)==null?void 0:$.maxSelect)>1&&cp(n);return{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),V(f.$$.fragment),d=O(),k&&k.c(),m=$e(),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(D,A){S(D,e,A),g(e,t),g(e,s),g(e,l),g(l,r),S(D,u,A),q(f,D,A),S(D,d,A),k&&k.m(D,A),S(D,m,A),h=!0},p(D,A){var L,F,N,R,K;(!h||A&2&&i!==(i=H.getFieldTypeIcon(D[1].type)))&&p(t,"class",i),(!h||A&2)&&o!==(o=D[1].name+"")&&le(r,o),(!h||A&16&&a!==(a=D[4]))&&p(e,"for",a);const I={};A&16&&(I.id=D[4]),A&6&&(I.toggle=!D[1].required||D[2]),A&4&&(I.multiple=D[2]),A&7&&(I.closable=!D[2]||((L=D[0])==null?void 0:L.length)>=((F=D[1].options)==null?void 0:F.maxSelect)),A&2&&(I.items=(N=D[1].options)==null?void 0:N.values),A&2&&(I.searchable=((R=D[1].options)==null?void 0:R.values)>5),!c&&A&1&&(c=!0,I.selected=D[0],ke(()=>c=!1)),f.$set(I),((K=D[1].options)==null?void 0:K.maxSelect)>1?k?k.p(D,A):(k=cp(D),k.c(),k.m(m.parentNode,m)):k&&(k.d(1),k=null)},i(D){h||(E(f.$$.fragment,D),h=!0)},o(D){P(f.$$.fragment,D),h=!1},d(D){D&&w(e),D&&w(u),j(f,D),D&&w(d),k&&k.d(D),D&&w(m)}}}function Q4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[X4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function x4(n,e,t){let i,{field:s=new mn}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class eM extends ye{constructor(e){super(),ve(this,e,x4,Q4,he,{field:1,value:0})}}function tM(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("textarea"),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4]),p(f,"id",c=n[4]),p(f,"class","txt-mono"),f.required=d=n[1].required,f.value=n[2]},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),S(_,f,v),m||(h=Y(f,"input",n[3]),m=!0)},p(_,v){v&2&&i!==(i=H.getFieldTypeIcon(_[1].type))&&p(t,"class",i),v&2&&o!==(o=_[1].name+"")&&le(r,o),v&16&&a!==(a=_[4])&&p(e,"for",a),v&16&&c!==(c=_[4])&&p(f,"id",c),v&2&&d!==(d=_[1].required)&&(f.required=d),v&4&&(f.value=_[2])},d(_){_&&w(e),_&&w(u),_&&w(f),m=!1,h()}}}function nM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[tM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function iM(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e,l=JSON.stringify(typeof s>"u"?null:s,null,2);const o=r=>{t(2,l=r.target.value),t(0,s=r.target.value.trim())};return n.$$set=r=>{"field"in r&&t(1,i=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(l==null?void 0:l.trim())&&(t(2,l=JSON.stringify(typeof s>"u"?null:s,null,2)),t(0,s=l))},[s,i,l,o]}class sM extends ye{constructor(e){super(),ve(this,e,iM,nM,he,{field:1,value:0})}}function lM(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){S(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&w(e)}}}function oM(n){let e,t,i;return{c(){e=b("img"),Hn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){S(s,e,l)},p(s,l){l&4&&!Hn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&w(e)}}}function rM(n){let e;function t(l,o){return l[2]?oM:lM}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:G,o:G,d(l){s.d(l),l&&w(e)}}}function aM(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),H.hasImageExtension(s==null?void 0:s.name)&&H.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{console.warn("Unable to generate thumb: ",r)})}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class uM extends ye{constructor(e){super(),ve(this,e,aM,rM,he,{file:0,size:1})}}function dp(n){let e;function t(l,o){return l[4]==="image"?cM:fM}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function fM(n){let e,t;return{c(){e=b("object"),t=B("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){S(i,e,s),g(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&w(e)}}}function cM(n){let e,t,i;return{c(){e=b("img"),Hn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){S(s,e,l)},p(s,l){l&2&&!Hn(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&w(e)}}}function dM(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&dp(n);return{c(){i&&i.c(),t=$e()},m(l,o){i&&i.m(l,o),S(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=dp(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&w(t)}}}function pM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=Y(e,"click",dt(n[0])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function mM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("a"),t=B(n[2]),i=O(),s=b("i"),l=O(),o=b("div"),r=O(),a=b("button"),a.textContent="Close",p(s,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,l,d),S(c,o,d),S(c,r,d),S(c,a,d),u||(f=Y(a,"click",n[0]),u=!0)},p(c,d){d&4&&le(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&w(e),c&&w(l),c&&w(o),c&&w(r),c&&w(a),u=!1,f()}}}function hM(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[mM],header:[pM],default:[dM]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[6](e),e.$on("show",n[7]),e.$on("hide",n[8]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&542&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function _M(n,e,t){let i,s,l,o="";function r(d){d!==""&&(t(1,o=d),l==null||l.show())}function a(){return l==null?void 0:l.hide()}function u(d){se[d?"unshift":"push"](()=>{l=d,t(3,l)})}function f(d){ze.call(this,n,d)}function c(d){ze.call(this,n,d)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=o.substring(o.lastIndexOf("/")+1)),n.$$.dirty&4&&t(4,s=H.getFileType(i))},[a,o,i,l,s,r,u,f,c]}class gM extends ye{constructor(e){super(),ve(this,e,_M,hM,he,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function bM(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function vM(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function yM(n){let e,t,i,s,l;return{c(){e=b("img"),Hn(e.src,t=n[4])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){S(o,e,r),s||(l=Y(e,"error",n[7]),s=!0)},p(o,r){r&16&&!Hn(e.src,t=o[4])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&w(e),s=!1,l()}}}function kM(n){let e,t,i,s,l,o,r,a;function u(m,h){return m[2]==="image"?yM:m[2]==="video"||m[2]==="audio"?vM:bM}let f=u(n),c=f(n),d={};return l=new gM({props:d}),n[10](l),{c(){e=b("a"),c.c(),s=O(),V(l.$$.fragment),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[5]?"Preview":"Download")+" "+n[0])},m(m,h){S(m,e,h),c.m(e,null),S(m,s,h),q(l,m,h),o=!0,r||(a=Y(e,"click",kn(n[9])),r=!0)},p(m,[h]){f===(f=u(m))&&c?c.p(m,h):(c.d(1),c=f(m),c&&(c.c(),c.m(e,null))),(!o||h&2&&t!==(t="thumb "+(m[1]?`thumb-${m[1]}`:"")))&&p(e,"class",t),(!o||h&33&&i!==(i=(m[5]?"Preview":"Download")+" "+m[0]))&&p(e,"title",i);const _={};l.$set(_)},i(m){o||(E(l.$$.fragment,m),o=!0)},o(m){P(l.$$.fragment,m),o=!1},d(m){m&&w(e),c.d(),m&&w(s),n[10](null),j(l,m),r=!1,a()}}}function wM(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f=pe.getFileUrl(l,o);function c(){t(4,u="")}const d=h=>{s&&(h.preventDefault(),a==null||a.show(f))};function m(h){se[h?"unshift":"push"](()=>{a=h,t(3,a)})}return n.$$set=h=>{"record"in h&&t(8,l=h.record),"filename"in h&&t(0,o=h.filename),"size"in h&&t(1,r=h.size)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=H.getFileType(o)),n.$$.dirty&5&&t(5,s=["image","audio","video"].includes(i)||o.endsWith(".pdf"))},t(4,u=f?f+"?thumb=100x100":""),[o,r,i,a,u,s,f,c,l,d,m]}class su extends ye{constructor(e){super(),ve(this,e,wM,kM,he,{record:8,filename:0,size:1})}}function pp(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function mp(n,e,t){const i=n.slice();i[25]=e[t],i[24]=t;const s=i[1].includes(i[24]);return i[26]=s,i}function SM(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){S(l,e,o),t||(i=[Ie(Ue.call(null,e,"Remove file")),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,Pe(i)}}}function TM(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){S(l,e,o),t||(i=Y(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,i()}}}function hp(n,e){let t,i,s,l,o,r,a=e[25]+"",u,f,c,d,m,h,_;s=new su({props:{record:e[2],filename:e[25]}});function v(T,C){return C&18&&(h=null),h==null&&(h=!!T[1].includes(T[24])),h?TM:SM}let k=v(e,-1),y=k(e);return{key:n,first:null,c(){t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),r=b("a"),u=B(a),d=O(),m=b("div"),y.c(),x(i,"fade",e[1].includes(e[24])),p(r,"href",f=pe.getFileUrl(e[2],e[25])),p(r,"class",c="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")),p(r,"title","Download"),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","content"),p(m,"class","actions"),p(t,"class","list-item"),this.first=t},m(T,C){S(T,t,C),g(t,i),q(s,i,null),g(t,l),g(t,o),g(o,r),g(r,u),g(t,d),g(t,m),y.m(m,null),_=!0},p(T,C){e=T;const M={};C&4&&(M.record=e[2]),C&16&&(M.filename=e[25]),s.$set(M),(!_||C&18)&&x(i,"fade",e[1].includes(e[24])),(!_||C&16)&&a!==(a=e[25]+"")&&le(u,a),(!_||C&20&&f!==(f=pe.getFileUrl(e[2],e[25])))&&p(r,"href",f),(!_||C&18&&c!==(c="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")))&&p(r,"class",c),k===(k=v(e,C))&&y?y.p(e,C):(y.d(1),y=k(e),y&&(y.c(),y.m(m,null)))},i(T){_||(E(s.$$.fragment,T),_=!0)},o(T){P(s.$$.fragment,T),_=!1},d(T){T&&w(t),j(s),y.d()}}}function _p(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,m,h,_,v;i=new uM({props:{file:n[22]}});function k(){return n[15](n[24])}return{c(){e=b("div"),t=b("figure"),V(i.$$.fragment),s=O(),l=b("div"),o=b("small"),o.textContent="New",r=O(),a=b("span"),f=B(u),d=O(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"title",c=n[22].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-sm btn-circle btn-remove"),p(e,"class","list-item")},m(y,T){S(y,e,T),g(e,t),q(i,t,null),g(e,s),g(e,l),g(l,o),g(l,r),g(l,a),g(a,f),g(e,d),g(e,m),h=!0,_||(v=[Ie(Ue.call(null,m,"Remove file")),Y(m,"click",k)],_=!0)},p(y,T){n=y;const C={};T&1&&(C.file=n[22]),i.$set(C),(!h||T&1)&&u!==(u=n[22].name+"")&&le(f,u),(!h||T&1&&c!==(c=n[22].name))&&p(l,"title",c)},i(y){h||(E(i.$$.fragment,y),h=!0)},o(y){P(i.$$.fragment,y),h=!1},d(y){y&&w(e),j(i),_=!1,Pe(v)}}}function CM(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,m,h,_,v,k,y,T,C,M,$,D,A,I=n[4];const L=K=>K[25]+K[2].id;for(let K=0;KP(N[K],1,1,()=>{N[K]=null});return{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("div");for(let K=0;K({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-list form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&270533119&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function MM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new mn}=e,c,d;function m(A){H.removeByValue(u,A),t(1,u)}function h(A){H.pushUnique(u,A),t(1,u)}function _(A){H.isEmpty(a[A])||a.splice(A,1),t(0,a)}function v(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const k=A=>m(A),y=A=>h(A),T=A=>_(A);function C(A){se[A?"unshift":"push"](()=>{c=A,t(6,c)})}const M=()=>{for(let A of c.files)a.push(A);t(0,a),t(6,c.value=null,c)},$=()=>c==null?void 0:c.click();function D(A){se[A?"unshift":"push"](()=>{d=A,t(7,d)})}return n.$$set=A=>{"record"in A&&t(2,o=A.record),"value"in A&&t(12,r=A.value),"uploadedFiles"in A&&t(0,a=A.uploadedFiles),"deletedFileIndexes"in A&&t(1,u=A.deletedFileIndexes),"field"in A&&t(3,f=A.field)},n.$$.update=()=>{var A,I;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=H.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=H.toArray(u))),n.$$.dirty&8&&t(5,i=((A=f.options)==null?void 0:A.maxSelect)>1),n.$$.dirty&4128&&H.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=H.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((I=f.options)==null?void 0:I.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&v()},[a,u,o,f,s,i,c,d,l,m,h,_,r,k,y,T,C,M,$,D]}class OM extends ye{constructor(e){super(),ve(this,e,MM,$M,he,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function gp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function DM(n,e){e=gp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=gp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}const EM=n=>({dragging:n&2,dragover:n&4}),bp=n=>({dragging:n[1],dragover:n[2]});function AM(n){let e,t,i,s;const l=n[8].default,o=Nt(l,n,n[7],bp);return{c(){e=b("div"),o&&o.c(),p(e,"draggable",!0),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[1]),x(e,"dragover",n[2])},m(r,a){S(r,e,a),o&&o.m(e,null),t=!0,i||(s=[Y(e,"dragover",dt(n[9])),Y(e,"dragleave",dt(n[10])),Y(e,"dragend",n[11]),Y(e,"dragstart",n[12]),Y(e,"drop",n[13])],i=!0)},p(r,[a]){o&&o.p&&(!t||a&134)&&Rt(o,l,r,r[7],t?Ft(l,r[7],a,EM):qt(r[7]),bp),(!t||a&2)&&x(e,"dragging",r[1]),(!t||a&4)&&x(e,"dragover",r[2])},i(r){t||(E(o,r),t=!0)},o(r){P(o,r),t=!1},d(r){r&&w(e),o&&o.d(r),i=!1,Pe(s)}}}function IM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=$t();let{index:o}=e,{list:r=[]}=e,{disabled:a=!1}=e,u=!1,f=!1;function c(y,T){!y&&!a||(t(1,u=!0),y.dataTransfer.effectAllowed="move",y.dataTransfer.dropEffect="move",y.dataTransfer.setData("text/plain",T))}function d(y,T){if(!y&&!a)return;t(2,f=!1),t(1,u=!1),y.dataTransfer.dropEffect="move";const C=parseInt(y.dataTransfer.getData("text/plain"));C{t(2,f=!0)},h=()=>{t(2,f=!1)},_=()=>{t(2,f=!1),t(1,u=!1)},v=y=>c(y,o),k=y=>d(y,o);return n.$$set=y=>{"index"in y&&t(0,o=y.index),"list"in y&&t(5,r=y.list),"disabled"in y&&t(6,a=y.disabled),"$$scope"in y&&t(7,s=y.$$scope)},[o,u,f,c,d,r,a,s,i,m,h,_,v,k]}class PM extends ye{constructor(e){super(),ve(this,e,IM,AM,he,{index:0,list:5,disabled:6})}}function vp(n,e,t){const i=n.slice();i[6]=e[t];const s=H.toArray(i[0][i[6]]).slice(0,5);return i[7]=s,i}function yp(n,e,t){const i=n.slice();return i[10]=e[t],i}function kp(n){let e,t;return e=new su({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[10]),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function wp(n){let e=!H.isEmpty(n[10]),t,i,s=e&&kp(n);return{c(){s&&s.c(),t=$e()},m(l,o){s&&s.m(l,o),S(l,t,o),i=!0},p(l,o){o&3&&(e=!H.isEmpty(l[10])),e?s?(s.p(l,o),o&3&&E(s,1)):(s=kp(l),s.c(),E(s,1),s.m(t.parentNode,t)):s&&(re(),P(s,1,1,()=>{s=null}),ae())},i(l){i||(E(s),i=!0)},o(l){P(s),i=!1},d(l){s&&s.d(l),l&&w(t)}}}function Sp(n){let e,t,i=n[7],s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oP(m[_],1,1,()=>{m[_]=null});return{c(){e=b("div"),t=b("i"),s=O();for(let _=0;_t(5,o=u));let{record:r}=e,{displayFields:a=[]}=e;return n.$$set=u=>{"record"in u&&t(0,r=u.record),"displayFields"in u&&t(3,a=u.displayFields)},n.$$.update=()=>{n.$$.dirty&33&&t(4,i=o==null?void 0:o.find(u=>u.id==(r==null?void 0:r.collectionId))),n.$$.dirty&24&&t(1,s=(a==null?void 0:a.filter(u=>{var f;return!!((f=i==null?void 0:i.schema)!=null&&f.find(c=>c.name==u&&c.type=="file"))}))||[]),n.$$.dirty&10&&t(2,l=(s.length?a==null?void 0:a.filter(u=>!s.includes(u)):a)||[])},[r,s,l,a,i,o]}class Xo extends ye{constructor(e){super(),ve(this,e,NM,LM,he,{record:0,displayFields:3})}}function Tp(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function Cp(n,e,t){const i=n.slice();i[49]=e[t];const s=i[8](i[49]);return i[6]=s,i}function $p(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
New record
',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint p-l-sm p-r-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[31]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Mp(n){let e,t;function i(o,r){return o[12]?RM:FM}let s=i(n),l=s(n);return{c(){e=b("div"),l.c(),t=O(),p(e,"class","list-item")},m(o,r){S(o,e,r),l.m(e,null),g(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&w(e),l.d()}}}function FM(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&Op(n);return{c(){e=b("span"),e.textContent="No records found.",t=O(),s&&s.c(),i=$e(),p(e,"class","txt txt-hint")},m(o,r){S(o,e,r),S(o,t,r),s&&s.m(o,r),S(o,i,r)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=Op(o),s.c(),s.m(i.parentNode,i)):s&&(s.d(1),s=null)},d(o){o&&w(e),o&&w(t),s&&s.d(o),o&&w(i)}}}function RM(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Op(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[35]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function qM(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function jM(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Dp(n){let e,t,i,s;function l(){return n[32](n[49])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){S(o,e,r),g(e,t),i||(s=[Ie(Ue.call(null,t,"Edit")),Y(t,"keydown",kn(n[27])),Y(t,"click",kn(l))],i=!0)},p(o,r){n=o},d(o){o&&w(e),i=!1,Pe(s)}}}function Ep(n,e){var k;let t,i,s,l,o,r,a,u,f;function c(y,T){return y[6]?jM:qM}let d=c(e),m=d(e);l=new Xo({props:{record:e[49],displayFields:e[13]}});let h=!((k=e[10])!=null&&k.isView)&&Dp(e);function _(){return e[33](e[49])}function v(...y){return e[34](e[49],...y)}return{key:n,first:null,c(){t=b("div"),m.c(),i=O(),s=b("div"),V(l.$$.fragment),o=O(),h&&h.c(),r=O(),p(s,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[5]>1&&!e[9]),this.first=t},m(y,T){S(y,t,T),m.m(t,null),g(t,i),g(t,s),q(l,s,null),g(t,o),h&&h.m(t,null),g(t,r),a=!0,u||(f=[Y(t,"click",_),Y(t,"keydown",v)],u=!0)},p(y,T){var M;e=y,d!==(d=c(e))&&(m.d(1),m=d(e),m&&(m.c(),m.m(t,i)));const C={};T[0]&8&&(C.record=e[49]),T[0]&8192&&(C.displayFields=e[13]),l.$set(C),(M=e[10])!=null&&M.isView?h&&(h.d(1),h=null):h?h.p(e,T):(h=Dp(e),h.c(),h.m(t,r)),(!a||T[0]&264)&&x(t,"selected",e[6]),(!a||T[0]&808)&&x(t,"disabled",!e[6]&&e[5]>1&&!e[9])},i(y){a||(E(l.$$.fragment,y),a=!0)},o(y){P(l.$$.fragment,y),a=!1},d(y){y&&w(t),m.d(),j(l),h&&h.d(),u=!1,Pe(f)}}}function Ap(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=B("("),i=B(t),s=B(" of MAX "),l=B(n[5]),o=B(")")},m(r,a){S(r,e,a),S(r,i,a),S(r,s,a),S(r,l,a),S(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&le(i,t),a[0]&32&&le(l,r[5])},d(r){r&&w(e),r&&w(i),r&&w(s),r&&w(l),r&&w(o)}}}function VM(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function HM(n){let e,t,i=n[6],s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){e=b("div");for(let o=0;o',l=O(),p(s,"type","button"),p(s,"title","Remove"),p(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(f,c){S(f,e,c),q(t,e,null),g(e,i),g(e,s),S(f,l,c),o=!0,r||(a=Y(s,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),c[0]&8192&&(d.displayFields=n[13]),t.$set(d),(!o||c[1]&2097152)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(e,"label-warning",n[53])},i(f){o||(E(t.$$.fragment,f),o=!0)},o(f){P(t.$$.fragment,f),o=!1},d(f){f&&w(e),j(t),f&&w(l),r=!1,a()}}}function Ip(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[zM,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new PM({props:l}),se.push(()=>_e(e,"list",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&8256|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function BM(n){var F;let e,t,i,s,l,o=[],r=new Map,a,u,f,c,d,m,h,_,v,k,y;t=new Uo({props:{value:n[2],autocompleteCollection:n[10]}}),t.$on("submit",n[30]);let T=!((F=n[10])!=null&&F.isView)&&$p(n),C=n[3];const M=N=>N[49].id;for(let N=0;N1&&Ap(n);const A=[HM,VM],I=[];function L(N,R){return N[6].length?0:1}return m=L(n),h=I[m]=A[m](n),{c(){e=b("div"),V(t.$$.fragment),i=O(),T&&T.c(),s=O(),l=b("div");for(let N=0;N1?D?D.p(N,R):(D=Ap(N),D.c(),D.m(f,null)):D&&(D.d(1),D=null);let Q=m;m=L(N),m===Q?I[m].p(N,R):(re(),P(I[Q],1,1,()=>{I[Q]=null}),ae(),h=I[m],h?h.p(N,R):(h=I[m]=A[m](N),h.c()),E(h,1),h.m(_.parentNode,_))},i(N){if(!v){E(t.$$.fragment,N);for(let R=0;RCancel',t=O(),i=b("button"),i.innerHTML='Save selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function YM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[WM],header:[UM],default:[BM]},$$scope:{ctx:n}};for(let a=0;at(26,m=Ae));const h=$t(),_="picker_"+H.randomString(5);let{value:v}=e,{field:k}=e,y,T,C="",M=[],$=[],D=1,A=0,I=!1,L=!1;function F(){return t(2,C=""),t(3,M=[]),t(6,$=[]),R(),K(!0),y==null?void 0:y.show()}function N(){return y==null?void 0:y.hide()}async function R(){const Ae=H.toArray(v);if(!s||!Ae.length)return;t(24,L=!0);let ie=[];const we=Ae.slice(),nt=[];for(;we.length>0;){const et=[];for(const bt of we.splice(0,Er))et.push(`id="${bt}"`);nt.push(pe.collection(s).getFullList(Er,{filter:et.join("||"),$autoCancel:!1}))}try{await Promise.all(nt).then(et=>{ie=ie.concat(...et)}),t(6,$=[]);for(const et of Ae){const bt=H.findByKey(ie,"id",et);bt&&$.push(bt)}C.trim()||t(3,M=H.filterDuplicatesByKey($.concat(M)))}catch(et){pe.errorResponseHandler(et)}t(24,L=!1)}async function K(Ae=!1){if(s){t(4,I=!0),Ae&&(C.trim()?t(3,M=[]):t(3,M=H.toArray($).slice()));try{const ie=Ae?1:D+1,we=await pe.collection(s).getList(ie,Er,{filter:C,sort:o!=null&&o.isView?"":"-created",$cancelKey:_+"loadList"});t(3,M=H.filterDuplicatesByKey(M.concat(we.items))),D=we.page,t(23,A=we.totalItems)}catch(ie){pe.errorResponseHandler(ie)}t(4,I=!1)}}function Q(Ae){i==1?t(6,$=[Ae]):u&&(H.pushOrReplaceByKey($,Ae),t(6,$))}function U(Ae){H.removeByKey($,"id",Ae.id),t(6,$)}function X(Ae){f(Ae)?U(Ae):Q(Ae)}function ne(){var Ae;i!=1?t(20,v=$.map(ie=>ie.id)):t(20,v=((Ae=$==null?void 0:$[0])==null?void 0:Ae.id)||""),h("save",$),N()}function J(Ae){ze.call(this,n,Ae)}const ue=()=>N(),Z=()=>ne(),de=Ae=>t(2,C=Ae.detail),ge=()=>T==null?void 0:T.show(),Ce=Ae=>T==null?void 0:T.show(Ae),Ne=Ae=>X(Ae),Re=(Ae,ie)=>{(ie.code==="Enter"||ie.code==="Space")&&(ie.preventDefault(),ie.stopPropagation(),X(Ae))},be=()=>t(2,C=""),Se=()=>{a&&!I&&K()},We=Ae=>U(Ae);function lt(Ae){$=Ae,t(6,$)}function ce(Ae){se[Ae?"unshift":"push"](()=>{y=Ae,t(1,y)})}function He(Ae){ze.call(this,n,Ae)}function te(Ae){ze.call(this,n,Ae)}function Fe(Ae){se[Ae?"unshift":"push"](()=>{T=Ae,t(7,T)})}const ot=Ae=>{H.removeByKey(M,"id",Ae.detail.id),M.unshift(Ae.detail),t(3,M),Q(Ae.detail)},Vt=Ae=>{H.removeByKey(M,"id",Ae.detail.id),t(3,M),U(Ae.detail)};return n.$$set=Ae=>{e=Je(Je({},e),Qn(Ae)),t(19,d=Et(e,c)),"value"in Ae&&t(20,v=Ae.value),"field"in Ae&&t(21,k=Ae.field)},n.$$.update=()=>{var Ae,ie,we;n.$$.dirty[0]&2097152&&t(5,i=((Ae=k==null?void 0:k.options)==null?void 0:Ae.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=(ie=k==null?void 0:k.options)==null?void 0:ie.collectionId),n.$$.dirty[0]&2097152&&t(13,l=(we=k==null?void 0:k.options)==null?void 0:we.displayFields),n.$$.dirty[0]&100663296&&t(10,o=m.find(nt=>nt.id==s)||null),n.$$.dirty[0]&16777222&&typeof C<"u"&&!L&&y!=null&&y.isActive()&&K(!0),n.$$.dirty[0]&16777232&&t(12,r=I||L),n.$$.dirty[0]&8388616&&t(11,a=A>M.length),n.$$.dirty[0]&96&&t(9,u=i===null||i>$.length),n.$$.dirty[0]&64&&t(8,f=function(nt){return H.findByKey($,"id",nt.id)})},[N,y,C,M,I,i,$,T,f,u,o,a,r,l,K,Q,U,X,ne,d,v,k,F,A,L,s,m,J,ue,Z,de,ge,Ce,Ne,Re,be,Se,We,lt,ce,He,te,Fe,ot,Vt]}class JM extends ye{constructor(e){super(),ve(this,e,KM,YM,he,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Pp(n,e,t){const i=n.slice();return i[15]=e[t],i}function Lp(n,e,t){const i=n.slice();return i[18]=e[t],i}function Np(n){let e,t=n[5]&&Fp(n);return{c(){t&&t.c(),e=$e()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=Fp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Fp(n){let e,t=H.toArray(n[0]).slice(0,10),i=[];for(let s=0;s
`,p(e,"class","list-item")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function qp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Xo({props:{record:n[15],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[8](n[15])}return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),o=b("button"),o.innerHTML='',r=O(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item")},m(m,h){S(m,e,h),g(e,t),q(i,t,null),g(e,s),g(e,l),g(l,o),g(e,r),a=!0,u||(f=[Ie(Ue.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(m,h){var v;n=m;const _={};h&16&&(_.record=n[15]),h&4&&(_.displayFields=(v=n[2].options)==null?void 0:v.displayFields),i.$set(_)},i(m){a||(E(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),j(i),u=!1,Pe(f)}}}function ZM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y=n[4],T=[];for(let $=0;$P(T[$],1,1,()=>{T[$]=null});let M=null;return y.length||(M=Np(n)),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),f=b("div"),c=b("div");for(let $=0;$ - Open picker`,p(t,"class",i=Si(H.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[14]),p(c,"class","relations-list svelte-1ynw0pc"),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-block"),p(m,"class","list-item list-item-btn"),p(f,"class","list")},m($,D){S($,e,D),g(e,t),g(e,s),g(e,l),g(l,r),S($,u,D),S($,f,D),g(f,c);for(let A=0;A({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new me({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new JM({props:o}),n[11](i),i.$on("save",n[12]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(E(e.$$.fragment,r),E(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const jp=100;function XM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new mn}=e,r,a=[],u=!1;f();async function f(){var C,M;const k=H.toArray(s);if(!((C=o==null?void 0:o.options)!=null&&C.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const y=k.slice(),T=[];for(;y.length>0;){const $=[];for(const D of y.splice(0,jp))$.push(`id="${D}"`);T.push(pe.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(jp,{filter:$.join("||"),$autoCancel:!1}))}try{let $=[];await Promise.all(T).then(D=>{$=$.concat(...D)});for(const D of k){const A=H.findByKey($,"id",D);A&&a.push(A)}t(4,a)}catch($){pe.errorResponseHandler($)}t(5,u=!1)}function c(k){var y;H.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=((y=a[0])==null?void 0:y.id)||"")}const d=k=>c(k),m=()=>l==null?void 0:l.show();function h(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function _(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const v=k=>{var y;t(4,a=k.detail||[]),t(0,s=i?a.map(T=>T.id):((y=a[0])==null?void 0:y.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,c,d,m,h,_,v]}class QM extends ye{constructor(e){super(),ve(this,e,XM,GM,he,{value:0,picker:1,field:2})}}const xM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],e5=(n,e)=>{xM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function t5(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Lr(e,"visibility","hidden")},m(t,i){S(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function n5(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){S(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function i5(n){let e;function t(l,o){return l[1]?n5:t5}let i=t(n),s=i(n);return{c(){e=b("div"),s.c(),p(e,"class",n[2])},m(l,o){S(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:G,o:G,d(l){l&&w(e),s.d(),n[19](null)}}}const qb=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),s5=()=>{let n={listeners:[],scriptId:qb("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=l,r.onload=()=>{o()},s.head&&s.head.appendChild(r)};return{load:(i,s,l)=>{n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(n.scriptId,i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}}};let l5=s5();function o5(n,e,t){var i;let{id:s=qb("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:u=void 0}=e,{conf:f={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:m=""}=e,{cssClass:h="tinymce-wrapper"}=e,_,v,k,y="",T=o;const C=$t(),M=()=>{const F=(()=>typeof window<"u"?window:global)();return F&&F.tinymce?F.tinymce:null},$=()=>{const L=Object.assign(Object.assign({},f),{target:v,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:F=>{t(14,k=F),F.on("init",()=>{F.setContent(d),F.on(c,()=>{t(15,y=F.getContent()),y!==d&&(t(5,d=y),t(6,m=F.getContent({format:"text"})))})}),e5(F,C),typeof f.setup=="function"&&f.setup(F)}});t(4,v.style.visibility="",v),M().init(L)};Zt(()=>{if(M()!==null)$();else{const L=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;l5.load(_.ownerDocument,L,()=>{$()})}}),y_(()=>{var L;k&&((L=M())===null||L===void 0||L.remove(k))});function D(L){se[L?"unshift":"push"](()=>{v=L,t(4,v)})}function A(L){se[L?"unshift":"push"](()=>{v=L,t(4,v)})}function I(L){se[L?"unshift":"push"](()=>{_=L,t(3,_)})}return n.$$set=L=>{"id"in L&&t(0,s=L.id),"inline"in L&&t(1,l=L.inline),"disabled"in L&&t(7,o=L.disabled),"apiKey"in L&&t(8,r=L.apiKey),"channel"in L&&t(9,a=L.channel),"scriptSrc"in L&&t(10,u=L.scriptSrc),"conf"in L&&t(11,f=L.conf),"modelEvents"in L&&t(12,c=L.modelEvents),"value"in L&&t(5,d=L.value),"text"in L&&t(6,m=L.text),"cssClass"in L&&t(2,h=L.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(k&&y!==d&&(k.setContent(d),t(6,m=k.getContent({format:"text"}))),k&&o!==T&&(t(16,T=o),typeof(t(13,i=k.mode)===null||i===void 0?void 0:i.set)=="function"?k.mode.set(o?"readonly":"design"):k.setMode(o?"readonly":"design")))},[s,l,h,_,v,d,m,o,r,a,u,f,c,i,k,y,T,D,A,I]}class jb extends ye{constructor(e){super(),ve(this,e,o5,i5,he,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function r5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function m(_){n[2](_)}let h={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:H.defaultEditorOptions()};return n[0]!==void 0&&(h.value=n[0]),f=new jb({props:h}),se.push(()=>_e(f,"value",m)),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),V(f.$$.fragment),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),q(f,_,v),d=!0},p(_,v){(!d||v&2&&i!==(i=H.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||v&2)&&o!==(o=_[1].name+"")&&le(r,o),(!d||v&8&&a!==(a=_[3]))&&p(e,"for",a);const k={};v&8&&(k.id=_[3]),!c&&v&1&&(c=!0,k.value=_[0],ke(()=>c=!1)),f.$set(k)},i(_){d||(E(f.$$.fragment,_),d=!0)},o(_){P(f.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(u),j(f,_)}}}function a5(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[r5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function u5(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class f5 extends ye{constructor(e){super(),ve(this,e,u5,a5,he,{field:1,value:0})}}function c5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),s=O(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].authUrl),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&fe(l,u[0].authUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function d5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Token URL"),s=O(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].tokenUrl),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&fe(l,u[0].tokenUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function p5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("User API URL"),s=O(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].userApiUrl),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&fe(l,u[0].userApiUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function m5(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new me({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[c5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[d5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),c=new me({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[p5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Selfhosted endpoints (optional)",t=O(),i=b("div"),s=b("div"),V(l.$$.fragment),o=O(),r=b("div"),V(a.$$.fragment),u=O(),f=b("div"),V(c.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),g(i,u),g(i,f),q(c,f,null),d=!0},p(m,[h]){const _={};h&2&&(_.name=m[1]+".authUrl"),h&97&&(_.$$scope={dirty:h,ctx:m}),l.$set(_);const v={};h&2&&(v.name=m[1]+".tokenUrl"),h&97&&(v.$$scope={dirty:h,ctx:m}),a.$set(v);const k={};h&2&&(k.name=m[1]+".userApiUrl"),h&97&&(k.$$scope={dirty:h,ctx:m}),c.$set(k)},i(m){d||(E(l.$$.fragment,m),E(a.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){P(l.$$.fragment,m),P(a.$$.fragment,m),P(c.$$.fragment,m),d=!1},d(m){m&&w(e),m&&w(t),m&&w(i),j(l),j(a),j(c)}}}function h5(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Vp extends ye{constructor(e){super(),ve(this,e,h5,m5,he,{key:1,config:0})}}function _5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Auth URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].authUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[2]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&fe(l,d[0].authUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function g5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Token URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","text"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].tokenUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[3]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].tokenUrl&&fe(l,d[0].tokenUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function b5(n){let e,t,i,s,l,o,r,a,u;return l=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[_5,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[g5,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=O(),i=b("div"),s=b("div"),V(l.$$.fragment),o=O(),r=b("div"),V(a.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-12"),p(r,"class","col-lg-12"),p(i,"class","grid")},m(f,c){S(f,e,c),S(f,t,c),S(f,i,c),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),u=!0},p(f,[c]){const d={};c&1&&(d.class="form-field "+(f[0].enabled?"required":"")),c&2&&(d.name=f[1]+".authUrl"),c&49&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&1&&(m.class="form-field "+(f[0].enabled?"required":"")),c&2&&(m.name=f[1]+".tokenUrl"),c&49&&(m.$$scope={dirty:c,ctx:f}),a.$set(m)},i(f){u||(E(l.$$.fragment,f),E(a.$$.fragment,f),u=!0)},o(f){P(l.$$.fragment,f),P(a.$$.fragment,f),u=!1},d(f){f&&w(e),f&&w(t),f&&w(i),j(l),j(a)}}}function v5(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class y5 extends ye{constructor(e){super(),ve(this,e,v5,b5,he,{key:1,config:0})}}function k5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Auth URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://example.com/authorize/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].authUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[2]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&fe(l,d[0].authUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function w5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Token URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://example.com/token/",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].tokenUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[3]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].tokenUrl&&fe(l,d[0].tokenUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function S5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("User API URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://example.com/userinfo/",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].userApiUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[4]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].userApiUrl&&fe(l,d[0].userApiUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function T5(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[k5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[w5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),c=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[S5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Endpoints",t=O(),i=b("div"),s=b("div"),V(l.$$.fragment),o=O(),r=b("div"),V(a.$$.fragment),u=O(),f=b("div"),V(c.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-12"),p(r,"class","col-lg-12"),p(f,"class","col-lg-12"),p(i,"class","grid")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),g(i,u),g(i,f),q(c,f,null),d=!0},p(m,[h]){const _={};h&1&&(_.class="form-field "+(m[0].enabled?"required":"")),h&2&&(_.name=m[1]+".authUrl"),h&97&&(_.$$scope={dirty:h,ctx:m}),l.$set(_);const v={};h&1&&(v.class="form-field "+(m[0].enabled?"required":"")),h&2&&(v.name=m[1]+".tokenUrl"),h&97&&(v.$$scope={dirty:h,ctx:m}),a.$set(v);const k={};h&1&&(k.class="form-field "+(m[0].enabled?"required":"")),h&2&&(k.name=m[1]+".userApiUrl"),h&97&&(k.$$scope={dirty:h,ctx:m}),c.$set(k)},i(m){d||(E(l.$$.fragment,m),E(a.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){P(l.$$.fragment,m),P(a.$$.fragment,m),P(c.$$.fragment,m),d=!1},d(m){m&&w(e),m&&w(t),m&&w(i),j(l),j(a),j(c)}}}function C5(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Ar extends ye{constructor(e){super(),ve(this,e,C5,T5,he,{key:1,config:0})}}const vl={googleAuth:{title:"Google",icon:"ri-google-fill"},facebookAuth:{title:"Facebook",icon:"ri-facebook-fill"},twitterAuth:{title:"Twitter",icon:"ri-twitter-fill"},githubAuth:{title:"GitHub",icon:"ri-github-fill"},gitlabAuth:{title:"GitLab",icon:"ri-gitlab-fill",optionsComponent:Vp},discordAuth:{title:"Discord",icon:"ri-discord-fill"},microsoftAuth:{title:"Microsoft",icon:"ri-microsoft-fill",optionsComponent:y5},spotifyAuth:{title:"Spotify",icon:"ri-spotify-fill"},kakaoAuth:{title:"Kakao",icon:"ri-kakao-talk-fill"},twitchAuth:{title:"Twitch",icon:"ri-twitch-fill"},stravaAuth:{title:"Strava",icon:"ri-riding-fill"},giteeAuth:{title:"Gitee",icon:"ri-git-repository-fill"},giteaAuth:{title:"Gitea",icon:"ri-cup-fill",optionsComponent:Vp},livechatAuth:{title:"LiveChat",icon:"ri-chat-1-fill"},oidcAuth:{title:"OpenID Connect (Authentik, Keycloak, Okta, ...)",icon:"ri-lock-fill",optionsComponent:Ar},oidc2Auth:{title:"(2) OpenID Connect (Authentik, Keycloak, Okta, ...)",icon:"ri-lock-fill",hidden:!0,optionsComponent:Ar},oidc3Auth:{title:"(3) OpenID Connect (Authentik, Keycloak, Okta, ...)",icon:"ri-lock-fill",hidden:!0,optionsComponent:Ar}};function Hp(n,e,t){const i=n.slice();return i[9]=e[t],i}function $5(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function M5(n){let e,t=n[1],i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function zp(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,c=n[9].providerId+"",d,m,h,_,v,k;function y(){return n[6](n[9])}return{c(){e=b("div"),t=b("i"),s=O(),l=b("span"),r=B(o),a=O(),u=b("div"),f=B("ID: "),d=B(c),m=O(),h=b("button"),h.innerHTML='',_=O(),p(t,"class",i=n[4](n[9].provider)),p(l,"class","txt"),p(u,"class","txt-hint"),p(h,"type","button"),p(h,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,C){S(T,e,C),g(e,t),g(e,s),g(e,l),g(l,r),g(e,a),g(e,u),g(u,f),g(u,d),g(e,m),g(e,h),g(e,_),v||(k=Y(h,"click",y),v=!0)},p(T,C){n=T,C&2&&i!==(i=n[4](n[9].provider))&&p(t,"class",i),C&2&&o!==(o=n[3](n[9].provider)+"")&&le(r,o),C&2&&c!==(c=n[9].providerId+"")&&le(d,c)},d(T){T&&w(e),v=!1,k()}}}function D5(n){let e;function t(l,o){var r;return l[2]?O5:(r=l[0])!=null&&r.id&&l[1].length?M5:$5}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:G,o:G,d(l){s.d(l),l&&w(e)}}}function E5(n,e,t){const i=$t();let{record:s}=e,l=[],o=!1;function r(d){var m;return((m=vl[d+"Auth"])==null?void 0:m.title)||H.sentenize(d,!1)}function a(d){var m;return((m=vl[d+"Auth"])==null?void 0:m.icon)||`ri-${d}-line`}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await pe.collection(s.collectionId).listExternalAuths(s.id))}catch(d){pe.errorResponseHandler(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||cn(`Do you really want to unlink the ${r(d)} provider?`,()=>pe.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{zt(`Successfully unlinked the ${r(d)} provider.`),i("unlink",d),u()}).catch(m=>{pe.errorResponseHandler(m)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class A5 extends ye{constructor(e){super(),ve(this,e,E5,D5,he,{record:0})}}function Bp(n,e,t){const i=n.slice();return i[51]=e[t],i[52]=e,i[53]=t,i}function Up(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[I5,({uniqueId:i})=>({54:i}),({uniqueId:i})=>[0,i?8388608:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&4|s[1]&25165824&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function I5(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="id",l=O(),o=b("span"),a=O(),u=b("div"),f=b("i"),d=O(),m=b("input"),p(t,"class",H.getFieldTypeIcon("primary")),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[54]),p(f,"class","ri-calendar-event-line txt-disabled"),p(u,"class","form-field-addon"),p(m,"type","text"),p(m,"id",h=n[54]),m.value=_=n[2].id,m.readOnly=!0},m(y,T){S(y,e,T),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),S(y,a,T),S(y,u,T),g(u,f),S(y,d,T),S(y,m,T),v||(k=Ie(c=Ue.call(null,f,{text:`Created: ${n[2].created} + Open picker`,p(t,"class",i=Si(H.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[14]),p(c,"class","relations-list svelte-1ynw0pc"),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-block"),p(m,"class","list-item list-item-btn"),p(f,"class","list")},m($,D){S($,e,D),g(e,t),g(e,s),g(e,l),g(l,r),S($,u,D),S($,f,D),g(f,c);for(let A=0;A({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new me({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new JM({props:o}),n[11](i),i.$on("save",n[12]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(E(e.$$.fragment,r),E(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const jp=100;function XM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new mn}=e,r,a=[],u=!1;f();async function f(){var C,M;const k=H.toArray(s);if(!((C=o==null?void 0:o.options)!=null&&C.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const y=k.slice(),T=[];for(;y.length>0;){const $=[];for(const D of y.splice(0,jp))$.push(`id="${D}"`);T.push(pe.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(jp,{filter:$.join("||"),$autoCancel:!1}))}try{let $=[];await Promise.all(T).then(D=>{$=$.concat(...D)});for(const D of k){const A=H.findByKey($,"id",D);A&&a.push(A)}t(4,a)}catch($){pe.errorResponseHandler($)}t(5,u=!1)}function c(k){var y;H.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=((y=a[0])==null?void 0:y.id)||"")}const d=k=>c(k),m=()=>l==null?void 0:l.show();function h(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function _(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const v=k=>{var y;t(4,a=k.detail||[]),t(0,s=i?a.map(T=>T.id):((y=a[0])==null?void 0:y.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,c,d,m,h,_,v]}class QM extends ye{constructor(e){super(),ve(this,e,XM,GM,he,{value:0,picker:1,field:2})}}const xM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],e5=(n,e)=>{xM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function t5(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Lr(e,"visibility","hidden")},m(t,i){S(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function n5(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){S(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function i5(n){let e;function t(l,o){return l[1]?n5:t5}let i=t(n),s=i(n);return{c(){e=b("div"),s.c(),p(e,"class",n[2])},m(l,o){S(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:G,o:G,d(l){l&&w(e),s.d(),n[19](null)}}}const q1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),s5=()=>{let n={listeners:[],scriptId:q1("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=l,r.onload=()=>{o()},s.head&&s.head.appendChild(r)};return{load:(i,s,l)=>{n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(n.scriptId,i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}}};let l5=s5();function o5(n,e,t){var i;let{id:s=q1("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:u=void 0}=e,{conf:f={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:m=""}=e,{cssClass:h="tinymce-wrapper"}=e,_,v,k,y="",T=o;const C=$t(),M=()=>{const F=(()=>typeof window<"u"?window:global)();return F&&F.tinymce?F.tinymce:null},$=()=>{const L=Object.assign(Object.assign({},f),{target:v,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:F=>{t(14,k=F),F.on("init",()=>{F.setContent(d),F.on(c,()=>{t(15,y=F.getContent()),y!==d&&(t(5,d=y),t(6,m=F.getContent({format:"text"})))})}),e5(F,C),typeof f.setup=="function"&&f.setup(F)}});t(4,v.style.visibility="",v),M().init(L)};Zt(()=>{if(M()!==null)$();else{const L=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;l5.load(_.ownerDocument,L,()=>{$()})}}),y_(()=>{var L;k&&((L=M())===null||L===void 0||L.remove(k))});function D(L){se[L?"unshift":"push"](()=>{v=L,t(4,v)})}function A(L){se[L?"unshift":"push"](()=>{v=L,t(4,v)})}function I(L){se[L?"unshift":"push"](()=>{_=L,t(3,_)})}return n.$$set=L=>{"id"in L&&t(0,s=L.id),"inline"in L&&t(1,l=L.inline),"disabled"in L&&t(7,o=L.disabled),"apiKey"in L&&t(8,r=L.apiKey),"channel"in L&&t(9,a=L.channel),"scriptSrc"in L&&t(10,u=L.scriptSrc),"conf"in L&&t(11,f=L.conf),"modelEvents"in L&&t(12,c=L.modelEvents),"value"in L&&t(5,d=L.value),"text"in L&&t(6,m=L.text),"cssClass"in L&&t(2,h=L.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(k&&y!==d&&(k.setContent(d),t(6,m=k.getContent({format:"text"}))),k&&o!==T&&(t(16,T=o),typeof(t(13,i=k.mode)===null||i===void 0?void 0:i.set)=="function"?k.mode.set(o?"readonly":"design"):k.setMode(o?"readonly":"design")))},[s,l,h,_,v,d,m,o,r,a,u,f,c,i,k,y,T,D,A,I]}class j1 extends ye{constructor(e){super(),ve(this,e,o5,i5,he,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function r5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function m(_){n[2](_)}let h={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:H.defaultEditorOptions()};return n[0]!==void 0&&(h.value=n[0]),f=new j1({props:h}),se.push(()=>_e(f,"value",m)),{c(){e=b("label"),t=b("i"),s=O(),l=b("span"),r=B(o),u=O(),V(f.$$.fragment),p(t,"class",i=H.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),q(f,_,v),d=!0},p(_,v){(!d||v&2&&i!==(i=H.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||v&2)&&o!==(o=_[1].name+"")&&le(r,o),(!d||v&8&&a!==(a=_[3]))&&p(e,"for",a);const k={};v&8&&(k.id=_[3]),!c&&v&1&&(c=!0,k.value=_[0],ke(()=>c=!1)),f.$set(k)},i(_){d||(E(f.$$.fragment,_),d=!0)},o(_){P(f.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(u),j(f,_)}}}function a5(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[r5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function u5(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class f5 extends ye{constructor(e){super(),ve(this,e,u5,a5,he,{field:1,value:0})}}function c5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Auth URL"),s=O(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].authUrl),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&fe(l,u[0].authUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function d5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Token URL"),s=O(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].tokenUrl),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&fe(l,u[0].tokenUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function p5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("User API URL"),s=O(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].userApiUrl),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&fe(l,u[0].userApiUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function m5(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new me({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[c5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[d5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),c=new me({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[p5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Selfhosted endpoints (optional)",t=O(),i=b("div"),s=b("div"),V(l.$$.fragment),o=O(),r=b("div"),V(a.$$.fragment),u=O(),f=b("div"),V(c.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),g(i,u),g(i,f),q(c,f,null),d=!0},p(m,[h]){const _={};h&2&&(_.name=m[1]+".authUrl"),h&97&&(_.$$scope={dirty:h,ctx:m}),l.$set(_);const v={};h&2&&(v.name=m[1]+".tokenUrl"),h&97&&(v.$$scope={dirty:h,ctx:m}),a.$set(v);const k={};h&2&&(k.name=m[1]+".userApiUrl"),h&97&&(k.$$scope={dirty:h,ctx:m}),c.$set(k)},i(m){d||(E(l.$$.fragment,m),E(a.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){P(l.$$.fragment,m),P(a.$$.fragment,m),P(c.$$.fragment,m),d=!1},d(m){m&&w(e),m&&w(t),m&&w(i),j(l),j(a),j(c)}}}function h5(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Vp extends ye{constructor(e){super(),ve(this,e,h5,m5,he,{key:1,config:0})}}function _5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Auth URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].authUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[2]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&fe(l,d[0].authUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function g5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Token URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","text"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].tokenUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[3]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].tokenUrl&&fe(l,d[0].tokenUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function b5(n){let e,t,i,s,l,o,r,a,u;return l=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[_5,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[g5,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=O(),i=b("div"),s=b("div"),V(l.$$.fragment),o=O(),r=b("div"),V(a.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-12"),p(r,"class","col-lg-12"),p(i,"class","grid")},m(f,c){S(f,e,c),S(f,t,c),S(f,i,c),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),u=!0},p(f,[c]){const d={};c&1&&(d.class="form-field "+(f[0].enabled?"required":"")),c&2&&(d.name=f[1]+".authUrl"),c&49&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&1&&(m.class="form-field "+(f[0].enabled?"required":"")),c&2&&(m.name=f[1]+".tokenUrl"),c&49&&(m.$$scope={dirty:c,ctx:f}),a.$set(m)},i(f){u||(E(l.$$.fragment,f),E(a.$$.fragment,f),u=!0)},o(f){P(l.$$.fragment,f),P(a.$$.fragment,f),u=!1},d(f){f&&w(e),f&&w(t),f&&w(i),j(l),j(a)}}}function v5(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class y5 extends ye{constructor(e){super(),ve(this,e,v5,b5,he,{key:1,config:0})}}function k5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Auth URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://example.com/authorize/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].authUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[2]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&fe(l,d[0].authUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function w5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("Token URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://example.com/token/",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].tokenUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[3]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].tokenUrl&&fe(l,d[0].tokenUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function S5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=B("User API URL"),s=O(),l=b("input"),a=O(),u=b("div"),u.textContent="Eg. https://example.com/userinfo/",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0].userApiUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[4]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&l.value!==d[0].userApiUrl&&fe(l,d[0].userApiUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function T5(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[k5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[w5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),c=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[S5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Endpoints",t=O(),i=b("div"),s=b("div"),V(l.$$.fragment),o=O(),r=b("div"),V(a.$$.fragment),u=O(),f=b("div"),V(c.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-12"),p(r,"class","col-lg-12"),p(f,"class","col-lg-12"),p(i,"class","grid")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),g(i,u),g(i,f),q(c,f,null),d=!0},p(m,[h]){const _={};h&1&&(_.class="form-field "+(m[0].enabled?"required":"")),h&2&&(_.name=m[1]+".authUrl"),h&97&&(_.$$scope={dirty:h,ctx:m}),l.$set(_);const v={};h&1&&(v.class="form-field "+(m[0].enabled?"required":"")),h&2&&(v.name=m[1]+".tokenUrl"),h&97&&(v.$$scope={dirty:h,ctx:m}),a.$set(v);const k={};h&1&&(k.class="form-field "+(m[0].enabled?"required":"")),h&2&&(k.name=m[1]+".userApiUrl"),h&97&&(k.$$scope={dirty:h,ctx:m}),c.$set(k)},i(m){d||(E(l.$$.fragment,m),E(a.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){P(l.$$.fragment,m),P(a.$$.fragment,m),P(c.$$.fragment,m),d=!1},d(m){m&&w(e),m&&w(t),m&&w(i),j(l),j(a),j(c)}}}function C5(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Ar extends ye{constructor(e){super(),ve(this,e,C5,T5,he,{key:1,config:0})}}const vl={googleAuth:{title:"Google",icon:"ri-google-fill"},facebookAuth:{title:"Facebook",icon:"ri-facebook-fill"},twitterAuth:{title:"Twitter",icon:"ri-twitter-fill"},githubAuth:{title:"GitHub",icon:"ri-github-fill"},gitlabAuth:{title:"GitLab",icon:"ri-gitlab-fill",optionsComponent:Vp},discordAuth:{title:"Discord",icon:"ri-discord-fill"},microsoftAuth:{title:"Microsoft",icon:"ri-microsoft-fill",optionsComponent:y5},spotifyAuth:{title:"Spotify",icon:"ri-spotify-fill"},kakaoAuth:{title:"Kakao",icon:"ri-kakao-talk-fill"},twitchAuth:{title:"Twitch",icon:"ri-twitch-fill"},stravaAuth:{title:"Strava",icon:"ri-riding-fill"},giteeAuth:{title:"Gitee",icon:"ri-git-repository-fill"},giteaAuth:{title:"Gitea",icon:"ri-cup-fill",optionsComponent:Vp},livechatAuth:{title:"LiveChat",icon:"ri-chat-1-fill"},oidcAuth:{title:"OpenID Connect (Authentik, Keycloak, Okta, ...)",icon:"ri-lock-fill",optionsComponent:Ar},oidc2Auth:{title:"(2) OpenID Connect (Authentik, Keycloak, Okta, ...)",icon:"ri-lock-fill",hidden:!0,optionsComponent:Ar},oidc3Auth:{title:"(3) OpenID Connect (Authentik, Keycloak, Okta, ...)",icon:"ri-lock-fill",hidden:!0,optionsComponent:Ar}};function Hp(n,e,t){const i=n.slice();return i[9]=e[t],i}function $5(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function M5(n){let e,t=n[1],i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function zp(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,c=n[9].providerId+"",d,m,h,_,v,k;function y(){return n[6](n[9])}return{c(){e=b("div"),t=b("i"),s=O(),l=b("span"),r=B(o),a=O(),u=b("div"),f=B("ID: "),d=B(c),m=O(),h=b("button"),h.innerHTML='',_=O(),p(t,"class",i=n[4](n[9].provider)),p(l,"class","txt"),p(u,"class","txt-hint"),p(h,"type","button"),p(h,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,C){S(T,e,C),g(e,t),g(e,s),g(e,l),g(l,r),g(e,a),g(e,u),g(u,f),g(u,d),g(e,m),g(e,h),g(e,_),v||(k=Y(h,"click",y),v=!0)},p(T,C){n=T,C&2&&i!==(i=n[4](n[9].provider))&&p(t,"class",i),C&2&&o!==(o=n[3](n[9].provider)+"")&&le(r,o),C&2&&c!==(c=n[9].providerId+"")&&le(d,c)},d(T){T&&w(e),v=!1,k()}}}function D5(n){let e;function t(l,o){var r;return l[2]?O5:(r=l[0])!=null&&r.id&&l[1].length?M5:$5}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:G,o:G,d(l){s.d(l),l&&w(e)}}}function E5(n,e,t){const i=$t();let{record:s}=e,l=[],o=!1;function r(d){var m;return((m=vl[d+"Auth"])==null?void 0:m.title)||H.sentenize(d,!1)}function a(d){var m;return((m=vl[d+"Auth"])==null?void 0:m.icon)||`ri-${d}-line`}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await pe.collection(s.collectionId).listExternalAuths(s.id))}catch(d){pe.errorResponseHandler(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||cn(`Do you really want to unlink the ${r(d)} provider?`,()=>pe.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{zt(`Successfully unlinked the ${r(d)} provider.`),i("unlink",d),u()}).catch(m=>{pe.errorResponseHandler(m)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class A5 extends ye{constructor(e){super(),ve(this,e,E5,D5,he,{record:0})}}function Bp(n,e,t){const i=n.slice();return i[51]=e[t],i[52]=e,i[53]=t,i}function Up(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[I5,({uniqueId:i})=>({54:i}),({uniqueId:i})=>[0,i?8388608:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&4|s[1]&25165824&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function I5(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return{c(){e=b("label"),t=b("i"),i=O(),s=b("span"),s.textContent="id",l=O(),o=b("span"),a=O(),u=b("div"),f=b("i"),d=O(),m=b("input"),p(t,"class",H.getFieldTypeIcon("primary")),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[54]),p(f,"class","ri-calendar-event-line txt-disabled"),p(u,"class","form-field-addon"),p(m,"type","text"),p(m,"id",h=n[54]),m.value=_=n[2].id,m.readOnly=!0},m(y,T){S(y,e,T),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),S(y,a,T),S(y,u,T),g(u,f),S(y,d,T),S(y,m,T),v||(k=Ie(c=Ue.call(null,f,{text:`Created: ${n[2].created} Updated: ${n[2].updated}`,position:"left"})),v=!0)},p(y,T){T[1]&8388608&&r!==(r=y[54])&&p(e,"for",r),c&&Bt(c.update)&&T[0]&4&&c.update.call(null,{text:`Created: ${y[2].created} Updated: ${y[2].updated}`,position:"left"}),T[1]&8388608&&h!==(h=y[54])&&p(m,"id",h),T[0]&4&&_!==(_=y[2].id)&&m.value!==_&&(m.value=_)},d(y){y&&w(e),y&&w(a),y&&w(u),y&&w(d),y&&w(m),v=!1,k()}}}function Wp(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new S4({props:r}),se.push(()=>_e(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Yp();return{c(){V(e.$$.fragment),i=O(),a&&a.c(),s=$e()},m(c,d){q(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var h,_;const m={};d[0]&1&&(m.collection=c[0]),!t&&d[0]&4&&(t=!0,m.record=c[2],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=Yp(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(E(e.$$.fragment,c),l=!0)},o(c){P(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function Yp(n){let e;return{c(){e=b("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function P5(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new QM({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function L5(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new OM({props:u}),se.push(()=>_e(e,"value",o)),se.push(()=>_e(e,"uploadedFiles",r)),se.push(()=>_e(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],ke(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],ke(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],ke(()=>s=!1)),e.$set(d)},i(f){l||(E(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function N5(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new sM({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function F5(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new eM({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function R5(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new G4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function q5(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new f5({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function j5(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new Y4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function V5(n){let e,t,i;function s(o){n[33](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new z4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function H5(n){let e,t,i;function s(o){n[32](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new q4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function z5(n){let e,t,i;function s(o){n[31](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new L4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function B5(n){let e,t,i;function s(o){n[30](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new E4({props:l}),se.push(()=>_e(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Kp(n,e){let t,i,s,l,o;const r=[B5,z5,H5,V5,j5,q5,R5,F5,N5,L5,P5],a=[];function u(f,c){return f[51].type==="text"?0:f[51].type==="number"?1:f[51].type==="bool"?2:f[51].type==="email"?3:f[51].type==="url"?4:f[51].type==="editor"?5:f[51].type==="date"?6:f[51].type==="select"?7:f[51].type==="json"?8:f[51].type==="file"?9:f[51].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=$e(),s&&s.c(),l=$e(),this.first=t},m(f,c){S(f,t,c),~i&&a[i].m(f,c),S(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(re(),P(a[d],1,1,()=>{a[d]=null}),ae()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),E(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(E(s),o=!0)},o(f){P(s),o=!1},d(f){f&&w(t),~i&&a[i].d(f),f&&w(l)}}}function Jp(n){let e,t,i;return t=new A5({props:{record:n[2]}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[10]===yl)},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&4&&(o.record=s[2]),t.$set(o),(!i||l[0]&1024)&&x(e,"active",s[10]===yl)},i(s){i||(E(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function U5(n){var v,k;let e,t,i,s,l=[],o=new Map,r,a,u,f,c=!n[2].isNew&&Up(n),d=((v=n[0])==null?void 0:v.isAuth)&&Wp(n),m=((k=n[0])==null?void 0:k.schema)||[];const h=y=>y[51].name;for(let y=0;y{c=null}),ae()):c?(c.p(y,T),T[0]&4&&E(c,1)):(c=Up(y),c.c(),E(c,1),c.m(t,i)),(C=y[0])!=null&&C.isAuth?d?(d.p(y,T),T[0]&1&&E(d,1)):(d=Wp(y),d.c(),E(d,1),d.m(t,s)):d&&(re(),P(d,1,1,()=>{d=null}),ae()),T[0]&29&&(m=((M=y[0])==null?void 0:M.schema)||[],re(),l=wt(l,T,h,1,y,m,o,t,ln,Kp,null,Bp),ae()),(!a||T[0]&1024)&&x(t,"active",y[10]===Gi),y[0].isAuth&&!y[2].isNew?_?(_.p(y,T),T[0]&5&&E(_,1)):(_=Jp(y),_.c(),E(_,1),_.m(e,null)):_&&(re(),P(_,1,1,()=>{_=null}),ae())},i(y){if(!a){E(c),E(d);for(let T=0;T Send verification email`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[23]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Xp(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` @@ -135,13 +135,13 @@ Updated: ${y[2].updated}`,position:"left"}),T[1]&8388608&&h!==(h=y[54])&&p(m,"id record-panel `+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+` `+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+` - `),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const Gi="form",yl="providers";function xp(n){return JSON.stringify(n)}function Z5(n,e,t){let i,s,l,o;const r=$t(),a="record_"+H.randomString(5);let{collection:u}=e,f,c=null,d=new Ti,m=!1,h=!1,_={},v={},k="",y=Gi;function T(ie){return M(ie),t(9,h=!0),t(10,y=Gi),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function M(ie){Bn({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new Ti),t(3,_={}),t(4,v={}),await sn(),t(20,k=xp(d))}function $(){if(m||!o||!(u!=null&&u.id))return;t(8,m=!0);const ie=A();let we;d.isNew?we=pe.collection(u.id).create(ie):we=pe.collection(u.id).update(d.id,ie),we.then(nt=>{zt(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),C(),r("save",nt)}).catch(nt=>{pe.errorResponseHandler(nt)}).finally(()=>{t(8,m=!1)})}function D(){c!=null&&c.id&&cn("Do you really want to delete the selected record?",()=>pe.collection(c.collectionId).delete(c.id).then(()=>{C(),zt("Successfully deleted record."),r("delete",c)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function A(){const ie=(d==null?void 0:d.export())||{},we=new FormData,nt={};for(const et of(u==null?void 0:u.schema)||[])nt[et.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const et in ie)nt[et]&&(typeof ie[et]>"u"&&(ie[et]=null),H.addValueToFormData(we,et,ie[et]));for(const et in _){const bt=H.toArray(_[et]);for(const Gt of bt)we.append(et,Gt)}for(const et in v){const bt=H.toArray(v[et]);for(const Gt of bt)we.append(et+"."+Gt,"")}return we}function I(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent verification email to ${c.email}?`,()=>pe.collection(u.id).requestVerification(c.email).then(()=>{zt(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent password reset email to ${c.email}?`,()=>pe.collection(u.id).requestPasswordReset(c.email).then(()=>{zt(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function F(){l?cn("You have unsaved changes. Do you really want to discard them?",()=>{N()}):N()}async function N(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const we=(u==null?void 0:u.schema)||[];for(const nt of we)nt.type==="file"&&delete ie[nt.name]}T(ie),await sn(),t(20,k="")}const R=()=>C(),K=()=>I(),Q=()=>L(),U=()=>F(),X=()=>D(),ne=()=>t(10,y=Gi),J=()=>t(10,y=yl);function ue(ie){d=ie,t(2,d)}function Z(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function de(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ge(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ce(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ne(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Re(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function be(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Se(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function We(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function lt(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ce(ie,we){n.$$.not_equal(_[we.name],ie)&&(_[we.name]=ie,t(3,_))}function He(ie,we){n.$$.not_equal(v[we.name],ie)&&(v[we.name]=ie,t(4,v))}function te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}const Fe=()=>l&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),C()}),!1):(Bn({}),!0);function ot(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Vt(ie){ze.call(this,n,ie)}function Ae(ie){ze.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((ie=u==null?void 0:u.schema)!=null&&ie.find(we=>we.type==="editor"))),n.$$.dirty[0]&24&&t(21,s=H.hasNonEmptyProps(_)||H.hasNonEmptyProps(v)),n.$$.dirty[0]&3145732&&t(5,l=s||k!=xp(d)),n.$$.dirty[0]&36&&t(11,o=d.isNew||l)},[u,C,d,_,v,l,f,c,m,h,y,o,i,a,$,D,I,L,F,T,k,s,R,K,Q,U,X,ne,J,ue,Z,de,ge,Ce,Ne,Re,be,Se,We,lt,ce,He,te,Fe,ot,Vt,Ae]}class Vb extends ye{constructor(e){super(),ve(this,e,Z5,J5,he,{collection:0,show:19,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function G5(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class",t=n[2]?n[1]:n[0])},m(o,r){S(o,e,r),s||(l=[Ie(i=Ue.call(null,e,n[2]?"":"Copy")),Y(e,"click",kn(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&Bt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:G,o:G,d(o){o&&w(e),s=!1,Pe(l)}}}function X5(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(H.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Zt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,s=u.idleClasses),"successClasses"in u&&t(1,l=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[s,l,r,a,i,o]}class Qo extends ye{constructor(e){super(),ve(this,e,X5,G5,he,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function em(n,e,t){const i=n.slice();return i[16]=e[t],i[8]=t,i}function tm(n,e,t){const i=n.slice();return i[13]=e[t],i}function nm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function im(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Q5(n){const e=n.slice(),t=H.toArray(e[3]);e[9]=t;const i=H.toArray(e[0].expand[e[1].name]);e[10]=i;const s=e[2]?20:200;return e[11]=s,e}function x5(n){const e=n.slice(),t=JSON.stringify(e[3])||"";return e[5]=t,e}function eO(n){let e,t;return{c(){e=b("div"),t=B(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){S(i,e,s),g(e,t)},p(i,s){s&8&&le(t,i[3])},i:G,o:G,d(i){i&&w(e)}}}function tO(n){let e,t=H.truncate(n[3])+"",i,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=H.truncate(n[3]))},m(l,o){S(l,e,o),g(e,i)},p(l,o){o&8&&t!==(t=H.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=H.truncate(l[3]))&&p(e,"title",s)},i:G,o:G,d(l){l&&w(e)}}}function nO(n){let e,t=[],i=new Map,s,l=H.toArray(n[3]);const o=r=>r[8]+r[16];for(let r=0;rn[11]&&rm();return{c(){e=b("div"),i.c(),s=O(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){S(f,e,c),r[t].m(e,null),g(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),P(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),E(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=rm(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(E(i),l=!0)},o(f){P(i),l=!1},d(f){f&&w(e),r[t].d(),u&&u.d()}}}function sO(n){let e,t=[],i=new Map,s=H.toArray(n[3]);const l=o=>o[8]+o[6];for(let o=0;o{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function rO(n){let e,t=H.truncate(n[3])+"",i,s,l;return{c(){e=b("a"),i=B(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){S(o,e,r),g(e,i),s||(l=[Ie(Ue.call(null,e,"Open in new tab")),Y(e,"click",kn(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=H.truncate(o[3])+"")&&le(i,t),r&8&&p(e,"href",o[3])},i:G,o:G,d(o){o&&w(e),s=!1,Pe(l)}}}function aO(n){let e,t;return{c(){e=b("span"),t=B(n[3]),p(e,"class","txt")},m(i,s){S(i,e,s),g(e,t)},p(i,s){s&8&&le(t,i[3])},i:G,o:G,d(i){i&&w(e)}}}function uO(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function fO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function cO(n){let e,t,i,s;const l=[gO,_O],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=$e()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),P(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function sm(n,e){let t,i,s;return i=new su({props:{record:e[0],filename:e[16],size:"sm"}}),{key:n,first:null,c(){t=$e(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&8&&(r.filename=e[16]),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function dO(n){let e,t=n[9].slice(0,n[11]),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&um(n);return{c(){e=b("span"),i=B(t),s=O(),r&&r.c(),l=$e(),p(e,"class","txt")},m(a,u){S(a,e,u),g(e,i),S(a,s,u),r&&r.m(a,u),S(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=H.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,u),u&8&&E(r,1)):(r=um(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){o||(E(r),o=!0)},o(a){P(r),o=!1},d(a){a&&w(e),a&&w(s),r&&r.d(a),a&&w(l)}}}function gO(n){let e,t=H.truncate(n[5])+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=H.truncate(s[5])+"")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function um(n){let e,t;return e=new Qo({props:{value:JSON.stringify(n[3],null,2)}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function bO(n){let e,t,i,s,l;const o=[cO,fO,uO,aO,rO,oO,lO,sO,iO,nO,tO,eO],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!H.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===0?x5(f):c===8?Q5(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=$e()},m(f,c){r[t].m(f,c),S(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(re(),P(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),E(i,1),i.m(s.parentNode,s))},i(f){l||(E(i),l=!0)},o(f){P(i),l=!1},d(f){r[t].d(f),f&&w(s)}}}function vO(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){ze.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,s=a.record),"field"in a&&t(1,l=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s[l.name])},[s,l,o,i,r]}class Hb extends ye{constructor(e){super(),ve(this,e,vO,bO,he,{record:0,field:1,short:2})}}function fm(n,e,t){const i=n.slice();return i[10]=e[t],i}function cm(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new Hb({props:{field:n[10],record:n[3]}}),{c(){e=b("tr"),t=b("td"),s=B(i),l=O(),o=b("td"),V(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){S(u,e,f),g(e,t),g(t,s),g(e,l),g(e,o),q(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&le(s,i);const c={};f&1&&(c.field=u[10]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(E(r.$$.fragment,u),a=!0)},o(u){P(r.$$.fragment,u),a=!1},d(u){u&&w(e),j(r)}}}function dm(n){let e,t,i,s,l,o;return l=new ui({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=O(),s=b("td"),V(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),q(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(E(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function pm(n){let e,t,i,s,l,o;return l=new ui({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=O(),s=b("td"),V(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),q(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(E(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function yO(n){var $;let e,t,i,s,l,o,r,a,u,f,c=n[3].id+"",d,m,h,_,v;a=new Qo({props:{value:n[3].id}});let k=($=n[0])==null?void 0:$.schema,y=[];for(let D=0;DP(y[D],1,1,()=>{y[D]=null});let C=n[3].created&&dm(n),M=n[3].updated&&pm(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),s=b("td"),s.textContent="id",l=O(),o=b("td"),r=b("div"),V(a.$$.fragment),u=O(),f=b("span"),d=B(c),m=O();for(let D=0;D{C=null}),ae()),D[3].updated?M?(M.p(D,A),A&8&&E(M,1)):(M=pm(D),M.c(),E(M,1),M.m(t,null)):M&&(re(),P(M,1,1,()=>{M=null}),ae())},i(D){if(!v){E(a.$$.fragment,D);for(let A=0;AClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[6]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function SO(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[wO],header:[kO],default:[yO]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="record-preview-panel "+(s[4]?"overlay-panel-xl":"overlay-panel-lg")),l&8201&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[7](null),j(e,s)}}}function TO(n,e,t){let i,{collection:s}=e,l,o=new Ti;function r(m){return t(3,o=m),l==null?void 0:l.show()}function a(){return l==null?void 0:l.hide()}const u=()=>a();function f(m){se[m?"unshift":"push"](()=>{l=m,t(2,l)})}function c(m){ze.call(this,n,m)}function d(m){ze.call(this,n,m)}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{var m;n.$$.dirty&1&&t(4,i=!!((m=s==null?void 0:s.schema)!=null&&m.find(h=>h.type==="editor")))},[s,a,l,o,i,r,u,f,c,d]}class CO extends ye{constructor(e){super(),ve(this,e,TO,SO,he,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function mm(n,e,t){const i=n.slice();return i[55]=e[t],i}function hm(n,e,t){const i=n.slice();return i[58]=e[t],i}function _m(n,e,t){const i=n.slice();return i[58]=e[t],i}function gm(n,e,t){const i=n.slice();return i[51]=e[t],i}function bm(n){let e;function t(l,o){return l[12]?MO:$O}let i=t(n),s=i(n);return{c(){e=b("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){S(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&w(e),s.d()}}}function $O(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),t=b("input"),s=O(),l=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[4].length,t.checked=n[16],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){S(a,e,u),g(e,t),g(e,s),g(e,l),o||(r=Y(t,"change",n[28]),o=!0)},p(a,u){u[0]&16&&i!==(i=!a[4].length)&&(t.disabled=i),u[0]&65536&&(t.checked=a[16])},d(a){a&&w(e),o=!1,r()}}}function MO(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function vm(n){let e,t,i;function s(o){n[29](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[OO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function OO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="id",p(t,"class",H.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function ym(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l,o=e&&km(n),r=i&&wm(n);return{c(){o&&o.c(),t=O(),r&&r.c(),s=$e()},m(a,u){o&&o.m(a,u),S(a,t,u),r&&r.m(a,u),S(a,s,u),l=!0},p(a,u){u[0]&128&&(e=!a[7].includes("@username")),e?o?(o.p(a,u),u[0]&128&&E(o,1)):(o=km(a),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(re(),P(o,1,1,()=>{o=null}),ae()),u[0]&128&&(i=!a[7].includes("@email")),i?r?(r.p(a,u),u[0]&128&&E(r,1)):(r=wm(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){l||(E(o),E(r),l=!0)},o(a){P(o),P(r),l=!1},d(a){o&&o.d(a),a&&w(t),r&&r.d(a),a&&w(s)}}}function km(n){let e,t,i;function s(o){n[30](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[DO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function DO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="username",p(t,"class",H.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function wm(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[EO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function EO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="email",p(t,"class",H.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function AO(n){let e,t,i,s,l,o=n[58].name+"",r;return{c(){e=b("div"),t=b("i"),s=O(),l=b("span"),r=B(o),p(t,"class",i=H.getFieldTypeIcon(n[58].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){S(a,e,u),g(e,t),g(e,s),g(e,l),g(l,r)},p(a,u){u[0]&262144&&i!==(i=H.getFieldTypeIcon(a[58].type))&&p(t,"class",i),u[0]&262144&&o!==(o=a[58].name+"")&&le(r,o)},d(a){a&&w(e)}}}function Sm(n,e){let t,i,s,l;function o(a){e[32](a)}let r={class:"col-type-"+e[58].type+" col-field-"+e[58].name,name:e[58].name,$$slots:{default:[AO]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Wt({props:r}),se.push(()=>_e(i,"sort",o)),{key:n,first:null,c(){t=$e(),V(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&262144&&(f.class="col-type-"+e[58].type+" col-field-"+e[58].name),u[0]&262144&&(f.name=e[58].name),u[0]&262144|u[2]&2&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],ke(()=>s=!1)),i.$set(f)},i(a){l||(E(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(t),j(i,a)}}}function Tm(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[IO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function IO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class",H.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Cm(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[PO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function PO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="updated",p(t,"class",H.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function $m(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){S(t,e,i),n[35](e)},p:G,d(t){t&&w(e),n[35](null)}}}function Mm(n){let e;function t(l,o){return l[12]?NO:LO}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function LO(n){let e,t,i,s,l;function o(u,f){var c,d;if((c=u[1])!=null&&c.length)return RO;if(!((d=u[2])!=null&&d.isView))return FO}let r=o(n),a=r&&r(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",s=O(),a&&a.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(u,f){S(u,e,f),g(e,t),g(t,i),g(t,s),a&&a.m(t,null),g(e,l)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a&&a.d(1),a=r&&r(u),a&&(a.c(),a.m(t,null)))},d(u){u&&w(e),a&&a.d()}}}function NO(n){let e;return{c(){e=b("tr"),e.innerHTML=` + `),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const Gi="form",yl="providers";function xp(n){return JSON.stringify(n)}function Z5(n,e,t){let i,s,l,o;const r=$t(),a="record_"+H.randomString(5);let{collection:u}=e,f,c=null,d=new Ti,m=!1,h=!1,_={},v={},k="",y=Gi;function T(ie){return M(ie),t(9,h=!0),t(10,y=Gi),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function M(ie){Bn({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new Ti),t(3,_={}),t(4,v={}),await sn(),t(20,k=xp(d))}function $(){if(m||!o||!(u!=null&&u.id))return;t(8,m=!0);const ie=A();let we;d.isNew?we=pe.collection(u.id).create(ie):we=pe.collection(u.id).update(d.id,ie),we.then(nt=>{zt(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),C(),r("save",nt)}).catch(nt=>{pe.errorResponseHandler(nt)}).finally(()=>{t(8,m=!1)})}function D(){c!=null&&c.id&&cn("Do you really want to delete the selected record?",()=>pe.collection(c.collectionId).delete(c.id).then(()=>{C(),zt("Successfully deleted record."),r("delete",c)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function A(){const ie=(d==null?void 0:d.export())||{},we=new FormData,nt={};for(const et of(u==null?void 0:u.schema)||[])nt[et.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const et in ie)nt[et]&&(typeof ie[et]>"u"&&(ie[et]=null),H.addValueToFormData(we,et,ie[et]));for(const et in _){const bt=H.toArray(_[et]);for(const Gt of bt)we.append(et,Gt)}for(const et in v){const bt=H.toArray(v[et]);for(const Gt of bt)we.append(et+"."+Gt,"")}return we}function I(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent verification email to ${c.email}?`,()=>pe.collection(u.id).requestVerification(c.email).then(()=>{zt(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent password reset email to ${c.email}?`,()=>pe.collection(u.id).requestPasswordReset(c.email).then(()=>{zt(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{pe.errorResponseHandler(ie)}))}function F(){l?cn("You have unsaved changes. Do you really want to discard them?",()=>{N()}):N()}async function N(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const we=(u==null?void 0:u.schema)||[];for(const nt of we)nt.type==="file"&&delete ie[nt.name]}T(ie),await sn(),t(20,k="")}const R=()=>C(),K=()=>I(),Q=()=>L(),U=()=>F(),X=()=>D(),ne=()=>t(10,y=Gi),J=()=>t(10,y=yl);function ue(ie){d=ie,t(2,d)}function Z(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function de(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ge(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ce(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ne(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Re(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function be(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Se(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function We(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function lt(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ce(ie,we){n.$$.not_equal(_[we.name],ie)&&(_[we.name]=ie,t(3,_))}function He(ie,we){n.$$.not_equal(v[we.name],ie)&&(v[we.name]=ie,t(4,v))}function te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}const Fe=()=>l&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),C()}),!1):(Bn({}),!0);function ot(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Vt(ie){ze.call(this,n,ie)}function Ae(ie){ze.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((ie=u==null?void 0:u.schema)!=null&&ie.find(we=>we.type==="editor"))),n.$$.dirty[0]&24&&t(21,s=H.hasNonEmptyProps(_)||H.hasNonEmptyProps(v)),n.$$.dirty[0]&3145732&&t(5,l=s||k!=xp(d)),n.$$.dirty[0]&36&&t(11,o=d.isNew||l)},[u,C,d,_,v,l,f,c,m,h,y,o,i,a,$,D,I,L,F,T,k,s,R,K,Q,U,X,ne,J,ue,Z,de,ge,Ce,Ne,Re,be,Se,We,lt,ce,He,te,Fe,ot,Vt,Ae]}class V1 extends ye{constructor(e){super(),ve(this,e,Z5,J5,he,{collection:0,show:19,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function G5(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class",t=n[2]?n[1]:n[0])},m(o,r){S(o,e,r),s||(l=[Ie(i=Ue.call(null,e,n[2]?"":"Copy")),Y(e,"click",kn(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&Bt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:G,o:G,d(o){o&&w(e),s=!1,Pe(l)}}}function X5(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(H.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Zt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,s=u.idleClasses),"successClasses"in u&&t(1,l=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[s,l,r,a,i,o]}class Qo extends ye{constructor(e){super(),ve(this,e,X5,G5,he,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function em(n,e,t){const i=n.slice();return i[16]=e[t],i[8]=t,i}function tm(n,e,t){const i=n.slice();return i[13]=e[t],i}function nm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function im(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Q5(n){const e=n.slice(),t=H.toArray(e[3]);e[9]=t;const i=H.toArray(e[0].expand[e[1].name]);e[10]=i;const s=e[2]?20:200;return e[11]=s,e}function x5(n){const e=n.slice(),t=JSON.stringify(e[3])||"";return e[5]=t,e}function eO(n){let e,t;return{c(){e=b("div"),t=B(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){S(i,e,s),g(e,t)},p(i,s){s&8&&le(t,i[3])},i:G,o:G,d(i){i&&w(e)}}}function tO(n){let e,t=H.truncate(n[3])+"",i,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=H.truncate(n[3]))},m(l,o){S(l,e,o),g(e,i)},p(l,o){o&8&&t!==(t=H.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=H.truncate(l[3]))&&p(e,"title",s)},i:G,o:G,d(l){l&&w(e)}}}function nO(n){let e,t=[],i=new Map,s,l=H.toArray(n[3]);const o=r=>r[8]+r[16];for(let r=0;rn[11]&&rm();return{c(){e=b("div"),i.c(),s=O(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){S(f,e,c),r[t].m(e,null),g(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),P(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),E(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=rm(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(E(i),l=!0)},o(f){P(i),l=!1},d(f){f&&w(e),r[t].d(),u&&u.d()}}}function sO(n){let e,t=[],i=new Map,s=H.toArray(n[3]);const l=o=>o[8]+o[6];for(let o=0;o{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function rO(n){let e,t=H.truncate(n[3])+"",i,s,l;return{c(){e=b("a"),i=B(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){S(o,e,r),g(e,i),s||(l=[Ie(Ue.call(null,e,"Open in new tab")),Y(e,"click",kn(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=H.truncate(o[3])+"")&&le(i,t),r&8&&p(e,"href",o[3])},i:G,o:G,d(o){o&&w(e),s=!1,Pe(l)}}}function aO(n){let e,t;return{c(){e=b("span"),t=B(n[3]),p(e,"class","txt")},m(i,s){S(i,e,s),g(e,t)},p(i,s){s&8&&le(t,i[3])},i:G,o:G,d(i){i&&w(e)}}}function uO(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function fO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function cO(n){let e,t,i,s;const l=[gO,_O],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=$e()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),P(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function sm(n,e){let t,i,s;return i=new su({props:{record:e[0],filename:e[16],size:"sm"}}),{key:n,first:null,c(){t=$e(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&8&&(r.filename=e[16]),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function dO(n){let e,t=n[9].slice(0,n[11]),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&um(n);return{c(){e=b("span"),i=B(t),s=O(),r&&r.c(),l=$e(),p(e,"class","txt")},m(a,u){S(a,e,u),g(e,i),S(a,s,u),r&&r.m(a,u),S(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=H.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,u),u&8&&E(r,1)):(r=um(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){o||(E(r),o=!0)},o(a){P(r),o=!1},d(a){a&&w(e),a&&w(s),r&&r.d(a),a&&w(l)}}}function gO(n){let e,t=H.truncate(n[5])+"",i;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=H.truncate(s[5])+"")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function um(n){let e,t;return e=new Qo({props:{value:JSON.stringify(n[3],null,2)}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function bO(n){let e,t,i,s,l;const o=[cO,fO,uO,aO,rO,oO,lO,sO,iO,nO,tO,eO],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!H.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===0?x5(f):c===8?Q5(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=$e()},m(f,c){r[t].m(f,c),S(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(re(),P(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),E(i,1),i.m(s.parentNode,s))},i(f){l||(E(i),l=!0)},o(f){P(i),l=!1},d(f){r[t].d(f),f&&w(s)}}}function vO(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){ze.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,s=a.record),"field"in a&&t(1,l=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s[l.name])},[s,l,o,i,r]}class H1 extends ye{constructor(e){super(),ve(this,e,vO,bO,he,{record:0,field:1,short:2})}}function fm(n,e,t){const i=n.slice();return i[10]=e[t],i}function cm(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new H1({props:{field:n[10],record:n[3]}}),{c(){e=b("tr"),t=b("td"),s=B(i),l=O(),o=b("td"),V(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){S(u,e,f),g(e,t),g(t,s),g(e,l),g(e,o),q(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&le(s,i);const c={};f&1&&(c.field=u[10]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(E(r.$$.fragment,u),a=!0)},o(u){P(r.$$.fragment,u),a=!1},d(u){u&&w(e),j(r)}}}function dm(n){let e,t,i,s,l,o;return l=new ui({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=O(),s=b("td"),V(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),q(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(E(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function pm(n){let e,t,i,s,l,o;return l=new ui({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=O(),s=b("td"),V(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),q(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(E(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function yO(n){var $;let e,t,i,s,l,o,r,a,u,f,c=n[3].id+"",d,m,h,_,v;a=new Qo({props:{value:n[3].id}});let k=($=n[0])==null?void 0:$.schema,y=[];for(let D=0;DP(y[D],1,1,()=>{y[D]=null});let C=n[3].created&&dm(n),M=n[3].updated&&pm(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),s=b("td"),s.textContent="id",l=O(),o=b("td"),r=b("div"),V(a.$$.fragment),u=O(),f=b("span"),d=B(c),m=O();for(let D=0;D{C=null}),ae()),D[3].updated?M?(M.p(D,A),A&8&&E(M,1)):(M=pm(D),M.c(),E(M,1),M.m(t,null)):M&&(re(),P(M,1,1,()=>{M=null}),ae())},i(D){if(!v){E(a.$$.fragment,D);for(let A=0;AClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[6]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function SO(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[wO],header:[kO],default:[yO]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="record-preview-panel "+(s[4]?"overlay-panel-xl":"overlay-panel-lg")),l&8201&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[7](null),j(e,s)}}}function TO(n,e,t){let i,{collection:s}=e,l,o=new Ti;function r(m){return t(3,o=m),l==null?void 0:l.show()}function a(){return l==null?void 0:l.hide()}const u=()=>a();function f(m){se[m?"unshift":"push"](()=>{l=m,t(2,l)})}function c(m){ze.call(this,n,m)}function d(m){ze.call(this,n,m)}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{var m;n.$$.dirty&1&&t(4,i=!!((m=s==null?void 0:s.schema)!=null&&m.find(h=>h.type==="editor")))},[s,a,l,o,i,r,u,f,c,d]}class CO extends ye{constructor(e){super(),ve(this,e,TO,SO,he,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function mm(n,e,t){const i=n.slice();return i[55]=e[t],i}function hm(n,e,t){const i=n.slice();return i[58]=e[t],i}function _m(n,e,t){const i=n.slice();return i[58]=e[t],i}function gm(n,e,t){const i=n.slice();return i[51]=e[t],i}function bm(n){let e;function t(l,o){return l[12]?MO:$O}let i=t(n),s=i(n);return{c(){e=b("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){S(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&w(e),s.d()}}}function $O(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),t=b("input"),s=O(),l=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[4].length,t.checked=n[16],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){S(a,e,u),g(e,t),g(e,s),g(e,l),o||(r=Y(t,"change",n[28]),o=!0)},p(a,u){u[0]&16&&i!==(i=!a[4].length)&&(t.disabled=i),u[0]&65536&&(t.checked=a[16])},d(a){a&&w(e),o=!1,r()}}}function MO(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function vm(n){let e,t,i;function s(o){n[29](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[OO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function OO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="id",p(t,"class",H.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function ym(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l,o=e&&km(n),r=i&&wm(n);return{c(){o&&o.c(),t=O(),r&&r.c(),s=$e()},m(a,u){o&&o.m(a,u),S(a,t,u),r&&r.m(a,u),S(a,s,u),l=!0},p(a,u){u[0]&128&&(e=!a[7].includes("@username")),e?o?(o.p(a,u),u[0]&128&&E(o,1)):(o=km(a),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(re(),P(o,1,1,()=>{o=null}),ae()),u[0]&128&&(i=!a[7].includes("@email")),i?r?(r.p(a,u),u[0]&128&&E(r,1)):(r=wm(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){l||(E(o),E(r),l=!0)},o(a){P(o),P(r),l=!1},d(a){o&&o.d(a),a&&w(t),r&&r.d(a),a&&w(s)}}}function km(n){let e,t,i;function s(o){n[30](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[DO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function DO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="username",p(t,"class",H.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function wm(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[EO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function EO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="email",p(t,"class",H.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function AO(n){let e,t,i,s,l,o=n[58].name+"",r;return{c(){e=b("div"),t=b("i"),s=O(),l=b("span"),r=B(o),p(t,"class",i=H.getFieldTypeIcon(n[58].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){S(a,e,u),g(e,t),g(e,s),g(e,l),g(l,r)},p(a,u){u[0]&262144&&i!==(i=H.getFieldTypeIcon(a[58].type))&&p(t,"class",i),u[0]&262144&&o!==(o=a[58].name+"")&&le(r,o)},d(a){a&&w(e)}}}function Sm(n,e){let t,i,s,l;function o(a){e[32](a)}let r={class:"col-type-"+e[58].type+" col-field-"+e[58].name,name:e[58].name,$$slots:{default:[AO]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Wt({props:r}),se.push(()=>_e(i,"sort",o)),{key:n,first:null,c(){t=$e(),V(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&262144&&(f.class="col-type-"+e[58].type+" col-field-"+e[58].name),u[0]&262144&&(f.name=e[58].name),u[0]&262144|u[2]&2&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],ke(()=>s=!1)),i.$set(f)},i(a){l||(E(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(t),j(i,a)}}}function Tm(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[IO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function IO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="created",p(t,"class",H.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Cm(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[PO]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function PO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),s.textContent="updated",p(t,"class",H.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function $m(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){S(t,e,i),n[35](e)},p:G,d(t){t&&w(e),n[35](null)}}}function Mm(n){let e;function t(l,o){return l[12]?NO:LO}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function LO(n){let e,t,i,s,l;function o(u,f){var c,d;if((c=u[1])!=null&&c.length)return RO;if(!((d=u[2])!=null&&d.isView))return FO}let r=o(n),a=r&&r(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",s=O(),a&&a.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(u,f){S(u,e,f),g(e,t),g(t,i),g(t,s),a&&a.m(t,null),g(e,l)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a&&a.d(1),a=r&&r(u),a&&(a.c(),a.m(t,null)))},d(u){u&&w(e),a&&a.d()}}}function NO(n){let e;return{c(){e=b("tr"),e.innerHTML=` `},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function FO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` - New record`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[40]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function RO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[39]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Om(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=O(),r=b("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],p(r,"for",a="checkbox_"+n[55].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){S(d,e,m),g(e,t),g(t,i),g(t,o),g(t,r),u||(f=[Y(i,"change",c),Y(t,"click",kn(n[26]))],u=!0)},p(d,m){n=d,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&p(i,"id",s),m[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),m[0]&16&&a!==(a="checkbox_"+n[55].id)&&p(r,"for",a)},d(d){d&&w(e),u=!1,Pe(f)}}}function Dm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new Qo({props:{value:n[55].id}});let c=n[2].isAuth&&Em(n);return{c(){e=b("td"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),a=B(r),u=O(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){S(d,e,m),g(e,t),g(t,i),q(s,i,null),g(i,l),g(i,o),g(o,a),g(t,u),c&&c.m(t,null),f=!0},p(d,m){const h={};m[0]&16&&(h.value=d[55].id),s.$set(h),(!f||m[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,m):(c=Em(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(E(s.$$.fragment,d),f=!0)},o(d){P(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function Em(n){let e;function t(l,o){return l[55].verified?jO:qO}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function qO(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ie(Ue.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function jO(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ie(Ue.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Am(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Im(n),o=i&&Pm(n);return{c(){l&&l.c(),t=O(),o&&o.c(),s=$e()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Im(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Pm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Im(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].username)),t?HO:VO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function VO(n){let e,t=n[55].username+"",i,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].username)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&p(e,"title",s)},d(l){l&&w(e)}}}function HO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Pm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].email)),t?BO:zO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function zO(n){let e,t=n[55].email+"",i,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].email)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&p(e,"title",s)},d(l){l&&w(e)}}}function BO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Lm(n,e){let t,i,s,l;return i=new Hb({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=b("td"),V(i.$$.fragment),p(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){S(o,t,r),q(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&16&&(a.record=e[55]),r[0]&262144&&(a.field=e[58]),i.$set(a),(!l||r[0]&262144&&s!==(s="col-type-"+e[58].type+" col-field-"+e[58].name))&&p(t,"class",s)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&w(t),j(i)}}}function Nm(n){let e,t,i;return t=new ui({props:{date:n[55].created}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].created),t.$set(o)},i(s){i||(E(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Fm(n){let e,t,i;return t=new ui({props:{date:n[55].updated}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].updated),t.$set(o)},i(s){i||(E(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Rm(n,e){let t,i,s=!e[7].includes("@id"),l,o,r=[],a=new Map,u,f=e[10]&&!e[7].includes("@created"),c,d=e[9]&&!e[7].includes("@updated"),m,h,_,v,k,y,T=!e[2].isView&&Om(e),C=s&&Dm(e),M=e[2].isAuth&&Am(e),$=e[18];const D=N=>N[58].name;for(let N=0;N<$.length;N+=1){let R=hm(e,$,N),K=D(R);a.set(K,r[N]=Lm(K,R))}let A=f&&Nm(e),I=d&&Fm(e);function L(){return e[37](e[55])}function F(...N){return e[38](e[55],...N)}return{key:n,first:null,c(){t=b("tr"),T&&T.c(),i=O(),C&&C.c(),l=O(),M&&M.c(),o=O();for(let N=0;N',_=O(),p(h,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(N,R){S(N,t,R),T&&T.m(t,null),g(t,i),C&&C.m(t,null),g(t,l),M&&M.m(t,null),g(t,o);for(let K=0;K{C=null}),ae()),e[2].isAuth?M?M.p(e,R):(M=Am(e),M.c(),M.m(t,o)):M&&(M.d(1),M=null),R[0]&262160&&($=e[18],re(),r=wt(r,R,D,1,e,$,a,t,ln,Lm,u,hm),ae()),R[0]&1152&&(f=e[10]&&!e[7].includes("@created")),f?A?(A.p(e,R),R[0]&1152&&E(A,1)):(A=Nm(e),A.c(),E(A,1),A.m(t,c)):A&&(re(),P(A,1,1,()=>{A=null}),ae()),R[0]&640&&(d=e[9]&&!e[7].includes("@updated")),d?I?(I.p(e,R),R[0]&640&&E(I,1)):(I=Fm(e),I.c(),E(I,1),I.m(t,m)):I&&(re(),P(I,1,1,()=>{I=null}),ae())},i(N){if(!v){E(C);for(let R=0;R<$.length;R+=1)E(r[R]);E(A),E(I),v=!0}},o(N){P(C);for(let R=0;RU[58].name;for(let U=0;UU[2].isView?U[55]:U[55].id;for(let U=0;U{$=null}),ae()),U[2].isAuth?D?(D.p(U,X),X[0]&4&&E(D,1)):(D=ym(U),D.c(),E(D,1),D.m(i,r)):D&&(re(),P(D,1,1,()=>{D=null}),ae()),X[0]&262145&&(A=U[18],re(),a=wt(a,X,I,1,U,A,u,i,ln,Sm,f,_m),ae()),X[0]&1152&&(c=U[10]&&!U[7].includes("@created")),c?L?(L.p(U,X),X[0]&1152&&E(L,1)):(L=Tm(U),L.c(),E(L,1),L.m(i,d)):L&&(re(),P(L,1,1,()=>{L=null}),ae()),X[0]&640&&(m=U[9]&&!U[7].includes("@updated")),m?F?(F.p(U,X),X[0]&640&&E(F,1)):(F=Cm(U),F.c(),E(F,1),F.m(i,h)):F&&(re(),P(F,1,1,()=>{F=null}),ae()),U[15].length?N?N.p(U,X):(N=$m(U),N.c(),N.m(_,null)):N&&(N.d(1),N=null),X[0]&4986582&&(R=U[4],re(),y=wt(y,X,K,1,U,R,T,k,ln,Rm,null,mm),ae(),!R.length&&Q?Q.p(U,X):R.length?Q&&(Q.d(1),Q=null):(Q=Mm(U),Q.c(),Q.m(k,null))),(!C||X[0]&4096)&&x(e,"table-loading",U[12])},i(U){if(!C){E($),E(D);for(let X=0;X({54:l}),({uniqueId:l})=>[0,l?8388608:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=$e(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&32896|o[1]&8388608|o[2]&2&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function YO(n){let e,t,i=[],s=new Map,l,o,r=n[15];const a=u=>u[51].id+u[51].name;for(let u=0;u{i=null}),ae())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Vm(n){let e,t,i=n[4].length+"",s,l,o;return{c(){e=b("small"),t=B("Showing "),s=B(i),l=B(" of "),o=B(n[5]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),g(e,t),g(e,s),g(e,l),g(e,o)},p(r,a){a[0]&16&&i!==(i=r[4].length+"")&&le(s,i),a[0]&32&&le(o,r[5])},d(r){r&&w(e)}}}function Hm(n){let e,t,i,s,l=n[5]-n[4].length+"",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),s=B("Load more ("),o=B(l),r=B(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[12]),x(t,"btn-disabled",n[12]),p(e,"class","block txt-center m-t-xs")},m(f,c){S(f,e,c),g(e,t),g(t,i),g(i,s),g(i,o),g(i,r),a||(u=Y(t,"click",n[41]),a=!0)},p(f,c){c[0]&48&&l!==(l=f[5]-f[4].length+"")&&le(o,l),c[0]&4096&&x(t,"btn-loading",f[12]),c[0]&4096&&x(t,"btn-disabled",f[12])},d(f){f&&w(e),a=!1,u()}}}function zm(n){let e,t,i,s,l,o,r=n[8]===1?"record":"records",a,u,f,c,d,m,h,_,v,k,y;return{c(){e=b("div"),t=b("div"),i=B("Selected "),s=b("strong"),l=B(n[8]),o=O(),a=B(r),u=O(),f=b("button"),f.innerHTML='Reset',c=O(),d=b("div"),m=O(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[13]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[13]),x(h,"btn-disabled",n[13]),p(e,"class","bulkbar")},m(T,C){S(T,e,C),g(e,t),g(t,i),g(t,s),g(s,l),g(t,o),g(t,a),g(e,u),g(e,f),g(e,c),g(e,d),g(e,m),g(e,h),v=!0,k||(y=[Y(f,"click",n[42]),Y(h,"click",n[43])],k=!0)},p(T,C){(!v||C[0]&256)&&le(l,T[8]),(!v||C[0]&256)&&r!==(r=T[8]===1?"record":"records")&&le(a,r),(!v||C[0]&8192)&&x(f,"btn-disabled",T[13]),(!v||C[0]&8192)&&x(h,"btn-loading",T[13]),(!v||C[0]&8192)&&x(h,"btn-disabled",T[13])},i(T){v||(T&&xe(()=>{_||(_=je(e,An,{duration:150,y:5},!0)),_.run(1)}),v=!0)},o(T){T&&(_||(_=je(e,An,{duration:150,y:5},!1)),_.run(0)),v=!1},d(T){T&&w(e),T&&_&&_.end(),k=!1,Pe(y)}}}function JO(n){let e,t,i,s,l,o;e=new Aa({props:{class:"table-wrapper",$$slots:{before:[KO],default:[UO]},$$scope:{ctx:n}}});let r=n[4].length&&Vm(n),a=n[4].length&&n[17]&&Hm(n),u=n[8]&&zm(n);return{c(){V(e.$$.fragment),t=O(),r&&r.c(),i=O(),a&&a.c(),s=O(),u&&u.c(),l=$e()},m(f,c){q(e,f,c),S(f,t,c),r&&r.m(f,c),S(f,i,c),a&&a.m(f,c),S(f,s,c),u&&u.m(f,c),S(f,l,c),o=!0},p(f,c){const d={};c[0]&382679|c[2]&2&&(d.$$scope={dirty:c,ctx:f}),e.$set(d),f[4].length?r?r.p(f,c):(r=Vm(f),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),f[4].length&&f[17]?a?a.p(f,c):(a=Hm(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[8]?u?(u.p(f,c),c[0]&256&&E(u,1)):(u=zm(f),u.c(),E(u,1),u.m(l.parentNode,l)):u&&(re(),P(u,1,1,()=>{u=null}),ae())},i(f){o||(E(e.$$.fragment,f),E(u),o=!0)},o(f){P(e.$$.fragment,f),P(u),o=!1},d(f){j(e,f),f&&w(t),r&&r.d(f),f&&w(i),a&&a.d(f),f&&w(s),u&&u.d(f),f&&w(l)}}}const ZO=/^([\+\-])?(\w+)$/;function GO(n,e,t){let i,s,l,o,r,a,u,f;const c=$t();let{collection:d}=e,{sort:m=""}=e,{filter:h=""}=e,_=[],v=1,k=0,y={},T=!0,C=!1,M=0,$,D=[],A=[];function I(){d!=null&&d.id&&localStorage.setItem((d==null?void 0:d.id)+"@hiddenCollumns",JSON.stringify(D))}function L(){if(t(7,D=[]),!!(d!=null&&d.id))try{const ie=localStorage.getItem(d.id+"@hiddenCollumns");ie&&t(7,D=JSON.parse(ie)||[])}catch{}}async function F(){const ie=v;for(let we=1;we<=ie;we++)(we===1||o)&&await N(we,!1)}async function N(ie=1,we=!0){var Gt,di;if(!(d!=null&&d.id))return;t(12,T=!0);let nt=m;const et=nt.match(ZO),bt=et?s.find(ft=>ft.name===et[2]):null;if(et&&((di=(Gt=bt==null?void 0:bt.options)==null?void 0:Gt.displayFields)==null?void 0:di.length)>0){const ft=[];for(const Wn of bt.options.displayFields)ft.push((et[1]||"")+et[2]+"."+Wn);nt=ft.join(",")}return pe.collection(d.id).getList(ie,30,{sort:nt,filter:h,expand:s.map(ft=>ft.name).join(","),$cancelKey:"records_list"}).then(async ft=>{if(ie<=1&&R(),t(12,T=!1),t(11,v=ft.page),t(5,k=ft.totalItems),c("load",_.concat(ft.items)),we){const Wn=++M;for(;ft.items.length&&M==Wn;)t(4,_=_.concat(ft.items.splice(0,15))),await H.yieldToMain()}else t(4,_=_.concat(ft.items))}).catch(ft=>{ft!=null&&ft.isAbort||(t(12,T=!1),console.warn(ft),R(),pe.errorResponseHandler(ft,!1))})}function R(){t(4,_=[]),t(11,v=1),t(5,k=0),t(6,y={})}function K(){a?Q():U()}function Q(){t(6,y={})}function U(){for(const ie of _)t(6,y[ie.id]=ie,y);t(6,y)}function X(ie){y[ie.id]?delete y[ie.id]:t(6,y[ie.id]=ie,y),t(6,y)}function ne(){cn(`Do you really want to delete the selected ${r===1?"record":"records"}?`,J)}async function J(){if(C||!r||!(d!=null&&d.id))return;let ie=[];for(const we of Object.keys(y))ie.push(pe.collection(d.id).delete(we));return t(13,C=!0),Promise.all(ie).then(()=>{zt(`Successfully deleted the selected ${r===1?"record":"records"}.`),Q()}).catch(we=>{pe.errorResponseHandler(we)}).finally(()=>(t(13,C=!1),F()))}function ue(ie){ze.call(this,n,ie)}const Z=(ie,we)=>{we.target.checked?H.removeByValue(D,ie.id):H.pushUnique(D,ie.id),t(7,D)},de=()=>K();function ge(ie){m=ie,t(0,m)}function Ce(ie){m=ie,t(0,m)}function Ne(ie){m=ie,t(0,m)}function Re(ie){m=ie,t(0,m)}function be(ie){m=ie,t(0,m)}function Se(ie){m=ie,t(0,m)}function We(ie){se[ie?"unshift":"push"](()=>{$=ie,t(14,$)})}const lt=ie=>X(ie),ce=ie=>c("select",ie),He=(ie,we)=>{we.code==="Enter"&&(we.preventDefault(),c("select",ie))},te=()=>t(1,h=""),Fe=()=>c("new"),ot=()=>N(v+1),Vt=()=>Q(),Ae=()=>ne();return n.$$set=ie=>{"collection"in ie&&t(2,d=ie.collection),"sort"in ie&&t(0,m=ie.sort),"filter"in ie&&t(1,h=ie.filter)},n.$$.update=()=>{n.$$.dirty[0]&4&&d!=null&&d.id&&(L(),R()),n.$$.dirty[0]&4&&t(25,i=(d==null?void 0:d.schema)||[]),n.$$.dirty[0]&33554432&&(s=i.filter(ie=>ie.type==="relation")),n.$$.dirty[0]&33554560&&t(18,l=i.filter(ie=>!D.includes(ie.id))),n.$$.dirty[0]&7&&d!=null&&d.id&&m!==-1&&h!==-1&&N(1),n.$$.dirty[0]&48&&t(17,o=k>_.length),n.$$.dirty[0]&64&&t(8,r=Object.keys(y).length),n.$$.dirty[0]&272&&t(16,a=_.length&&r===_.length),n.$$.dirty[0]&128&&D!==-1&&I(),n.$$.dirty[0]&20&&t(10,u=!(d!=null&&d.isView)||_.length>0&&_[0].created!=""),n.$$.dirty[0]&20&&t(9,f=!(d!=null&&d.isView)||_.length>0&&_[0].updated!=""),n.$$.dirty[0]&33555972&&t(15,A=[].concat(d.isAuth?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],i.map(ie=>({id:ie.id,name:ie.name})),u?{id:"@created",name:"created"}:[],f?{id:"@updated",name:"updated"}:[]))},[m,h,d,N,_,k,y,D,r,f,u,v,T,C,$,A,a,o,l,c,K,Q,X,ne,F,i,ue,Z,de,ge,Ce,Ne,Re,be,Se,We,lt,ce,He,te,Fe,ot,Vt,Ae]}class XO extends ye{constructor(e){super(),ve(this,e,GO,JO,he,{collection:2,sort:0,filter:1,reloadLoadedPages:24,load:3},null,[-1,-1,-1])}get reloadLoadedPages(){return this.$$.ctx[24]}get load(){return this.$$.ctx[3]}}function QO(n){let e,t,i,s;return e=new o4({}),i=new wn({props:{$$slots:{default:[tD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&1527|o[1]&8&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function xO(n){let e,t;return e=new wn({props:{center:!0,$$slots:{default:[sD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1040|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function eD(n){let e,t;return e=new wn({props:{center:!0,$$slots:{default:[lD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Bm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){S(s,e,l),t||(i=[Ie(Ue.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[15])],t=!0)},p:G,d(s){s&&w(e),t=!1,Pe(i)}}}function Um(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` + New record`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[40]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function RO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[39]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Om(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=O(),r=b("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],p(r,"for",a="checkbox_"+n[55].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){S(d,e,m),g(e,t),g(t,i),g(t,o),g(t,r),u||(f=[Y(i,"change",c),Y(t,"click",kn(n[26]))],u=!0)},p(d,m){n=d,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&p(i,"id",s),m[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),m[0]&16&&a!==(a="checkbox_"+n[55].id)&&p(r,"for",a)},d(d){d&&w(e),u=!1,Pe(f)}}}function Dm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new Qo({props:{value:n[55].id}});let c=n[2].isAuth&&Em(n);return{c(){e=b("td"),t=b("div"),i=b("div"),V(s.$$.fragment),l=O(),o=b("div"),a=B(r),u=O(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){S(d,e,m),g(e,t),g(t,i),q(s,i,null),g(i,l),g(i,o),g(o,a),g(t,u),c&&c.m(t,null),f=!0},p(d,m){const h={};m[0]&16&&(h.value=d[55].id),s.$set(h),(!f||m[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,m):(c=Em(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(E(s.$$.fragment,d),f=!0)},o(d){P(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function Em(n){let e;function t(l,o){return l[55].verified?jO:qO}let i=t(n),s=i(n);return{c(){s.c(),e=$e()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function qO(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ie(Ue.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function jO(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ie(Ue.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Am(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Im(n),o=i&&Pm(n);return{c(){l&&l.c(),t=O(),o&&o.c(),s=$e()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Im(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Pm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Im(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].username)),t?HO:VO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function VO(n){let e,t=n[55].username+"",i,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].username)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&p(e,"title",s)},d(l){l&&w(e)}}}function HO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Pm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].email)),t?BO:zO}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function zO(n){let e,t=n[55].email+"",i,s;return{c(){e=b("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].email)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&p(e,"title",s)},d(l){l&&w(e)}}}function BO(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Lm(n,e){let t,i,s,l;return i=new H1({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=b("td"),V(i.$$.fragment),p(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){S(o,t,r),q(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&16&&(a.record=e[55]),r[0]&262144&&(a.field=e[58]),i.$set(a),(!l||r[0]&262144&&s!==(s="col-type-"+e[58].type+" col-field-"+e[58].name))&&p(t,"class",s)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&w(t),j(i)}}}function Nm(n){let e,t,i;return t=new ui({props:{date:n[55].created}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].created),t.$set(o)},i(s){i||(E(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Fm(n){let e,t,i;return t=new ui({props:{date:n[55].updated}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].updated),t.$set(o)},i(s){i||(E(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Rm(n,e){let t,i,s=!e[7].includes("@id"),l,o,r=[],a=new Map,u,f=e[10]&&!e[7].includes("@created"),c,d=e[9]&&!e[7].includes("@updated"),m,h,_,v,k,y,T=!e[2].isView&&Om(e),C=s&&Dm(e),M=e[2].isAuth&&Am(e),$=e[18];const D=N=>N[58].name;for(let N=0;N<$.length;N+=1){let R=hm(e,$,N),K=D(R);a.set(K,r[N]=Lm(K,R))}let A=f&&Nm(e),I=d&&Fm(e);function L(){return e[37](e[55])}function F(...N){return e[38](e[55],...N)}return{key:n,first:null,c(){t=b("tr"),T&&T.c(),i=O(),C&&C.c(),l=O(),M&&M.c(),o=O();for(let N=0;N',_=O(),p(h,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(N,R){S(N,t,R),T&&T.m(t,null),g(t,i),C&&C.m(t,null),g(t,l),M&&M.m(t,null),g(t,o);for(let K=0;K{C=null}),ae()),e[2].isAuth?M?M.p(e,R):(M=Am(e),M.c(),M.m(t,o)):M&&(M.d(1),M=null),R[0]&262160&&($=e[18],re(),r=wt(r,R,D,1,e,$,a,t,ln,Lm,u,hm),ae()),R[0]&1152&&(f=e[10]&&!e[7].includes("@created")),f?A?(A.p(e,R),R[0]&1152&&E(A,1)):(A=Nm(e),A.c(),E(A,1),A.m(t,c)):A&&(re(),P(A,1,1,()=>{A=null}),ae()),R[0]&640&&(d=e[9]&&!e[7].includes("@updated")),d?I?(I.p(e,R),R[0]&640&&E(I,1)):(I=Fm(e),I.c(),E(I,1),I.m(t,m)):I&&(re(),P(I,1,1,()=>{I=null}),ae())},i(N){if(!v){E(C);for(let R=0;R<$.length;R+=1)E(r[R]);E(A),E(I),v=!0}},o(N){P(C);for(let R=0;RU[58].name;for(let U=0;UU[2].isView?U[55]:U[55].id;for(let U=0;U{$=null}),ae()),U[2].isAuth?D?(D.p(U,X),X[0]&4&&E(D,1)):(D=ym(U),D.c(),E(D,1),D.m(i,r)):D&&(re(),P(D,1,1,()=>{D=null}),ae()),X[0]&262145&&(A=U[18],re(),a=wt(a,X,I,1,U,A,u,i,ln,Sm,f,_m),ae()),X[0]&1152&&(c=U[10]&&!U[7].includes("@created")),c?L?(L.p(U,X),X[0]&1152&&E(L,1)):(L=Tm(U),L.c(),E(L,1),L.m(i,d)):L&&(re(),P(L,1,1,()=>{L=null}),ae()),X[0]&640&&(m=U[9]&&!U[7].includes("@updated")),m?F?(F.p(U,X),X[0]&640&&E(F,1)):(F=Cm(U),F.c(),E(F,1),F.m(i,h)):F&&(re(),P(F,1,1,()=>{F=null}),ae()),U[15].length?N?N.p(U,X):(N=$m(U),N.c(),N.m(_,null)):N&&(N.d(1),N=null),X[0]&4986582&&(R=U[4],re(),y=wt(y,X,K,1,U,R,T,k,ln,Rm,null,mm),ae(),!R.length&&Q?Q.p(U,X):R.length?Q&&(Q.d(1),Q=null):(Q=Mm(U),Q.c(),Q.m(k,null))),(!C||X[0]&4096)&&x(e,"table-loading",U[12])},i(U){if(!C){E($),E(D);for(let X=0;X({54:l}),({uniqueId:l})=>[0,l?8388608:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=$e(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&32896|o[1]&8388608|o[2]&2&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function YO(n){let e,t,i=[],s=new Map,l,o,r=n[15];const a=u=>u[51].id+u[51].name;for(let u=0;u{i=null}),ae())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Vm(n){let e,t,i=n[4].length+"",s,l,o;return{c(){e=b("small"),t=B("Showing "),s=B(i),l=B(" of "),o=B(n[5]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),g(e,t),g(e,s),g(e,l),g(e,o)},p(r,a){a[0]&16&&i!==(i=r[4].length+"")&&le(s,i),a[0]&32&&le(o,r[5])},d(r){r&&w(e)}}}function Hm(n){let e,t,i,s,l=n[5]-n[4].length+"",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),s=B("Load more ("),o=B(l),r=B(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[12]),x(t,"btn-disabled",n[12]),p(e,"class","block txt-center m-t-xs")},m(f,c){S(f,e,c),g(e,t),g(t,i),g(i,s),g(i,o),g(i,r),a||(u=Y(t,"click",n[41]),a=!0)},p(f,c){c[0]&48&&l!==(l=f[5]-f[4].length+"")&&le(o,l),c[0]&4096&&x(t,"btn-loading",f[12]),c[0]&4096&&x(t,"btn-disabled",f[12])},d(f){f&&w(e),a=!1,u()}}}function zm(n){let e,t,i,s,l,o,r=n[8]===1?"record":"records",a,u,f,c,d,m,h,_,v,k,y;return{c(){e=b("div"),t=b("div"),i=B("Selected "),s=b("strong"),l=B(n[8]),o=O(),a=B(r),u=O(),f=b("button"),f.innerHTML='Reset',c=O(),d=b("div"),m=O(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[13]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[13]),x(h,"btn-disabled",n[13]),p(e,"class","bulkbar")},m(T,C){S(T,e,C),g(e,t),g(t,i),g(t,s),g(s,l),g(t,o),g(t,a),g(e,u),g(e,f),g(e,c),g(e,d),g(e,m),g(e,h),v=!0,k||(y=[Y(f,"click",n[42]),Y(h,"click",n[43])],k=!0)},p(T,C){(!v||C[0]&256)&&le(l,T[8]),(!v||C[0]&256)&&r!==(r=T[8]===1?"record":"records")&&le(a,r),(!v||C[0]&8192)&&x(f,"btn-disabled",T[13]),(!v||C[0]&8192)&&x(h,"btn-loading",T[13]),(!v||C[0]&8192)&&x(h,"btn-disabled",T[13])},i(T){v||(T&&xe(()=>{_||(_=je(e,An,{duration:150,y:5},!0)),_.run(1)}),v=!0)},o(T){T&&(_||(_=je(e,An,{duration:150,y:5},!1)),_.run(0)),v=!1},d(T){T&&w(e),T&&_&&_.end(),k=!1,Pe(y)}}}function JO(n){let e,t,i,s,l,o;e=new Aa({props:{class:"table-wrapper",$$slots:{before:[KO],default:[UO]},$$scope:{ctx:n}}});let r=n[4].length&&Vm(n),a=n[4].length&&n[17]&&Hm(n),u=n[8]&&zm(n);return{c(){V(e.$$.fragment),t=O(),r&&r.c(),i=O(),a&&a.c(),s=O(),u&&u.c(),l=$e()},m(f,c){q(e,f,c),S(f,t,c),r&&r.m(f,c),S(f,i,c),a&&a.m(f,c),S(f,s,c),u&&u.m(f,c),S(f,l,c),o=!0},p(f,c){const d={};c[0]&382679|c[2]&2&&(d.$$scope={dirty:c,ctx:f}),e.$set(d),f[4].length?r?r.p(f,c):(r=Vm(f),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),f[4].length&&f[17]?a?a.p(f,c):(a=Hm(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[8]?u?(u.p(f,c),c[0]&256&&E(u,1)):(u=zm(f),u.c(),E(u,1),u.m(l.parentNode,l)):u&&(re(),P(u,1,1,()=>{u=null}),ae())},i(f){o||(E(e.$$.fragment,f),E(u),o=!0)},o(f){P(e.$$.fragment,f),P(u),o=!1},d(f){j(e,f),f&&w(t),r&&r.d(f),f&&w(i),a&&a.d(f),f&&w(s),u&&u.d(f),f&&w(l)}}}const ZO=/^([\+\-])?(\w+)$/;function GO(n,e,t){let i,s,l,o,r,a,u,f;const c=$t();let{collection:d}=e,{sort:m=""}=e,{filter:h=""}=e,_=[],v=1,k=0,y={},T=!0,C=!1,M=0,$,D=[],A=[];function I(){d!=null&&d.id&&localStorage.setItem((d==null?void 0:d.id)+"@hiddenCollumns",JSON.stringify(D))}function L(){if(t(7,D=[]),!!(d!=null&&d.id))try{const ie=localStorage.getItem(d.id+"@hiddenCollumns");ie&&t(7,D=JSON.parse(ie)||[])}catch{}}async function F(){const ie=v;for(let we=1;we<=ie;we++)(we===1||o)&&await N(we,!1)}async function N(ie=1,we=!0){var Gt,di;if(!(d!=null&&d.id))return;t(12,T=!0);let nt=m;const et=nt.match(ZO),bt=et?s.find(ft=>ft.name===et[2]):null;if(et&&((di=(Gt=bt==null?void 0:bt.options)==null?void 0:Gt.displayFields)==null?void 0:di.length)>0){const ft=[];for(const Wn of bt.options.displayFields)ft.push((et[1]||"")+et[2]+"."+Wn);nt=ft.join(",")}return pe.collection(d.id).getList(ie,30,{sort:nt,filter:h,expand:s.map(ft=>ft.name).join(","),$cancelKey:"records_list"}).then(async ft=>{if(ie<=1&&R(),t(12,T=!1),t(11,v=ft.page),t(5,k=ft.totalItems),c("load",_.concat(ft.items)),we){const Wn=++M;for(;ft.items.length&&M==Wn;)t(4,_=_.concat(ft.items.splice(0,15))),await H.yieldToMain()}else t(4,_=_.concat(ft.items))}).catch(ft=>{ft!=null&&ft.isAbort||(t(12,T=!1),console.warn(ft),R(),pe.errorResponseHandler(ft,!1))})}function R(){t(4,_=[]),t(11,v=1),t(5,k=0),t(6,y={})}function K(){a?Q():U()}function Q(){t(6,y={})}function U(){for(const ie of _)t(6,y[ie.id]=ie,y);t(6,y)}function X(ie){y[ie.id]?delete y[ie.id]:t(6,y[ie.id]=ie,y),t(6,y)}function ne(){cn(`Do you really want to delete the selected ${r===1?"record":"records"}?`,J)}async function J(){if(C||!r||!(d!=null&&d.id))return;let ie=[];for(const we of Object.keys(y))ie.push(pe.collection(d.id).delete(we));return t(13,C=!0),Promise.all(ie).then(()=>{zt(`Successfully deleted the selected ${r===1?"record":"records"}.`),Q()}).catch(we=>{pe.errorResponseHandler(we)}).finally(()=>(t(13,C=!1),F()))}function ue(ie){ze.call(this,n,ie)}const Z=(ie,we)=>{we.target.checked?H.removeByValue(D,ie.id):H.pushUnique(D,ie.id),t(7,D)},de=()=>K();function ge(ie){m=ie,t(0,m)}function Ce(ie){m=ie,t(0,m)}function Ne(ie){m=ie,t(0,m)}function Re(ie){m=ie,t(0,m)}function be(ie){m=ie,t(0,m)}function Se(ie){m=ie,t(0,m)}function We(ie){se[ie?"unshift":"push"](()=>{$=ie,t(14,$)})}const lt=ie=>X(ie),ce=ie=>c("select",ie),He=(ie,we)=>{we.code==="Enter"&&(we.preventDefault(),c("select",ie))},te=()=>t(1,h=""),Fe=()=>c("new"),ot=()=>N(v+1),Vt=()=>Q(),Ae=()=>ne();return n.$$set=ie=>{"collection"in ie&&t(2,d=ie.collection),"sort"in ie&&t(0,m=ie.sort),"filter"in ie&&t(1,h=ie.filter)},n.$$.update=()=>{n.$$.dirty[0]&4&&d!=null&&d.id&&(L(),R()),n.$$.dirty[0]&4&&t(25,i=(d==null?void 0:d.schema)||[]),n.$$.dirty[0]&33554432&&(s=i.filter(ie=>ie.type==="relation")),n.$$.dirty[0]&33554560&&t(18,l=i.filter(ie=>!D.includes(ie.id))),n.$$.dirty[0]&7&&d!=null&&d.id&&m!==-1&&h!==-1&&N(1),n.$$.dirty[0]&48&&t(17,o=k>_.length),n.$$.dirty[0]&64&&t(8,r=Object.keys(y).length),n.$$.dirty[0]&272&&t(16,a=_.length&&r===_.length),n.$$.dirty[0]&128&&D!==-1&&I(),n.$$.dirty[0]&20&&t(10,u=!(d!=null&&d.isView)||_.length>0&&_[0].created!=""),n.$$.dirty[0]&20&&t(9,f=!(d!=null&&d.isView)||_.length>0&&_[0].updated!=""),n.$$.dirty[0]&33555972&&t(15,A=[].concat(d.isAuth?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],i.map(ie=>({id:ie.id,name:ie.name})),u?{id:"@created",name:"created"}:[],f?{id:"@updated",name:"updated"}:[]))},[m,h,d,N,_,k,y,D,r,f,u,v,T,C,$,A,a,o,l,c,K,Q,X,ne,F,i,ue,Z,de,ge,Ce,Ne,Re,be,Se,We,lt,ce,He,te,Fe,ot,Vt,Ae]}class XO extends ye{constructor(e){super(),ve(this,e,GO,JO,he,{collection:2,sort:0,filter:1,reloadLoadedPages:24,load:3},null,[-1,-1,-1])}get reloadLoadedPages(){return this.$$.ctx[24]}get load(){return this.$$.ctx[3]}}function QO(n){let e,t,i,s;return e=new o4({}),i=new wn({props:{$$slots:{default:[tD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&1527|o[1]&8&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function xO(n){let e,t;return e=new wn({props:{center:!0,$$slots:{default:[sD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1040|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function eD(n){let e,t;return e=new wn({props:{center:!0,$$slots:{default:[lD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Bm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){S(s,e,l),t||(i=[Ie(Ue.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[15])],t=!0)},p:G,d(s){s&&w(e),t=!1,Pe(i)}}}function Um(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` New record`,p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[18]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function tD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I,L,F=!n[10]&&Bm(n);c=new Ea({}),c.$on("refresh",n[16]);let N=!n[2].isView&&Um(n);k=new Uo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function R(U){n[21](U)}function K(U){n[22](U)}let Q={collection:n[2]};return n[0]!==void 0&&(Q.filter=n[0]),n[1]!==void 0&&(Q.sort=n[1]),M=new XO({props:Q}),n[20](M),se.push(()=>_e(M,"filter",R)),se.push(()=>_e(M,"sort",K)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",s=O(),l=b("div"),r=B(o),a=O(),u=b("div"),F&&F.c(),f=O(),V(c.$$.fragment),d=O(),m=b("div"),h=b("button"),h.innerHTML=` API Preview`,_=O(),N&&N.c(),v=O(),V(k.$$.fragment),y=O(),T=b("div"),C=O(),V(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(T,"class","clearfix m-b-base")},m(U,X){S(U,e,X),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),g(e,u),F&&F.m(u,null),g(u,f),q(c,u,null),g(e,d),g(e,m),g(m,h),g(m,_),N&&N.m(m,null),S(U,v,X),q(k,U,X),S(U,y,X),S(U,T,X),S(U,C,X),q(M,U,X),A=!0,I||(L=Y(h,"click",n[17]),I=!0)},p(U,X){(!A||X[0]&4)&&o!==(o=U[2].name+"")&&le(r,o),U[10]?F&&(F.d(1),F=null):F?F.p(U,X):(F=Bm(U),F.c(),F.m(u,f)),U[2].isView?N&&(N.d(1),N=null):N?N.p(U,X):(N=Um(U),N.c(),N.m(m,null));const ne={};X[0]&1&&(ne.value=U[0]),X[0]&4&&(ne.autocompleteCollection=U[2]),k.$set(ne);const J={};X[0]&4&&(J.collection=U[2]),!$&&X[0]&1&&($=!0,J.filter=U[0],ke(()=>$=!1)),!D&&X[0]&2&&(D=!0,J.sort=U[1],ke(()=>D=!1)),M.$set(J)},i(U){A||(E(c.$$.fragment,U),E(k.$$.fragment,U),E(M.$$.fragment,U),A=!0)},o(U){P(c.$$.fragment,U),P(k.$$.fragment,U),P(M.$$.fragment,U),A=!1},d(U){U&&w(e),F&&F.d(),j(c),N&&N.d(),U&&w(v),j(k,U),U&&w(y),U&&w(T),U&&w(C),n[20](null),j(M,U),I=!1,L()}}}function nD(n){let e,t,i,s,l;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=O(),i=b("button"),i.innerHTML=` Create new collection`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function iD(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function sD(n){let e,t,i;function s(r,a){return r[10]?iD:nD}let l=s(n),o=l(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=O(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),g(e,t),g(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function lD(n){let e;return{c(){e=b("div"),e.innerHTML=` -

Loading collections...

`,p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function oD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[eD,xO,QO],m=[];function h(T,C){return T[3]&&!T[9].length?0:T[9].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};s=new iu({props:_}),n[25](s);let v={};o=new m4({props:v}),n[26](o);let k={collection:n[2]};a=new Vb({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let y={collection:n[2]};return f=new CO({props:y}),n[30](f),{c(){t.c(),i=O(),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment)},m(T,C){m[e].m(T,C),S(T,i,C),q(s,T,C),S(T,l,C),q(o,T,C),S(T,r,C),q(a,T,C),S(T,u,C),q(f,T,C),c=!0},p(T,C){let M=e;e=h(T),e===M?m[e].p(T,C):(re(),P(m[M],1,1,()=>{m[M]=null}),ae(),t=m[e],t?t.p(T,C):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const $={};s.$set($);const D={};o.$set(D);const A={};C[0]&4&&(A.collection=T[2]),a.$set(A);const I={};C[0]&4&&(I.collection=T[2]),f.$set(I)},i(T){c||(E(t),E(s.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(f.$$.fragment,T),c=!0)},o(T){P(t),P(s.$$.fragment,T),P(o.$$.fragment,T),P(a.$$.fragment,T),P(f.$$.fragment,T),c=!1},d(T){m[e].d(T),T&&w(i),n[25](null),j(s,T),T&&w(l),n[26](null),j(o,T),T&&w(r),n[27](null),j(a,T),T&&w(u),n[30](null),j(f,T)}}}function rD(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,Z=>t(2,s=Z)),Ye(n,St,Z=>t(31,l=Z)),Ye(n,Po,Z=>t(3,o=Z)),Ye(n,_a,Z=>t(13,r=Z)),Ye(n,Ai,Z=>t(9,a=Z)),Ye(n,$s,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,m,h,_,v=f.get("filter")||"",k=f.get("sort")||"",y=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,y=s==null?void 0:s.id),t(0,v=""),t(1,k="-created"),s!=null&&s.isView&&!H.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}Pb(y);const C=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),$=()=>_==null?void 0:_.load(),D=()=>d==null?void 0:d.show(s),A=()=>m==null?void 0:m.show(),I=Z=>t(0,v=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{_=Z,t(8,_)})}function F(Z){v=Z,t(0,v)}function N(Z){k=Z,t(1,k)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):m==null||m.show(Z==null?void 0:Z.detail)},K=()=>m==null?void 0:m.show();function Q(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function U(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function X(Z){se[Z?"unshift":"push"](()=>{m=Z,t(6,m)})}const ne=()=>_==null?void 0:_.reloadLoadedPages(),J=()=>_==null?void 0:_.reloadLoadedPages();function ue(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=y&&F3(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&y!=s.id&&T(),n.$$.dirty[0]&7&&(k||v||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:k}).toString();Oi("/collections?"+Z)}n.$$.dirty[0]&4&&Kt(St,l=(s==null?void 0:s.name)||"Collections",l)},[v,k,s,o,c,d,m,h,_,a,u,y,i,r,C,M,$,D,A,I,L,F,N,R,K,Q,U,X,ne,J,ue]}class aD extends ye{constructor(e){super(),ve(this,e,rD,oD,he,{},null,[-1,-1])}}function uD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I;return{c(){e=b("aside"),t=b("div"),i=b("div"),i.textContent="System",s=O(),l=b("a"),l.innerHTML=` +

Loading collections...

`,p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function oD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[eD,xO,QO],m=[];function h(T,C){return T[3]&&!T[9].length?0:T[9].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};s=new iu({props:_}),n[25](s);let v={};o=new m4({props:v}),n[26](o);let k={collection:n[2]};a=new V1({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let y={collection:n[2]};return f=new CO({props:y}),n[30](f),{c(){t.c(),i=O(),V(s.$$.fragment),l=O(),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment)},m(T,C){m[e].m(T,C),S(T,i,C),q(s,T,C),S(T,l,C),q(o,T,C),S(T,r,C),q(a,T,C),S(T,u,C),q(f,T,C),c=!0},p(T,C){let M=e;e=h(T),e===M?m[e].p(T,C):(re(),P(m[M],1,1,()=>{m[M]=null}),ae(),t=m[e],t?t.p(T,C):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const $={};s.$set($);const D={};o.$set(D);const A={};C[0]&4&&(A.collection=T[2]),a.$set(A);const I={};C[0]&4&&(I.collection=T[2]),f.$set(I)},i(T){c||(E(t),E(s.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(f.$$.fragment,T),c=!0)},o(T){P(t),P(s.$$.fragment,T),P(o.$$.fragment,T),P(a.$$.fragment,T),P(f.$$.fragment,T),c=!1},d(T){m[e].d(T),T&&w(i),n[25](null),j(s,T),T&&w(l),n[26](null),j(o,T),T&&w(r),n[27](null),j(a,T),T&&w(u),n[30](null),j(f,T)}}}function rD(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,Z=>t(2,s=Z)),Ye(n,St,Z=>t(31,l=Z)),Ye(n,Po,Z=>t(3,o=Z)),Ye(n,_a,Z=>t(13,r=Z)),Ye(n,Ai,Z=>t(9,a=Z)),Ye(n,$s,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,m,h,_,v=f.get("filter")||"",k=f.get("sort")||"",y=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,y=s==null?void 0:s.id),t(0,v=""),t(1,k="-created"),s!=null&&s.isView&&!H.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}P1(y);const C=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),$=()=>_==null?void 0:_.load(),D=()=>d==null?void 0:d.show(s),A=()=>m==null?void 0:m.show(),I=Z=>t(0,v=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{_=Z,t(8,_)})}function F(Z){v=Z,t(0,v)}function N(Z){k=Z,t(1,k)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):m==null||m.show(Z==null?void 0:Z.detail)},K=()=>m==null?void 0:m.show();function Q(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function U(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function X(Z){se[Z?"unshift":"push"](()=>{m=Z,t(6,m)})}const ne=()=>_==null?void 0:_.reloadLoadedPages(),J=()=>_==null?void 0:_.reloadLoadedPages();function ue(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=y&&F3(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&y!=s.id&&T(),n.$$.dirty[0]&7&&(k||v||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:k}).toString();Oi("/collections?"+Z)}n.$$.dirty[0]&4&&Kt(St,l=(s==null?void 0:s.name)||"Collections",l)},[v,k,s,o,c,d,m,h,_,a,u,y,i,r,C,M,$,D,A,I,L,F,N,R,K,Q,U,X,ne,J,ue]}class aD extends ye{constructor(e){super(),ve(this,e,rD,oD,he,{},null,[-1,-1])}}function uD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I;return{c(){e=b("aside"),t=b("div"),i=b("div"),i.textContent="System",s=O(),l=b("a"),l.innerHTML=` Application`,o=O(),r=b("a"),r.innerHTML=` Mail settings`,a=O(),u=b("a"),u.innerHTML=` Files storage`,f=O(),c=b("div"),c.innerHTML='Sync',d=O(),m=b("a"),m.innerHTML=` @@ -174,7 +174,7 @@ Updated: ${v[1].updated}`,position:"left"}),k[0]&536870912&&d!==(d=v[29])&&p(c," `),h=b("button"),h.textContent=`{TOKEN} `,_=B(`, `),v=b("button"),v.textContent=`{ACTION_URL} - `,k=B("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(v,"type","button"),p(v,"class","label label-sm link-primary txt-mono"),p(v,"title","Required parameter"),p(a,"class","help-block")},m(A,I){S(A,e,I),g(e,t),S(A,s,I),$[l].m(A,I),S(A,r,I),S(A,a,I),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),g(a,v),g(a,k),y=!0,T||(C=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(h,"click",n[24]),Y(v,"click",n[25])],T=!0)},p(A,I){(!y||I[1]&1&&i!==(i=A[31]))&&p(e,"for",i);let L=l;l=D(A),l===L?$[l].p(A,I):(re(),P($[L],1,1,()=>{$[L]=null}),ae(),o=$[l],o?o.p(A,I):(o=$[l]=M[l](A),o.c()),E(o,1),o.m(r.parentNode,r))},i(A){y||(E(o),y=!0)},o(A){P(o),y=!1},d(A){A&&w(e),A&&w(s),$[l].d(A),A&&w(r),A&&w(a),T=!1,Pe(C)}}}function sE(n){let e,t,i,s,l,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[xD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[eE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[iE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),S(r,s,a),q(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function sh(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function lE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&sh();return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),l=B(n[2]),o=O(),r=b("div"),a=O(),f&&f.c(),u=$e(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&E(f,1):(f=sh(),f.c(),E(f,1),f.m(u.parentNode,u)):f&&(re(),P(f,1,1,()=>{f=null}),ae())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function oE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[lE],default:[sE]},$$scope:{ctx:n}};for(let l=0;lt(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=lh,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function v(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-26a8b39e.js"),["./CodeEditor-26a8b39e.js","./index-96653a6b.js"],import.meta.url)).default),lh=c,t(5,d=!1))}function k(J){H.copyToClipboard(J),Eg(`Copied ${J} to clipboard`,2e3)}v();function y(){u.subject=this.value,t(0,u)}const T=()=>k("{APP_NAME}"),C=()=>k("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const $=()=>k("{APP_NAME}"),D=()=>k("{APP_URL}"),A=()=>k("{TOKEN}");function I(J){n.$$.not_equal(u.body,J)&&(u.body=J,t(0,u))}function L(){u.body=this.value,t(0,u)}const F=()=>k("{APP_NAME}"),N=()=>k("{APP_URL}"),R=()=>k("{TOKEN}"),K=()=>k("{ACTION_URL}");function Q(J){se[J?"unshift":"push"](()=>{f=J,t(3,f)})}function U(J){ze.call(this,n,J)}function X(J){ze.call(this,n,J)}function ne(J){ze.call(this,n,J)}return n.$$set=J=>{e=Je(Je({},e),Qn(J)),t(8,l=Et(e,s)),"key"in J&&t(1,r=J.key),"title"in J&&t(2,a=J.title),"config"in J&&t(0,u=J.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!H.isEmpty(H.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Qi(r))},[u,r,a,f,c,d,i,k,l,m,h,_,o,y,T,C,M,$,D,A,I,L,F,N,R,K,Q,U,X,ne]}class Ir extends ye{constructor(e){super(),ve(this,e,rE,oE,he,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function oh(n,e,t){const i=n.slice();return i[22]=e[t],i}function rh(n,e){let t,i,s,l,o,r=e[22].label+"",a,u,f,c,d;return{key:n,first:null,c(){t=b("div"),i=b("input"),l=O(),o=b("label"),a=B(r),f=O(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[21]+e[22].value),i.__value=e[22].value,i.value=i.__value,e[12][0].push(i),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),this.first=t},m(m,h){S(m,t,h),g(t,i),i.checked=i.__value===e[2],g(t,l),g(t,o),g(o,a),g(t,f),c||(d=Y(i,"change",e[11]),c=!0)},p(m,h){e=m,h&2097152&&s!==(s=e[21]+e[22].value)&&p(i,"id",s),h&4&&(i.checked=i.__value===e[2]),h&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(m){m&&w(t),e[12][0].splice(e[12][0].indexOf(i),1),c=!1,d()}}}function aE(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[22].value;for(let o=0;o({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field required m-0",name:"email",$$slots:{default:[uE,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),V(t.$$.fragment),i=O(),V(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){S(a,e,u),q(t,e,null),g(e,i),q(s,e,null),l=!0,o||(r=Y(e,"submit",dt(n[14])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(E(t.$$.fragment,a),E(s.$$.fragment,a),l=!0)},o(a){P(t.$$.fragment,a),P(s.$$.fragment,a),l=!1},d(a){a&&w(e),j(t),j(s),o=!1,r()}}}function cE(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function dE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=O(),s=b("button"),l=b("i"),o=O(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],x(s,"btn-loading",n[4])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"click",n[0]),Y(s,"click",n[10])],u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&x(s,"btn-loading",c[4])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function pE(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[15],popup:!0,$$slots:{footer:[dE],header:[cE],default:[fE]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[15]),l&33554486&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}const Pr="last_email_test",ah="email_test_request";function mE(n,e,t){let i;const s=$t(),l="email_test_"+H.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Pr),u=o[0].value,f=!1,c=null;function d(A="",I=""){t(1,a=A||localStorage.getItem(Pr)),t(2,u=I||o[0].value),Bn({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Pr,a),clearTimeout(c),c=setTimeout(()=>{pe.cancelRequest(ah),cl("Test email send timeout.")},3e4);try{await pe.settings.testEmail(a,u,{$cancelKey:ah}),zt("Successfully sent test email."),s("submit"),t(4,f=!1),await sn(),m()}catch(A){t(4,f=!1),pe.errorResponseHandler(A)}clearTimeout(c)}}const _=[[]],v=()=>h();function k(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const T=()=>h(),C=()=>!f;function M(A){se[A?"unshift":"push"](()=>{r=A,t(3,r)})}function $(A){ze.call(this,n,A)}function D(A){ze.call(this,n,A)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,l,o,h,d,v,k,_,y,T,C,M,$,D]}class hE extends ye{constructor(e){super(),ve(this,e,mE,pE,he,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function _E(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I,L;i=new me({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[bE,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[vE,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});function F(Z){n[14](Z)}let N={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(N.config=n[0].meta.verificationTemplate),u=new Ir({props:N}),se.push(()=>_e(u,"config",F));function R(Z){n[15](Z)}let K={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(K.config=n[0].meta.resetPasswordTemplate),d=new Ir({props:K}),se.push(()=>_e(d,"config",R));function Q(Z){n[16](Z)}let U={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(U.config=n[0].meta.confirmEmailChangeTemplate),_=new Ir({props:U}),se.push(()=>_e(_,"config",Q)),C=new me({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[yE,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let X=n[0].smtp.enabled&&uh(n);function ne(Z,de){return Z[4]?OE:ME}let J=ne(n),ue=J(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),c=O(),V(d.$$.fragment),h=O(),V(_.$$.fragment),k=O(),y=b("hr"),T=O(),V(C.$$.fragment),M=O(),X&&X.c(),$=O(),D=b("div"),A=b("div"),I=O(),ue.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(A,"class","flex-fill"),p(D,"class","flex")},m(Z,de){S(Z,e,de),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),S(Z,r,de),S(Z,a,de),q(u,a,null),g(a,c),q(d,a,null),g(a,h),q(_,a,null),S(Z,k,de),S(Z,y,de),S(Z,T,de),q(C,Z,de),S(Z,M,de),X&&X.m(Z,de),S(Z,$,de),S(Z,D,de),g(D,A),g(D,I),ue.m(D,null),L=!0},p(Z,de){const ge={};de[0]&1|de[1]&3&&(ge.$$scope={dirty:de,ctx:Z}),i.$set(ge);const Ce={};de[0]&1|de[1]&3&&(Ce.$$scope={dirty:de,ctx:Z}),o.$set(Ce);const Ne={};!f&&de[0]&1&&(f=!0,Ne.config=Z[0].meta.verificationTemplate,ke(()=>f=!1)),u.$set(Ne);const Re={};!m&&de[0]&1&&(m=!0,Re.config=Z[0].meta.resetPasswordTemplate,ke(()=>m=!1)),d.$set(Re);const be={};!v&&de[0]&1&&(v=!0,be.config=Z[0].meta.confirmEmailChangeTemplate,ke(()=>v=!1)),_.$set(be);const Se={};de[0]&1|de[1]&3&&(Se.$$scope={dirty:de,ctx:Z}),C.$set(Se),Z[0].smtp.enabled?X?(X.p(Z,de),de[0]&1&&E(X,1)):(X=uh(Z),X.c(),E(X,1),X.m($.parentNode,$)):X&&(re(),P(X,1,1,()=>{X=null}),ae()),J===(J=ne(Z))&&ue?ue.p(Z,de):(ue.d(1),ue=J(Z),ue&&(ue.c(),ue.m(D,null)))},i(Z){L||(E(i.$$.fragment,Z),E(o.$$.fragment,Z),E(u.$$.fragment,Z),E(d.$$.fragment,Z),E(_.$$.fragment,Z),E(C.$$.fragment,Z),E(X),L=!0)},o(Z){P(i.$$.fragment,Z),P(o.$$.fragment,Z),P(u.$$.fragment,Z),P(d.$$.fragment,Z),P(_.$$.fragment,Z),P(C.$$.fragment,Z),P(X),L=!1},d(Z){Z&&w(e),j(i),j(o),Z&&w(r),Z&&w(a),j(u),j(d),j(_),Z&&w(k),Z&&w(y),Z&&w(T),j(C,Z),Z&&w(M),X&&X.d(Z),Z&&w($),Z&&w(D),ue.d()}}}function gE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function bE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Sender name"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.senderName),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&fe(l,u[0].meta.senderName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function vE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Sender address"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","email"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.senderAddress),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&fe(l,u[0].meta.senderAddress)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function yE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("span"),l.innerHTML="Use SMTP mail server (recommended)",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[31])},m(c,d){S(c,e,d),e.checked=n[0].smtp.enabled,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[17]),Ie(Ue.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&1&&t!==(t=c[31])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&1&&a!==(a=c[31])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function uh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$;return i=new me({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[kE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[wE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[SE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[TE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field",name:"smtp.username",$$slots:{default:[CE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),y=new me({props:{class:"form-field",name:"smtp.password",$$slots:{default:[$E,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),f=O(),c=b("div"),V(d.$$.fragment),m=O(),h=b("div"),V(_.$$.fragment),v=O(),k=b("div"),V(y.$$.fragment),T=O(),C=b("div"),p(t,"class","col-lg-4"),p(l,"class","col-lg-2"),p(a,"class","col-lg-3"),p(c,"class","col-lg-3"),p(h,"class","col-lg-6"),p(k,"class","col-lg-6"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(D,A){S(D,e,A),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),g(e,m),g(e,h),q(_,h,null),g(e,v),g(e,k),q(y,k,null),g(e,T),g(e,C),$=!0},p(D,A){const I={};A[0]&1|A[1]&3&&(I.$$scope={dirty:A,ctx:D}),i.$set(I);const L={};A[0]&1|A[1]&3&&(L.$$scope={dirty:A,ctx:D}),o.$set(L);const F={};A[0]&1|A[1]&3&&(F.$$scope={dirty:A,ctx:D}),u.$set(F);const N={};A[0]&1|A[1]&3&&(N.$$scope={dirty:A,ctx:D}),d.$set(N);const R={};A[0]&1|A[1]&3&&(R.$$scope={dirty:A,ctx:D}),_.$set(R);const K={};A[0]&1|A[1]&3&&(K.$$scope={dirty:A,ctx:D}),y.$set(K)},i(D){$||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(u.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(y.$$.fragment,D),D&&xe(()=>{M||(M=je(e,At,{duration:150},!0)),M.run(1)}),$=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(d.$$.fragment,D),P(_.$$.fragment,D),P(y.$$.fragment,D),D&&(M||(M=je(e,At,{duration:150},!1)),M.run(0)),$=!1},d(D){D&&w(e),j(i),j(o),j(u),j(d),j(_),j(y),D&&M&&M.end()}}}function kE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("SMTP server host"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.host),r||(a=Y(l,"input",n[18]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&fe(l,u[0].smtp.host)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function wE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Port"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.port),r||(a=Y(l,"input",n[19]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&pt(l.value)!==u[0].smtp.port&&fe(l,u[0].smtp.port)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function SE(n){let e,t,i,s,l,o,r;function a(f){n[20](f)}let u={id:n[31],items:n[6]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("TLS encryption"),s=O(),V(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function TE(n){let e,t,i,s,l,o,r;function a(f){n[21](f)}let u={id:n[31],items:n[7]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("AUTH method"),s=O(),V(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function CE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Username"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.username),r||(a=Y(l,"input",n[22]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&fe(l,u[0].smtp.username)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function $E(n){let e,t,i,s,l,o,r;function a(f){n[23](f)}let u={id:n[31]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new lu({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=B("Password"),s=O(),V(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function ME(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` + `,k=B("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(v,"type","button"),p(v,"class","label label-sm link-primary txt-mono"),p(v,"title","Required parameter"),p(a,"class","help-block")},m(A,I){S(A,e,I),g(e,t),S(A,s,I),$[l].m(A,I),S(A,r,I),S(A,a,I),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),g(a,v),g(a,k),y=!0,T||(C=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(h,"click",n[24]),Y(v,"click",n[25])],T=!0)},p(A,I){(!y||I[1]&1&&i!==(i=A[31]))&&p(e,"for",i);let L=l;l=D(A),l===L?$[l].p(A,I):(re(),P($[L],1,1,()=>{$[L]=null}),ae(),o=$[l],o?o.p(A,I):(o=$[l]=M[l](A),o.c()),E(o,1),o.m(r.parentNode,r))},i(A){y||(E(o),y=!0)},o(A){P(o),y=!1},d(A){A&&w(e),A&&w(s),$[l].d(A),A&&w(r),A&&w(a),T=!1,Pe(C)}}}function sE(n){let e,t,i,s,l,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[xD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[eE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[iE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),S(r,s,a),q(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function sh(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function lE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&sh();return{c(){e=b("div"),t=b("i"),i=O(),s=b("span"),l=B(n[2]),o=O(),r=b("div"),a=O(),f&&f.c(),u=$e(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&E(f,1):(f=sh(),f.c(),E(f,1),f.m(u.parentNode,u)):f&&(re(),P(f,1,1,()=>{f=null}),ae())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function oE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[lE],default:[sE]},$$scope:{ctx:n}};for(let l=0;lt(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=lh,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function v(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-441745aa.js"),["./CodeEditor-441745aa.js","./index-a6ccb683.js"],import.meta.url)).default),lh=c,t(5,d=!1))}function k(J){H.copyToClipboard(J),Eg(`Copied ${J} to clipboard`,2e3)}v();function y(){u.subject=this.value,t(0,u)}const T=()=>k("{APP_NAME}"),C=()=>k("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const $=()=>k("{APP_NAME}"),D=()=>k("{APP_URL}"),A=()=>k("{TOKEN}");function I(J){n.$$.not_equal(u.body,J)&&(u.body=J,t(0,u))}function L(){u.body=this.value,t(0,u)}const F=()=>k("{APP_NAME}"),N=()=>k("{APP_URL}"),R=()=>k("{TOKEN}"),K=()=>k("{ACTION_URL}");function Q(J){se[J?"unshift":"push"](()=>{f=J,t(3,f)})}function U(J){ze.call(this,n,J)}function X(J){ze.call(this,n,J)}function ne(J){ze.call(this,n,J)}return n.$$set=J=>{e=Je(Je({},e),Qn(J)),t(8,l=Et(e,s)),"key"in J&&t(1,r=J.key),"title"in J&&t(2,a=J.title),"config"in J&&t(0,u=J.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!H.isEmpty(H.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Qi(r))},[u,r,a,f,c,d,i,k,l,m,h,_,o,y,T,C,M,$,D,A,I,L,F,N,R,K,Q,U,X,ne]}class Ir extends ye{constructor(e){super(),ve(this,e,rE,oE,he,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function oh(n,e,t){const i=n.slice();return i[22]=e[t],i}function rh(n,e){let t,i,s,l,o,r=e[22].label+"",a,u,f,c,d;return{key:n,first:null,c(){t=b("div"),i=b("input"),l=O(),o=b("label"),a=B(r),f=O(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[21]+e[22].value),i.__value=e[22].value,i.value=i.__value,e[12][0].push(i),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),this.first=t},m(m,h){S(m,t,h),g(t,i),i.checked=i.__value===e[2],g(t,l),g(t,o),g(o,a),g(t,f),c||(d=Y(i,"change",e[11]),c=!0)},p(m,h){e=m,h&2097152&&s!==(s=e[21]+e[22].value)&&p(i,"id",s),h&4&&(i.checked=i.__value===e[2]),h&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(m){m&&w(t),e[12][0].splice(e[12][0].indexOf(i),1),c=!1,d()}}}function aE(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[22].value;for(let o=0;o({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field required m-0",name:"email",$$slots:{default:[uE,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),V(t.$$.fragment),i=O(),V(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){S(a,e,u),q(t,e,null),g(e,i),q(s,e,null),l=!0,o||(r=Y(e,"submit",dt(n[14])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(E(t.$$.fragment,a),E(s.$$.fragment,a),l=!0)},o(a){P(t.$$.fragment,a),P(s.$$.fragment,a),l=!1},d(a){a&&w(e),j(t),j(s),o=!1,r()}}}function cE(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function dE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=B("Close"),i=O(),s=b("button"),l=b("i"),o=O(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],x(s,"btn-loading",n[4])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"click",n[0]),Y(s,"click",n[10])],u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&x(s,"btn-loading",c[4])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function pE(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[15],popup:!0,$$slots:{footer:[dE],header:[cE],default:[fE]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[15]),l&33554486&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}const Pr="last_email_test",ah="email_test_request";function mE(n,e,t){let i;const s=$t(),l="email_test_"+H.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Pr),u=o[0].value,f=!1,c=null;function d(A="",I=""){t(1,a=A||localStorage.getItem(Pr)),t(2,u=I||o[0].value),Bn({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Pr,a),clearTimeout(c),c=setTimeout(()=>{pe.cancelRequest(ah),cl("Test email send timeout.")},3e4);try{await pe.settings.testEmail(a,u,{$cancelKey:ah}),zt("Successfully sent test email."),s("submit"),t(4,f=!1),await sn(),m()}catch(A){t(4,f=!1),pe.errorResponseHandler(A)}clearTimeout(c)}}const _=[[]],v=()=>h();function k(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const T=()=>h(),C=()=>!f;function M(A){se[A?"unshift":"push"](()=>{r=A,t(3,r)})}function $(A){ze.call(this,n,A)}function D(A){ze.call(this,n,A)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,l,o,h,d,v,k,_,y,T,C,M,$,D]}class hE extends ye{constructor(e){super(),ve(this,e,mE,pE,he,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function _E(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$,D,A,I,L;i=new me({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[bE,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[vE,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});function F(Z){n[14](Z)}let N={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(N.config=n[0].meta.verificationTemplate),u=new Ir({props:N}),se.push(()=>_e(u,"config",F));function R(Z){n[15](Z)}let K={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(K.config=n[0].meta.resetPasswordTemplate),d=new Ir({props:K}),se.push(()=>_e(d,"config",R));function Q(Z){n[16](Z)}let U={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(U.config=n[0].meta.confirmEmailChangeTemplate),_=new Ir({props:U}),se.push(()=>_e(_,"config",Q)),C=new me({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[yE,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let X=n[0].smtp.enabled&&uh(n);function ne(Z,de){return Z[4]?OE:ME}let J=ne(n),ue=J(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),c=O(),V(d.$$.fragment),h=O(),V(_.$$.fragment),k=O(),y=b("hr"),T=O(),V(C.$$.fragment),M=O(),X&&X.c(),$=O(),D=b("div"),A=b("div"),I=O(),ue.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(A,"class","flex-fill"),p(D,"class","flex")},m(Z,de){S(Z,e,de),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),S(Z,r,de),S(Z,a,de),q(u,a,null),g(a,c),q(d,a,null),g(a,h),q(_,a,null),S(Z,k,de),S(Z,y,de),S(Z,T,de),q(C,Z,de),S(Z,M,de),X&&X.m(Z,de),S(Z,$,de),S(Z,D,de),g(D,A),g(D,I),ue.m(D,null),L=!0},p(Z,de){const ge={};de[0]&1|de[1]&3&&(ge.$$scope={dirty:de,ctx:Z}),i.$set(ge);const Ce={};de[0]&1|de[1]&3&&(Ce.$$scope={dirty:de,ctx:Z}),o.$set(Ce);const Ne={};!f&&de[0]&1&&(f=!0,Ne.config=Z[0].meta.verificationTemplate,ke(()=>f=!1)),u.$set(Ne);const Re={};!m&&de[0]&1&&(m=!0,Re.config=Z[0].meta.resetPasswordTemplate,ke(()=>m=!1)),d.$set(Re);const be={};!v&&de[0]&1&&(v=!0,be.config=Z[0].meta.confirmEmailChangeTemplate,ke(()=>v=!1)),_.$set(be);const Se={};de[0]&1|de[1]&3&&(Se.$$scope={dirty:de,ctx:Z}),C.$set(Se),Z[0].smtp.enabled?X?(X.p(Z,de),de[0]&1&&E(X,1)):(X=uh(Z),X.c(),E(X,1),X.m($.parentNode,$)):X&&(re(),P(X,1,1,()=>{X=null}),ae()),J===(J=ne(Z))&&ue?ue.p(Z,de):(ue.d(1),ue=J(Z),ue&&(ue.c(),ue.m(D,null)))},i(Z){L||(E(i.$$.fragment,Z),E(o.$$.fragment,Z),E(u.$$.fragment,Z),E(d.$$.fragment,Z),E(_.$$.fragment,Z),E(C.$$.fragment,Z),E(X),L=!0)},o(Z){P(i.$$.fragment,Z),P(o.$$.fragment,Z),P(u.$$.fragment,Z),P(d.$$.fragment,Z),P(_.$$.fragment,Z),P(C.$$.fragment,Z),P(X),L=!1},d(Z){Z&&w(e),j(i),j(o),Z&&w(r),Z&&w(a),j(u),j(d),j(_),Z&&w(k),Z&&w(y),Z&&w(T),j(C,Z),Z&&w(M),X&&X.d(Z),Z&&w($),Z&&w(D),ue.d()}}}function gE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function bE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Sender name"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.senderName),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&fe(l,u[0].meta.senderName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function vE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Sender address"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","email"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].meta.senderAddress),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&fe(l,u[0].meta.senderAddress)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function yE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=O(),s=b("label"),l=b("span"),l.innerHTML="Use SMTP mail server (recommended)",o=O(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[31])},m(c,d){S(c,e,d),e.checked=n[0].smtp.enabled,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[17]),Ie(Ue.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&1&&t!==(t=c[31])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&1&&a!==(a=c[31])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function uh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,T,C,M,$;return i=new me({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[kE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[wE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[SE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[TE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field",name:"smtp.username",$$slots:{default:[CE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),y=new me({props:{class:"form-field",name:"smtp.password",$$slots:{default:[$E,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),s=O(),l=b("div"),V(o.$$.fragment),r=O(),a=b("div"),V(u.$$.fragment),f=O(),c=b("div"),V(d.$$.fragment),m=O(),h=b("div"),V(_.$$.fragment),v=O(),k=b("div"),V(y.$$.fragment),T=O(),C=b("div"),p(t,"class","col-lg-4"),p(l,"class","col-lg-2"),p(a,"class","col-lg-3"),p(c,"class","col-lg-3"),p(h,"class","col-lg-6"),p(k,"class","col-lg-6"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(D,A){S(D,e,A),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),g(e,m),g(e,h),q(_,h,null),g(e,v),g(e,k),q(y,k,null),g(e,T),g(e,C),$=!0},p(D,A){const I={};A[0]&1|A[1]&3&&(I.$$scope={dirty:A,ctx:D}),i.$set(I);const L={};A[0]&1|A[1]&3&&(L.$$scope={dirty:A,ctx:D}),o.$set(L);const F={};A[0]&1|A[1]&3&&(F.$$scope={dirty:A,ctx:D}),u.$set(F);const N={};A[0]&1|A[1]&3&&(N.$$scope={dirty:A,ctx:D}),d.$set(N);const R={};A[0]&1|A[1]&3&&(R.$$scope={dirty:A,ctx:D}),_.$set(R);const K={};A[0]&1|A[1]&3&&(K.$$scope={dirty:A,ctx:D}),y.$set(K)},i(D){$||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(u.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(y.$$.fragment,D),D&&xe(()=>{M||(M=je(e,At,{duration:150},!0)),M.run(1)}),$=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(d.$$.fragment,D),P(_.$$.fragment,D),P(y.$$.fragment,D),D&&(M||(M=je(e,At,{duration:150},!1)),M.run(0)),$=!1},d(D){D&&w(e),j(i),j(o),j(u),j(d),j(_),j(y),D&&M&&M.end()}}}function kE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("SMTP server host"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.host),r||(a=Y(l,"input",n[18]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&fe(l,u[0].smtp.host)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function wE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Port"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.port),r||(a=Y(l,"input",n[19]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&pt(l.value)!==u[0].smtp.port&&fe(l,u[0].smtp.port)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function SE(n){let e,t,i,s,l,o,r;function a(f){n[20](f)}let u={id:n[31],items:n[6]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("TLS encryption"),s=O(),V(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function TE(n){let e,t,i,s,l,o,r;function a(f){n[21](f)}let u={id:n[31],items:n[7]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=B("AUTH method"),s=O(),V(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function CE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=B("Username"),s=O(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),fe(l,n[0].smtp.username),r||(a=Y(l,"input",n[22]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&fe(l,u[0].smtp.username)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function $E(n){let e,t,i,s,l,o,r;function a(f){n[23](f)}let u={id:n[31]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new lu({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=B("Password"),s=O(),V(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function ME(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` Send test email`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function OE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=O(),s=b("button"),l=b("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],x(s,"btn-loading",n[3])},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),g(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&x(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Pe(a)}}}function DE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[gE,_E],y=[];function T(C,M){return C[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[5]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

Configure common settings for sending emails.

",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[27])),_=!0)},p(C,M){(!h||M[0]&32)&&le(o,C[5]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function EE(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[DE]},$$scope:{ctx:n}}});let r={};return l=new hE({props:r}),n[28](l),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function AE(n,e,t){let i,s,l;Ye(n,St,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Kt(St,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const ne=await pe.settings.getAll()||{};_(ne)}catch(ne){pe.errorResponseHandler(ne)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ne=await pe.settings.update(H.filterRedactedProps(f));_(ne),Bn({}),zt("Successfully saved mail settings.")}catch(ne){pe.errorResponseHandler(ne)}t(3,d=!1)}}function _(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function v(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function y(){f.meta.senderAddress=this.value,t(0,f)}function T(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function C(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function $(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function A(){f.smtp.port=pt(this.value),t(0,f)}function I(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function F(){f.smtp.username=this.value,t(0,f)}function N(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>v(),K=()=>h(),Q=()=>a==null?void 0:a.show(),U=()=>h();function X(ne){se[ne?"unshift":"push"](()=>{a=ne,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&1024&&t(11,i=JSON.stringify(u)),n.$$.dirty[0]&2049&&t(4,s=i!=JSON.stringify(f))},[f,a,c,d,s,l,o,r,h,v,u,i,k,y,T,C,M,$,D,A,I,L,F,N,R,K,Q,U,X]}class IE extends ye{constructor(e){super(),ve(this,e,AE,EE,he,{},null,[-1,-1])}}function PE(n){var C,M;let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[NE,({uniqueId:$})=>({25:$}),({uniqueId:$})=>$?33554432:0]},$$scope:{ctx:n}}});let v=((C=n[0].s3)==null?void 0:C.enabled)!=n[1].s3.enabled&&fh(n),k=n[1].s3.enabled&&ch(n),y=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&dh(n),T=n[6]&&ph(n);return{c(){V(e.$$.fragment),t=O(),v&&v.c(),i=O(),k&&k.c(),s=O(),l=b("div"),o=b("div"),r=O(),y&&y.c(),a=O(),T&&T.c(),u=O(),f=b("button"),c=b("span"),c.textContent="Save changes",p(o,"class","flex-fill"),p(c,"class","txt"),p(f,"type","submit"),p(f,"class","btn btn-expanded"),f.disabled=d=!n[6]||n[3],x(f,"btn-loading",n[3]),p(l,"class","flex")},m($,D){q(e,$,D),S($,t,D),v&&v.m($,D),S($,i,D),k&&k.m($,D),S($,s,D),S($,l,D),g(l,o),g(l,r),y&&y.m(l,null),g(l,a),T&&T.m(l,null),g(l,u),g(l,f),g(f,c),m=!0,h||(_=Y(f,"click",n[19]),h=!0)},p($,D){var I,L;const A={};D&100663298&&(A.$$scope={dirty:D,ctx:$}),e.$set(A),((I=$[0].s3)==null?void 0:I.enabled)!=$[1].s3.enabled?v?(v.p($,D),D&3&&E(v,1)):(v=fh($),v.c(),E(v,1),v.m(i.parentNode,i)):v&&(re(),P(v,1,1,()=>{v=null}),ae()),$[1].s3.enabled?k?(k.p($,D),D&2&&E(k,1)):(k=ch($),k.c(),E(k,1),k.m(s.parentNode,s)):k&&(re(),P(k,1,1,()=>{k=null}),ae()),(L=$[1].s3)!=null&&L.enabled&&!$[6]&&!$[3]?y?y.p($,D):(y=dh($),y.c(),y.m(l,a)):y&&(y.d(1),y=null),$[6]?T?T.p($,D):(T=ph($),T.c(),T.m(l,u)):T&&(T.d(1),T=null),(!m||D&72&&d!==(d=!$[6]||$[3]))&&(f.disabled=d),(!m||D&8)&&x(f,"btn-loading",$[3])},i($){m||(E(e.$$.fragment,$),E(v),E(k),m=!0)},o($){P(e.$$.fragment,$),P(v),P(k),m=!1},d($){j(e,$),$&&w(t),v&&v.d($),$&&w(i),k&&k.d($),$&&w(s),$&&w(l),y&&y.d(),T&&T.d(),h=!1,_()}}}function LE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function NE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[25]),e.required=!0,p(s,"for",o=n[25])},m(u,f){S(u,e,f),e.checked=n[1].s3.enabled,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[11]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&2&&(e.checked=u[1].s3.enabled),f&33554432&&o!==(o=u[25])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function fh(n){var I;let e,t,i,s,l,o,r,a=(I=n[0].s3)!=null&&I.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,v,k,y,T,C,M,$,D,A;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',s=O(),l=b("div"),o=B(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=b("strong"),u=B(a),f=B(` @@ -189,7 +189,7 @@ Updated: ${v[1].updated}`,position:"left"}),k[0]&536870912&&d!==(d=v[29])&&p(c," S3 connected successfully`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function BE(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=` Failed to establish S3 connection`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ie(t=Ue.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Bt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function UE(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function ph(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function WE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[LE,PE],y=[];function T(C,M){return C[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[7]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML=`

By default PocketBase uses the local file system to store uploaded files.

If you have limited disk space, you could optionally connect to a S3 compatible storage.

`,c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[20])),_=!0)},p(C,M){(!h||M&128)&&le(o,C[7]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function YE(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[WE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const lo="s3_test_request";function KE(n,e,t){let i,s,l;Ye(n,St,N=>t(7,l=N)),Kt(St,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;m();async function m(){t(2,a=!0);try{const N=await pe.settings.getAll()||{};_(N)}catch(N){pe.errorResponseHandler(N)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{pe.cancelRequest(lo);const N=await pe.settings.update(H.filterRedactedProps(r));Bn({}),await _(N),Ma(),c?Nv("Successfully saved but failed to establish S3 connection."):zt("Successfully saved files storage settings.")}catch(N){pe.errorResponseHandler(N)}t(3,u=!1)}}async function _(N={}){t(1,r={s3:(N==null?void 0:N.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function v(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,c=null),!!r.s3.enabled){pe.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{pe.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await pe.settings.testS3({$cancelKey:lo})}catch(N){t(5,c=N)}t(4,f=!1),clearTimeout(d)}}Zt(()=>()=>{clearTimeout(d)});function y(){r.s3.enabled=this.checked,t(1,r)}function T(){r.s3.endpoint=this.value,t(1,r)}function C(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function $(){r.s3.accessKey=this.value,t(1,r)}function D(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function A(){r.s3.forcePathStyle=this.checked,t(1,r)}const I=()=>v(),L=()=>h(),F=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,v,i,y,T,C,M,$,D,A,I,L,F]}class JE extends ye{constructor(e){super(),ve(this,e,KE,YE,he,{})}}function ZE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=O(),s=b("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(s,"for",o=n[21])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function GE(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=B("Client ID"),s=O(),l=b("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),fe(l,n[0].clientId),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&2097152&&i!==(i=f[21])&&p(e,"for",i),c&2097152&&o!==(o=f[21])&&p(l,"id",o),c&1&&r!==(r=f[0].enabled)&&(l.required=r),c&1&&l.value!==f[0].clientId&&fe(l,f[0].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function XE(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new lu({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=B("Client Secret"),s=O(),V(l.$$.fragment),p(e,"for",i=n[21])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&p(e,"for",i);const d={};c&2097152&&(d.id=f[21]),c&1&&(d.required=f[0].enabled),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function mh(n){let e,t,i,s;function l(a){n[16](a)}var o=n[4];function r(a){let u={key:a[1]};return a[0]!==void 0&&(u.config=a[0]),{props:u}}return o&&(t=jt(o,r(n)),se.push(()=>_e(t,"config",l))),{c(){e=b("div"),t&&V(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&q(t,e,null),s=!0},p(a,u){const f={};if(u&2&&(f.key=a[1]),!i&&u&1&&(i=!0,f.config=a[0],ke(()=>i=!1)),o!==(o=a[4])){if(t){re();const c=t;P(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(t=jt(o,r(a)),se.push(()=>_e(t,"config",l)),V(t.$$.fragment),E(t.$$.fragment,1),q(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&E(t.$$.fragment,a),s=!0)},o(a){t&&P(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&j(t)}}}function QE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;t=new me({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[ZE,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".clientId",$$slots:{default:[GE,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".clientSecret",$$slots:{default:[XE,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}});let y=n[4]&&mh(n);return{c(){e=b("div"),V(t.$$.fragment),i=O(),s=b("button"),s.innerHTML='Clear all fields',l=O(),o=b("div"),r=b("div"),a=O(),u=b("div"),V(f.$$.fragment),c=O(),d=b("div"),V(m.$$.fragment),h=O(),y&&y.c(),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(e,"class","flex"),p(r,"class","col-12 spacing"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(o,"class","grid")},m(T,C){S(T,e,C),q(t,e,null),g(e,i),g(e,s),S(T,l,C),S(T,o,C),g(o,r),g(o,a),g(o,u),q(f,u,null),g(o,c),g(o,d),q(m,d,null),g(o,h),y&&y.m(o,null),_=!0,v||(k=Y(s,"click",n[7]),v=!0)},p(T,C){const M={};C&2&&(M.name=T[1]+".enabled"),C&6291457&&(M.$$scope={dirty:C,ctx:T}),t.$set(M);const $={};C&1&&($.class="form-field "+(T[0].enabled?"required":"")),C&2&&($.name=T[1]+".clientId"),C&6291457&&($.$$scope={dirty:C,ctx:T}),f.$set($);const D={};C&1&&(D.class="form-field "+(T[0].enabled?"required":"")),C&2&&(D.name=T[1]+".clientSecret"),C&6291457&&(D.$$scope={dirty:C,ctx:T}),m.$set(D),T[4]?y?(y.p(T,C),C&16&&E(y,1)):(y=mh(T),y.c(),E(y,1),y.m(o,null)):y&&(re(),P(y,1,1,()=>{y=null}),ae())},i(T){_||(E(t.$$.fragment,T),E(f.$$.fragment,T),E(m.$$.fragment,T),E(y),_=!0)},o(T){P(t.$$.fragment,T),P(f.$$.fragment,T),P(m.$$.fragment,T),P(y),_=!1},d(T){T&&w(e),j(t),T&&w(l),T&&w(o),j(f),j(m),y&&y.d(),v=!1,k()}}}function hh(n){let e;return{c(){e=b("i"),p(e,"class",n[3])},m(t,i){S(t,e,i)},p(t,i){i&8&&p(e,"class",t[3])},d(t){t&&w(e)}}}function _h(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function xE(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label label-hint")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function eA(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function tA(n){let e,t,i,s,l,o,r=n[1].substring(0,n[1].length-4)+"",a,u,f,c,d,m,h=n[3]&&hh(n),_=n[6]&&_h();function v(T,C){return T[0].enabled?eA:xE}let k=v(n),y=k(n);return{c(){e=b("div"),h&&h.c(),t=O(),i=b("span"),s=B(n[2]),l=O(),o=b("code"),a=B(r),u=O(),f=b("div"),c=O(),_&&_.c(),d=O(),y.c(),m=$e(),p(i,"class","txt"),p(o,"title","Provider key"),p(e,"class","inline-flex"),p(f,"class","flex-fill")},m(T,C){S(T,e,C),h&&h.m(e,null),g(e,t),g(e,i),g(i,s),g(e,l),g(e,o),g(o,a),S(T,u,C),S(T,f,C),S(T,c,C),_&&_.m(T,C),S(T,d,C),y.m(T,C),S(T,m,C)},p(T,C){T[3]?h?h.p(T,C):(h=hh(T),h.c(),h.m(e,t)):h&&(h.d(1),h=null),C&4&&le(s,T[2]),C&2&&r!==(r=T[1].substring(0,T[1].length-4)+"")&&le(a,r),T[6]?_?C&64&&E(_,1):(_=_h(),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(re(),P(_,1,1,()=>{_=null}),ae()),k!==(k=v(T))&&(y.d(1),y=k(T),y&&(y.c(),y.m(m.parentNode,m)))},d(T){T&&w(e),h&&h.d(),T&&w(u),T&&w(f),T&&w(c),_&&_.d(T),T&&w(d),y.d(T),T&&w(m)}}}function nA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[tA],default:[QE]},$$scope:{ctx:n}};for(let l=0;lt(12,o=I));let{key:r}=e,{title:a}=e,{icon:u=""}=e,{config:f={}}=e,{optionsComponent:c}=e,d;function m(){d==null||d.expand()}function h(){d==null||d.collapse()}function _(){d==null||d.collapseSiblings()}function v(){for(let I in f)t(0,f[I]="",f);t(0,f.enabled=!1,f)}function k(){f.enabled=this.checked,t(0,f)}function y(){f.clientId=this.value,t(0,f)}function T(I){n.$$.not_equal(f.clientSecret,I)&&(f.clientSecret=I,t(0,f))}function C(I){f=I,t(0,f)}function M(I){se[I?"unshift":"push"](()=>{d=I,t(5,d)})}function $(I){ze.call(this,n,I)}function D(I){ze.call(this,n,I)}function A(I){ze.call(this,n,I)}return n.$$set=I=>{e=Je(Je({},e),Qn(I)),t(8,l=Et(e,s)),"key"in I&&t(1,r=I.key),"title"in I&&t(2,a=I.title),"icon"in I&&t(3,u=I.icon),"config"in I&&t(0,f=I.config),"optionsComponent"in I&&t(4,c=I.optionsComponent)},n.$$.update=()=>{n.$$.dirty&4098&&t(6,i=!H.isEmpty(H.getNestedVal(o,r))),n.$$.dirty&3&&(f.enabled||Qi(r))},[f,r,a,u,c,d,i,v,l,m,h,_,o,k,y,T,C,M,$,D,A]}class sA extends ye{constructor(e){super(),ve(this,e,iA,nA,he,{key:1,title:2,icon:3,config:0,optionsComponent:4,expand:9,collapse:10,collapseSiblings:11})}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function gh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i[19]=e,i[20]=t,i}function lA(n){let e,t,i,s,l,o,r,a,u,f,c,d=Object.entries(vl),m=[];for(let k=0;kP(m[k],1,1,()=>{m[k]=null});let _=!n[4]&&yh(n),v=n[5]&&kh(n);return{c(){e=b("div");for(let k=0;kn[11](e,t),o=()=>n[11](null,t);function r(u){n[12](u,n[17])}let a={single:!0,key:n[17],title:n[18].title,icon:n[18].icon||"ri-fingerprint-line",optionsComponent:n[18].optionsComponent};return n[0][n[17]]!==void 0&&(a.config=n[0][n[17]]),e=new sA({props:a}),l(),se.push(()=>_e(e,"config",r)),{c(){V(e.$$.fragment)},m(u,f){q(e,u,f),s=!0},p(u,f){n=u,t!==n[17]&&(o(),t=n[17],l());const c={};!i&&f&1&&(i=!0,c.config=n[0][n[17]],ke(()=>i=!1)),e.$set(c)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){o(),j(e,u)}}}function vh(n){var s;let e,t,i=(n[4]||!n[18].hidden||((s=n[0][n[17]])==null?void 0:s.enabled))&&bh(n);return{c(){i&&i.c(),e=$e()},m(l,o){i&&i.m(l,o),S(l,e,o),t=!0},p(l,o){var r;l[4]||!l[18].hidden||(r=l[0][l[17]])!=null&&r.enabled?i?(i.p(l,o),o&17&&E(i,1)):(i=bh(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(re(),P(i,1,1,()=>{i=null}),ae())},i(l){t||(E(i),t=!0)},o(l){P(i),t=!1},d(l){i&&i.d(l),l&&w(e)}}}function yh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=` - Show all`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint m-t-10")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[13]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function kh(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function rA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[oA,lA],y=[];function T(C,M){return C[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[6]),r=O(),a=b("div"),u=b("form"),f=b("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[7])),_=!0)},p(C,M){(!h||M&64)&&le(o,C[6]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function aA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[rA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&2097279&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function uA(n,e,t){let i,s,l;Ye(n,St,C=>t(6,l=C)),Kt(St,l="Auth providers",l);let o={},r={},a={},u=!1,f=!1,c=!1;d();async function d(){t(2,u=!0);try{const C=await pe.settings.getAll()||{};h(C)}catch(C){pe.errorResponseHandler(C)}t(2,u=!1)}async function m(){var C;if(!(f||!s)){t(3,f=!0);try{const M=await pe.settings.update(H.filterRedactedProps(a));h(M),Bn({}),(C=o[Object.keys(o)[0]])==null||C.collapseSiblings(),zt("Successfully updated auth providers.")}catch(M){pe.errorResponseHandler(M)}t(3,f=!1)}}function h(C){C=C||{},t(0,a={});for(const M in vl)t(0,a[M]=Object.assign({enabled:!1},C[M]),a);t(9,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(C,M){se[C?"unshift":"push"](()=>{o[M]=C,t(1,o)})}function k(C,M){n.$$.not_equal(a[M],C)&&(a[M]=C,t(0,a))}const y=()=>t(4,c=!0),T=()=>_();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(r)),n.$$.dirty&1025&&t(5,s=i!=JSON.stringify(a))},[a,o,u,f,c,s,l,m,_,r,i,v,k,y,T]}class fA extends ye{constructor(e){super(),ve(this,e,uA,aA,he,{})}}function wh(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function cA(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,m,h=n[5];const _=k=>k[16].key;for(let k=0;k({19:l}),({uniqueId:l})=>l?524288:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=$e(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&1572865&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function Th(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function mA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[dA,cA],y=[];function T(C,M){return C[1]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[4]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

Adjust common token options.

",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[6])),_=!0)},p(C,M){(!h||M&16)&&le(o,C[4]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function hA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[mA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048607&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function _A(n,e,t){let i,s,l;Ye(n,St,T=>t(4,l=T));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];Kt(St,l="Token options",l);let r={},a={},u=!1,f=!1;c();async function c(){t(1,u=!0);try{const T=await pe.settings.getAll()||{};m(T)}catch(T){pe.errorResponseHandler(T)}t(1,u=!1)}async function d(){if(!(f||!s)){t(2,f=!0);try{const T=await pe.settings.update(H.filterRedactedProps(a));m(T),zt("Successfully saved tokens options.")}catch(T){pe.errorResponseHandler(T)}t(2,f=!1)}}function m(T){var C;T=T||{},t(0,a={});for(const M of o)t(0,a[M.key]={duration:((C=T[M.key])==null?void 0:C.duration)||0},a);t(8,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(T){a[T.key].duration=pt(this.value),t(0,a)}const v=T=>{a[T.key].secret?(delete a[T.key].secret,t(0,a)):t(0,a[T.key].secret=H.randomString(50),a)},k=()=>h(),y=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(3,s=i!=JSON.stringify(a))},[a,u,f,s,l,o,d,h,r,i,_,v,k,y]}class gA extends ye{constructor(e){super(),ve(this,e,_A,hA,he,{})}}function bA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h;return o=new Ab({props:{content:n[2]}}),{c(){e=b("div"),e.innerHTML=`

Below you'll find your current collections configuration that you could import in + Show all`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint m-t-10")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[13]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function kh(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function rA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[oA,lA],y=[];function T(C,M){return C[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[6]),r=O(),a=b("div"),u=b("form"),f=b("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[7])),_=!0)},p(C,M){(!h||M&64)&&le(o,C[6]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function aA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[rA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&2097279&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function uA(n,e,t){let i,s,l;Ye(n,St,C=>t(6,l=C)),Kt(St,l="Auth providers",l);let o={},r={},a={},u=!1,f=!1,c=!1;d();async function d(){t(2,u=!0);try{const C=await pe.settings.getAll()||{};h(C)}catch(C){pe.errorResponseHandler(C)}t(2,u=!1)}async function m(){var C;if(!(f||!s)){t(3,f=!0);try{const M=await pe.settings.update(H.filterRedactedProps(a));h(M),Bn({}),(C=o[Object.keys(o)[0]])==null||C.collapseSiblings(),zt("Successfully updated auth providers.")}catch(M){pe.errorResponseHandler(M)}t(3,f=!1)}}function h(C){C=C||{},t(0,a={});for(const M in vl)t(0,a[M]=Object.assign({enabled:!1},C[M]),a);t(9,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(C,M){se[C?"unshift":"push"](()=>{o[M]=C,t(1,o)})}function k(C,M){n.$$.not_equal(a[M],C)&&(a[M]=C,t(0,a))}const y=()=>t(4,c=!0),T=()=>_();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(r)),n.$$.dirty&1025&&t(5,s=i!=JSON.stringify(a))},[a,o,u,f,c,s,l,m,_,r,i,v,k,y,T]}class fA extends ye{constructor(e){super(),ve(this,e,uA,aA,he,{})}}function wh(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function cA(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,m,h=n[5];const _=k=>k[16].key;for(let k=0;k({19:l}),({uniqueId:l})=>l?524288:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=$e(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&1572865&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function Th(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function mA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[dA,cA],y=[];function T(C,M){return C[1]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[4]),r=O(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

Adjust common token options.

",c=O(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,M){S(C,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(C,r,M),S(C,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",dt(n[6])),_=!0)},p(C,M){(!h||M&16)&&le(o,C[4]);let $=d;d=T(C),d===$?y[d].p(C,M):(re(),P(y[$],1,1,()=>{y[$]=null}),ae(),m=y[d],m?m.p(C,M):(m=y[d]=k[d](C),m.c()),E(m,1),m.m(u,null))},i(C){h||(E(m),h=!0)},o(C){P(m),h=!1},d(C){C&&w(e),C&&w(r),C&&w(a),y[d].d(),_=!1,v()}}}function hA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[mA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048607&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function _A(n,e,t){let i,s,l;Ye(n,St,T=>t(4,l=T));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];Kt(St,l="Token options",l);let r={},a={},u=!1,f=!1;c();async function c(){t(1,u=!0);try{const T=await pe.settings.getAll()||{};m(T)}catch(T){pe.errorResponseHandler(T)}t(1,u=!1)}async function d(){if(!(f||!s)){t(2,f=!0);try{const T=await pe.settings.update(H.filterRedactedProps(a));m(T),zt("Successfully saved tokens options.")}catch(T){pe.errorResponseHandler(T)}t(2,f=!1)}}function m(T){var C;T=T||{},t(0,a={});for(const M of o)t(0,a[M.key]={duration:((C=T[M.key])==null?void 0:C.duration)||0},a);t(8,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(T){a[T.key].duration=pt(this.value),t(0,a)}const v=T=>{a[T.key].secret?(delete a[T.key].secret,t(0,a)):t(0,a[T.key].secret=H.randomString(50),a)},k=()=>h(),y=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(3,s=i!=JSON.stringify(a))},[a,u,f,s,l,o,d,h,r,i,_,v,k,y]}class gA extends ye{constructor(e){super(),ve(this,e,_A,hA,he,{})}}function bA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h;return o=new A1({props:{content:n[2]}}),{c(){e=b("div"),e.innerHTML=`

Below you'll find your current collections configuration that you could import in another PocketBase environment.

`,t=O(),i=b("div"),s=b("button"),s.innerHTML='Copy',l=O(),V(o.$$.fragment),r=O(),a=b("div"),u=b("div"),f=O(),c=b("button"),c.innerHTML=` Download as JSON`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(_,v){S(_,e,v),S(_,t,v),S(_,i,v),g(i,s),g(i,l),q(o,i,null),n[8](i),S(_,r,v),S(_,a,v),g(a,u),g(a,f),g(a,c),d=!0,m||(h=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],m=!0)},p(_,v){const k={};v&4&&(k.content=_[2]),o.$set(k)},i(_){d||(E(o.$$.fragment,_),d=!0)},o(_){P(o.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(t),_&&w(i),j(o),n[8](null),_&&w(r),_&&w(a),m=!1,Pe(h)}}}function vA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function yA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[vA,bA],h=[];function _(v,k){return v[1]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[3]),r=O(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k&8)&&le(o,v[3]);let y=f;f=_(v),f===y?h[f].p(v,k):(re(),P(h[y],1,1,()=>{h[y]=null}),ae(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),E(c,1),c.m(u,null))},i(v){d||(E(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function kA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[yA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function wA(n,e,t){let i,s;Ye(n,St,v=>t(3,s=v)),Kt(St,s="Export collections",s);const l="export_"+H.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await pe.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let v of r)delete v.created,delete v.updated}catch(v){pe.errorResponseHandler(v)}t(1,a=!1)}function f(){H.downloadJson(r,"pb_schema")}function c(){H.copyToClipboard(i),Eg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(v){se[v?"unshift":"push"](()=>{o=v,t(0,o)})}const h=v=>{if(v.ctrlKey&&v.code==="KeyA"){v.preventDefault();const k=window.getSelection(),y=document.createRange();y.selectNodeContents(o),k.removeAllRanges(),k.addRange(y)}},_=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,m,h,_]}class SA extends ye{constructor(e){super(),ve(this,e,wA,kA,he,{})}}function Ch(n,e,t){const i=n.slice();return i[14]=e[t],i}function $h(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Mh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Dh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Eh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Ah(n,e,t){const i=n.slice();return i[30]=e[t],i}function TA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Ih(),a=n[0].name!==n[1].name&&Ph(n);return{c(){e=b("div"),r&&r.c(),t=O(),a&&a.c(),i=O(),s=b("strong"),o=B(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),g(e,t),a&&a.m(e,null),g(e,i),g(e,s),g(s,o)},p(u,f){u[9]?r||(r=Ih(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Ph(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function CA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Deleted",t=O(),i=b("strong"),l=B(s),p(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function $A(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Added",t=O(),i=b("strong"),l=B(s),p(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function Ih(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Ph(n){let e,t=n[0].name+"",i,s,l;return{c(){e=b("strong"),i=B(t),s=O(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),g(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function Lh(n){var v,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((v=n[0])==null?void 0:v[n[30]])+"",f,c,d,m,h=n[12]((k=n[1])==null?void 0:k[n[30]])+"",_;return{c(){var y,T,C,M,$,D;e=b("tr"),t=b("td"),i=b("span"),l=B(s),o=O(),r=b("td"),a=b("pre"),f=B(u),c=O(),d=b("td"),m=b("pre"),_=B(h),p(t,"class","min-width svelte-lmkr38"),p(a,"class","txt"),p(r,"class","svelte-lmkr38"),x(r,"changed-old-col",!n[10]&&un((y=n[0])==null?void 0:y[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(r,"changed-none-col",n[10]),p(m,"class","txt"),p(d,"class","svelte-lmkr38"),x(d,"changed-new-col",!n[5]&&un((C=n[0])==null?void 0:C[n[30]],(M=n[1])==null?void 0:M[n[30]])),x(d,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",un(($=n[0])==null?void 0:$[n[30]],(D=n[1])==null?void 0:D[n[30]]))},m(y,T){S(y,e,T),g(e,t),g(t,i),g(i,l),g(e,o),g(e,r),g(r,a),g(a,f),g(e,c),g(e,d),g(d,m),g(m,_)},p(y,T){var C,M,$,D,A,I,L,F;T[0]&1&&u!==(u=y[12]((C=y[0])==null?void 0:C[y[30]])+"")&&le(f,u),T[0]&3075&&x(r,"changed-old-col",!y[10]&&un((M=y[0])==null?void 0:M[y[30]],($=y[1])==null?void 0:$[y[30]])),T[0]&1024&&x(r,"changed-none-col",y[10]),T[0]&2&&h!==(h=y[12]((D=y[1])==null?void 0:D[y[30]])+"")&&le(_,h),T[0]&2083&&x(d,"changed-new-col",!y[5]&&un((A=y[0])==null?void 0:A[y[30]],(I=y[1])==null?void 0:I[y[30]])),T[0]&32&&x(d,"changed-none-col",y[5]),T[0]&2051&&x(e,"txt-primary",un((L=y[0])==null?void 0:L[y[30]],(F=y[1])==null?void 0:F[y[30]]))},d(y){y&&w(e)}}}function Nh(n){let e,t=n[6],i=[];for(let s=0;sProps Old @@ -199,6 +199,6 @@ Updated: ${v[1].updated}`,position:"left"}),k[0]&536870912&&d!==(d=v[29])&&p(c," `),o=b("button"),o.innerHTML='Load from JSON file',r=O(),V(a.$$.fragment),u=O(),f=O(),I&&I.c(),c=O(),L&&L.c(),d=O(),F&&F.c(),m=O(),h=b("div"),N&&N.c(),_=O(),v=b("div"),k=O(),y=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(v,"class","flex-fill"),p(T,"class","txt"),p(y,"type","button"),p(y,"class","btn btn-expanded btn-warning m-l-auto"),y.disabled=C=!n[14],p(h,"class","flex m-t-base")},m(R,K){S(R,e,K),n[19](e),S(R,t,K),S(R,i,K),g(i,s),g(s,l),g(s,o),S(R,r,K),q(a,R,K),S(R,u,K),S(R,f,K),I&&I.m(R,K),S(R,c,K),L&&L.m(R,K),S(R,d,K),F&&F.m(R,K),S(R,m,K),S(R,h,K),N&&N.m(h,null),g(h,_),g(h,v),g(h,k),g(h,y),g(y,T),M=!0,$||(D=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(y,"click",n[26])],$=!0)},p(R,K){(!M||K[0]&4096)&&x(o,"btn-loading",R[12]);const Q={};K[0]&64&&(Q.class="form-field "+(R[6]?"":"field-error")),K[0]&65|K[1]&1536&&(Q.$$scope={dirty:K,ctx:R}),a.$set(Q),R[6]&&R[1].length&&!R[7]?I||(I=Zh(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?L?L.p(R,K):(L=Gh(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?F?F.p(R,K):(F=r_(R),F.c(),F.m(m.parentNode,m)):F&&(F.d(1),F=null),R[0]?N?N.p(R,K):(N=a_(R),N.c(),N.m(h,_)):N&&(N.d(1),N=null),(!M||K[0]&16384&&C!==(C=!R[14]))&&(y.disabled=C)},i(R){M||(E(a.$$.fragment,R),E(A),M=!0)},o(R){P(a.$$.fragment,R),P(A),M=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),j(a,R),R&&w(u),R&&w(f),I&&I.d(R),R&&w(c),L&&L.d(R),R&&w(d),F&&F.d(R),R&&w(m),R&&w(h),N&&N.d(),$=!1,Pe(D)}}}function RA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function Jh(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function qA(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Jh();return{c(){e=b("label"),t=B("Collections"),s=O(),l=b("textarea"),r=O(),c&&c.c(),a=$e(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),fe(l,n[0]),S(d,r,m),c&&c.m(d,m),S(d,a,m),u||(f=Y(l,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(l,"id",o),m[0]&1&&fe(l,d[0]),d[0]&&!d[6]?c||(c=Jh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function Zh(n){let e;return{c(){e=b("div"),e.innerHTML=`
Your collections configuration is already up-to-date!
`,p(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Gh(n){let e,t,i,s,l,o=n[9].length&&Xh(n),r=n[4].length&&e_(n),a=n[8].length&&s_(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=O(),i=b("div"),o&&o.c(),s=O(),r&&r.c(),l=O(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),g(i,s),r&&r.m(i,null),g(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Xh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=e_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=s_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function Xh(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;oo[35].old.id+o[35].new.id;for(let o=0;oo[32].id;for(let o=0;o',i=O(),s=b("div"),s.innerHTML=`Some of the imported collections shares the same name and/or fields but are imported with different IDs. You can replace them in the import if you want - to.`,l=O(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:G,d(u){u&&w(e),r=!1,a()}}}function a_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function jA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[RA,FA],h=[];function _(v,k){return v[5]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[15]),r=O(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k[0]&32768)&&le(o,v[15]);let y=f;f=_(v),f===y?h[f].p(v,k):(re(),P(h[y],1,1,()=>{h[y]=null}),ae(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),E(c,1),c.m(u,null))},i(v){d||(E(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function VA(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[jA]},$$scope:{ctx:n}}});let r={};return l=new NA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function HA(n,e,t){let i,s,l,o,r,a,u;Ye(n,St,J=>t(15,u=J)),Kt(St,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],v=!0,k=[],y=!1;T();async function T(){t(5,y=!0);try{t(2,_=await pe.collections.getFullList(200));for(let J of _)delete J.created,delete J.updated}catch(J){pe.errorResponseHandler(J)}t(5,y=!1)}function C(){if(t(4,k=[]),!!i)for(let J of h){const ue=H.findByKey(_,"id",J.id);!(ue!=null&&ue.id)||!H.hasCollectionChanges(ue,J,v)||k.push({new:J,old:ue})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=H.filterDuplicatesByKey(h)):t(1,h=[]);for(let J of h)delete J.created,delete J.updated,J.schema=H.filterDuplicatesByKey(J.schema)}function $(){var J,ue;for(let Z of h){const de=H.findByKey(_,"name",Z.name)||H.findByKey(_,"id",Z.id);if(!de)continue;const ge=Z.id,Ce=de.id;Z.id=Ce;const Ne=Array.isArray(de.schema)?de.schema:[],Re=Array.isArray(Z.schema)?Z.schema:[];for(const be of Re){const Se=H.findByKey(Ne,"name",be.name);Se&&Se.id&&(be.id=Se.id)}for(let be of h)if(Array.isArray(be.schema))for(let Se of be.schema)(J=Se.options)!=null&&J.collectionId&&((ue=Se.options)==null?void 0:ue.collectionId)===ge&&(Se.options.collectionId=Ce)}t(0,d=JSON.stringify(h,null,4))}function D(J){t(12,m=!0);const ue=new FileReader;ue.onload=async Z=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Z.target.result),await sn(),h.length||(cl("Invalid collections configuration."),A())},ue.onerror=Z=>{console.warn(Z),cl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ue.readAsText(J)}function A(){t(0,d=""),t(10,f.value="",f),Bn({})}function I(J){se[J?"unshift":"push"](()=>{f=J,t(10,f)})}const L=()=>{f.files.length&&D(f.files[0])},F=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){v=this.checked,t(3,v)}const K=()=>$(),Q=()=>A(),U=()=>c==null?void 0:c.show(_,h,v);function X(J){se[J?"unshift":"push"](()=>{c=J,t(11,c)})}const ne=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=_.filter(J=>i&&v&&!H.findByKey(h,"id",J.id))),n.$$.dirty[0]&70&&t(8,l=h.filter(J=>i&&!H.findByKey(_,"id",J.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof v<"u")&&C(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!y&&i&&o),n.$$.dirty[0]&6&&t(13,a=h.filter(J=>{let ue=H.findByKey(_,"name",J.name)||H.findByKey(_,"id",J.id);if(!ue)return!1;if(ue.id!=J.id)return!0;const Z=Array.isArray(ue.schema)?ue.schema:[],de=Array.isArray(J.schema)?J.schema:[];for(const ge of de){if(H.findByKey(Z,"id",ge.id))continue;const Ne=H.findByKey(Z,"name",ge.name);if(Ne&&ge.id!=Ne.id)return!0}return!1}))},[d,h,_,v,k,y,i,o,l,s,f,c,m,a,r,u,$,D,A,I,L,F,N,R,K,Q,U,X,ne]}class zA extends ye{constructor(e){super(),ve(this,e,HA,VA,he,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Oi("/"):!0}],BA={"/login":Mt({component:qD,conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Mt({asyncComponent:()=>rt(()=>import("./PageAdminRequestPasswordReset-caf75d16.js"),[],import.meta.url),conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageAdminConfirmPasswordReset-a8627fa6.js"),[],import.meta.url),conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Mt({component:aD,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Mt({component:N3,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Mt({component:JD,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Mt({component:ID,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Mt({component:IE,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Mt({component:JE,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Mt({component:fA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Mt({component:gA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Mt({component:SA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Mt({component:zA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-ae243296.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-ae243296.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-e6772423.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-e6772423.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-e9ff1996.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-e9ff1996.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":Mt({component:ny,userData:{showAppSidebar:!1}})};function UA(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Bo}=i;return{delay:f,duration:Bt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const _=h*a,v=h*u,k=m+h*e.width/t.width,y=m+h*e.height/t.height;return`transform: ${l} translate(${_}px, ${v}px) scale(${k}, ${y});`}}}function u_(n,e,t){const i=n.slice();return i[2]=e[t],i}function WA(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function YA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function KA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function JA(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function f_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,m=G,h,_,v;function k(M,$){return M[2].type==="info"?JA:M[2].type==="success"?KA:M[2].type==="warning"?YA:WA}let y=k(e),T=y(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),s=O(),l=b("div"),r=B(o),a=O(),u=b("button"),u.innerHTML='',f=O(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,$){S(M,t,$),g(t,i),T.m(i,null),g(t,s),g(t,l),g(l,r),g(t,a),g(t,u),g(t,f),h=!0,_||(v=Y(u,"click",dt(C)),_=!0)},p(M,$){e=M,y!==(y=k(e))&&(T.d(1),T=y(e),T&&(T.c(),T.m(i,null))),(!h||$&1)&&o!==(o=e[2].message+"")&&le(r,o),(!h||$&1)&&x(t,"alert-info",e[2].type=="info"),(!h||$&1)&&x(t,"alert-success",e[2].type=="success"),(!h||$&1)&&x(t,"alert-danger",e[2].type=="error"),(!h||$&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){d=t.getBoundingClientRect()},f(){o1(t),m(),v_(t,d)},a(){m(),m=l1(t,d,UA,{duration:150})},i(M){h||(xe(()=>{c||(c=je(t,yo,{duration:150},!0)),c.run(1)}),h=!0)},o(M){c||(c=je(t,yo,{duration:150},!1)),c.run(0),h=!1},d(M){M&&w(t),T.d(),M&&c&&c.end(),_=!1,v()}}}function ZA(n){let e,t=[],i=new Map,s,l=n[0];const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>Ag(l)]}class XA extends ye{constructor(e){super(),ve(this,e,GA,ZA,he,{})}}function QA(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=b("h4"),i=B(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){S(l,e,o),g(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&le(i,t)},d(l){l&&w(e)}}}function xA(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=O(),s=b("button"),l=b("span"),l.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],x(s,"btn-loading",n[2])},m(a,u){S(a,e,u),g(e,t),S(a,i,u),S(a,s,u),g(s,l),e.focus(),o||(r=[Y(e,"click",n[4]),Y(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&x(s,"btn-loading",a[2])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Pe(r)}}}function e6(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[xA],header:[QA]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function t6(n,e,t){let i;Ye(n,eu,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){se[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await sn(),t(3,o=!1),Lb()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class n6 extends ye{constructor(e){super(),ve(this,e,t6,e6,he,{})}}function c_(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y;return _=new ei({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[i6]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=O(),s=b("nav"),l=b("a"),l.innerHTML='',o=O(),r=b("a"),r.innerHTML='',a=O(),u=b("a"),u.innerHTML='',f=O(),c=b("figure"),d=b("img"),h=O(),V(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),Hn(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,C){S(T,e,C),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),g(s,r),g(s,a),g(s,u),g(e,f),g(e,c),g(c,d),g(c,h),q(_,c,null),v=!0,k||(y=[Ie(xt.call(null,t)),Ie(xt.call(null,l)),Ie(qn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ie(Ue.call(null,l,{text:"Collections",position:"right"})),Ie(xt.call(null,r)),Ie(qn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ie(Ue.call(null,r,{text:"Logs",position:"right"})),Ie(xt.call(null,u)),Ie(qn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ie(Ue.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p(T,C){var $;(!v||C&1&&!Hn(d.src,m="./images/avatars/avatar"+((($=T[0])==null?void 0:$.avatar)||0)+".svg"))&&p(d,"src",m);const M={};C&1024&&(M.$$scope={dirty:C,ctx:T}),_.$set(M)},i(T){v||(E(_.$$.fragment,T),v=!0)},o(T){P(_.$$.fragment,T),v=!1},d(T){T&&w(e),j(_),k=!1,Pe(y)}}}function i6(n){let e,t,i,s,l,o,r;return{c(){e=b("a"),e.innerHTML=` + to.`,l=O(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:G,d(u){u&&w(e),r=!1,a()}}}function a_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function jA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[RA,FA],h=[];function _(v,k){return v[5]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=O(),l=b("div"),o=B(n[15]),r=O(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k[0]&32768)&&le(o,v[15]);let y=f;f=_(v),f===y?h[f].p(v,k):(re(),P(h[y],1,1,()=>{h[y]=null}),ae(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),E(c,1),c.m(u,null))},i(v){d||(E(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function VA(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[jA]},$$scope:{ctx:n}}});let r={};return l=new NA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=O(),V(i.$$.fragment),s=O(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function HA(n,e,t){let i,s,l,o,r,a,u;Ye(n,St,J=>t(15,u=J)),Kt(St,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],v=!0,k=[],y=!1;T();async function T(){t(5,y=!0);try{t(2,_=await pe.collections.getFullList(200));for(let J of _)delete J.created,delete J.updated}catch(J){pe.errorResponseHandler(J)}t(5,y=!1)}function C(){if(t(4,k=[]),!!i)for(let J of h){const ue=H.findByKey(_,"id",J.id);!(ue!=null&&ue.id)||!H.hasCollectionChanges(ue,J,v)||k.push({new:J,old:ue})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=H.filterDuplicatesByKey(h)):t(1,h=[]);for(let J of h)delete J.created,delete J.updated,J.schema=H.filterDuplicatesByKey(J.schema)}function $(){var J,ue;for(let Z of h){const de=H.findByKey(_,"name",Z.name)||H.findByKey(_,"id",Z.id);if(!de)continue;const ge=Z.id,Ce=de.id;Z.id=Ce;const Ne=Array.isArray(de.schema)?de.schema:[],Re=Array.isArray(Z.schema)?Z.schema:[];for(const be of Re){const Se=H.findByKey(Ne,"name",be.name);Se&&Se.id&&(be.id=Se.id)}for(let be of h)if(Array.isArray(be.schema))for(let Se of be.schema)(J=Se.options)!=null&&J.collectionId&&((ue=Se.options)==null?void 0:ue.collectionId)===ge&&(Se.options.collectionId=Ce)}t(0,d=JSON.stringify(h,null,4))}function D(J){t(12,m=!0);const ue=new FileReader;ue.onload=async Z=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Z.target.result),await sn(),h.length||(cl("Invalid collections configuration."),A())},ue.onerror=Z=>{console.warn(Z),cl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ue.readAsText(J)}function A(){t(0,d=""),t(10,f.value="",f),Bn({})}function I(J){se[J?"unshift":"push"](()=>{f=J,t(10,f)})}const L=()=>{f.files.length&&D(f.files[0])},F=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){v=this.checked,t(3,v)}const K=()=>$(),Q=()=>A(),U=()=>c==null?void 0:c.show(_,h,v);function X(J){se[J?"unshift":"push"](()=>{c=J,t(11,c)})}const ne=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=_.filter(J=>i&&v&&!H.findByKey(h,"id",J.id))),n.$$.dirty[0]&70&&t(8,l=h.filter(J=>i&&!H.findByKey(_,"id",J.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof v<"u")&&C(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!y&&i&&o),n.$$.dirty[0]&6&&t(13,a=h.filter(J=>{let ue=H.findByKey(_,"name",J.name)||H.findByKey(_,"id",J.id);if(!ue)return!1;if(ue.id!=J.id)return!0;const Z=Array.isArray(ue.schema)?ue.schema:[],de=Array.isArray(J.schema)?J.schema:[];for(const ge of de){if(H.findByKey(Z,"id",ge.id))continue;const Ne=H.findByKey(Z,"name",ge.name);if(Ne&&ge.id!=Ne.id)return!0}return!1}))},[d,h,_,v,k,y,i,o,l,s,f,c,m,a,r,u,$,D,A,I,L,F,N,R,K,Q,U,X,ne]}class zA extends ye{constructor(e){super(),ve(this,e,HA,VA,he,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Oi("/"):!0}],BA={"/login":Mt({component:qD,conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Mt({asyncComponent:()=>rt(()=>import("./PageAdminRequestPasswordReset-a3fb07bb.js"),[],import.meta.url),conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageAdminConfirmPasswordReset-cfe9e164.js"),[],import.meta.url),conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Mt({component:aD,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Mt({component:N3,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Mt({component:JD,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Mt({component:ID,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Mt({component:IE,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Mt({component:JE,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Mt({component:fA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Mt({component:gA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Mt({component:SA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Mt({component:zA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-c400898d.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-c400898d.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-31a028ed.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-31a028ed.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-92497cc2.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-92497cc2.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":Mt({component:ny,userData:{showAppSidebar:!1}})};function UA(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Bo}=i;return{delay:f,duration:Bt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const _=h*a,v=h*u,k=m+h*e.width/t.width,y=m+h*e.height/t.height;return`transform: ${l} translate(${_}px, ${v}px) scale(${k}, ${y});`}}}function u_(n,e,t){const i=n.slice();return i[2]=e[t],i}function WA(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function YA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function KA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function JA(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function f_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,m=G,h,_,v;function k(M,$){return M[2].type==="info"?JA:M[2].type==="success"?KA:M[2].type==="warning"?YA:WA}let y=k(e),T=y(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),s=O(),l=b("div"),r=B(o),a=O(),u=b("button"),u.innerHTML='',f=O(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,$){S(M,t,$),g(t,i),T.m(i,null),g(t,s),g(t,l),g(l,r),g(t,a),g(t,u),g(t,f),h=!0,_||(v=Y(u,"click",dt(C)),_=!0)},p(M,$){e=M,y!==(y=k(e))&&(T.d(1),T=y(e),T&&(T.c(),T.m(i,null))),(!h||$&1)&&o!==(o=e[2].message+"")&&le(r,o),(!h||$&1)&&x(t,"alert-info",e[2].type=="info"),(!h||$&1)&&x(t,"alert-success",e[2].type=="success"),(!h||$&1)&&x(t,"alert-danger",e[2].type=="error"),(!h||$&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){d=t.getBoundingClientRect()},f(){ob(t),m(),v_(t,d)},a(){m(),m=lb(t,d,UA,{duration:150})},i(M){h||(xe(()=>{c||(c=je(t,yo,{duration:150},!0)),c.run(1)}),h=!0)},o(M){c||(c=je(t,yo,{duration:150},!1)),c.run(0),h=!1},d(M){M&&w(t),T.d(),M&&c&&c.end(),_=!1,v()}}}function ZA(n){let e,t=[],i=new Map,s,l=n[0];const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>Ag(l)]}class XA extends ye{constructor(e){super(),ve(this,e,GA,ZA,he,{})}}function QA(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=b("h4"),i=B(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){S(l,e,o),g(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&le(i,t)},d(l){l&&w(e)}}}function xA(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=O(),s=b("button"),l=b("span"),l.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],x(s,"btn-loading",n[2])},m(a,u){S(a,e,u),g(e,t),S(a,i,u),S(a,s,u),g(s,l),e.focus(),o||(r=[Y(e,"click",n[4]),Y(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&x(s,"btn-loading",a[2])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Pe(r)}}}function e6(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[xA],header:[QA]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function t6(n,e,t){let i;Ye(n,eu,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){se[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await sn(),t(3,o=!1),L1()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class n6 extends ye{constructor(e){super(),ve(this,e,t6,e6,he,{})}}function c_(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y;return _=new ei({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[i6]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=O(),s=b("nav"),l=b("a"),l.innerHTML='',o=O(),r=b("a"),r.innerHTML='',a=O(),u=b("a"),u.innerHTML='',f=O(),c=b("figure"),d=b("img"),h=O(),V(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),Hn(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,C){S(T,e,C),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),g(s,r),g(s,a),g(s,u),g(e,f),g(e,c),g(c,d),g(c,h),q(_,c,null),v=!0,k||(y=[Ie(xt.call(null,t)),Ie(xt.call(null,l)),Ie(qn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ie(Ue.call(null,l,{text:"Collections",position:"right"})),Ie(xt.call(null,r)),Ie(qn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ie(Ue.call(null,r,{text:"Logs",position:"right"})),Ie(xt.call(null,u)),Ie(qn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ie(Ue.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p(T,C){var $;(!v||C&1&&!Hn(d.src,m="./images/avatars/avatar"+((($=T[0])==null?void 0:$.avatar)||0)+".svg"))&&p(d,"src",m);const M={};C&1024&&(M.$$scope={dirty:C,ctx:T}),_.$set(M)},i(T){v||(E(_.$$.fragment,T),v=!0)},o(T){P(_.$$.fragment,T),v=!1},d(T){T&&w(e),j(_),k=!1,Pe(y)}}}function i6(n){let e,t,i,s,l,o,r;return{c(){e=b("a"),e.innerHTML=` Manage admins`,t=O(),i=b("hr"),s=O(),l=b("button"),l.innerHTML=` - Logout`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ie(xt.call(null,e)),Y(l,"click",n[6])],o=!0)},p:G,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Pe(r)}}}function s6(n){var m;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=H.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((m=n[0])==null?void 0:m.id)&&n[1]&&c_(n);return o=new b1({props:{routes:BA}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new XA({}),f=new n6({}),{c(){t=O(),i=b("div"),d&&d.c(),s=O(),l=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(h,_){S(h,t,_),S(h,i,_),d&&d.m(i,null),g(i,s),g(i,l),q(o,l,null),g(l,r),q(a,l,null),S(h,u,_),q(f,h,_),c=!0},p(h,[_]){var v;(!c||_&12)&&e!==(e=H.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(v=h[0])!=null&&v.id&&h[1]?d?(d.p(h,_),_&3&&E(d,1)):(d=c_(h),d.c(),E(d,1),d.m(i,s)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(h){c||(E(d),E(o.$$.fragment,h),E(a.$$.fragment,h),E(f.$$.fragment,h),c=!0)},o(h){P(d),P(o.$$.fragment,h),P(a.$$.fragment,h),P(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function l6(n,e,t){let i,s,l,o;Ye(n,$s,m=>t(8,i=m)),Ye(n,vo,m=>t(2,s=m)),Ye(n,Da,m=>t(0,l=m)),Ye(n,St,m=>t(3,o=m));let r,a=!1;function u(m){var h,_,v,k;((h=m==null?void 0:m.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((v=(_=m==null?void 0:m.detail)==null?void 0:_.userData)!=null&&v.showAppSidebar)),r=(k=m==null?void 0:m.detail)==null?void 0:k.location,Kt(St,o="",o),Bn({}),Lb())}function f(){Oi("/")}async function c(){var m,h;if(l!=null&&l.id)try{const _=await pe.settings.getAll({$cancelKey:"initialAppSettings"});Kt(vo,s=((m=_==null?void 0:_.meta)==null?void 0:m.appName)||"",s),Kt($s,i=!!((h=_==null?void 0:_.meta)!=null&&h.hideControls),i)}catch(_){_!=null&&_.isAbort||console.warn("Failed to load app settings.",_)}}function d(){pe.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class o6 extends ye{constructor(e){super(),ve(this,e,l6,s6,he,{})}}new o6({target:document.getElementById("app")});export{Pe as A,zt as B,H as C,Oi as D,$e as E,Ig as F,ba as G,hu as H,Ye as I,Ai as J,$t as K,Zt as L,se as M,Ab as N,wt as O,es as P,ln as Q,pn as R,ye as S,Lr as T,P as a,O as b,V as c,j as d,b as e,p as f,S as g,g as h,ve as i,Ie as j,re as k,xt as l,q as m,ae as n,w as o,pe as p,me as q,x as r,he as s,E as t,Y as u,dt as v,B as w,le as x,G as y,fe as z}; + Logout`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ie(xt.call(null,e)),Y(l,"click",n[6])],o=!0)},p:G,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Pe(r)}}}function s6(n){var m;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=H.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((m=n[0])==null?void 0:m.id)&&n[1]&&c_(n);return o=new bb({props:{routes:BA}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new XA({}),f=new n6({}),{c(){t=O(),i=b("div"),d&&d.c(),s=O(),l=b("div"),V(o.$$.fragment),r=O(),V(a.$$.fragment),u=O(),V(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(h,_){S(h,t,_),S(h,i,_),d&&d.m(i,null),g(i,s),g(i,l),q(o,l,null),g(l,r),q(a,l,null),S(h,u,_),q(f,h,_),c=!0},p(h,[_]){var v;(!c||_&12)&&e!==(e=H.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(v=h[0])!=null&&v.id&&h[1]?d?(d.p(h,_),_&3&&E(d,1)):(d=c_(h),d.c(),E(d,1),d.m(i,s)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(h){c||(E(d),E(o.$$.fragment,h),E(a.$$.fragment,h),E(f.$$.fragment,h),c=!0)},o(h){P(d),P(o.$$.fragment,h),P(a.$$.fragment,h),P(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function l6(n,e,t){let i,s,l,o;Ye(n,$s,m=>t(8,i=m)),Ye(n,vo,m=>t(2,s=m)),Ye(n,Da,m=>t(0,l=m)),Ye(n,St,m=>t(3,o=m));let r,a=!1;function u(m){var h,_,v,k;((h=m==null?void 0:m.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((v=(_=m==null?void 0:m.detail)==null?void 0:_.userData)!=null&&v.showAppSidebar)),r=(k=m==null?void 0:m.detail)==null?void 0:k.location,Kt(St,o="",o),Bn({}),L1())}function f(){Oi("/")}async function c(){var m,h;if(l!=null&&l.id)try{const _=await pe.settings.getAll({$cancelKey:"initialAppSettings"});Kt(vo,s=((m=_==null?void 0:_.meta)==null?void 0:m.appName)||"",s),Kt($s,i=!!((h=_==null?void 0:_.meta)!=null&&h.hideControls),i)}catch(_){_!=null&&_.isAbort||console.warn("Failed to load app settings.",_)}}function d(){pe.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class o6 extends ye{constructor(e){super(),ve(this,e,l6,s6,he,{})}}new o6({target:document.getElementById("app")});export{Pe as A,zt as B,H as C,Oi as D,$e as E,Ig as F,ba as G,hu as H,Ye as I,Ai as J,$t as K,Zt as L,se as M,A1 as N,wt as O,es as P,ln as Q,pn as R,ye as S,Lr as T,P as a,O as b,V as c,j as d,b as e,p as f,S as g,g as h,ve as i,Ie as j,re as k,xt as l,q as m,ae as n,w as o,pe as p,me as q,x as r,he as s,E as t,Y as u,dt as v,B as w,le as x,G as y,fe as z}; diff --git a/ui/dist/assets/index-96653a6b.js b/ui/dist/assets/index-96653a6b.js deleted file mode 100644 index 913b0781..00000000 --- a/ui/dist/assets/index-96653a6b.js +++ /dev/null @@ -1,13 +0,0 @@ -class I{constructor(){}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,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),qe.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),qe.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new ii(this),r=new ii(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new ii(this,e)}iterRange(e,t=this.length){return new rl(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ol(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?I.empty:e.length<=32?new G(e):qe.from(G.split(e,[]))}}class G extends I{constructor(e,t=Gh(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Jh(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(kr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=$i(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new G(l,o.length+r.length));else{let a=l.length>>1;i.push(new G(l.slice(0,a)),new G(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof G))return super.replace(e,t,i);let s=$i(this.text,$i(i.text,kr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new G(s,r):qe.from(G.split(s,[]),r)}sliceString(e,t=this.length,i=` -`){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new G(i,s)),i=[],s=-1);return s>-1&&t.push(new G(i,s)),t}}class qe extends I{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new qe(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` -`){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof qe))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new G(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof qe)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof G&&a&&(p=c[c.length-1])instanceof G&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new G(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:qe.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new qe(l,t)}}I.empty=new G([""],0);function Gh(n){let e=-1;for(let t of n)e+=t.length+1;return e}function $i(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof G?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof G?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(s instanceof G){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof G?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class rl{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ii(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),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 ol{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=function(){return this.iter()},ii.prototype[Symbol.iterator]=rl.prototype[Symbol.iterator]=ol.prototype[Symbol.iterator]=function(){return this});class Jh{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Rt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return Rt[e-1]<=n;return!1}function Cr(n){return n>=127462&&n<=127487}const Ar=8205;function ue(n,e,t=!0,i=!0){return(t?ll:Xh)(n,e,i)}function ll(n,e,t){if(e==n.length)return e;e&&al(n.charCodeAt(e))&&hl(n.charCodeAt(e-1))&&e--;let i=ne(n,e);for(e+=De(i);e=0&&Cr(ne(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Xh(n,e,t){for(;e>0;){let i=ll(n,e-2,t);if(i=56320&&n<57344}function hl(n){return n>=55296&&n<56320}function ne(n,e){let t=n.charCodeAt(e);if(!hl(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return al(i)?(t-55296<<10)+(i-56320)+65536:t}function Ks(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function De(n){return n<65536?1:2}const Zn=/\r\n?|\n/;var he=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(he||(he={}));class Ue{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=he.Simple&&h>=e&&(i==he.TrackDel&&se||i==he.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ue(e)}static create(e){return new Ue(e)}}class Y extends Ue{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return es(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return ts(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&it(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?I.of(d.split(i||Zn)):d:I.empty,m=p.length;if(f==u&&m==0)return;fo&&ae(s,f-o,-1),ae(s,u-f,m),it(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new Y(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function it(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function ts(n,e,t,i=!1){let s=[],r=i?[]:null,o=new ri(n),l=new ri(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ae(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class ri{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?I.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?I.empty:t[i].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 gt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new gt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}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 b.range(e.anchor,e.head)}static create(e,t,i){return new gt(e,t,i)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.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 b(e.ranges.map(t=>gt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?b.range(a,l):b.range(l,a))}}return new b(e,t)}}function fl(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let js=0;class D{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=js++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new D(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Us),!!e.static,e.enables)}of(e){return new Ki([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ki(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ki(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Us(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Ki{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=js++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||is(f,c)){let d=i(f);if(l?!Mr(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=Yi(u,p);if(this.dependencies.every(g=>g instanceof D?u.facet(g)===f.facet(g):g instanceof be?u.field(g,!1)==f.field(g,!1):!0)||(l?Mr(d=i(f),m,s):s(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}}function Mr(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Dr).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Dr.of({field:this,create:e})]}get extension(){return this}}const pt={lowest:4,low:3,default:2,high:1,highest:0};function Gt(n){return e=>new ul(e,n)}const Ct={highest:Gt(pt.highest),high:Gt(pt.high),default:Gt(pt.default),low:Gt(pt.low),lowest:Gt(pt.lowest)};class ul{constructor(e,t){this.inner=e,this.prec=t}}class vn{of(e){return new ns(this,e)}reconfigure(e){return vn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ns{constructor(e,t){this.compartment=e,this.inner=t}}class Xi{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Qh(e,t,o))u instanceof be?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,Us(m,d))a.push(i.facet(p));else{let g=p.combine(d.map(y=>y.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(y=>g.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(g=>Yh(g,p,d))}}let f=h.map(u=>u(l));return new Xi(e,o,f,l,a,r)}}function Qh(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof ns&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof ns){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof ul)r(o.inner,o.prec);else if(o instanceof be)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Ki)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,pt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,pt.default),i.reduce((o,l)=>o.concat(l))}function ni(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function Yi(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const dl=D.define(),pl=D.define({combine:n=>n.some(e=>e),static:!0}),gl=D.define({combine:n=>n.length?n[0]:void 0,static:!0}),ml=D.define(),yl=D.define(),bl=D.define(),wl=D.define({combine:n=>n.length?n[0]:!1});class Qe{constructor(e,t){this.type=e,this.value=t}static define(){return new Zh}}class Zh{of(e){return new Qe(this,e)}}class ec{constructor(e){this.map=e}of(e){return new E(this,e)}}class E{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new E(this.type,t)}is(e){return this.type==e}static define(e={}){return new ec(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}E.reconfigure=E.define();E.appendConfig=E.define();class Q{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&fl(i,t.newLength),r.some(l=>l.type==Q.time)||(this.annotations=r.concat(Q.time.of(Date.now())))}static create(e,t,i,s,r,o){return new Q(e,t,i,s,r,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 t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Q.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Q.time=Qe.define();Q.userEvent=Qe.define();Q.addToHistory=Qe.define();Q.remote=Qe.define();function tc(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof Q?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Q?n=r[0]:n=vl(e,Lt(r),!1)}return n}function nc(n){let e=n.startState,t=e.facet(bl),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=xl(i,ss(e,r,n.changes.newLength),!0))}return i==n?n:Q.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const sc=[];function Lt(n){return n==null?sc:Array.isArray(n)?n:[n]}var $=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}($||($={}));const rc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let rs;try{rs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function oc(n){if(rs)return rs.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||rc.test(t)))return!0}return!1}function lc(n){return e=>{if(!/\S/.test(e))return $.Space;if(oc(e))return $.Word;for(let t=0;t-1)return $.Word;return $.Other}}class N{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(E.reconfigure)?(t=null,i=o.value):o.is(E.appendConfig)&&(t=null,i=Lt(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=Xi.resolve(i,s,this),r=new N(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new N(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Lt(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return N.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Xi.resolve(e.extensions||[],new Map),i=e.doc instanceof I?e.doc:I.of((e.doc||"").split(t.staticFacet(N.lineSeparator)||Zn)),s=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return fl(s,i.length),t.staticFacet(pl)||(s=s.asSingle()),new N(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(N.tabSize)}get lineBreak(){return this.facet(N.lineSeparator)||` -`}get readOnly(){return this.facet(wl)}phrase(e,...t){for(let i of this.facet(N.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(dl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return lc(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=ue(t,o,!1);if(r(t.slice(a,o))!=$.Word)break;o=a}for(;ln.length?n[0]:4});N.lineSeparator=gl;N.readOnly=wl;N.phrases=D.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});N.languageData=dl;N.changeFilter=ml;N.transactionFilter=yl;N.transactionExtender=bl;vn.reconfigure=E.define();function At(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class wt{eq(e){return this==e}range(e,t=e){return os.create(e,t,this)}}wt.prototype.startSide=wt.prototype.endSide=0;wt.prototype.point=!1;wt.prototype.mapMode=he.TrackDel;let os=class Sl{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Sl(e,t,i)}};function ls(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Gs{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Gs(s,r,i,l):null,pos:o}}}class j{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new j(e,t,i,s)}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 t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(ls)),this.isEmpty)return t.length?j.of(t):this;let l=new kl(this,null,-1).goto(0),a=0,h=[],c=new xt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return oi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return oi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Or(o,l,i),h=new Jt(o,a,r),c=new Jt(l,a,r);i.iterGaps((f,u,d)=>Tr(h,f,c,u,d,s)),i.empty&&i.length==0&&Tr(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Or(r,o),a=new Jt(r,l,0).goto(i),h=new Jt(o,l,0).goto(i);for(;;){if(a.to!=h.to||!as(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new Jt(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new xt;for(let s of e instanceof os?[e]:t?ac(e):e)i.add(s.from,s.to,s.value);return i.finish()}}j.empty=new j([],[],null,-1);function ac(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(ls);e=i}return n}j.empty.nextLayer=j.empty;class xt{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}finishChunk(e){this.chunks.push(new Gs(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=[])}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new xt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(j.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=j.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Or(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new kl(o,t,i,r));return s.length==1?s[0]:new oi(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)En(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)En(this.heap,i);(this.to-e||this.value.endSide-t)<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(),En(this.heap,0)}}}function En(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class Jt{constructor(e,t,i){this.minPoint=i,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=oi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ki(this.active,e),ki(this.activeTo,e),ki(this.activeRank,e),this.minActive=Br(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&ki(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Tr(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to||n.endSide-t.endSide,c=h<0?n.to+a:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&as(n.activeForPoint(n.to+a),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!as(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,h<=0&&n.next(),h>=0&&t.next()}}function as(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Br(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=ue(n,s)}return i===!0?-1:n.length}const cs="ͼ",Pr=typeof Symbol>"u"?"__"+cs:Symbol.for(cs),fs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class lt{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=Rr[Pr]||1;return Rr[Pr]=e+1,cs+e.toString(36)}static mount(e,t){(e[fs]||new hc(e)).mount(Array.isArray(t)?t:[t])}}let Ai=null;class hc{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(Ai)return e.adoptedStyleSheets=[Ai.sheet].concat(e.adoptedStyleSheets),e[fs]=Ai;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),Ai=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[fs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Lr=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),cc=typeof navigator<"u"&&/Mac/.test(navigator.platform),fc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),uc=cc||Lr&&+Lr[1]<57;for(var se=0;se<10;se++)at[48+se]=at[96+se]=String(se);for(var se=1;se<=24;se++)at[se+111]="F"+se;for(var se=65;se<=90;se++)at[se]=String.fromCharCode(se+32),li[se]=String.fromCharCode(se);for(var In in at)li.hasOwnProperty(In)||(li[In]=at[In]);function dc(n){var e=uc&&(n.ctrlKey||n.altKey||n.metaKey)||fc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?li:at)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Qi(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Ft(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function pc(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ji(n,e){if(!e.anchorNode)return!1;try{return Ft(n,e.anchorNode)}catch{return!1}}function ai(n){return n.nodeType==3?Vt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Zi(n,e,t,i){return t?Er(n,e,t,i,-1)||Er(n,e,t,i,1):!1}function en(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Er(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:hi(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=en(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?hi(n):0}else return!1}}function hi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const Cl={left:0,right:0,top:0,bottom:0};function Js(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function gc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function mc(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n;c;)if(c.nodeType==1){let f,u=c==a.body;if(u)f=gc(h);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let m=c.getBoundingClientRect();f={left:m.left,right:m.left+c.clientWidth,top:m.top,bottom:m.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class bc{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){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Ot=null;function Al(n){if(n.setActive)return n.setActive();if(Ot)return n.focus(Ot);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Ot==null?{get preventScroll(){return Ot={preventScroll:!0},!0}}:void 0),!Ot){Ot=!1;for(let t=0;tt)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.dirty|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),t.dirty&1)return;t.dirty|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=_s){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ol(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(t2);var M={mac:Wr||/Mac/.test(Ae.platform),windows:/Win/.test(Ae.platform),linux:/Linux|X11/.test(Ae.platform),ie:Sn,ie_version:Bl?us.documentMode||6:ps?+ps[1]:ds?+ds[1]:0,gecko:Fr,gecko_version:Fr?+(/Firefox\/(\d+)/.exec(Ae.userAgent)||[0,0])[1]:0,chrome:!!Nn,chrome_version:Nn?+Nn[1]:0,ios:Wr,android:/Android\b/.test(Ae.userAgent),webkit:Vr,safari:Pl,webkit_version:Vr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:us.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const vc=256;class ht extends q{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return i&&(!(i instanceof ht)||this.length-(t-e)+i.length>vc)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new ht(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ce(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return gs(this.dom,e,t)}}class Je extends q{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(Ml(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}sync(e,t){this.dom?this.dirty&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof Je&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Je(this.mark,t,o)}domAtPos(e){return El(this,e)}coordsAt(e,t){return Nl(this,e,t)}}function gs(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?M.chrome||M.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return M.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?Js(a,o<0):a||null}class nt extends q{constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}static create(e,t,i){return new(e.customView||nt)(e,t,i)}split(e){let t=nt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof nt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0?i.length-1:0;s=i[r],!(e>0?r==0:r==i.length-1||s.top0?-1:1);return this.length?s:Js(s,this.side>0)}get isEditable(){return!1}get isWidget(){return!0}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Rl extends nt{domAtPos(e){let{topView:t,text:i}=this.widget;return t?ms(e,0,t,i,(s,r)=>s.domAtPos(r),s=>new ce(i,Math.min(s,i.nodeValue.length))):new ce(i,Math.min(e,i.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(e,t){let{topView:i,text:s}=this.widget;return i?Ll(e,t,i,s):Math.min(t,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(e,t){let{topView:i,text:s}=this.widget;return i?ms(e,t,i,s,(r,o,l)=>r.coordsAt(o,l),(r,o)=>gs(s,r,o)):gs(s,e,t)}destroy(){var e;super.destroy(),(e=this.widget.topView)===null||e===void 0||e.destroy()}get isEditable(){return!0}canReuseDOM(){return!0}}function ms(n,e,t,i,s,r){if(t instanceof Je){for(let o=t.dom.firstChild;o;o=o.nextSibling){let l=q.get(o);if(!l)return r(n,e);let a=Ft(o,i),h=l.length+(a?i.nodeValue.length:0);if(n0?-1:1);return i&&i.topt.top?{left:t.left,right:t.right,top:i.top,bottom:i.bottom}:t}get overrideDOMText(){return I.empty}}ht.prototype.children=nt.prototype.children=Wt.prototype.children=_s;function Sc(n,e){let t=n.parent,i=t?t.children.indexOf(n):-1;for(;t&&i>=0;)if(e<0?i>0:ir&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof Je&&s.length&&(i=s[s.length-1])instanceof Je&&i.mark.eq(e.mark)?Il(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Nl(n,e,t){let i=null,s=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f=c&&(d.children.length?l(d,c-u):!r&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u0?3e8:-4e8:t>0?1e8:-1e8,new vt(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Fl(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new vt(e,i,s,t,e.widget||null,!0)}static line(e){return new bi(e)}static set(e,t=!1){return j.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}B.none=j.empty;class kn extends B{constructor(e){let{start:t,end:i}=Fl(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){return this==e||e instanceof kn&&this.tagName==e.tagName&&this.class==e.class&&Xs(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}kn.prototype.point=!1;class bi extends B{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof bi&&this.spec.class==e.spec.class&&Xs(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}bi.prototype.mapMode=he.TrackBefore;bi.prototype.point=!0;class vt extends B{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?he.TrackBefore:he.TrackAfter:he.TrackDel}get type(){return this.startSide=5}eq(e){return e instanceof vt&&Cc(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}vt.prototype.point=!0;function Fl(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function Cc(n,e){return n==e||!!(n&&e&&n.compare(e))}function ws(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class de extends q{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof de))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),Tl(this,e,t,i?i.children:[],r,o),!0}split(e){let t=new de;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:s}=this.childPos(e);s&&(t.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Xs(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Il(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=ys(t,this.attrs||{})),i&&(this.attrs=ys({class:i},this.attrs||{}))}domAtPos(e){return El(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.dirty|=6)}sync(e,t){var i;this.dom?this.dirty&4&&(Ml(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(bs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&q.get(s)instanceof Je;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=q.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!M.ios||!this.children.some(r=>r instanceof ht))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0;for(let t of this.children){if(!(t instanceof ht)||/[^ -~]/.test(t.text))return null;let i=ai(t.dom);if(i.length!=1)return null;e+=i[0].width}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}:null}coordsAt(e,t){return Nl(this,e,t)}become(e){return!1}get type(){return z.Text}static find(e,t){for(let i=0,s=0;i=t){if(r instanceof de)return r;if(o>t)break}s=o+r.breakAfter}return null}}class bt extends q{constructor(e,t,i){super(),this.widget=e,this.length=t,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof bt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Mi(new ht(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof vt){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof vt)if(i.block){let{type:a}=i;a==z.WidgetAfter&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new bt(i.widget||new Hr("div"),l,a))}else{let a=nt.create(i.widget||new Hr("span"),l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(Mi(new Wt(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Mi(a,s),r),this.atCursorPos=c,this.pendingBuffer=c?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new Ys(e,t,i,r);return o.openEnd=j.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Mi(n,e){for(let t of e)n=new Je(t,[n],n.length);return n}class Hr extends ct{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}}const Vl=D.define(),Wl=D.define(),Hl=D.define(),zl=D.define(),xs=D.define(),ql=D.define(),$l=D.define(),Kl=D.define({combine:n=>n.some(e=>e)}),jl=D.define({combine:n=>n.some(e=>e)});class tn{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new tn(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const zr=E.define({map:(n,e)=>n.map(e)});function Ee(n,e,t){let i=n.facet(zl);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Cn=D.define({combine:n=>n.length?n[0]:!0});let Ac=0;const Qt=D.define();class ge{constructor(e,t,i,s){this.id=e,this.create=t,this.domEventHandlers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:i,provide:s,decorations:r}=t||{};return new ge(Ac++,e,i,o=>{let l=[Qt.of(o)];return r&&l.push(ci.of(a=>{let h=a.plugin(o);return h?r(h):B.none})),s&&l.push(s(o)),l})}static fromClass(e,t){return ge.define(i=>new e(i),t)}}class Fn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Ee(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Ee(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Ee(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Ul=D.define(),Qs=D.define(),ci=D.define(),Gl=D.define(),Jl=D.define(),Zt=D.define();class Ge{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Ge(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 t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Ge(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class nn{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Y.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Ge(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new nn(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}}var J=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(J||(J={}));const vs=J.LTR,Mc=J.RTL;function _l(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}const K=[];function Pc(n,e){let t=n.length,i=e==vs?1:2,s=e==vs?2:1;if(!n||i==1&&!Bc.test(n))return Xl(t);for(let o=0,l=i,a=i;o=0;u-=3)if(Fe[u+1]==-c){let d=Fe[u+2],p=d&2?i:d&4?d&1?s:i:0;p&&(K[o]=K[Fe[u]]=p),l=u;break}}else{if(Fe.length==189)break;Fe[l++]=o,Fe[l++]=h,Fe[l++]=a}else if((f=K[o])==2||f==1){let u=f==i;a=u?0:1;for(let d=l-3;d>=0;d-=3){let p=Fe[d+2];if(p&2)break;if(u)Fe[d+2]|=2;else{if(p&4)break;Fe[d+2]|=4}}}for(let o=0;ol;){let c=h,f=K[--h]!=2;for(;h>l&&f==(K[h-1]!=2);)h--;r.push(new It(h,c,f?2:1))}else r.push(new It(l,o,0))}else for(let o=0;o1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=q.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.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,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+Math.min(t,i.offset))}}function qr(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}class $r{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Kr extends q{constructor(e){super(),this.view=e,this.compositionDeco=B.none,this.decorations=[],this.dynamicDecorationMap=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new de],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Ge(0,0,0,e.state.doc.length)],0)}get length(){return this.view.state.doc.length}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:o,toA:l})=>lthis.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.view.inputState.composing<0?this.compositionDeco=B.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=Ec(this.view,e.changes)),(M.ie||M.chrome)&&!this.compositionDeco.size&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,s=this.updateDeco(),r=Vc(i,s,e.changes);return t=Ge.extendWithRanges(t,r),this.dirty==0&&t.length==0?!1:(this.updateInner(t,e.startState.doc.length),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=M.chrome||M.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,r),this.dirty=0,r&&(r.written||i.selectionRange.focusNode!=r.node)&&(this.forceSelection=!0),this.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to=0?e[s]:null;if(!r)break;let{fromA:o,toA:l,fromB:a,toB:h}=r,{content:c,breakAtStart:f,openStart:u,openEnd:d}=Ys.build(this.view.state.doc,a,h,this.decorations,this.dynamicDecorationMap),{i:p,off:m}=i.findPos(l,1),{i:g,off:y}=i.findPos(o,-1);Ol(this,g,y,p,m,c,f,u,d)}}updateSelection(e=!1,t=!1){if((e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange(),!(t||this.mayControlSelection()))return;let i=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,r=this.domAtPos(s.anchor),o=s.empty?r:this.domAtPos(s.head);if(M.gecko&&s.empty&&Lc(r)){let a=document.createTextNode("");this.view.observer.ignore(()=>r.node.insertBefore(a,r.node.childNodes[r.offset]||null)),r=o=new ce(a,0),i=!0}let l=this.view.observer.selectionRange;(i||!l.focusNode||!Zi(r.node,r.offset,l.anchorNode,l.anchorOffset)||!Zi(o.node,o.offset,l.focusNode,l.focusOffset))&&(this.view.observer.ignore(()=>{M.android&&M.chrome&&this.dom.contains(l.focusNode)&&Wc(l.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let a=Qi(this.view.root);if(a)if(s.empty){if(M.gecko){let h=Nc(r.node,r.offset);if(h&&h!=3){let c=ea(r.node,r.offset,h==1?1:-1);c&&(r=new ce(c,h==1?0:c.nodeValue.length))}}a.collapse(r.node,r.offset),s.bidiLevel!=null&&l.cursorBidiLevel!=null&&(l.cursorBidiLevel=s.bidiLevel)}else if(a.extend){a.collapse(r.node,r.offset);try{a.extend(o.node,o.offset)}catch{}}else{let h=document.createRange();s.anchor>s.head&&([r,o]=[o,r]),h.setEnd(o.node,o.offset),h.setStart(r.node,r.offset),a.removeAllRanges(),a.addRange(h)}}),this.view.observer.setSelectionRange(r,o)),this.impreciseAnchor=r.precise?null:new ce(l.anchorNode,l.anchorOffset),this.impreciseHead=o.precise?null:new ce(l.focusNode,l.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let{view:e}=this,t=e.state.selection.main,i=Qi(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=de.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}mayControlSelection(){let e=this.view.root.activeElement;return e==this.dom||ji(this.dom,this.view.observer.selectionRange)&&!(e&&this.dom.contains(e))}nearest(e){for(let t=e;t;){let i=q.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;to||e==o&&r.type!=z.WidgetBefore&&r.type!=z.WidgetAfter&&(!s||t==2||this.children[s-1].breakAfter||this.children[s-1].type==z.WidgetBefore&&t>-2))return r.coordsAt(e-o,t);i=o}}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==J.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,m=p?ai(p):[];if(m.length){let g=m[m.length-1],y=a?g.right-d.left:d.right-g.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?J.RTL:J.LTR}measureTextSize(){for(let s of this.children)if(s instanceof de){let r=s.measureTextSize();if(r)return r}let e=document.createElement("div"),t,i;return e.className="cm-line",e.style.width="99999px",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=ai(e.firstChild)[0];t=e.getBoundingClientRect().height,i=s?s.width/27:7,e.remove()}),{lineHeight:t,charWidth:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Dl(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=t.lineBlockAt(o).bottom-t.lineBlockAt(i).top;e.push(B.replace({widget:new jr(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return B.set(e)}updateDeco(){let e=this.view.state.facet(ci).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.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 r=0,o=0,l=0,a=0;for(let c of this.view.state.facet(Jl).map(f=>f(this.view)))if(c){let{left:f,right:u,top:d,bottom:p}=c;f!=null&&(r=Math.max(r,f)),u!=null&&(o=Math.max(o,u)),d!=null&&(l=Math.max(l,d)),p!=null&&(a=Math.max(a,p))}let h={left:i.left-r,top:i.top-l,right:i.right+o,bottom:i.bottom+a};mc(this.view.scrollDOM,h,t.head0&&t<=0)n=n.childNodes[e-1],e=hi(n);else if(n.nodeType==1&&e=0)n=n.childNodes[e],e=0;else return null}}function Nc(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e0;){let h=ue(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function qc(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Vn(n,e){return n.tope.top+1}function Ur(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function ks(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let m=ai(p);for(let g=0;gA||o==A&&r>S){i=p,s=y,r=S,o=A;let x=A?t0?g0)}S==0?t>y.bottom&&(!c||c.bottomy.top)&&(h=p,f=y):c&&Vn(c,y)?c=Gr(c,y.bottom):f&&Vn(f,y)&&(f=Ur(f,y.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Jr(i,u,t);if(l&&i.contentEditable!="false")return ks(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function Jr(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((M.chrome||M.gecko)&&Vt(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function ta(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,{x:c,y:f}=e,u=f-l;if(u<0)return 0;if(u>h)return n.state.doc.length;for(let x=n.defaultLineHeight/2,v=!1;a=n.elementAtHeight(u),a.type!=z.Text;)for(;u=i>0?a.bottom+x:a.top-x,!(u>=0&&u<=h);){if(v)return t?null:0;v=!0,i=-i}f=l+u;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:_r(n,o,a,c,f);let p=n.dom.ownerDocument,m=n.root.elementFromPoint?n.root:p,g=m.elementFromPoint(c,f);g&&!n.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=m.elementFromPoint(c,f),g&&!n.contentDOM.contains(g)&&(g=null));let y,S=-1;if(g&&((s=n.docView.nearest(g))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let x=p.caretPositionFromPoint(c,f);x&&({offsetNode:y,offset:S}=x)}else if(p.caretRangeFromPoint){let x=p.caretRangeFromPoint(c,f);x&&({startContainer:y,startOffset:S}=x,(!n.contentDOM.contains(y)||M.safari&&$c(y,S,c)||M.chrome&&Kc(y,S,c))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let x=de.find(n.docView,d);if(!x)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:S}=ks(x.dom,c,f))}let A=n.docView.nearest(y);if(!A)return null;if(A.isWidget&&((r=A.dom)===null||r===void 0?void 0:r.nodeType)==1){let x=A.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=Math.floor((s-t.top)/n.defaultLineHeight);r+=l*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+hs(o,r,n.state.tabSize)}function $c(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Vt(n,i-1,i).getBoundingClientRect().left>t}function Kc(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Vt(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function jc(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=!i||!n.lineWrapping?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let a=n.dom.getBoundingClientRect(),h=n.textDirectionAt(s.from),c=n.posAtCoords({x:t==(h==J.LTR)?a.right-1:a.left+1,y:(r.top+r.bottom)/2});if(c!=null)return b.cursor(c,t?-1:1)}let o=de.find(n.docView,e.head),l=o?t?o.posAtEnd:o.posAtStart:t?s.to:s.from;return b.cursor(l,t?-1:1)}function Xr(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=Rc(s,r,o,l,t),c=Yl;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c=` -`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=b.cursor(t?s.from:s.to)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function Uc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==$.Space&&(s=o),s==o}}function Gc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return b.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i??n.defaultLineHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,m=ta(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?ms))return b.cursor(m,e.assoc,void 0,o)}}function Wn(n,e,t){let i=n.state.facet(Gl).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,a)=>{t.from>o&&t.fromt.from?b.cursor(o,1):b.cursor(l,-1),s=!0)});if(!s)return t}}class Jc{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.mouseSelection=null;let t=(i,s)=>{this.ignoreDuringComposition(s)||s.type=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(s.type,e,s)?s.preventDefault():i(e,s))};for(let i in Z){let s=Z[i];e.contentDOM.addEventListener(i,r=>{Yr(e,r)&&t(s,r)},Cs[i]),this.registeredEvents.push(i)}e.scrollDOM.addEventListener("mousedown",i=>{i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&t(Z.mousedown,i)}),M.chrome&&M.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,M.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{Yr(e,l)&&this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Ee(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Ee(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()s.keyCode==t.keyCode))&&!t.ctrlKey||_c.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=i||t,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,Et(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&!M.ios&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const ia=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],_c="dthko",na=[16,17,18,20,91,92,224,225];function Di(n){return n*.7+8}class Xc{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=yc(e.contentDOM);let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&Yc(e,t),this.dragMove=Qc(e,t),this.dragging=Zc(e,t)&&la(t)==1?null:!1}start(e){this.dragging===!1&&(e.preventDefault(),this.select(e))}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging!==!1)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight};e.clientX<=r.left?i=-Di(r.left-e.clientX):e.clientX>=r.right&&(i=Di(e.clientX-r.right)),e.clientY<=r.top?s=-Di(r.top-e.clientY):e.clientY>=r.bottom&&(s=Di(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}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=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}select(e){let t=this.style.get(e,this.extend,this.multiple);(this.mustSelect||!t.eq(this.view.state.selection)||t.main.assoc!=this.view.state.selection.main.assoc)&&this.view.dispatch({selection:t,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Yc(n,e){let t=n.state.facet(Vl);return t.length?t[0](e):M.mac?e.metaKey:e.ctrlKey}function Qc(n,e){let t=n.state.facet(Wl);return t.length?t[0](e):M.mac?!e.altKey:!e.ctrlKey}function Zc(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Qi(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Yr(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=q.get(t))&&i.ignoreEvent(e))return!1;return!0}const Z=Object.create(null),Cs=Object.create(null),sa=M.ie&&M.ie_version<15||M.ios&&M.webkit_version<604;function ef(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),ra(n,t.value)},50)}function ra(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(As!=null&&t.selection.ranges.every(a=>a.empty)&&As==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:b.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:b.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Z.keydown=(n,e)=>{n.inputState.setSelectionOrigin("select"),e.keyCode==27?n.inputState.lastEscPress=Date.now():na.indexOf(e.keyCode)<0&&(n.inputState.lastEscPress=0)};Z.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Z.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Cs.touchstart=Cs.touchmove={passive:!0};Z.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return;let t=null;for(let i of n.state.facet(Hl))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=sf(n,e)),t){let i=n.root.activeElement!=n.contentDOM;n.inputState.startMouseSelection(new Xc(n,e,t,i)),i&&n.observer.ignore(()=>Al(n.contentDOM)),n.inputState.mouseSelection&&n.inputState.mouseSelection.start(e)}};function Qr(n,e,t,i){if(i==1)return b.cursor(e,t);if(i==2)return Hc(n.state,e,t);{let s=de.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,Zr=(n,e,t)=>oa(e,t)&&n>=t.left&&n<=t.right;function tf(n,e,t,i){let s=de.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Zr(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&Zr(t,i,l)?1:o&&oa(i,o)?-1:1}function eo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:tf(n,t,e.clientX,e.clientY)}}const nf=M.ie&&M.ie_version<=11;let to=null,io=0,no=0;function la(n){if(!nf)return n.detail;let e=to,t=no;return to=n,no=Date.now(),io=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(io+1)%3:1}function sf(n,e){let t=eo(n,e),i=la(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=eo(n,r),h=Qr(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let c=Qr(n,t.pos,t.bias,i),f=Math.min(c.from,h.from),u=Math.max(c.to,h.to);h=f1&&s.ranges.some(c=>c.eq(h))?rf(s,h):l?s.addRange(h):b.create([h])}}}function rf(n,e){for(let t=0;;t++)if(n.ranges[t].eq(e))return b.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}Z.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove")};function so(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&r.dragMove?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}Z.drop=(n,e)=>{if(!e.dataTransfer)return;if(n.state.readOnly)return e.preventDefault();let t=e.dataTransfer.files;if(t&&t.length){e.preventDefault();let i=Array(t.length),s=0,r=()=>{++s==t.length&&so(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}}else so(n,e,e.dataTransfer.getData("Text"),!0)};Z.paste=(n,e)=>{if(n.state.readOnly)return e.preventDefault();n.observer.flush();let t=sa?null:e.clipboardData;t?(ra(n,t.getData("text/plain")||t.getData("text/uri-text")),e.preventDefault()):ef(n)};function of(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function lf(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let As=null;Z.copy=Z.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=lf(n.state);if(!t&&!s)return;As=s?t:null;let r=sa?null:e.clipboardData;r?(e.preventDefault(),r.clearData(),r.setData("text/plain",t)):of(n,t),e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})};const aa=Qe.define();function ha(n,e){let t=[];for(let i of n.facet($l)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:aa.of(!0)}):null}function ca(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=ha(n.state,e);t?n.dispatch(t):n.update([])}},10)}Z.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),ca(n)};Z.blur=n=>{n.observer.clearSelectionRange(),ca(n)};Z.compositionstart=Z.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};Z.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionFirstChange=null,M.chrome&&M.android&&n.observer.flushSoon(),setTimeout(()=>{n.inputState.composing<0&&n.docView.compositionDeco.size&&n.update([])},50)};Z.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Z.beforeinput=(n,e)=>{var t;let i;if(M.chrome&&M.android&&(i=ia.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}};const ro=["pre-wrap","normal","pre-line","break-spaces"];class af{constructor(e){this.lineWrapping=e,this.doc=I.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return ro.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.lineLength=s,l){this.heightSamples={};for(let a=0;a0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Ui&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return pe.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=s[l],u=r.lineAt(a,H.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,H.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,c=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ce extends fa{constructor(e,t){super(e,t,z.Text),this.collapsed=0,this.widgetHeight=0}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Ce||s instanceof ie&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof ie?s=new Ce(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):pe.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ie extends pe{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,l=(this.height-a)/(this.length-r-1)}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),c=t.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,e-f/2);return new Xe(c.from,c.length,u,f,z.Text)}else{let h=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.doc.line(r+h);return new Xe(c,f,i+l*h,l,z.Text)}}lineAt(e,t,i,s,r){if(t==H.ByHeight)return this.blockAt(e,i,s,r);if(t==H.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new Xe(d,p-d,0,0,z.Text)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(e),c=l+h.length*a,f=h.number-o,u=s+l*f+a*(h.from-r-f);return new Xe(h.from,h.length,Math.max(s,Math.min(u,s+this.height-c)),c,z.Text)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=e,f=s;c<=t;){let u=i.doc.lineAt(c);if(c==e){let p=u.number-l;f+=a*p+h*(e-r-p)}let d=a+h*u.length;o(new Xe(u.from,u.length,f,d,z.Text)),f+=d,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof ie?i[i.length-1]=new ie(r.length+s):i.push(null,new ie(s-1))}if(e>0){let r=i[0];r instanceof ie?i[0]=new ie(e+r.length):i.unshift(new ie(e-1),null)}return pe.of(i)}decomposeLeft(e,t){t.push(new ie(e-1),null)}decomposeRight(e,t){t.push(null,new ie(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new ie(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=Ui&&(a=-2);let u=new Ce(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new ie(r-l).updateHeight(e,l));let h=pe.of(o);return(a<0||Math.abs(h.height-this.height)>=Ui||Math.abs(a-this.heightMetrics(e,t).perLine)>=Ui)&&(e.heightChanged=!0),h}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class cf extends pe{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==H.ByPosNoHeight?H.ByPosNoHeight:H.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,H.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&oo(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?pe.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function oo(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof ie&&(i=n[e+1])instanceof ie&&n.splice(e-1,3,new ie(t.length+1+i.length))}const ff=5;class Zs{constructor(e,t){this.pos=e,this.oracle=t,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,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ce?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ce(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=ff)&&this.addLineDeco(s,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ce(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new ie(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ce)return e;let t=new Ce(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine(),e.type==z.WidgetAfter&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=z.WidgetBefore&&(this.covering=e)}addLineDeco(e,t){let i=this.ensureLine();i.length+=t,i.collapsed+=t,i.widgetHeight=Math.max(i.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ce)&&!this.isCovered?this.nodes.push(new Ce(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=h==n.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function gf(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Hn{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new af(t),this.stateDeco=e.facet(ci).filter(i=>typeof i!="function"),this.heightMap=pe.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle.setDoc(e.doc),[new Ge(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=B.set(this.lineGaps.map(i=>i.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Oi(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?ao:new wf(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:ei(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(ci).filter(h=>typeof h!="function");let s=e.changedRanges,r=Ge.extendWithRanges(s,uf(i,this.stateDeco,e?e.changes:Y.empty(this.state.doc.length))),o=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2);let l=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let a=!e.changes.empty||e.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),a&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(jl)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?J.RTL:J.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0,f=parseInt(i.paddingTop)||0,u=parseInt(i.paddingBottom)||0;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8);let d=(this.printing?gf:pf)(t,this.paddingTop),p=d.top-this.pixelViewport.top,m=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let y=l.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let A=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(A)&&(o=!0),o||s.lineWrapping&&Math.abs(y-this.contentDOMWidth)>s.charWidth){let{lineHeight:x,charWidth:v}=e.docView.measureTextSize();o=x>0&&s.refresh(r,x,v,y/v,A),o&&(e.docView.minWidth=0,h|=8)}p>0&&m>0?c=Math.max(p,m):p<0&&m<0&&(c=Math.min(p,m)),s.heightChanged=!1;for(let x of this.viewports){let v=x.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(x);this.heightMap=(o?pe.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle,[new Ge(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new hf(x.from,v))}s.heightChanged&&(h|=2)}let S=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return S&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Oi(s.lineAt(o-i*1e3,H.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,H.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,H.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=J.LTR&&!i)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-h)g.fromy));if(!m){if(cg.from<=c&&g.to>=c)){let g=t.moveToLineBoundary(b.cursor(c),!1,!0).head;g>h&&(c=g)}m=new Hn(h,c,this.gapSize(f,h,c,u))}l.push(m)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];j.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ei(this.heightMap.lineAt(e,H.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return ei(this.heightMap.lineAt(this.scaler.fromDOM(e),H.ByHeight,this.heightOracle,0,0),this.scaler)}elementAtHeight(e){return ei(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 Oi{constructor(e,t){this.from=e,this.to=t}}function yf(n,e,t){let i=[],s=n,r=0;return j.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Bi(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function bf(n,e){for(let t of n)if(e(t))return t}const ao={toDOM(n){return n},fromDOM(n){return n},scale:1};class wf{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,H.ByPos,e,0,0).top,c=t.lineAt(a,H.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tei(s,e)):n.type)}const Pi=D.define({combine:n=>n.join(" ")}),Ms=D.define({combine:n=>n.indexOf(!0)>-1}),Ds=lt.newName(),ua=lt.newName(),da=lt.newName(),pa={"&light":"."+ua,"&dark":"."+da};function Os(n,e,t){return new lt(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const xf=Os("."+Ds,{"&":{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},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",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-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused .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:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused .cm-cursor":{display:"block"},"&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",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&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},"&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-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"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},pa);class vf{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="";let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:kf(e),a=new Ql(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Cf(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Ft(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Ft(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=b.single(h,a)}}}function ga(n,e){let t,{newSel:i}=e,s=n.state.selection.main;if(e.bounds){let{from:r,to:o}=e.bounds,l=s.from,a=null;(n.inputState.lastKeyCode===8&&n.inputState.lastKeyTime>Date.now()-100||M.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(M.mac||M.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:I.of([" "])}):M.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` - `&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:I.of([" "])}),t){let r=n.state;if(M.ios&&n.inputState.flushIOSKey(n)||M.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&Et(n.contentDOM,"Enter",13)||t.from==s.from-1&&t.to==s.to&&t.insert.length==0&&Et(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&Et(n.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();if(n.state.facet(ql).some(h=>h(n,t.from,t.to,o)))return!0;n.inputState.composing>=0&&n.inputState.composing++;let l;if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let h=s.fromt.to?r.sliceDoc(t.to,s.to):"";l=r.replaceSelection(n.state.toText(h+t.insert.sliceString(0,void 0,n.state.lineBreak)+c))}else{let h=r.changes(t),c=i&&!r.selection.main.eq(i.main)&&i.main.to<=h.newLength?i.main:void 0;if(r.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=s.to&&t.to>=s.to-10){let f=n.state.sliceDoc(t.from,t.to),u=Zl(n)||n.state.doc.lineAt(s.head),d=s.to-t.to,p=s.to-s.from;l=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:h,range:c||m.map(h)};let g=m.to-d,y=g-f.length;if(m.to-m.from!=p||n.state.sliceDoc(y,g)!=f||u&&m.to>=u.from&&m.from<=u.to)return{range:m};let S=r.changes({from:y,to:g,insert:t.insert}),A=m.to-s.to;return{changes:S,range:c?b.range(Math.max(0,c.anchor+A),Math.max(0,c.head+A)):m.map(S)}})}else l={changes:h,selection:c&&r.selection.replaceRange(c)}}let a="input.type";return n.composing&&(a+=".compose",n.inputState.compositionFirstChange&&(a+=".start",n.inputState.compositionFirstChange=!1)),n.dispatch(l,{scrollIntoView:!0,userEvent:a}),!0}else if(i&&!i.main.eq(s)){let r=!1,o="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(r=!0),o=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:r,userEvent:o}),!0}else return!1}function Sf(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function kf(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new $r(t,i)),(s!=t||r!=i)&&e.push(new $r(s,r))),e}function Cf(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?b.single(t+e,i+e):null}const Af={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},zn=M.ie&&M.ie_version<=11;class Mf{constructor(e){this.view=e,this.active=!1,this.selectionRange=new bc,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.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(M.ie&&M.ie_version<=11||M.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),zn&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runScrollHandlers(this.view,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){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((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(Cn)?i.root.activeElement!=this.dom:!ji(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(M.ie&&M.ie_version<=11||M.android&&M.chrome)&&!i.state.selection.main.empty&&s.focusNode&&Zi(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=M.safari&&e.root.nodeType==11&&pc(this.dom.ownerDocument)==this.dom&&Df(this.view)||Qi(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=ji(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),!this.flush()&&r.force&&Et(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}processRecords(){let e=this.queue;for(let r of this.observer.takeRecords())e.push(r);e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&ji(this.dom,this.selectionRange);return e<0&&!s?null:(e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new vf(this.view,e,t,i))}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let i=this.view.state,s=ga(this.view,t);return this.view.state==i&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.dirty|=4),e.type=="childList"){let i=ho(t,e.previousSibling||e.target.previousSibling,-1),s=ho(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.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),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),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i,s;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect(),(s=this.resizeContent)===null||s===void 0||s.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function ho(n,e,t){for(;e;){let i=q.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function Df(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return Zi(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}class T{constructor(e={}){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.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this._root=e.root||wc(e.parent)||document,this.viewState=new lo(e.state||N.create(e)),this.plugins=this.state.facet(Qt).map(t=>new Fn(t));for(let t of this.plugins)t.update(this);this.observer=new Mf(this),this.inputState=new Jc(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new Kr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}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.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}dispatch(...e){this._dispatch(e.length==1&&e[0]instanceof Q?e[0]:this.state.update(...e))}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(aa))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=ha(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(N.phrases)!=this.state.facet(N.phrases))return this.setState(r);s=nn.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new tn(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(zr)&&(f=d.value)}this.viewState.update(s,f),this.bidiCache=sn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Zt)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Pi)!=s.state.facet(Pi)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let u of this.state.facet(xs))u(s);(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!ga(this,c)&&h.force&&Et(this.contentDOM,h.key,h.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 t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new lo(e),this.plugins=e.facet(Qt).map(i=>new Fn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Kr(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Qt),i=e.state.facet(Qt);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Fn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,{scrollHeight:i,scrollTop:s,clientHeight:r}=this.scrollDOM,o=s>i-r-4?i:s;try{for(let l=0;;l++){this.updateState=1;let a=this.viewport,h=this.viewState.lineBlockAtHeight(o),c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];c&4||([this.measureRequests,f]=[f,this.measureRequests]);let u=f.map(g=>{try{return g.read(this)}catch(y){return Ee(this.state,y),co}}),d=nn.create(this,this.state,[]),p=!1,m=!1;d.flags|=c,t?t.flags|=c:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),p=this.docView.update(d));for(let g=0;g1||g<-1)&&(this.scrollDOM.scrollTop+=g,m=!0)}if(p&&this.docView.updateSelection(!0),this.viewport.from==a.from&&this.viewport.to==a.to&&!m&&this.measureRequests.length==0)break}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(xs))l(t)}get themeClasses(){return Ds+" "+(this.state.facet(Ms)?da:ua)+" "+this.state.facet(Pi)}updateAttrs(){let e=fo(this,Ul,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Cn)?"true":"false",class:"cm-content",style:`${M.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),fo(this,Qs,t);let i=this.observer.ignore(()=>{let s=bs(this.contentDOM,this.contentAttrs,t),r=bs(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(T.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Zt),lt.mount(this.root,this.styleModules.concat(xf).reverse())}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 t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}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,t,i){return Wn(this,e,Xr(this,e,t,i))}moveByGroup(e,t){return Wn(this,e,Xr(this,e,t,i=>Uc(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return jc(this,e,t,i)}moveVertically(e,t,i){return Wn(this,e,Gc(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),ta(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[It.find(r,e-s.from,-1,t)];return Js(i,o.dir==J.LTR==t>0)}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(Kl)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Of)return Xl(e.length);let t=this.textDirectionAt(e.from);for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t)return s.order;let i=Pc(e.text,t);return this.bidiCache.push(new sn(e.from,e.to,t,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||M.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Al(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(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return zr.of(new tn(typeof e=="number"?b.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return ge.define(()=>({}),{eventHandlers:e})}static theme(e,t){let i=lt.newName(),s=[Pi.of(i),Zt.of(Os(`.${i}`,e))];return t&&t.dark&&s.push(Ms.of(!0)),s}static baseTheme(e){return Ct.lowest(Zt.of(Os("."+Ds,e,pa)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&q.get(i)||q.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}T.styleModule=Zt;T.inputHandler=ql;T.focusChangeEffect=$l;T.perLineTextDirection=Kl;T.exceptionSink=zl;T.updateListener=xs;T.editable=Cn;T.mouseSelectionStyle=Hl;T.dragMovesSelection=Wl;T.clickAddsSelectionRange=Vl;T.decorations=ci;T.atomicRanges=Gl;T.scrollMargins=Jl;T.darkTheme=Ms;T.contentAttributes=Qs;T.editorAttributes=Ul;T.lineWrapping=T.contentAttributes.of({class:"cm-lineWrapping"});T.announce=E.define();const Of=4096,co={};class sn{constructor(e,t,i,s){this.from=e,this.to=t,this.dir=i,this.order=s}static update(e,t){if(t.empty)return e;let i=[],s=e.length?e[e.length-1].dir:J.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&ys(o,t)}return t}const Tf=M.mac?"mac":M.windows?"win":M.linux?"linux":"key";function Bf(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function Rf(n,e,t){return ya(ma(n.state),e,n,t)}let tt=null;const Lf=4e3;function Ef(n,e=Tf){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h)=>{var c,f;let u=t[o]||(t[o]=Object.create(null)),d=l.split(/ (?!$)/).map(g=>Bf(g,e));for(let g=1;g{let A=tt={view:S,prefix:y,scope:o};return setTimeout(()=>{tt==A&&(tt=null)},Lf),!0}]})}let p=d.join(" ");s(p,!1);let m=u[p]||(u[p]={preventDefault:!1,run:((f=(c=u._any)===null||c===void 0?void 0:c.run)===null||f===void 0?void 0:f.slice())||[]});a&&m.run.push(a),h&&(m.preventDefault=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,run:[]});for(let f in c)c[f].run.push(o.any)}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault)}return t}function ya(n,e,t,i){let s=dc(e),r=ne(s,0),o=De(r)==s.length&&s!=" ",l="",a=!1;tt&&tt.view==t&&tt.scope==i&&(l=tt.prefix+" ",(a=na.indexOf(e.keyCode)<0)&&(tt=null));let h=new Set,c=p=>{if(p){for(let m of p.run)if(!h.has(m)&&(h.add(m),m(t,e)))return!0;p.preventDefault&&(a=!0)}return!1},f=n[i],u,d;if(f){if(c(f[l+Ri(s,e,!o)]))return!0;if(o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(M.windows&&e.ctrlKey&&e.altKey)&&(u=at[e.keyCode])&&u!=s){if(c(f[l+Ri(u,e,!0)]))return!0;if(e.shiftKey&&(d=li[e.keyCode])!=s&&d!=u&&c(f[l+Ri(d,e,!1)]))return!0}else if(o&&e.shiftKey&&c(f[l+Ri(s,e,!0)]))return!0;if(c(f._any))return!0}return a}class wi{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.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,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=ba(e);return[new wi(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return If(e,t,i)}}function ba(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==J.LTR?e.left:e.right-n.scrollDOM.clientWidth)-n.scrollDOM.scrollLeft,top:e.top-n.scrollDOM.scrollTop}}function po(n,e,t){let i=b.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:z.Text}}function go(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==z.Text))return i}return t}function If(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==J.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=ba(n),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=go(n,i),p=go(n,s),m=d.type==z.Text?d:null,g=p.type==z.Text?p:null;if(n.lineWrapping&&(m&&(m=po(n,i,m)),g&&(g=po(n,s,g))),m&&g&&m.from==g.from)return S(A(t.from,t.to,m));{let v=m?A(t.from,null,m):x(d,!1),k=g?A(null,t.to,g):x(p,!0),O=[];return(m||d).to<(g||p).from-1?O.push(y(f,v.bottom,u,k.top)):v.bottomX&&we.from=oe)break;ee>te&&W(Math.max(_,te),v==null&&_<=X,Math.min(ee,oe),k==null&&ee>=re,xe.dir)}if(te=Ne.to+1,te>=oe)break}return L.length==0&&W(X,v==null,re,k==null,n.textDirection),{top:F,bottom:P,horizontal:L}}function x(v,k){let O=l.top+(k?v.top:v.bottom);return{top:O,bottom:O,horizontal:[]}}}function Nf(n,e){return n.constructor==e.constructor&&n.eq(e)}class Ff{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],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"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Gi)!=e.state.facet(Gi)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&e.view.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(Gi);for(;t!Nf(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Gi=D.define();function wa(n){return[ge.define(e=>new Ff(e,n)),Gi.of(n)]}const xa=!M.ios,fi=D.define({combine(n){return At(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Og(n={}){return[fi.of(n),Vf,Wf,Hf,jl.of(!0)]}function va(n){return n.startState.facet(fi)!=n.state.facet(fi)}const Vf=wa({above:!0,markers(n){let{state:e}=n,t=e.facet(fi),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||xa:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let a of wi.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=va(n);return t&&mo(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){mo(e.state,n)},class:"cm-cursorLayer"});function mo(n,e){e.style.animationDuration=n.facet(fi).cursorBlinkRate+"ms"}const Wf=wa({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:wi.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||va(n)},class:"cm-selectionLayer"}),Sa={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};xa&&(Sa[".cm-line"].caretColor="transparent !important");const Hf=Ct.highest(T.theme(Sa)),ka=E.define({map(n,e){return n==null?null:e.mapPos(n)}}),ti=be.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(ka)?i.value:t,n)}}),zf=ge.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(ti);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(ti)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let n=this.view.state.field(ti),e=n!=null&&this.view.coordsAtPos(n);if(!e)return null;let t=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-t.left+this.view.scrollDOM.scrollLeft,top:e.top-t.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(n){this.cursor&&(n?(this.cursor.style.left=n.left+"px",this.cursor.style.top=n.top+"px",this.cursor.style.height=n.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(ti)!=n&&this.view.dispatch({effects:ka.of(n)})}},{eventHandlers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Tg(){return[ti,zf]}function yo(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function qf(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class $f{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new xt,i=t.add.bind(t);for(let{from:s,to:r}of qf(e,this.maxLength))yo(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(y.range(m,g));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const Ts=/x/.unicode!=null?"gu":"g",Kf=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Ts),jf={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 qn=null;function Uf(){var n;if(qn==null&&typeof document<"u"&&document.body){let e=document.body.style;qn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return qn||!1}const Ji=D.define({combine(n){let e=At(n,{render:null,specialChars:Kf,addSpecialChars:null});return(e.replaceTabs=!Uf())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ts)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ts)),e}});function Bg(n={}){return[Ji.of(n),Gf()]}let bo=null;function Gf(){return bo||(bo=ge.fromClass(class{constructor(n){this.view=n,this.decorations=B.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ji)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new $f({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ne(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=yi(o.text,l,i-o.from);return B.replace({widget:new Yf((l-a%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=B.replace({widget:new Xf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ji);n.startState.facet(Ji)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Jf="•";function _f(n){return n>=32?Jf:n==10?"␤":String.fromCharCode(9216+n)}class Xf extends ct{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=_f(this.code),i=e.state.phrase("Control character")+" "+(jf[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Yf extends ct{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}}class Qf extends ct{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function Pg(n){return ge.fromClass(class{constructor(e){this.view=e,this.placeholder=B.set([B.widget({widget:new Qf(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?B.none:this.placeholder}},{decorations:e=>e.decorations})}const Bs=2e3;function Zf(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Bs||t.off>Bs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(b.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=hs(h.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(h.to));else{let f=hs(h.text,l,n.tabSize);r.push(b.range(h.from+c,h.from+f))}}}return r}function eu(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function wo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Bs?-1:s==i.length?eu(n,e.clientX):yi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function tu(n,e){let t=wo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=wo(n,s);if(!l)return i;let a=Zf(n.state,t,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function Rg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return T.mouseSelectionStyle.of((t,i)=>e(i)?tu(t,i):null)}const Li="-10000px";class iu{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){var t;let i=e.state.facet(this.facet),s=i.filter(o=>o);if(i===this.input){for(let o of this.tooltipViews)o.update&&o.update(e);return!1}let r=[];for(let o=0;o{var e,t,i;return{position:M.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||nu}}}),xo=new WeakMap,Ca=ge.fromClass(class{constructor(n){this.view=n,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet($n);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new iu(n,Aa,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet($n);if(i.position!=this.position){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Li,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect();return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet($n).tooltipSpace(this.view)}}writeMeasure(n){var e;let{editor:t,space:i}=n,s=[];for(let r=0;r=Math.min(t.bottom,i.bottom)||h.rightMath.min(t.right,i.right)+.1){a.style.top=Li;continue}let f=o.arrow?l.dom.querySelector(".cm-tooltip-arrow"):null,u=f?7:0,d=c.right-c.left,p=(e=xo.get(l))!==null&&e!==void 0?e:c.bottom-c.top,m=l.offset||ru,g=this.view.textDirection==J.LTR,y=c.width>i.right-i.left?g?i.left:i.right-c.width:g?Math.min(h.left-(f?14:0)+m.x,i.right-d):Math.max(i.left,h.left-d+(f?14:0)-m.x),S=!!o.above;!o.strictSide&&(S?h.top-(c.bottom-c.top)-m.yi.bottom)&&S==i.bottom-h.bottom>h.top-i.top&&(S=!S);let A=(S?h.top-i.top:i.bottom-h.bottom)-u;if(Ay&&k.topx&&(x=S?k.top-p-2-u:k.bottom+u+2);this.position=="absolute"?(a.style.top=x-n.parent.top+"px",a.style.left=y-n.parent.left+"px"):(a.style.top=x+"px",a.style.left=y+"px"),f&&(f.style.left=`${h.left+(g?m.x:-m.x)-(y+14-7)}px`),l.overlap!==!0&&s.push({left:y,top:x,right:v,bottom:x+p}),a.classList.toggle("cm-tooltip-above",S),a.classList.toggle("cm-tooltip-below",!S),l.positioned&&l.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Li}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),su=T.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),ru={x:0,y:0},Aa=D.define({enables:[Ca,su]});function ou(n,e){let t=n.plugin(Ca);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const vo=D.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function rn(n,e){let t=n.plugin(Ma),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Ma=ge.fromClass(class{constructor(n){this.input=n.state.facet(on),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(vo);this.top=new Ei(n,!0,e.topContainer),this.bottom=new Ei(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(vo);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ei(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ei(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(on);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>T.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Ei{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.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 t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=So(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=So(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 So(n){let e=n.nextSibling;return n.remove(),e}const on=D.define({enables:Ma});class St extends wt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}St.prototype.elementClass="";St.prototype.toDOM=void 0;St.prototype.mapMode=he.TrackBefore;St.prototype.startSide=St.prototype.endSide=-1;St.prototype.point=!0;const lu=D.define(),au=new class extends St{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},hu=lu.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(au.range(s)))}return j.of(e)});function Lg(){return hu}const cu=1024;let fu=0;class Oe{constructor(e,t){this.from=e,this.to=t}}class R{constructor(e={}){this.id=fu++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=me.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}R.closedBy=new R({deserialize:n=>n.split(" ")});R.openedBy=new R({deserialize:n=>n.split(" ")});R.group=new R({deserialize:n=>n.split(" ")});R.contextHash=new R({perNode:!0});R.lookAhead=new R({perNode:!0});R.mounted=new R({perNode:!0});class uu{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}}const du=Object.create(null);class me{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):du,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new me(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}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 t=this.prop(R.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(R.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}me.none=new me("",Object.create(null),0,8);class tr{constructor(e){this.types=e;for(let t=0;t=s&&(o.type.isAnonymous||t(o)!==!1)){if(o.firstChild())continue;l=!0}for(;l&&i&&!o.type.isAnonymous&&i(o),!o.nextSibling();){if(!o.parent())return;l=!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 t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:sr(me.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new V(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new V(me.none,t,i,s)))}static build(e){return gu(e)}}V.empty=new V(me.none,[],[],0);class ir{constructor(e,t){this.buffer=e,this.index=t}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 ir(this.buffer,this.index)}}class Mt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return me.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Oa(n,e){let t=n.childBefore(e);for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(n=t,t=i.prevSibling):t=i}return n}function Ht(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(Da(s,i,f,f+c.length)){if(c instanceof Mt){if(r&U.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new $e(new pu(o,c,e,f),null,u)}else if(r&U.IncludeAnonymous||!c.type.isAnonymous||nr(c)){let u;if(!(r&U.IgnoreMounts)&&c.props&&(u=c.prop(R.mounted))&&!u.overlay)return new Pe(u.tree,f,e,o);let d=new Pe(c,f,e,o);return r&U.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&U.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<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)}enter(e,t,i=0){let s;if(!(i&U.IgnoreOverlays)&&(s=this._tree.prop(R.mounted))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new Pe(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}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}cursor(e=0){return new ui(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return Ht(this,e,t,!1)}resolveInner(e,t=0){return Ht(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Oa(this,e)}getChild(e,t=null,i=null){let s=ln(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return ln(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return an(this,e)}}function ln(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function an(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class pu{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class $e{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,t,i){this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new $e(this.context,this,r)}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)}enter(e,t,i=0){if(i&U.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new $e(this.context,this,r)}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,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new $e(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new $e(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new ui(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new V(this.type,e,t,this.to-this.from)}resolve(e,t=0){return Ht(this,e,t,!1)}resolveInner(e,t=0){return Ht(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Oa(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let s=ln(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return ln(this,e,t,i)}get node(){return this}matchContext(e){return an(this,e)}}class ui{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Pe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.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,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Pe?(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,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}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,t,i=this.mode){return this.buffer?i&U.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&U.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&U.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:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<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 t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&U.IncludeAnonymous||l instanceof Mt||!l.type.isAnonymous||nr(l))return!1}return!0}move(e,t){if(t&&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,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}}for(let s=i;s=0;r--){if(r<0)return an(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function nr(n){return n.children.some(e=>e instanceof Mt||!e.type.isAnonymous||nr(e))}function gu(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=cu,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new ir(t,t.length):t,a=i.types,h=0,c=0;function f(x,v,k,O,F){let{id:P,start:L,end:W,size:X}=l,re=c;for(;X<0;)if(l.next(),X==-1){let xe=r[P];k.push(xe),O.push(L-x);return}else if(X==-3){h=P;return}else if(X==-4){c=P;return}else throw new RangeError(`Unrecognized record size: ${X}`);let we=a[P],te,oe,Ne=L-x;if(W-L<=s&&(oe=m(l.pos-v,F))){let xe=new Uint16Array(oe.size-oe.skip),_=l.pos-oe.size,ee=xe.length;for(;l.pos>_;)ee=g(oe.start,xe,ee);te=new Mt(xe,W-oe.start,i),Ne=oe.start-x}else{let xe=l.pos-X;l.next();let _=[],ee=[],ut=P>=o?P:-1,Dt=0,Si=W;for(;l.pos>xe;)ut>=0&&l.id==ut&&l.size>=0?(l.end<=Si-s&&(d(_,ee,L,Dt,l.end,Si,ut,re),Dt=_.length,Si=l.end),l.next()):f(L,xe,_,ee,ut);if(ut>=0&&Dt>0&&Dt<_.length&&d(_,ee,L,Dt,L,Si,ut,re),_.reverse(),ee.reverse(),ut>-1&&Dt>0){let Sr=u(we);te=sr(we,_,ee,0,_.length,0,W-L,Sr,Sr)}else te=p(we,_,ee,W-L,re-W)}k.push(te),O.push(Ne)}function u(x){return(v,k,O)=>{let F=0,P=v.length-1,L,W;if(P>=0&&(L=v[P])instanceof V){if(!P&&L.type==x&&L.length==O)return L;(W=L.prop(R.lookAhead))&&(F=k[P]+L.length+W)}return p(x,v,k,O,F)}}function d(x,v,k,O,F,P,L,W){let X=[],re=[];for(;x.length>O;)X.push(x.pop()),re.push(v.pop()+k-F);x.push(p(i.types[L],X,re,P-F,W-P)),v.push(F-k)}function p(x,v,k,O,F=0,P){if(h){let L=[R.contextHash,h];P=P?[L].concat(P):[L]}if(F>25){let L=[R.lookAhead,F];P=P?[L].concat(P):[L]}return new V(x,v,k,O,P)}function m(x,v){let k=l.fork(),O=0,F=0,P=0,L=k.end-s,W={size:0,start:0,skip:0};e:for(let X=k.pos-x;k.pos>X;){let re=k.size;if(k.id==v&&re>=0){W.size=O,W.start=F,W.skip=P,P+=4,O+=4,k.next();continue}let we=k.pos-re;if(re<0||we=o?4:0,oe=k.start;for(k.next();k.pos>we;){if(k.size<0)if(k.size==-3)te+=4;else break e;else k.id>=o&&(te+=4);k.next()}F=oe,O+=re,P+=te}return(v<0||O==x)&&(W.size=O,W.start=F,W.skip=P),W.size>4?W:void 0}function g(x,v,k){let{id:O,start:F,end:P,size:L}=l;if(l.next(),L>=0&&O4){let X=l.pos-(L-4);for(;l.pos>X;)k=g(x,v,k)}v[--k]=W,v[--k]=P-x,v[--k]=F-x,v[--k]=O}else L==-3?h=O:L==-4&&(c=O);return k}let y=[],S=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,S,-1);let A=(e=n.length)!==null&&e!==void 0?e:y.length?S[0]+y[0].length:0;return new V(a[n.topID],y.reverse(),S.reverse(),A)}const Co=new WeakMap;function _i(n,e){if(!n.isAnonymous||e instanceof Mt||e.type!=n)return 1;let t=Co.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof V)){t=1;break}t+=_i(n,i)}Co.set(e,t)}return t}function sr(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;k+=O}if(A==x+1){if(k>c){let O=p[x];d(O.children,O.positions,0,O.children.length,m[x]+S);continue}f.push(p[x])}else{let O=m[A-1]+p[A-1].length-v;f.push(sr(n,p,m,x,A,v,O,null,a))}u.push(v+S-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class Eg{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof $e?this.setBuffer(e.context.buffer,e.index,t):e instanceof Pe&&this.map.set(e.tree,t)}get(e){return e instanceof $e?this.getBuffer(e.context.buffer,e.index):e instanceof Pe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ye{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Ye(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Ye(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew Oe(s.from,s.to)):[new Oe(0,0)]:[new Oe(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class mu{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Ig(n){return(e,t,i,s)=>new bu(e,n,t,i,s)}class Ao{constructor(e,t,i,s,r){this.parser=e,this.parse=t,this.overlay=i,this.target=s,this.ranges=r}}class yu{constructor(e,t,i,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Ps=new R({perNode:!0});class bu{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new V(i.type,i.children,i.positions,i.length,i.propValues.concat([[Ps,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[R.mounted.id]=new uu(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tc.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=wu(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&s.fromnew Oe(f.from-s.from,f.to-s.from)):null,s.tree,c)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else t&&(a=t.predicate(s))&&(a===!0&&(a=new Oe(s.from,s.to)),a.fromnew Oe(c.from-t.start,c.to-t.start)),t.target,h)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function wu(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Mo(n,e,t,i,s,r){if(e=e.to);i++);let o=s.children[i],l=o.buffer;function a(h,c,f,u,d){let p=h;for(;l[p+2]+r<=e.from;)p=l[p+3];let m=[],g=[];Mo(o,h,p,m,g,u);let y=l[p+1],S=l[p+2],A=y+r==e.from&&S+r==e.to&&l[p]==e.type.id;return m.push(A?e.toTree():a(p+4,l[p+3],o.set.types[l[p]],y,S-y)),g.push(y-u),Mo(o,l[p+3],c,m,g,u),new V(f,m,g,d)}s.children[i]=a(0,l.length,me.none,0,o.length);for(let h=0;h<=t;h++)n.childAfter(e.from)}class Do{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(U.IncludeAnonymous|U.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,U.IgnoreOverlays|U.ExcludeBuffers)||t.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 t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof V)t=t.children[0];else break}return!1}}class vu{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Ps))!==null&&t!==void 0?t:i.to,this.inner=new Do(i.tree,-i.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 t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Ps))!==null&&e!==void 0?e:t.to,this.inner=new Do(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(R.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function Oo(n,e){let t=null,i=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new Oe(l,a.to))):a.to>l?t[r--]=new Oe(l,a.to):t.splice(r--,1))}}return i}function Su(n,e,t,i){let s=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew Oe(u.from+i,u.to+i)),f=Su(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,m=p?h:f[u].from;if(m>d&&t.push(new Ye(d,m,s.tree,-o,r.from>=d||r.openStart,r.to<=m||r.openEnd)),p)break;d=f[u].to}}else t.push(new Ye(a,h,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let ku=0;class ze{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=ku++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new ze([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new hn;return t=>t.modified.indexOf(e)>-1?t:hn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let Cu=0;class hn{constructor(){this.instances=[],this.id=Cu++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Au(t,l.modified));if(i)return i;let s=[],r=new ze(s,e,t);for(let l of t)l.instances.push(r);let o=Mu(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(hn.get(l,a));return r}}function Au(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function Mu(n){let e=[[]];for(let t=0;ti.length-t.length)}function Du(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new cn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Ba.add(e)}const Ba=new R;class cn{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function Ou(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function Tu(n,e,t,i=0,s=n.length){let r=new Bu(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class Bu{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=Pu(e)||cn.empty,f=Ou(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(e.from,h),c.opaque)return;let u=e.tree&&e.tree.prop(R.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,y=l;;g++){let S=g=A||!e.nextSibling())););if(!S||A>i)break;y=S.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,S.from+l),Math.min(i,y),s,p),this.startSpan(y,h))}m&&e.parent()}else if(e.firstChild()){do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function Pu(n){let e=n.type.prop(Ba);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const w=ze.define,Ni=w(),Ze=w(),Bo=w(Ze),Po=w(Ze),et=w(),Fi=w(et),Kn=w(et),He=w(),dt=w(He),Ve=w(),We=w(),Rs=w(),_t=w(Rs),Vi=w(),C={comment:Ni,lineComment:w(Ni),blockComment:w(Ni),docComment:w(Ni),name:Ze,variableName:w(Ze),typeName:Bo,tagName:w(Bo),propertyName:Po,attributeName:w(Po),className:w(Ze),labelName:w(Ze),namespace:w(Ze),macroName:w(Ze),literal:et,string:Fi,docString:w(Fi),character:w(Fi),attributeValue:w(Fi),number:Kn,integer:w(Kn),float:w(Kn),bool:w(et),regexp:w(et),escape:w(et),color:w(et),url:w(et),keyword:Ve,self:w(Ve),null:w(Ve),atom:w(Ve),unit:w(Ve),modifier:w(Ve),operatorKeyword:w(Ve),controlKeyword:w(Ve),definitionKeyword:w(Ve),moduleKeyword:w(Ve),operator:We,derefOperator:w(We),arithmeticOperator:w(We),logicOperator:w(We),bitwiseOperator:w(We),compareOperator:w(We),updateOperator:w(We),definitionOperator:w(We),typeOperator:w(We),controlOperator:w(We),punctuation:Rs,separator:w(Rs),bracket:_t,angleBracket:w(_t),squareBracket:w(_t),paren:w(_t),brace:w(_t),content:He,heading:dt,heading1:w(dt),heading2:w(dt),heading3:w(dt),heading4:w(dt),heading5:w(dt),heading6:w(dt),contentSeparator:w(He),list:w(He),quote:w(He),emphasis:w(He),strong:w(He),link:w(He),monospace:w(He),strikethrough:w(He),inserted:w(),deleted:w(),changed:w(),invalid:w(),meta:Vi,documentMeta:w(Vi),annotation:w(Vi),processingInstruction:w(Vi),definition:ze.defineModifier(),constant:ze.defineModifier(),function:ze.defineModifier(),standard:ze.defineModifier(),local:ze.defineModifier(),special:ze.defineModifier()};Pa([{tag:C.link,class:"tok-link"},{tag:C.heading,class:"tok-heading"},{tag:C.emphasis,class:"tok-emphasis"},{tag:C.strong,class:"tok-strong"},{tag:C.keyword,class:"tok-keyword"},{tag:C.atom,class:"tok-atom"},{tag:C.bool,class:"tok-bool"},{tag:C.url,class:"tok-url"},{tag:C.labelName,class:"tok-labelName"},{tag:C.inserted,class:"tok-inserted"},{tag:C.deleted,class:"tok-deleted"},{tag:C.literal,class:"tok-literal"},{tag:C.string,class:"tok-string"},{tag:C.number,class:"tok-number"},{tag:[C.regexp,C.escape,C.special(C.string)],class:"tok-string2"},{tag:C.variableName,class:"tok-variableName"},{tag:C.local(C.variableName),class:"tok-variableName tok-local"},{tag:C.definition(C.variableName),class:"tok-variableName tok-definition"},{tag:C.special(C.variableName),class:"tok-variableName2"},{tag:C.definition(C.propertyName),class:"tok-propertyName tok-definition"},{tag:C.typeName,class:"tok-typeName"},{tag:C.namespace,class:"tok-namespace"},{tag:C.className,class:"tok-className"},{tag:C.macroName,class:"tok-macroName"},{tag:C.propertyName,class:"tok-propertyName"},{tag:C.operator,class:"tok-operator"},{tag:C.comment,class:"tok-comment"},{tag:C.meta,class:"tok-meta"},{tag:C.invalid,class:"tok-invalid"},{tag:C.punctuation,class:"tok-punctuation"}]);var jn;const mt=new R;function Ra(n){return D.define({combine:n?e=>e.concat(n):void 0})}const Ru=new R;class Te{constructor(e,t,i=[],s=""){this.data=e,this.name=s,N.prototype.hasOwnProperty("tree")||Object.defineProperty(N.prototype,"tree",{get(){return ye(this)}}),this.parser=t,this.extension=[$t.of(this),N.languageData.of((r,o,l)=>{let a=Ro(r,o,l),h=a.type.prop(mt);if(!h)return[];let c=r.facet(h),f=a.type.prop(Ru);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return Ro(e,t,i).type.prop(mt)==this.data}findRegions(e){let t=e.facet($t);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(mt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(R.mounted);if(l){if(l.tree.prop(mt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ls(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ye(n){let e=n.field(Te.state,!1);return e?e.tree:V.empty}class Lu{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,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Xt=null;class zt{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new zt(e,t,[],V.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Lu(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=V.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ye.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Xt;Xt=this;try{return e()}finally{Xt=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Lo(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Ye.applyChanges(i,a),s=V.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Lo(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ta{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=Xt;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new V(me.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Xt}}function Lo(n,e,t){return Ye.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class qt{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new qt(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=zt.create(e.facet($t).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new qt(i)}}Te.state=be.define({create:qt.init,update(n,e){for(let t of e.effects)if(t.is(Te.setState))return t.value;return e.startState.facet($t)!=e.state.facet($t)?qt.init(e.state):n.apply(e)}});let La=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(La=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Un=typeof navigator<"u"&&(!((jn=navigator.scheduling)===null||jn===void 0)&&jn.isInputPending)?()=>navigator.scheduling.isInputPending():null,Eu=ge.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 t=this.view.state.field(Te.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Te.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=La(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>Un&&Un()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Te.setState.of(new qt(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ee(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),$t=D.define({combine(n){return n.length?n[0]:null},enables:n=>[Te.state,Eu,T.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Fg{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Ea=D.define(),An=D.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function kt(n){let e=n.facet(An);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function fn(n,e){let t="",i=n.tabSize,s=n.facet(An)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return yi(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Iu=new R;function Nu(n,e,t){return Na(e.resolveInner(t).enterUnfinishedNodesBefore(t),t,n)}function Fu(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Vu(n){let e=n.type.prop(Iu);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(R.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>Fa(o,!0,1,void 0,r&&!Fu(o)?s.from:void 0)}return n.parent==null?Wu:null}function Na(n,e,t){for(;n;n=n.parent){let i=Vu(n);if(i)return i(rr.create(t,e,n))}return null}function Wu(){return 0}class rr extends Mn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.node=i}static create(e,t,i){return new rr(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(Hu(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?Na(e,this.pos,this.base):0}}function Hu(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function zu(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.fromFa(i,e,t,n)}function Fa(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?zu(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const Wg=n=>n.baseIndent;function Hg({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const zg=new R;function qg(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(mt)==o.data:o?l=>l==o:void 0,this.style=Pa(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new lt(i):null,this.themeType=t.themeType}static define(e,t){return new Dn(e,t||{})}}const Es=D.define(),Va=D.define({combine(n){return n.length?[n[0]]:null}});function Gn(n){let e=n.facet(Es);return e.length?e:n.facet(Va)}function $g(n,e){let t=[$u],i;return n instanceof Dn&&(n.module&&t.push(T.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Va.of(n)):i?t.push(Es.computeN([T.darkTheme],s=>s.facet(T.darkTheme)==(i=="dark")?[n]:[])):t.push(Es.of(n)),t}class qu{constructor(e){this.markCache=Object.create(null),this.tree=ye(e.state),this.decorations=this.buildDeco(e,Gn(e.state))}update(e){let t=ye(e.state),i=Gn(e.state),s=i!=Gn(e.startState);t.length{i.add(o,l,this.markCache[a]||(this.markCache[a]=B.mark({class:a})))},s,r);return i.finish()}}const $u=Ct.high(ge.fromClass(qu,{decorations:n=>n.decorations})),Kg=Dn.define([{tag:C.meta,color:"#404740"},{tag:C.link,textDecoration:"underline"},{tag:C.heading,textDecoration:"underline",fontWeight:"bold"},{tag:C.emphasis,fontStyle:"italic"},{tag:C.strong,fontWeight:"bold"},{tag:C.strikethrough,textDecoration:"line-through"},{tag:C.keyword,color:"#708"},{tag:[C.atom,C.bool,C.url,C.contentSeparator,C.labelName],color:"#219"},{tag:[C.literal,C.inserted],color:"#164"},{tag:[C.string,C.deleted],color:"#a11"},{tag:[C.regexp,C.escape,C.special(C.string)],color:"#e40"},{tag:C.definition(C.variableName),color:"#00f"},{tag:C.local(C.variableName),color:"#30a"},{tag:[C.typeName,C.namespace],color:"#085"},{tag:C.className,color:"#167"},{tag:[C.special(C.variableName),C.macroName],color:"#256"},{tag:C.definition(C.propertyName),color:"#00c"},{tag:C.comment,color:"#940"},{tag:C.invalid,color:"#f00"}]),Ku=T.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Wa=1e4,Ha="()[]{}",za=D.define({combine(n){return At(n,{afterCursor:!0,brackets:Ha,maxScanDistance:Wa,renderMatch:Gu})}}),ju=B.mark({class:"cm-matchingBracket"}),Uu=B.mark({class:"cm-nonmatchingBracket"});function Gu(n){let e=[],t=n.matched?ju:Uu;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const Ju=be.define({create(){return B.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(za);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=Ke(e.state,s.head,-1,i)||s.head>0&&Ke(e.state,s.head-1,1,i)||i.afterCursor&&(Ke(e.state,s.head,1,i)||s.headT.decorations.from(n)}),_u=[Ju,Ku];function jg(n={}){return[za.of(n),_u]}const Xu=new R;function Is(n,e,t){let i=n.prop(e<0?R.openedBy:R.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function Ns(n){let e=n.type.prop(Xu);return e?e(n.node):n}function Ke(n,e,t,i={}){let s=i.maxScanDistance||Wa,r=i.brackets||Ha,o=ye(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=Is(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return Yu(n,e,t,a,c,h,r)}}return Qu(n,e,t,o,l.type,s,r)}function Yu(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function Eo(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}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 t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Zu(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||ed,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||lr}}function ed(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const Io=new WeakMap;class $a extends Te{constructor(e){let t=Ra(e.languageData),i=Zu(e),s,r=new class extends Ta{createParse(o,l,a){return new id(s,o,l,a)}};super(t,r,[Ea.of((o,l)=>this.getIndent(o,l))],e.name),this.topNode=rd(t),s=this,this.streamParser=i,this.stateAfter=new R({perNode:!0}),this.tokenTable=e.tokenTable?new Ga(i.tokenTable):sd}static define(e){return new $a(e)}getIndent(e,t){let i=ye(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r,{overrideIndentation:o}=e.options;o&&(r=Io.get(e.state),r!=null&&r1e4)return null;for(;a=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof V&&a=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&or(n,s.tree,0-s.offset,t,o),a;if(l&&(a=Ka(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?kt(i):4),tree:V.empty}}class id{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=zt.get(),o=s[0].from,{state:l,tree:a}=td(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` -`&&(t="");else{let i=t.indexOf(` -`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new qa(t,e?e.state.tabSize:4,e?kt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=ja(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const lr=Object.create(null),di=[me.none],nd=new tr(di),No=[],Ua=Object.create(null);for(let[n,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"]])Ua[n]=Ja(lr,e);class Ga{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Ua)}resolve(e){return e?this.table[e]||(this.table[e]=Ja(this.extra,e)):0}}const sd=new Ga(lr);function Jn(n,e){No.indexOf(n)>-1||(No.push(n),console.warn(e))}function Ja(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||C[r];o?typeof o=="function"?t?t=o(t):Jn(r,`Modifier ${r} used at start of tag`):t?Jn(r,`Tag ${r} used as modifier`):t=o:Jn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=me.define({id:di.length,name:i,props:[Du({[i]:t})]});return di.push(s),s.id}function rd(n){let e=me.define({id:di.length,name:"Document",props:[mt.add(()=>n)]});return di.push(e),e}const od=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.head),i=hr(n.state,t.from);return i.line?ld(n):i.block?hd(n):!1};function ar(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const ld=ar(ud,0),ad=ar(_a,0),hd=ar((n,e)=>_a(n,e,fd(e)),0);function hr(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Yt=50;function cd(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Yt,i),o=n.sliceDoc(s,s+Yt),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*Yt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Yt),f=n.sliceDoc(s-Yt,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function fd(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from,to:s.to})}return e}function _a(n,e,t=e.selection.ranges){let i=t.map(r=>hr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>cd(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>c.from)){s=c.from;let f=hr(e,c.from).line;if(!f)continue;let u=/^\s*/.exec(c.text)[0].length,d=u==c.length,p=c.text.slice(u,u+f.length)==f?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const Fs=Qe.define(),dd=Qe.define(),pd=D.define(),Xa=D.define({combine(n){return At(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}});function gd(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const Ya=be.define({create(){return je.empty},update(n,e){let t=e.state.facet(Xa),i=e.annotation(Fs);if(i){let a=e.docChanged?b.single(gd(e.changes)):void 0,h=Se.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=un(f,f.length,t.minDepth,h):f=eh(f,e.startState.selection),new je(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation(dd);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(Q.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=Se.fromTransaction(e),o=e.annotation(Q.time),l=e.annotation(Q.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new je(n.done.map(Se.fromJSON),n.undone.map(Se.fromJSON))}});function Ug(n={}){return[Ya,Xa.of(n),T.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Qa:e.inputType=="historyRedo"?Vs:null;return i?(e.preventDefault(),i(t)):!1}})]}function On(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(Ya,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const Qa=On(0,!1),Vs=On(1,!1),md=On(0,!0),yd=On(1,!0);class Se{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Se(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Se(e.changes&&Y.fromJSON(e.changes),[],e.mapped&&Ue.fromJSON(e.mapped),e.startSelection&&b.fromJSON(e.startSelection),e.selectionsAfter.map(b.fromJSON))}static fromTransaction(e,t){let i=Be;for(let s of e.startState.facet(pd)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Se(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Be)}static selection(e){return new Se(void 0,Be,void 0,void 0,e)}}function un(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function bd(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function wd(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Za(n,e){return n.length?e.length?n.concat(e):n:e}const Be=[],xd=200;function eh(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-xd));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),un(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Se.selection([e])]}function vd(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function _n(n,e){if(!n.length)return n;let t=n.length,i=Be;for(;t;){let s=Sd(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[Se.selection(i)]:Be}function Sd(n,e,t){let i=Za(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Be,t);if(!n.changes)return Se.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new Se(s,E.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const kd=/^(input\.type|delete)($|\.)/;class je{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new je(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||kd.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Tn(t,e))}function fe(n){return n.textDirectionAt(n.state.selection.main.head)==J.LTR}const ih=n=>th(n,!fe(n)),nh=n=>th(n,fe(n));function sh(n,e){return Ie(n,t=>t.empty?n.moveByGroup(t,e):Tn(t,e))}const Cd=n=>sh(n,!fe(n)),Ad=n=>sh(n,fe(n));function Md(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Bn(n,e,t){let i=ye(n).resolveInner(e.head),s=t?R.closedBy:R.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;Md(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?Ke(n,i.from,1):Ke(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,b.cursor(l,t?-1:1)}const Dd=n=>Ie(n,e=>Bn(n.state,e,!fe(n))),Od=n=>Ie(n,e=>Bn(n.state,e,fe(n)));function rh(n,e){return Ie(n,t=>{if(!t.empty)return Tn(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const oh=n=>rh(n,!1),lh=n=>rh(n,!0);function ah(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Tn(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomhh(n,!1),Ws=n=>hh(n,!0);function ft(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const Td=n=>Ie(n,e=>ft(n,e,!0)),Bd=n=>Ie(n,e=>ft(n,e,!1)),Pd=n=>Ie(n,e=>ft(n,e,!fe(n))),Rd=n=>Ie(n,e=>ft(n,e,fe(n))),Ld=n=>Ie(n,e=>b.cursor(n.lineBlockAt(e.head).from,1)),Ed=n=>Ie(n,e=>b.cursor(n.lineBlockAt(e.head).to,-1));function Id(n,e,t){let i=!1,s=jt(n.selection,r=>{let o=Ke(n,r.head,-1)||Ke(n,r.head,1)||r.head>0&&Ke(n,r.head-1,1)||r.headId(n,e,!1);function Le(n,e){let t=jt(n.state.selection,i=>{let s=e(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(_e(n.state,t)),!0)}function ch(n,e){return Le(n,t=>n.moveByChar(t,e))}const fh=n=>ch(n,!fe(n)),uh=n=>ch(n,fe(n));function dh(n,e){return Le(n,t=>n.moveByGroup(t,e))}const Fd=n=>dh(n,!fe(n)),Vd=n=>dh(n,fe(n)),Wd=n=>Le(n,e=>Bn(n.state,e,!fe(n))),Hd=n=>Le(n,e=>Bn(n.state,e,fe(n)));function ph(n,e){return Le(n,t=>n.moveVertically(t,e))}const gh=n=>ph(n,!1),mh=n=>ph(n,!0);function yh(n,e){return Le(n,t=>n.moveVertically(t,e,ah(n).height))}const Vo=n=>yh(n,!1),Wo=n=>yh(n,!0),zd=n=>Le(n,e=>ft(n,e,!0)),qd=n=>Le(n,e=>ft(n,e,!1)),$d=n=>Le(n,e=>ft(n,e,!fe(n))),Kd=n=>Le(n,e=>ft(n,e,fe(n))),jd=n=>Le(n,e=>b.cursor(n.lineBlockAt(e.head).from)),Ud=n=>Le(n,e=>b.cursor(n.lineBlockAt(e.head).to)),Ho=({state:n,dispatch:e})=>(e(_e(n,{anchor:0})),!0),zo=({state:n,dispatch:e})=>(e(_e(n,{anchor:n.doc.length})),!0),qo=({state:n,dispatch:e})=>(e(_e(n,{anchor:n.selection.main.anchor,head:0})),!0),$o=({state:n,dispatch:e})=>(e(_e(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Gd=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),Jd=({state:n,dispatch:e})=>{let t=Rn(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:b.create(t),userEvent:"select"})),!0},_d=({state:n,dispatch:e})=>{let t=jt(n.selection,i=>{var s;let r=ye(n).resolveInner(i.head,1);for(;!(r.from=i.to||r.to>i.to&&r.from<=i.from||!(!((s=r.parent)===null||s===void 0)&&s.parent));)r=r.parent;return b.range(r.to,r.from)});return e(_e(n,t)),!0},Xd=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=b.create([t.main]):t.main.empty||(i=b.create([b.cursor(t.main.head)])),i?(e(_e(n,i)),!0):!1};function Pn(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(o);ao&&(t="delete.forward",a=Wi(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Wi(n,o,!1),l=Wi(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?T.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Wi(n,e,t){if(n instanceof T)for(let i of n.state.facet(T.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const bh=(n,e)=>Pn(n,t=>{let{state:i}=n,s=i.doc.lineAt(t),r,o;if(!e&&t>s.from&&tbh(n,!1),wh=n=>bh(n,!0),xh=(n,e)=>Pn(n,t=>{let i=t,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ue(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t)&&(l=c),i=a}return i}),vh=n=>xh(n,!1),Yd=n=>xh(n,!0),Sh=n=>Pn(n,e=>{let t=n.lineBlockAt(e).to;return ePn(n,e=>{let t=n.lineBlockAt(e).from;return e>t?t:Math.max(0,e-1)}),Zd=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:I.of(["",""])},range:b.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},ep=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ue(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ue(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Rn(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function kh(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Rn(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(b.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(b.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const tp=({state:n,dispatch:e})=>kh(n,e,!1),ip=({state:n,dispatch:e})=>kh(n,e,!0);function Ch(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Rn(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const np=({state:n,dispatch:e})=>Ch(n,e,!1),sp=({state:n,dispatch:e})=>Ch(n,e,!0),rp=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Rn(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function op(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ye(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(R.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from?{from:i.to,to:s.from}:null}const lp=Ah(!1),ap=Ah(!0);function Ah(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&op(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Mn(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Ia(h,r);for(c==null&&(c=/^\s*/.exec(e.doc.lineAt(r).text)[0].length);ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const hp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Mn(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=cr(n,(r,o,l)=>{let a=Ia(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=fn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(cr(n,(t,i)=>{i.push({from:t.from,insert:n.facet(An)})}),{userEvent:"input.indent"})),!0),fp=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(cr(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=yi(s,n.tabSize),o=0,l=fn(n,Math.max(0,r-kt(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),Jg=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Dd,shift:Wd},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Od,shift:Hd},{key:"Alt-ArrowUp",run:tp},{key:"Shift-Alt-ArrowUp",run:np},{key:"Alt-ArrowDown",run:ip},{key:"Shift-Alt-ArrowDown",run:sp},{key:"Escape",run:Xd},{key:"Mod-Enter",run:ap},{key:"Alt-l",mac:"Ctrl-l",run:Jd},{key:"Mod-i",run:_d,preventDefault:!0},{key:"Mod-[",run:fp},{key:"Mod-]",run:cp},{key:"Mod-Alt-\\",run:hp},{key:"Shift-Mod-k",run:rp},{key:"Shift-Mod-\\",run:Nd},{key:"Mod-/",run:od},{key:"Alt-A",run:ad}].concat(dp);function le(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class Kt{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(Ko(l)):Ko,this.query=this.normalize(t)}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 ne(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 t=Ks(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=De(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(a)return this.value=a,this;if(r==s.length-1)break;o==i&&rthis.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 t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=dn(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new Nt(t,e.sliceString(t,i));return Xn.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=dn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Nt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Oh.prototype[Symbol.iterator]=Th.prototype[Symbol.iterator]=function(){return this});function pp(n){try{return new RegExp(n,fr),!0}catch{return!1}}function dn(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function zs(n){let e=le("input",{class:"cm-textfield",name:"line"}),t=le("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:pn.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},le("label",n.state.phrase("Go to line"),": ",e)," ",le("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!s)return;let{state:r}=n,o=r.doc.lineAt(r.selection.main.head),[,l,a,h,c]=s,f=h?+h.slice(1):0,u=a?+a:o.number;if(a&&c){let p=u/100;l&&(p=p*(l=="-"?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*p)}else a&&l&&(u=u*(l=="-"?-1:1)+o.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u)));n.dispatch({effects:pn.of(!1),selection:b.cursor(d.from+Math.max(0,Math.min(f,d.length))),scrollIntoView:!0}),n.focus()}return{dom:t}}const pn=E.define(),jo=be.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(pn)&&(n=t.value);return n},provide:n=>on.from(n,e=>e?zs:null)}),gp=n=>{let e=rn(n,zs);if(!e){let t=[pn.of(!0)];n.state.field(jo,!1)==null&&t.push(E.appendConfig.of([jo,mp])),n.dispatch({effects:t}),e=rn(n,zs)}return e&&e.dom.querySelector("input").focus(),!0},mp=T.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),yp={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Bh=D.define({combine(n){return At(n,yp,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function _g(n){let e=[Sp,vp];return n&&e.push(Bh.of(n)),e}const bp=B.mark({class:"cm-selectionMatch"}),wp=B.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Uo(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=$.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=$.Word)}function xp(n,e,t,i){return n(e.sliceDoc(t,t+1))==$.Word&&n(e.sliceDoc(i-1,i))==$.Word}const vp=ge.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Bh),{state:t}=n,i=t.selection;if(i.ranges.length>1)return B.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return B.none;let a=t.wordAt(s.head);if(!a)return B.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return B.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Uo(o,t,s.from,s.to)&&xp(o,t,s.from,s.to)))return B.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return B.none}let l=[];for(let a of n.visibleRanges){let h=new Kt(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Uo(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(wp.range(c,f)):(c>=s.to||f<=s.from)&&l.push(bp.range(c,f)),l.length>e.maxMatches))return B.none}}return B.set(l)}},{decorations:n=>n.decorations}),Sp=T.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),kp=({state:n,dispatch:e})=>{let{selection:t}=n,i=b.create(t.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function Cp(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new Kt(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Kt(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const Ap=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return kp({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=Cp(n,i);return s?(e(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:T.scrollIntoView(s.to)})),!0):!1},ur=D.define({combine(n){return At(n,{top:!1,caseSensitive:!1,literal:!1,wholeWord:!1,createPanel:e=>new Np(e)})}});class Ph{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||pp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Tp(this):new Dp(this)}getCursor(e,t=0,i){let s=e.doc?e:N.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Bt(this,s,t,i):Tt(this,s,t,i)}}class Rh{constructor(e){this.spec=e}}function Tt(n,e,t,i){return new Kt(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?Mp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Mp(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Tt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Bt(n,e,t,i){return new Oh(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Op(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function gn(n,e){return n.slice(ue(n,e,!1),e)}function mn(n,e){return n.slice(e,ue(n,e))}function Op(n){return(e,t,i)=>!i[0].length||(n(gn(i.input,i.index))!=$.Word||n(mn(i.input,i.index))!=$.Word)&&(n(mn(i.input,i.index+i[0].length))!=$.Word||n(gn(i.input,i.index+i[0].length))!=$.Word)}class Tp extends Rh{nextMatch(e,t,i){let s=Bt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Bt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Bt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Bt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const pi=E.define(),dr=E.define(),rt=be.define({create(n){return new Yn(qs(n).create(),null)},update(n,e){for(let t of e.effects)t.is(pi)?n=new Yn(t.value.create(),n.panel):t.is(dr)&&(n=new Yn(n.query,t.value?pr:null));return n},provide:n=>on.from(n,e=>e.panel)});class Yn{constructor(e,t){this.query=e,this.panel=t}}const Bp=B.mark({class:"cm-searchMatch"}),Pp=B.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Rp=ge.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(rt))}update(n){let e=n.state.field(rt);(e!=n.startState.field(rt)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return B.none;let{view:t}=this,i=new xt;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Pp:Bp)})}return i.finish()}},{decorations:n=>n.decorations});function xi(n){return e=>{let t=e.state.field(rt,!1);return t&&t.query.spec.valid?n(e,t):Lh(e)}}const yn=xi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);return i?(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:gr(n,i),userEvent:"select.search"}),!0):!1}),bn=xi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);return s?(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:gr(n,s),userEvent:"select.search"}),!0):!1}),Lp=xi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:b.create(t.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Ep=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Kt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return e(n.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},Go=xi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t,r.from,r.to),h.push(T.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l={anchor:r.from-c,head:r.to-c},h.push(gr(n,r))}return n.dispatch({changes:o,selection:l,scrollIntoView:!!l,effects:h,userEvent:"input.replace"}),!0}),Ip=xi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:T.announce.of(i),userEvent:"input.replace.all"}),!0});function pr(n){return n.state.facet(ur).createPanel(n)}function qs(n,e){var t,i,s,r;let o=n.selection.main,l=o.empty||o.to>o.from+100?"":n.sliceDoc(o.from,o.to);if(e&&!l)return e;let a=n.facet(ur);return new Ph({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:a.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:a.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:a.literal,wholeWord:(r=e==null?void 0:e.wholeWord)!==null&&r!==void 0?r:a.wholeWord})}const Lh=n=>{let e=n.state.field(rt,!1);if(e&&e.panel){let t=rn(n,pr);if(!t)return!1;let i=t.dom.querySelector("[main-field]");if(i&&i!=n.root.activeElement){let s=qs(n.state,e.query.spec);s.valid&&n.dispatch({effects:pi.of(s)}),i.focus(),i.select()}}else n.dispatch({effects:[dr.of(!0),e?pi.of(qs(n.state,e.query.spec)):E.appendConfig.of(Vp)]});return!0},Eh=n=>{let e=n.state.field(rt,!1);if(!e||!e.panel)return!1;let t=rn(n,pr);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:dr.of(!1)}),!0},Xg=[{key:"Mod-f",run:Lh,scope:"editor search-panel"},{key:"F3",run:yn,shift:bn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:yn,shift:bn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Eh,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Ep},{key:"Alt-g",run:gp},{key:"Mod-d",run:Ap,preventDefault:!0}];class Np{constructor(e){this.view=e;let t=this.query=e.state.field(rt).query.spec;this.commit=this.commit.bind(this),this.searchField=le("input",{value:t.search,placeholder:ke(e,"Find"),"aria-label":ke(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=le("input",{value:t.replace,placeholder:ke(e,"Replace"),"aria-label":ke(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=le("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=le("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=le("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return le("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=le("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>yn(e),[ke(e,"next")]),i("prev",()=>bn(e),[ke(e,"previous")]),i("select",()=>Lp(e),[ke(e,"all")]),le("label",null,[this.caseField,ke(e,"match case")]),le("label",null,[this.reField,ke(e,"regexp")]),le("label",null,[this.wordField,ke(e,"by word")]),...e.state.readOnly?[]:[le("br"),this.replaceField,i("replace",()=>Go(e),[ke(e,"replace")]),i("replaceAll",()=>Ip(e),[ke(e,"replace all")])],le("button",{name:"close",onclick:()=>Eh(e),"aria-label":ke(e,"close"),type:"button"},["×"])])}commit(){let e=new Ph({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:pi.of(e)}))}keydown(e){Rf(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?bn:yn)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Go(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(pi)&&!i.value.eq(this.query)&&this.setQuery(i.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(ur).top}}function ke(n,e){return n.state.phrase(e)}const Hi=30,zi=/[\s\.,:;?!]/;function gr(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Hi),o=Math.min(s,t+Hi),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-Hi;a--)if(!zi.test(l[a-1])&&zi.test(l[a])){l=l.slice(0,a);break}}return T.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const Fp=T.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"}}),Vp=[rt,Ct.lowest(Rp),Fp];class Ih{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ye(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Nh(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Jo(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Wp(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Wp(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function Yg(n,e){return t=>{for(let i=ye(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class _o{constructor(e,t,i){this.completion=e,this.source=t,this.match=i}}function ot(n){return n.selection.main.head}function Nh(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Fh=Qe.define();function zp(n,e,t,i){return Object.assign(Object.assign({},n.changeByRange(s=>{if(s==n.selection.main)return{changes:{from:t,to:i,insert:e},range:b.cursor(t+e.length)};let r=i-t;return!s.empty||r&&n.sliceDoc(s.from-r,s.from)!=n.sliceDoc(t,i)?{range:s}:{changes:{from:s.from-r,to:s.from,insert:e},range:b.cursor(s.from-r+e.length)}})),{userEvent:"input.complete"})}function Vh(n,e){const t=e.completion.apply||e.completion.label;let i=e.source;typeof t=="string"?n.dispatch(Object.assign(Object.assign({},zp(n.state,t,i.from,i.to)),{annotations:Fh.of(e.completion)})):t(n,e.completion,i.from,i.to)}const Xo=new WeakMap;function qp(n){if(!Array.isArray(n))return n;let e=Xo.get(n);return e||Xo.set(n,e=Hp(n)),e}class $p{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t=48&&v<=57||v>=97&&v<=122?2:v>=65&&v<=90?1:0:(k=Ks(v))!=k.toLowerCase()?1:k!=k.toUpperCase()?2:0;(!S||O==1&&g||x==0&&O!=0)&&(t[f]==v||i[f]==v&&(u=!0)?o[f++]=S:o.length&&(y=!1)),x=O,S+=De(v)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?[-200-e.length+(m==e.length?0:-100),0,m]:l>-1?[-700-e.length,l,l+this.pattern.length]:d==a?[-200+-700-e.length,p,m]:f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[e-i.length],r=1;for(let o of t){let l=o+(this.astral?De(ne(i,o)):1);r>1&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return s}}const Re=D.define({combine(n){return At(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>Yo(e(i),t(i)),optionClass:(e,t)=>i=>Yo(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function Yo(n,e){return n?e?n+" "+e:n:e}function Kp(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let{label:o}=t,l=0;for(let a=1;al&&r.appendChild(document.createTextNode(o.slice(l,h)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,c))),f.className="cm-completionMatchedText",l=c}return lt.position-i.position).map(t=>t.render)}function Qo(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class jp{constructor(e,t){this.view=e,this.stateField=t,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:l=>this.positionInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:s,selected:r}=i.open,o=e.state.facet(Re);this.optionContent=Kp(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Qo(s.length,r,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{for(let a=l.target,h;a&&a!=this.dom;a=a.parentNode)if(a.nodeName=="LI"&&(h=/-(\d+)$/.exec(a.id))&&+h[1]{this.info&&this.view.requestMeasure(this.placeInfo)})}mount(){this.updateSel()}update(e){var t,i,s;let r=e.state.field(this.stateField),o=e.startState.field(this.stateField);this.updateTooltipClass(e.state),r!=o&&(this.updateSel(),((t=r.open)===null||t===void 0?void 0:t.disabled)!=((i=o.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((s=r.open)===null||s===void 0)&&s.disabled)))}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Qo(t.options.length,t.selected,this.view.state.facet(Re).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o)}).catch(o=>Ee(this.view.state,o,"completion info")):this.addInfoPane(r)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&Gp(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let p=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:p.innerWidth,bottom:p.innerHeight}}if(s.top>Math.min(r.bottom,t.bottom)-10||s.bottom=i.height||p>t.top?c=s.bottom-t.top+"px":f=t.bottom-s.top+"px"}return{top:c,bottom:f,maxWidth:h,class:a?o?"left-narrow":"right-narrow":l?"left":"right"}}positionInfo(e){this.info&&(e?(this.info.style.top=e.top,this.info.style.bottom=e.bottom,this.info.style.maxWidth=e.maxWidth,this.info.className="cm-tooltip cm-completionInfo cm-completionInfo-"+e.class):this.info.style.top="-1e6px")}createListBox(e,t,i){const s=document.createElement("ul");s.id=t,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions"));for(let r=i.from;rnew jp(e,n)}function Gp(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect();i.topt.bottom&&(n.scrollTop+=i.bottom-t.bottom)}function Zo(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function Jp(n,e){let t=[],i=0;for(let l of n)if(l.hasResult())if(l.result.filter===!1){let a=l.result.getMatch;for(let h of l.result.options){let c=[1e9-i++];if(a)for(let f of a(h))c.push(f);t.push(new _o(h,l,c))}}else{let a=new $p(e.sliceDoc(l.from,l.to)),h;for(let c of l.result.options)(h=a.match(c.label))&&(c.boost!=null&&(h[0]+=c.boost),t.push(new _o(c,l,h)))}let s=[],r=null,o=e.facet(Re).compareCompletions;for(let l of t.sort((a,h)=>h.match[0]-a.match[0]||o(a.completion,h.completion)))!r||r.label!=l.completion.label||r.detail!=l.completion.detail||r.type!=null&&l.completion.type!=null&&r.type!=l.completion.type||r.apply!=l.completion.apply?s.push(l):Zo(l.completion)>Zo(r)&&(s[s.length-1]=l),r=l.completion;return s}class Pt{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Pt(this.options,el(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=Jp(e,t);if(!o.length)return s&&e.some(a=>a.state==1)?new Pt(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(Re).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(a,h.from):a,1e8),create:Up(Me),above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new Pt(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class wn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new wn(Yp,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Re),r=(i.override||t.languageDataAt("autocomplete",ot(t)).map(qp)).map(l=>(this.active.find(h=>h.source==l)||new ve(l,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!_p(r,this.active)?o=Pt.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new ve(l.source,0):l));for(let l of e.effects)l.is(Hh)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new wn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Xp}}function _p(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const Yp=[];function $s(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class ve{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=$s(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new ve(s.source,0));for(let r of e.effects)if(r.is(mr))s=new ve(s.source,1,r.value?ot(e.state):-1);else if(r.is(xn))s=new ve(s.source,0);else if(r.is(Wh))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new ve(this.source,1)}handleChange(e){return e.changes.touchesRange(ot(e.startState))?new ve(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ve(this.source,this.state,e.mapPos(this.explicitPos))}}class si extends ve{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=ot(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&ot(e.startState)==this.from)return new ve(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return Qp(this.result.validFor,e.state,r,o)?new si(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new Ih(e.state,l,a>=0)))?new si(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:ot(e.state)):new ve(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ve(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new si(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function Qp(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Nh(n,!0).test(s)}const mr=E.define(),xn=E.define(),Wh=E.define({map(n,e){return n.map(t=>t.map(e))}}),Hh=E.define(),Me=be.define({create(){return wn.start()},update(n,e){return n.update(e)},provide:n=>[Aa.from(n,e=>e.tooltip),T.contentAttributes.from(n,e=>e.attrs)]});function qi(n,e="option"){return t=>{let i=t.state.field(Me,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Hh.of(l)}),!0}}const Zp=n=>{let e=n.state.field(Me,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||Date.now()-e.open.timestampn.state.field(Me,!1)?(n.dispatch({effects:mr.of(!0)}),!0):!1,tg=n=>{let e=n.state.field(Me,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:xn.of(null)}),!0)};class ig{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const tl=50,ng=50,sg=1e3,rg=ge.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Me).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Me);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Me)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!$s(i));for(let i=0;ing&&Date.now()-s.time>sg){for(let r of s.context.abortListeners)try{r()}catch(o){Ee(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),tl):-1,this.composing!=0)for(let i of n.transactions)$s(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Me);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=ot(e),i=new Ih(e,t,n.explicitPos==t),s=new ig(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:xn.of(null)}),Ee(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),tl))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Re);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new ve(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:Wh.of(e)})}},{eventHandlers:{blur(){let n=this.view.state.field(Me,!1);n&&n.tooltip&&this.view.state.facet(Re).closeOnBlur&&this.view.dispatch({effects:xn.of(null)})},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:mr.of(!1)}),20),this.composing=0}}}),zh=T.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":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&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:`${400}px`,boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`${30}px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`${30}px`},"&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 og{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class yr{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,he.TrackDel),i=e.mapPos(this.to,1,he.TrackDel);return t==null||i==null?null:new yr(this.field,t,i)}}class br{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew yr(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;for(let c=0;c=h&&f.field++}s.push(new og(h,i.length,r.index,r.index+a.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}for(let l;l=/\\([{}])/.exec(o);){o=o.slice(0,l.index)+l[1]+o.slice(l.index+l[0].length);for(let a of s)a.line==i.length&&a.from>l.index&&(a.from--,a.to--)}i.push(o)}return new br(i,s)}}let lg=B.widget({widget:new class extends ct{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),ag=B.mark({class:"cm-snippetField"});class Ut{constructor(e,t){this.ranges=e,this.active=t,this.deco=B.set(e.map(i=>(i.from==i.to?lg:ag).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new Ut(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const vi=E.define({map(n,e){return n&&n.map(e)}}),hg=E.define(),gi=be.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(vi))return t.value;if(t.is(hg)&&n)return new Ut(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>T.decorations.from(n,e=>e?e.deco:B.none)});function wr(n,e){return b.create(n.filter(t=>t.field==e).map(t=>b.range(t.from,t.to)))}function cg(n){let e=br.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),a={changes:{from:s,to:r,insert:I.of(o)},scrollIntoView:!0,annotations:Fh.of(i)};if(l.length&&(a.selection=wr(l,0)),l.length>1){let h=new Ut(l,0),c=a.effects=[vi.of(h)];t.state.field(gi,!1)===void 0&&c.push(E.appendConfig.of([gi,gg,mg,zh]))}t.dispatch(t.state.update(a))}}function qh(n){return({state:e,dispatch:t})=>{let i=e.field(gi,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:wr(i.ranges,s),effects:vi.of(r?null:new Ut(i.ranges,s))})),!0}}const fg=({state:n,dispatch:e})=>n.field(gi,!1)?(e(n.update({effects:vi.of(null)})),!0):!1,ug=qh(1),dg=qh(-1),pg=[{key:"Tab",run:ug,shift:dg},{key:"Escape",run:fg}],il=D.define({combine(n){return n.length?n[0]:pg}}),gg=Ct.highest(er.compute([il],n=>n.facet(il)));function Qg(n,e){return Object.assign(Object.assign({},e),{apply:cg(n)})}const mg=T.domEventHandlers({mousedown(n,e){let t=e.state.field(gi,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:wr(t.ranges,s.field),effects:vi.of(t.ranges.some(r=>r.field>s.field)?new Ut(t.ranges,s.field):null)}),!0)}}),mi={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},yt=E.define({map(n,e){let t=e.mapPos(n,-1,he.TrackAfter);return t??void 0}}),xr=E.define({map(n,e){return e.mapPos(n)}}),vr=new class extends wt{};vr.startSide=1;vr.endSide=-1;const $h=be.define({create(){return j.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=j.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(yt)?n=n.update({add:[vr.range(t.value,t.value+1)]}):t.is(xr)&&(n=n.update({filter:i=>i!=t.value}));return n}});function Zg(){return[bg,$h]}const Qn="()[]{}<>";function Kh(n){for(let e=0;e{if((yg?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&De(ne(i,0))==1||e!=s.from||t!=s.to)return!1;let r=xg(n.state,i);return r?(n.dispatch(r),!0):!1}),wg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=jh(n,n.selection.main.head).brackets||mi.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=vg(n.doc,o.head);for(let a of i)if(a==l&&Ln(n.doc,o.head)==Kh(ne(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},em=[{key:"Backspace",run:wg}];function xg(n,e){let t=jh(n,n.selection.main.head),i=t.brackets||mi.brackets;for(let s of i){let r=Kh(ne(s,0));if(e==s)return r==s?Cg(n,s,i.indexOf(s+s+s)>-1,t):Sg(n,s,r,t.before||mi.before);if(e==r&&Uh(n,n.selection.main.from))return kg(n,s,r)}return null}function Uh(n,e){let t=!1;return n.field($h).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Ln(n,e){let t=n.sliceString(e,e+2);return t.slice(0,De(ne(t,0)))}function vg(n,e){let t=n.sliceString(e-2,e);return De(ne(t,0))==t.length?t:t.slice(1)}function Sg(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:yt.of(o.to+e.length),range:b.range(o.anchor+e.length,o.head+e.length)};let l=Ln(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:yt.of(o.head+e.length),range:b.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function kg(n,e,t){let i=null,s=n.selection.ranges.map(r=>r.empty&&Ln(n.doc,r.head)==t?b.cursor(r.head+t.length):i=r);return i?null:n.update({selection:b.create(s,n.selection.mainIndex),scrollIntoView:!0,effects:n.selection.ranges.map(({from:r})=>xr.of(r))})}function Cg(n,e,t,i){let s=i.stringPrefixes||mi.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:yt.of(l.to+e.length),range:b.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=Ln(n.doc,a),c;if(h==e){if(nl(n,a))return{changes:{insert:e+e,from:a},effects:yt.of(a+e.length),range:b.cursor(a+e.length)};if(Uh(n,a)){let f=t&&n.sliceDoc(a,a+e.length*3)==e+e+e;return{range:b.cursor(a+e.length*(f?3:1)),effects:xr.of(a)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=sl(n,a-2*e.length,s))>-1&&nl(n,c))return{changes:{insert:e+e+e+e,from:a},effects:yt.of(a+e.length),range:b.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=$.Word&&sl(n,a,s)>-1&&!Ag(n,a,e,s))return{changes:{insert:e+e,from:a},effects:yt.of(a+e.length),range:b.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function nl(n,e){let t=ye(n).resolveInner(e+1);return t.parent&&t.from==e}function Ag(n,e,t,i){let s=ye(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function sl(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=$.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=$.Word)return r}return-1}function tm(n={}){return[Me,Re.of(n),rg,Dg,zh]}const Mg=[{key:"Ctrl-Space",run:eg},{key:"Escape",run:tg},{key:"ArrowDown",run:qi(!0)},{key:"ArrowUp",run:qi(!1)},{key:"PageDown",run:qi(!0,"page")},{key:"PageUp",run:qi(!1,"page")},{key:"Enter",run:Zp}],Dg=Ct.highest(er.computeN([Re],n=>n.facet(Re).defaultKeymap?[Mg]:[]));export{Hg as A,zg as B,vn as C,cu as D,T as E,qg as F,Fg as G,ye as H,U as I,Eg as J,Yg as K,Ls as L,Hp as M,tr as N,b as O,Ta as P,Wg as Q,Vg as R,$a as S,V as T,Ru as U,Qg as V,Ra as W,Xu as X,N as a,Bg as b,Ug as c,Og as d,Tg as e,jg as f,Zg as g,Lg as h,_g as i,em as j,er as k,Jg as l,Xg as m,Gg as n,Mg as o,tm as p,Pg as q,Rg as r,$g as s,Kg as t,me as u,R as v,Du as w,C as x,Ig as y,Iu as z}; diff --git a/ui/dist/assets/index-a6ccb683.js b/ui/dist/assets/index-a6ccb683.js new file mode 100644 index 00000000..ed0bb1ef --- /dev/null +++ b/ui/dist/assets/index-a6ccb683.js @@ -0,0 +1,13 @@ +class I{constructor(){}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,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),He.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),He.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new ii(this),r=new ii(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new ii(this,e)}iterRange(e,t=this.length){return new rl(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ol(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?I.empty:e.length<=32?new G(e):He.from(G.split(e,[]))}}class G extends I{constructor(e,t=Ka(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new ja(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(vr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=$i(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new G(l,o.length+r.length));else{let h=l.length>>1;i.push(new G(l.slice(0,h)),new G(l.slice(h)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof G))return super.replace(e,t,i);let s=$i(this.text,$i(i.text,vr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new G(s,r):He.from(G.split(s,[]),r)}sliceString(e,t=this.length,i=` +`){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=h+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new G(i,s)),i=[],s=-1);return s>-1&&t.push(new G(i,s)),t}}class He extends I{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,h=i+o.lines-1;if((t?h:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=h+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let a=s&((o<=e?1:0)|(h>=t?2:0));o>=e&&h<=t&&!a?i.push(l):l.decompose(e-o,t-o,i,a)}o=h+1}}replace(e,t,i){if(i.lines=r&&t<=l){let h=o.replace(e-r,t-r,i),a=this.lines-o.lines+h.lines;if(h.lines
>5-1&&h.lines>a>>5+1){let c=this.children.slice();return c[s]=h,new He(c,this.length-(t-e)+i.length)}return super.replace(r,l,h)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` +`){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=h+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof He))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let h=this.children[s],a=e.children[r];if(h!=a)return i+h.scanIdentical(a,t);i+=h.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new G(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],h=0,a=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof He)for(let g of d.children)f(g);else d.lines>o&&(h>o||!h)?(u(),l.push(d)):d instanceof G&&h&&(p=c[c.length-1])instanceof G&&d.lines+p.lines<=32?(h+=d.lines,a+=d.length+1,c[c.length-1]=new G(p.text.concat(d.text),p.length+1+d.length)):(h+d.lines>s&&u(),h+=d.lines,a+=d.length+1,c.push(d))}function u(){h!=0&&(l.push(c.length==1?c[0]:He.from(c,a)),a=-1,h=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new He(l,t)}}I.empty=new G([""],0);function Ka(n){let e=-1;for(let t of n)e+=t.length+1;return e}function $i(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(h>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof G?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof G?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(s instanceof G){let h=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,h.length>Math.max(0,e))return this.value=e==0?h:t>0?h.slice(e):h.slice(0,h.length-e),this;e-=h.length}else{let h=s.children[o+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof G?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class rl{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ii(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),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 ol{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=function(){return this.iter()},ii.prototype[Symbol.iterator]=rl.prototype[Symbol.iterator]=ol.prototype[Symbol.iterator]=function(){return this});class ja{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Rt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return Rt[e-1]<=n;return!1}function Cr(n){return n>=127462&&n<=127487}const Ar=8205;function de(n,e,t=!0,i=!0){return(t?ll:Ga)(n,e,i)}function ll(n,e,t){if(e==n.length)return e;e&&hl(n.charCodeAt(e))&&al(n.charCodeAt(e-1))&&e--;let i=se(n,e);for(e+=Me(i);e=0&&Cr(se(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Ga(n,e,t){for(;e>0;){let i=ll(n,e-2,t);if(i=56320&&n<57344}function al(n){return n>=55296&&n<56320}function se(n,e){let t=n.charCodeAt(e);if(!al(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return hl(i)?(t-55296<<10)+(i-56320)+65536:t}function Ks(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Me(n){return n<65536?1:2}const Zn=/\r\n?|\n/;var he=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(he||(he={}));class Ke{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=he.Simple&&a>=e&&(i==he.TrackDel&&se||i==he.TrackBefore&&se))return null;if(a>e||a==e&&t<0&&!l)return e==s||t<0?r:r+h;r+=h}s=a}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ke(e)}static create(e){return new Ke(e)}}class Q extends Ke{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return es(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return ts(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let h=s>>1;for(;i.length0&&tt(i,t,r.text),r.forward(c),l+=c}let a=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function h(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?I.of(d.split(i||Zn)):d:I.empty,g=p.length;if(f==u&&g==0)return;fo&&le(s,f-o,-1),le(s,u-f,g),tt(r,s,p),o=u}}return a(e),h(!l),l}static empty(e){return new Q(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function tt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],h=n.sections[o++];e(s,a,r,c,f),s=a,r=c}}}function ts(n,e,t,i=!1){let s=[],r=i?[]:null,o=new ri(n),l=new ri(e);for(let h=-1;;)if(o.ins==-1&&l.ins==-1){let a=Math.min(o.len,l.len);le(s,a,-1),o.forward(a),l.forward(a)}else if(l.ins>=0&&(o.ins<0||h==o.i||o.off==0&&(l.len=0&&h=0){let a=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);a+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lenh||o.ins>=0&&o.len>h)&&(l||i.length>a),r.forward2(h),o.forward(h)}}}}class ri{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?I.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?I.empty:t[i].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 gt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new gt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}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 b.range(e.anchor,e.head)}static create(e,t,i){return new gt(e,t,i)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.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 b(e.ranges.map(t=>gt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?b.range(h,l):b.range(l,h))}}return new b(e,t)}}function fl(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let js=0;class M{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=js++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new M(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Us),!!e.static,e.enables)}of(e){return new Ki([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ki(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ki(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Us(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Ki{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=js++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,h=!1,a=!1,c=[];for(let f of this.dependencies)f=="doc"?h=!0:f=="selection"?a=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(h&&u.docChanged||a&&(u.docChanged||u.selection)||is(f,c)){let d=i(f);if(l?!Mr(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=Yi(u,p);if(this.dependencies.every(m=>m instanceof M?u.facet(m)===f.facet(m):m instanceof we?u.field(m,!1)==f.field(m,!1):!0)||(l?Mr(d=i(f),g,s):s(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}}function Mr(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[h.id]),s=t.map(h=>h.type),r=i.filter(h=>!(h&1)),o=n[e.id]>>1;function l(h){let a=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Dr).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Dr.of({field:this,create:e})]}get extension(){return this}}const pt={lowest:4,low:3,default:2,high:1,highest:0};function Gt(n){return e=>new ul(e,n)}const Ct={highest:Gt(pt.highest),high:Gt(pt.high),default:Gt(pt.default),low:Gt(pt.low),lowest:Gt(pt.lowest)};class ul{constructor(e,t){this.inner=e,this.prec=t}}class kn{of(e){return new ns(this,e)}reconfigure(e){return kn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ns{constructor(e,t){this.compartment=e,this.inner=t}}class Xi{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of _a(e,t,o))u instanceof we?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),h=[],a=[];for(let u of s)l[u.id]=a.length<<1,a.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=c&&c[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=h.length<<1|1,Us(g,d))h.push(i.facet(p));else{let m=p.combine(d.map(y=>y.value));h.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=h.length<<1|1,h.push(m.value)):(l[m.id]=a.length<<1,a.push(y=>m.dynamicSlot(y)));l[p.id]=a.length<<1,a.push(m=>Ja(m,p,d))}}let f=a.map(u=>u(l));return new Xi(e,o,f,l,h,r)}}function _a(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let h=s.get(o);if(h!=null){if(h<=l)return;let a=i[h].indexOf(o);a>-1&&i[h].splice(a,1),o instanceof ns&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let a of o)r(a,l);else if(o instanceof ns){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let a=e.get(o.compartment)||o.inner;t.set(o.compartment,a),r(a,l)}else if(o instanceof ul)r(o.inner,o.prec);else if(o instanceof we)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Ki)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,pt.default);else{let a=o.extension;if(!a)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(a,l)}}return r(n,pt.default),i.reduce((o,l)=>o.concat(l))}function ni(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function Yi(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const dl=M.define(),pl=M.define({combine:n=>n.some(e=>e),static:!0}),gl=M.define({combine:n=>n.length?n[0]:void 0,static:!0}),ml=M.define(),yl=M.define(),bl=M.define(),wl=M.define({combine:n=>n.length?n[0]:!1});class at{constructor(e,t){this.type=e,this.value=t}static define(){return new Xa}}class Xa{of(e){return new at(this,e)}}class Ya{constructor(e){this.map=e}of(e){return new E(this,e)}}class E{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new E(this.type,t)}is(e){return this.type==e}static define(e={}){return new Ya(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}E.reconfigure=E.define();E.appendConfig=E.define();class Z{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&fl(i,t.newLength),r.some(l=>l.type==Z.time)||(this.annotations=r.concat(Z.time.of(Date.now())))}static create(e,t,i,s,r,o){return new Z(e,t,i,s,r,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 t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Z.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Z.time=at.define();Z.userEvent=at.define();Z.addToHistory=at.define();Z.remote=at.define();function Qa(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof Z?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Z?n=r[0]:n=kl(e,Lt(r),!1)}return n}function ec(n){let e=n.startState,t=e.facet(bl),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=xl(i,ss(e,r,n.changes.newLength),!0))}return i==n?n:Z.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const tc=[];function Lt(n){return n==null?tc:Array.isArray(n)?n:[n]}var $=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}($||($={}));const ic=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let rs;try{rs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function nc(n){if(rs)return rs.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||ic.test(t)))return!0}return!1}function sc(n){return e=>{if(!/\S/.test(e))return $.Space;if(nc(e))return $.Word;for(let t=0;t-1)return $.Word;return $.Other}}class N{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(h,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(E.reconfigure)?(t=null,i=o.value):o.is(E.appendConfig)&&(t=null,i=Lt(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=Xi.resolve(i,s,this),r=new N(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,h)=>h.reconfigure(l,this),null).values),new N(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Lt(i.effects);for(let l=1;lo.spec.fromJSON(l,h)))}}return N.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Xi.resolve(e.extensions||[],new Map),i=e.doc instanceof I?e.doc:I.of((e.doc||"").split(t.staticFacet(N.lineSeparator)||Zn)),s=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return fl(s,i.length),t.staticFacet(pl)||(s=s.asSingle()),new N(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(N.tabSize)}get lineBreak(){return this.facet(N.lineSeparator)||` +`}get readOnly(){return this.facet(wl)}phrase(e,...t){for(let i of this.facet(N.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(dl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return sc(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let h=de(t,o,!1);if(r(t.slice(h,o))!=$.Word)break;o=h}for(;ln.length?n[0]:4});N.lineSeparator=gl;N.readOnly=wl;N.phrases=M.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});N.languageData=dl;N.changeFilter=ml;N.transactionFilter=yl;N.transactionExtender=bl;kn.reconfigure=E.define();function At(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class wt{eq(e){return this==e}range(e,t=e){return os.create(e,t,this)}}wt.prototype.startSide=wt.prototype.endSide=0;wt.prototype.point=!1;wt.prototype.mapMode=he.TrackDel;let os=class Sl{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Sl(e,t,i)}};function ls(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Gs{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let h=o+l>>1,a=r[h]-e||(i?this.value[h].endSide:this.value[h].startSide)-t;if(h==o)return a>=0?o:l;a>=0?l=h:o=h+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&a.startSide>0&&a.endSide<=0)continue;(d-u||a.endSide-a.startSide)<0||(o<0&&(o=u),a.point&&(l=Math.max(l,d-u)),i.push(a),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Gs(s,r,i,l):null,pos:o}}}class j{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new j(e,t,i,s)}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 t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(ls)),this.isEmpty)return t.length?j.of(t):this;let l=new vl(this,null,-1).goto(0),h=0,a=[],c=new xt;for(;l.value||h=0){let f=t[h++];c.addInner(f.from,f.to,f.value)||a.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return oi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return oi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),h=Or(o,l,i),a=new Jt(o,h,r),c=new Jt(l,h,r);i.iterGaps((f,u,d)=>Tr(a,f,c,u,d,s)),i.empty&&i.length==0&&Tr(a,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Or(r,o),h=new Jt(r,l,0).goto(i),a=new Jt(o,l,0).goto(i);for(;;){if(h.to!=a.to||!hs(h.active,a.active)||h.point&&(!a.point||!h.point.eq(a.point)))return!1;if(h.to>s)return!0;h.next(),a.next()}}static spans(e,t,i,s,r=-1){let o=new Jt(e,null,r).goto(t),l=t,h=o.openStart;for(;;){let a=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,a,o.active,h),h=o.openEnd(a));if(o.to>i)return h+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new xt;for(let s of e instanceof os?[e]:t?rc(e):e)i.add(s.from,s.to,s.value);return i.finish()}}j.empty=new j([],[],null,-1);function rc(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(ls);e=i}return n}j.empty.nextLayer=j.empty;class xt{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}finishChunk(e){this.chunks.push(new Gs(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=[])}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new xt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(j.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=j.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Or(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new vl(o,t,i,r));return s.length==1?s[0]:new oi(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)En(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)En(this.heap,i);(this.to-e||this.value.endSide-t)<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(),En(this.heap,0)}}}function En(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class Jt{constructor(e,t,i){this.minPoint=i,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=oi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){vi(this.active,e),vi(this.activeTo,e),vi(this.activeRank,e),this.minActive=Br(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&vi(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Tr(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,h=i-e;for(;;){let a=n.to+h-t.to||n.endSide-t.endSide,c=a<0?n.to+h:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&hs(n.activeForPoint(n.to+h),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!hs(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,a<=0&&n.next(),a>=0&&t.next()}}function hs(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Br(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=de(n,s)}return i===!0?-1:n.length}const cs="ͼ",Pr=typeof Symbol>"u"?"__"+cs:Symbol.for(cs),fs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ot{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,h,a){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return h.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,h);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(c.length||u)&&h.push((i&&!f&&!a?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=Rr[Pr]||1;return Rr[Pr]=e+1,cs+e.toString(36)}static mount(e,t){(e[fs]||new oc(e)).mount(Array.isArray(t)?t:[t])}}let Ai=null;class oc{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(Ai)return e.adoptedStyleSheets=[Ai.sheet].concat(e.adoptedStyleSheets),e[fs]=Ai;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),Ai=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[fs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let h=0;h",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Lr=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),lc=typeof navigator<"u"&&/Mac/.test(navigator.platform),hc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ac=lc||Lr&&+Lr[1]<57;for(var re=0;re<10;re++)lt[48+re]=lt[96+re]=String(re);for(var re=1;re<=24;re++)lt[re+111]="F"+re;for(var re=65;re<=90;re++)lt[re]=String.fromCharCode(re+32),li[re]=String.fromCharCode(re);for(var In in lt)li.hasOwnProperty(In)||(li[In]=lt[In]);function cc(n){var e=ac&&(n.ctrlKey||n.altKey||n.metaKey)||hc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?li:lt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Qi(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Ft(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function fc(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ji(n,e){if(!e.anchorNode)return!1;try{return Ft(n,e.anchorNode)}catch{return!1}}function hi(n){return n.nodeType==3?Vt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Zi(n,e,t,i){return t?Er(n,e,t,i,-1)||Er(n,e,t,i,1):!1}function en(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Er(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:ai(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=en(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?ai(n):0}else return!1}}function ai(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const Cl={left:0,right:0,top:0,bottom:0};function Js(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function uc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function dc(n,e,t,i,s,r,o,l){let h=n.ownerDocument,a=h.defaultView||window;for(let c=n;c;)if(c.nodeType==1){let f,u=c==h.body;if(u)f=uc(a);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let g=c.getBoundingClientRect();f={left:g.left,right:g.left+c.clientWidth,top:g.top,bottom:g.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class gc{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){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Ot=null;function Al(n){if(n.setActive)return n.setActive();if(Ot)return n.focus(Ot);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Ot==null?{get preventScroll(){return Ot={preventScroll:!0},!0}}:void 0),!Ot){Ot=!1;for(let t=0;tt)return f.domBoundsAround(e,t,a);if(u>=e&&s==-1&&(s=h,r=a),a>t&&f.dom.parentNode==this.dom){o=h,l=c;break}c=u,a=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.dirty|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),t.dirty&1)return;t.dirty|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=_s){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ol(n,e,t,i,s,r,o,l,h){let{children:a}=n,c=a.length?a[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,h))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(t2);var A={mac:Wr||/Mac/.test(Ce.platform),windows:/Win/.test(Ce.platform),linux:/Linux|X11/.test(Ce.platform),ie:Sn,ie_version:Bl?us.documentMode||6:ps?+ps[1]:ds?+ds[1]:0,gecko:Fr,gecko_version:Fr?+(/Firefox\/(\d+)/.exec(Ce.userAgent)||[0,0])[1]:0,chrome:!!Nn,chrome_version:Nn?+Nn[1]:0,ios:Wr,android:/Android\b/.test(Ce.userAgent),webkit:Vr,safari:Pl,webkit_version:Vr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:us.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const bc=256;class ht extends q{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return i&&(!(i instanceof ht)||this.length-(t-e)+i.length>bc)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new ht(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ae(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return gs(this.dom,e,t)}}class Ue extends q{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(Ml(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}sync(e,t){this.dom?this.dirty&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof Ue&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=h,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Ue(this.mark,t,o)}domAtPos(e){return El(this,e)}coordsAt(e,t){return Nl(this,e,t)}}function gs(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?A.chrome||A.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return A.safari&&!o&&h.width==0&&(h=Array.prototype.find.call(l,a=>a.width)||h),o?Js(h,o<0):h||null}class it extends q{constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}static create(e,t,i){return new(e.customView||it)(e,t,i)}split(e){let t=it.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof it)||!this.widget.compare(i.widget)||e>0&&r<=0||t0?i.length-1:0;s=i[r],!(e>0?r==0:r==i.length-1||s.top0?-1:1);return this.length?s:Js(s,this.side>0)}get isEditable(){return!1}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Rl extends it{domAtPos(e){let{topView:t,text:i}=this.widget;return t?ms(e,0,t,i,(s,r)=>s.domAtPos(r),s=>new ae(i,Math.min(s,i.nodeValue.length))):new ae(i,Math.min(e,i.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(e,t){let{topView:i,text:s}=this.widget;return i?Ll(e,t,i,s):Math.min(t,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(e,t){let{topView:i,text:s}=this.widget;return i?ms(e,t,i,s,(r,o,l)=>r.coordsAt(o,l),(r,o)=>gs(s,r,o)):gs(s,e,t)}destroy(){var e;super.destroy(),(e=this.widget.topView)===null||e===void 0||e.destroy()}get isEditable(){return!0}canReuseDOM(){return!0}}function ms(n,e,t,i,s,r){if(t instanceof Ue){for(let o=t.dom.firstChild;o;o=o.nextSibling){let l=q.get(o);if(!l)return r(n,e);let h=Ft(o,i),a=l.length+(h?i.nodeValue.length:0);if(n0?-1:1);return i&&i.topt.top?{left:t.left,right:t.right,top:i.top,bottom:i.bottom}:t}get overrideDOMText(){return I.empty}}ht.prototype.children=it.prototype.children=Wt.prototype.children=_s;function wc(n,e){let t=n.parent,i=t?t.children.indexOf(n):-1;for(;t&&i>=0;)if(e<0?i>0:ir&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof Ue&&s.length&&(i=s[s.length-1])instanceof Ue&&i.mark.eq(e.mark)?Il(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Nl(n,e,t){let i=null,s=-1,r=null,o=-1;function l(a,c){for(let f=0,u=0;f=c&&(d.children.length?l(d,c-u):!r&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u0?3e8:-4e8:t>0?1e8:-1e8,new kt(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Fl(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new kt(e,i,s,t,e.widget||null,!0)}static line(e){return new bi(e)}static set(e,t=!1){return j.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}T.none=j.empty;class vn extends T{constructor(e){let{start:t,end:i}=Fl(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){return this==e||e instanceof vn&&this.tagName==e.tagName&&this.class==e.class&&Xs(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}vn.prototype.point=!1;class bi extends T{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof bi&&this.spec.class==e.spec.class&&Xs(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}bi.prototype.mapMode=he.TrackBefore;bi.prototype.point=!0;class kt extends T{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?he.TrackBefore:he.TrackAfter:he.TrackDel}get type(){return this.startSide=5}eq(e){return e instanceof kt&&kc(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}kt.prototype.point=!0;function Fl(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function kc(n,e){return n==e||!!(n&&e&&n.compare(e))}function ws(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class pe extends q{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof pe))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),Tl(this,e,t,i?i.children:[],r,o),!0}split(e){let t=new pe;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:s}=this.childPos(e);s&&(t.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Xs(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Il(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=ys(t,this.attrs||{})),i&&(this.attrs=ys({class:i},this.attrs||{}))}domAtPos(e){return El(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.dirty|=6)}sync(e,t){var i;this.dom?this.dirty&4&&(Ml(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(bs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&q.get(s)instanceof Ue;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=q.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!A.ios||!this.children.some(r=>r instanceof ht))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0;for(let t of this.children){if(!(t instanceof ht)||/[^ -~]/.test(t.text))return null;let i=hi(t.dom);if(i.length!=1)return null;e+=i[0].width}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}:null}coordsAt(e,t){return Nl(this,e,t)}become(e){return!1}get type(){return z.Text}static find(e,t){for(let i=0,s=0;i=t){if(r instanceof pe)return r;if(o>t)break}s=o+r.breakAfter}return null}}class bt extends q{constructor(e,t,i){super(),this.widget=e,this.length=t,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof bt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Mi(new ht(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof kt){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof kt)if(i.block){let{type:h}=i;h==z.WidgetAfter&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new bt(i.widget||new Hr("div"),l,h))}else{let h=it.create(i.widget||new Hr("span"),l,l?0:i.startSide),a=this.atCursorPos&&!h.isEditable&&r<=s.length&&(e0),c=!h.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!a&&(this.pendingBuffer=0),this.flushBuffer(s),a&&(f.append(Mi(new Wt(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Mi(h,s),r),this.atCursorPos=c,this.pendingBuffer=c?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new Ys(e,t,i,r);return o.openEnd=j.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Mi(n,e){for(let t of e)n=new Ue(t,[n],n.length);return n}class Hr extends ct{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}}const Vl=M.define(),Wl=M.define(),Hl=M.define(),zl=M.define(),xs=M.define(),ql=M.define(),$l=M.define(),Kl=M.define({combine:n=>n.some(e=>e)}),jl=M.define({combine:n=>n.some(e=>e)});class tn{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new tn(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const zr=E.define({map:(n,e)=>n.map(e)});function Le(n,e,t){let i=n.facet(zl);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Cn=M.define({combine:n=>n.length?n[0]:!0});let Sc=0;const Qt=M.define();class me{constructor(e,t,i,s){this.id=e,this.create=t,this.domEventHandlers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:i,provide:s,decorations:r}=t||{};return new me(Sc++,e,i,o=>{let l=[Qt.of(o)];return r&&l.push(ci.of(h=>{let a=h.plugin(o);return a?r(a):T.none})),s&&l.push(s(o)),l})}static fromClass(e,t){return me.define(i=>new e(i),t)}}class Fn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Le(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Le(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Le(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Ul=M.define(),Qs=M.define(),ci=M.define(),Gl=M.define(),Jl=M.define(),Zt=M.define();class je{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new je(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 t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!h)return i;new je(h.fromA,h.toA,h.fromB,h.toB).addToSet(i),o=h.toA,l=h.toB}}}class nn{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Q.empty(this.startState.doc.length);for(let o of i)this.changes=this.changes.compose(o.changes);let s=[];this.changes.iterChangedRanges((o,l,h,a)=>s.push(new je(o,l,h,a))),this.changedRanges=s;let r=e.hasFocus;r!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=r,this.flags|=1)}static create(e,t,i){return new nn(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}}var J=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(J||(J={}));const ks=J.LTR,vc=J.RTL;function _l(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}const K=[];function Oc(n,e){let t=n.length,i=e==ks?1:2,s=e==ks?2:1;if(!n||i==1&&!Dc.test(n))return Xl(t);for(let o=0,l=i,h=i;o=0;u-=3)if(Ie[u+1]==-c){let d=Ie[u+2],p=d&2?i:d&4?d&1?s:i:0;p&&(K[o]=K[Ie[u]]=p),l=u;break}}else{if(Ie.length==189)break;Ie[l++]=o,Ie[l++]=a,Ie[l++]=h}else if((f=K[o])==2||f==1){let u=f==i;h=u?0:1;for(let d=l-3;d>=0;d-=3){let p=Ie[d+2];if(p&2)break;if(u)Ie[d+2]|=2;else{if(p&4)break;Ie[d+2]|=4}}}for(let o=0;ol;){let c=a,f=K[--a]!=2;for(;a>l&&f==(K[a-1]!=2);)a--;r.push(new It(a,c,f?2:1))}else r.push(new It(l,o,0))}else for(let o=0;o1)for(let h of this.points)h.node==e&&h.pos>this.text.length&&(h.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=q.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.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,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+Math.min(t,i.offset))}}function qr(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}class $r{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Kr extends q{constructor(e){super(),this.view=e,this.compositionDeco=T.none,this.decorations=[],this.dynamicDecorationMap=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new pe],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new je(0,0,0,e.state.doc.length)],0)}get length(){return this.view.state.doc.length}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:o,toA:l})=>lthis.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.view.inputState.composing<0?this.compositionDeco=T.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=Pc(this.view,e.changes)),(A.ie||A.chrome)&&!this.compositionDeco.size&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,s=this.updateDeco(),r=Ic(i,s,e.changes);return t=je.extendWithRanges(t,r),this.dirty==0&&t.length==0?!1:(this.updateInner(t,e.startState.doc.length),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=A.chrome||A.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,r),this.dirty=0,r&&(r.written||i.selectionRange.focusNode!=r.node)&&(this.forceSelection=!0),this.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to=0?e[s]:null;if(!r)break;let{fromA:o,toA:l,fromB:h,toB:a}=r,{content:c,breakAtStart:f,openStart:u,openEnd:d}=Ys.build(this.view.state.doc,h,a,this.decorations,this.dynamicDecorationMap),{i:p,off:g}=i.findPos(l,1),{i:m,off:y}=i.findPos(o,-1);Ol(this,m,y,p,g,c,f,u,d)}}updateSelection(e=!1,t=!1){if((e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange(),!(t||this.mayControlSelection()))return;let i=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,r=this.domAtPos(s.anchor),o=s.empty?r:this.domAtPos(s.head);if(A.gecko&&s.empty&&Bc(r)){let h=document.createTextNode("");this.view.observer.ignore(()=>r.node.insertBefore(h,r.node.childNodes[r.offset]||null)),r=o=new ae(h,0),i=!0}let l=this.view.observer.selectionRange;(i||!l.focusNode||!Zi(r.node,r.offset,l.anchorNode,l.anchorOffset)||!Zi(o.node,o.offset,l.focusNode,l.focusOffset))&&(this.view.observer.ignore(()=>{A.android&&A.chrome&&this.dom.contains(l.focusNode)&&Nc(l.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let h=Qi(this.view.root);if(h)if(s.empty){if(A.gecko){let a=Lc(r.node,r.offset);if(a&&a!=3){let c=eh(r.node,r.offset,a==1?1:-1);c&&(r=new ae(c,a==1?0:c.nodeValue.length))}}h.collapse(r.node,r.offset),s.bidiLevel!=null&&l.cursorBidiLevel!=null&&(l.cursorBidiLevel=s.bidiLevel)}else if(h.extend){h.collapse(r.node,r.offset);try{h.extend(o.node,o.offset)}catch{}}else{let a=document.createRange();s.anchor>s.head&&([r,o]=[o,r]),a.setEnd(o.node,o.offset),a.setStart(r.node,r.offset),h.removeAllRanges(),h.addRange(a)}}),this.view.observer.setSelectionRange(r,o)),this.impreciseAnchor=r.precise?null:new ae(l.anchorNode,l.anchorOffset),this.impreciseHead=o.precise?null:new ae(l.focusNode,l.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let{view:e}=this,t=e.state.selection.main,i=Qi(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=pe.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let h=this.coordsAt(t.head,-1),a=this.coordsAt(t.head,1);if(!h||!a||h.bottom>a.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}mayControlSelection(){let e=this.view.root.activeElement;return e==this.dom||ji(this.dom,this.view.observer.selectionRange)&&!(e&&this.dom.contains(e))}nearest(e){for(let t=e;t;){let i=q.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;to||e==o&&r.type!=z.WidgetBefore&&r.type!=z.WidgetAfter&&(!s||t==2||this.children[s-1].breakAfter||this.children[s-1].type==z.WidgetBefore&&t>-2))return r.coordsAt(e-o,t);i=o}}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,h=this.view.textDirection==J.LTR;for(let a=0,c=0;cs)break;if(a>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,g=p?hi(p):[];if(g.length){let m=g[g.length-1],y=h?m.right-d.left:d.right-m.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=a,this.minWidthTo=u)}}}a=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?J.RTL:J.LTR}measureTextSize(){for(let s of this.children)if(s instanceof pe){let r=s.measureTextSize();if(r)return r}let e=document.createElement("div"),t,i;return e.className="cm-line",e.style.width="99999px",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=hi(e.firstChild)[0];t=e.getBoundingClientRect().height,i=s?s.width/27:7,e.remove()}),{lineHeight:t,charWidth:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Dl(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=t.lineBlockAt(o).bottom-t.lineBlockAt(i).top;e.push(T.replace({widget:new jr(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return T.set(e)}updateDeco(){let e=this.view.state.facet(ci).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.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 r=0,o=0,l=0,h=0;for(let c of this.view.state.facet(Jl).map(f=>f(this.view)))if(c){let{left:f,right:u,top:d,bottom:p}=c;f!=null&&(r=Math.max(r,f)),u!=null&&(o=Math.max(o,u)),d!=null&&(l=Math.max(l,d)),p!=null&&(h=Math.max(h,p))}let a={left:i.left-r,top:i.top-l,right:i.right+o,bottom:i.bottom+h};dc(this.view.scrollDOM,a,t.head0&&t<=0)n=n.childNodes[e-1],e=ai(n);else if(n.nodeType==1&&e=0)n=n.childNodes[e],e=0;else return null}}function Lc(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e0;){let a=de(s.text,o,!1);if(i(s.text.slice(a,o))!=h)break;o=a}for(;ln?e.left-n:Math.max(0,n-e.right)}function Wc(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Vn(n,e){return n.tope.top+1}function Ur(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function vs(n,e,t){let i,s,r,o,l=!1,h,a,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let g=hi(p);for(let m=0;mD||o==D&&r>v){i=p,s=y,r=v,o=D;let x=D?t0?m0)}v==0?t>y.bottom&&(!c||c.bottomy.top)&&(a=p,f=y):c&&Vn(c,y)?c=Gr(c,y.bottom):f&&Vn(f,y)&&(f=Ur(f,y.top))}}if(c&&c.bottom>=t?(i=h,s=c):f&&f.top<=t&&(i=a,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Jr(i,u,t);if(l&&i.contentEditable!="false")return vs(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function Jr(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((A.chrome||A.gecko)&&Vt(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function th(n,{x:e,y:t},i,s=-1){var r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,h,{docHeight:a}=n.viewState,c=t-l;if(c<0)return 0;if(c>a)return n.state.doc.length;for(let y=n.defaultLineHeight/2,v=!1;h=n.elementAtHeight(c),h.type!=z.Text;)for(;c=s>0?h.bottom+y:h.top-y,!(c>=0&&c<=a);){if(v)return i?null:0;v=!0,s=-s}t=l+c;let f=h.from;if(fn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:i?null:_r(n,o,h,e,t);let u=n.dom.ownerDocument,d=n.root.elementFromPoint?n.root:u,p=d.elementFromPoint(e,t);p&&!n.contentDOM.contains(p)&&(p=null),p||(e=Math.max(o.left+1,Math.min(o.right-1,e)),p=d.elementFromPoint(e,t),p&&!n.contentDOM.contains(p)&&(p=null));let g,m=-1;if(p&&((r=n.docView.nearest(p))===null||r===void 0?void 0:r.isEditable)!=!1){if(u.caretPositionFromPoint){let y=u.caretPositionFromPoint(e,t);y&&({offsetNode:g,offset:m}=y)}else if(u.caretRangeFromPoint){let y=u.caretRangeFromPoint(e,t);y&&({startContainer:g,startOffset:m}=y,(!n.contentDOM.contains(g)||A.safari&&Hc(g,m,e)||A.chrome&&zc(g,m,e))&&(g=void 0))}}if(!g||!n.docView.dom.contains(g)){let y=pe.find(n.docView,f);if(!y)return c>h.top+h.height/2?h.to:h.from;({node:g,offset:m}=vs(y.dom,e,t))}return n.docView.posFromDOM(g,m)}function _r(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let l=Math.floor((s-t.top)/n.defaultLineHeight);r+=l*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+as(o,r,n.state.tabSize)}function Hc(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Vt(n,i-1,i).getBoundingClientRect().left>t}function zc(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Vt(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function qc(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=!i||!n.lineWrapping?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let h=n.dom.getBoundingClientRect(),a=n.textDirectionAt(s.from),c=n.posAtCoords({x:t==(a==J.LTR)?h.right-1:h.left+1,y:(r.top+r.bottom)/2});if(c!=null)return b.cursor(c,t?-1:1)}let o=pe.find(n.docView,e.head),l=o?t?o.posAtEnd:o.posAtStart:t?s.to:s.from;return b.cursor(l,t?-1:1)}function Xr(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,h=null;;){let a=Tc(s,r,o,l,t),c=Yl;if(!a){if(s.number==(t?n.state.doc.lines:1))return l;c=` +`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),a=b.cursor(t?s.from:s.to)}if(h){if(!h(c))return l}else{if(!i)return a;h=i(c)}l=a}}function $c(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==$.Space&&(s=o),s==o}}function Kc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return b.cursor(s,e.assoc);let o=e.goalColumn,l,h=n.contentDOM.getBoundingClientRect(),a=n.coordsAtPos(s),c=n.documentTop;if(a)o==null&&(o=a.left-h.left),l=r<0?a.top:a.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(h.right-h.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=h.left+o,u=i??n.defaultLineHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=th(n,{x:f,y:p},!1,r);if(ph.bottom||(r<0?gs))return b.cursor(g,e.assoc,void 0,o)}}function Wn(n,e,t){let i=n.state.facet(Gl).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,h)=>{t.from>o&&t.fromt.from?b.cursor(o,1):b.cursor(l,-1),s=!0)});if(!s)return t}}class jc{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.mouseSelection=null;let t=(i,s)=>{this.ignoreDuringComposition(s)||s.type=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(s.type,e,s)?s.preventDefault():i(e,s))};for(let i in ee){let s=ee[i];e.contentDOM.addEventListener(i,r=>{Yr(e,r)&&t(s,r)},Cs[i]),this.registeredEvents.push(i)}e.scrollDOM.addEventListener("mousedown",i=>{i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&t(ee.mousedown,i)}),A.chrome&&A.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,A.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{Yr(e,l)&&this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Le(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Le(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()s.keyCode==t.keyCode))&&!t.ctrlKey||Uc.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=i||t,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,Et(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:A.safari&&!A.ios&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const ih=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Uc="dthko",nh=[16,17,18,20,91,92,224,225];function Di(n){return n*.7+8}class Gc{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=pc(e.contentDOM);let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(N.allowMultipleSelections)&&Jc(e,t),this.dragMove=_c(e,t),this.dragging=Xc(e,t)&&lh(t)==1?null:!1}start(e){this.dragging===!1&&(e.preventDefault(),this.select(e))}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging!==!1)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight};e.clientX<=r.left?i=-Di(r.left-e.clientX):e.clientX>=r.right&&(i=Di(e.clientX-r.right)),e.clientY<=r.top?s=-Di(r.top-e.clientY):e.clientY>=r.bottom&&(s=Di(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}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=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}select(e){let t=this.style.get(e,this.extend,this.multiple);(this.mustSelect||!t.eq(this.view.state.selection)||t.main.assoc!=this.view.state.selection.main.assoc)&&this.view.dispatch({selection:t,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Jc(n,e){let t=n.state.facet(Vl);return t.length?t[0](e):A.mac?e.metaKey:e.ctrlKey}function _c(n,e){let t=n.state.facet(Wl);return t.length?t[0](e):A.mac?!e.altKey:!e.ctrlKey}function Xc(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Qi(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Yr(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=q.get(t))&&i.ignoreEvent(e))return!1;return!0}const ee=Object.create(null),Cs=Object.create(null),sh=A.ie&&A.ie_version<15||A.ios&&A.webkit_version<604;function Yc(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),rh(n,t.value)},50)}function rh(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(As!=null&&t.selection.ranges.every(h=>h.empty)&&As==r.toString()){let h=-1;i=t.changeByRange(a=>{let c=t.doc.lineAt(a.from);if(c.from==h)return{range:a};h=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:b.cursor(a.from+f.length)}})}else o?i=t.changeByRange(h=>{let a=r.line(s++);return{changes:{from:h.from,to:h.to,insert:a.text},range:b.cursor(h.from+a.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ee.keydown=(n,e)=>{n.inputState.setSelectionOrigin("select"),e.keyCode==27?n.inputState.lastEscPress=Date.now():nh.indexOf(e.keyCode)<0&&(n.inputState.lastEscPress=0)};ee.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};ee.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Cs.touchstart=Cs.touchmove={passive:!0};ee.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return;let t=null;for(let i of n.state.facet(Hl))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=ef(n,e)),t){let i=n.root.activeElement!=n.contentDOM;n.inputState.startMouseSelection(new Gc(n,e,t,i)),i&&n.observer.ignore(()=>Al(n.contentDOM)),n.inputState.mouseSelection&&n.inputState.mouseSelection.start(e)}};function Qr(n,e,t,i){if(i==1)return b.cursor(e,t);if(i==2)return Fc(n.state,e,t);{let s=pe.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,Zr=(n,e,t)=>oh(e,t)&&n>=t.left&&n<=t.right;function Qc(n,e,t,i){let s=pe.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Zr(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&Zr(t,i,l)?1:o&&oh(i,o)?-1:1}function eo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Qc(n,t,e.clientX,e.clientY)}}const Zc=A.ie&&A.ie_version<=11;let to=null,io=0,no=0;function lh(n){if(!Zc)return n.detail;let e=to,t=no;return to=n,no=Date.now(),io=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(io+1)%3:1}function ef(n,e){let t=eo(n,e),i=lh(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let h=eo(n,r),a=Qr(n,h.pos,h.bias,i);if(t.pos!=h.pos&&!o){let c=Qr(n,t.pos,t.bias,i),f=Math.min(c.from,a.from),u=Math.max(c.to,a.to);a=f1&&s.ranges.some(c=>c.eq(a))?tf(s,a):l?s.addRange(a):b.create([a])}}}function tf(n,e){for(let t=0;;t++)if(n.ranges[t].eq(e))return b.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}ee.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove")};function so(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&r.dragMove?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},h=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:h,selection:{anchor:h.mapPos(s,-1),head:h.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}ee.drop=(n,e)=>{if(!e.dataTransfer)return;if(n.state.readOnly)return e.preventDefault();let t=e.dataTransfer.files;if(t&&t.length){e.preventDefault();let i=Array(t.length),s=0,r=()=>{++s==t.length&&so(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}}else so(n,e,e.dataTransfer.getData("Text"),!0)};ee.paste=(n,e)=>{if(n.state.readOnly)return e.preventDefault();n.observer.flush();let t=sh?null:e.clipboardData;t?(rh(n,t.getData("text/plain")),e.preventDefault()):Yc(n)};function nf(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function sf(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let As=null;ee.copy=ee.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=sf(n.state);if(!t&&!s)return;As=s?t:null;let r=sh?null:e.clipboardData;r?(e.preventDefault(),r.clearData(),r.setData("text/plain",t)):nf(n,t),e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})};function hh(n){setTimeout(()=>{if(n.hasFocus!=n.inputState.notifiedFocused){let e=[],t=!n.inputState.notifiedFocused;for(let i of n.state.facet($l)){let s=i(n.state,t);s&&e.push(s)}e.length?n.dispatch({effects:e}):n.update([])}},10)}ee.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),hh(n)};ee.blur=n=>{n.observer.clearSelectionRange(),hh(n)};ee.compositionstart=ee.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};ee.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionFirstChange=null,A.chrome&&A.android&&n.observer.flushSoon(),setTimeout(()=>{n.inputState.composing<0&&n.docView.compositionDeco.size&&n.update([])},50)};ee.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};ee.beforeinput=(n,e)=>{var t;let i;if(A.chrome&&A.android&&(i=ih.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}};const ro=["pre-wrap","normal","pre-line","break-spaces"];class rf{constructor(e){this.lineWrapping=e,this.doc=I.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return ro.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.lineLength=s,l){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Ui&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return ge.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:h,toA:a,fromB:c,toB:f}=s[l],u=r.lineAt(h,H.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=a?u:r.lineAt(a,H.ByPosNoHeight,i,0,0);for(f+=d.to-a,a=d.to;l>0&&u.from<=s[l-1].toA;)h=s[l-1].fromA,c=s[l-1].fromB,l--,hr*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ve extends ah{constructor(e,t){super(e,t,z.Text),this.collapsed=0,this.widgetHeight=0}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof ve||s instanceof ne&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof ne?s=new ve(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ge.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ne extends ge{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let h=Math.min(this.height,e.lineHeight*r);o=h/r,l=(this.height-h)/(this.length-r-1)}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:h}=this.heightMetrics(t,s);if(t.lineWrapping){let a=s+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),c=t.doc.lineAt(a),f=l+c.length*h,u=Math.max(i,e-f/2);return new _e(c.from,c.length,u,f,z.Text)}else{let a=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.doc.line(r+a);return new _e(c,f,i+l*a,l,z.Text)}}lineAt(e,t,i,s,r){if(t==H.ByHeight)return this.blockAt(e,i,s,r);if(t==H.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new _e(d,p-d,0,0,z.Text)}let{firstLine:o,perLine:l,perChar:h}=this.heightMetrics(i,r),a=i.doc.lineAt(e),c=l+a.length*h,f=a.number-o,u=s+l*f+h*(a.from-r-f);return new _e(a.from,a.length,Math.max(s,Math.min(u,s+this.height-c)),c,z.Text)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:h,perChar:a}=this.heightMetrics(i,r);for(let c=e,f=s;c<=t;){let u=i.doc.lineAt(c);if(c==e){let p=u.number-l;f+=h*p+a*(e-r-p)}let d=h+a*u.length;o(new _e(u.from,u.length,f,d,z.Text)),f+=d,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof ne?i[i.length-1]=new ne(r.length+s):i.push(null,new ne(s-1))}if(e>0){let r=i[0];r instanceof ne?i[0]=new ne(e+r.length):i.unshift(new ne(e-1),null)}return ge.of(i)}decomposeLeft(e,t){t.push(new ne(e-1),null)}decomposeRight(e,t){t.push(null,new ne(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),h=-1;for(s.from>t&&o.push(new ne(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];h==-1?h=f:Math.abs(f-h)>=Ui&&(h=-2);let u=new ve(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new ne(r-l).updateHeight(e,l));let a=ge.of(o);return(h<0||Math.abs(a.height-this.height)>=Ui||Math.abs(h-this.heightMetrics(e,t).perLine)>=Ui)&&(e.heightChanged=!0),a}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class lf extends ge{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return a;let c=t==H.ByPosNoHeight?H.ByPosNoHeight:H.ByPos;return h?a.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(a)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,h=r+this.left.length+this.break;if(this.break)e=h&&this.right.forEachLine(e,t,i,l,h,o);else{let a=this.lineAt(h,H.ByPos,i,s,r);e=e&&a.from<=t&&o(a),t>a.to&&this.right.forEachLine(a.to+1,t,i,l,h,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&oo(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?ge.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,h=null;return s&&s.from<=t+r.length&&s.more?h=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?h=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),h?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function oo(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof ne&&(i=n[e+1])instanceof ne&&n.splice(e-1,3,new ne(t.length+1+i.length))}const hf=5;class Zs{constructor(e,t){this.pos=e,this.oracle=t,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,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof ve?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new ve(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=hf)&&this.addLineDeco(s,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new ve(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new ne(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ve)return e;let t=new ve(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine(),e.type==z.WidgetAfter&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=z.WidgetBefore&&(this.covering=e)}addLineDeco(e,t){let i=this.ensureLine();i.length+=t,i.collapsed+=t,i.widgetHeight=Math.max(i.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof ve)&&!this.isCovered?this.nodes.push(new ve(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),h=a==n.parentNode?u.bottom:Math.min(h,u.bottom)}a=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(a.nodeType==11)a=a.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,h)-(t.top+e)}}function uf(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Hn{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new rf(t),this.stateDeco=e.facet(ci).filter(i=>typeof i!="function"),this.heightMap=ge.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle.setDoc(e.doc),[new je(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=T.set(this.lineGaps.map(i=>i.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Oi(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?ho:new mf(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:ei(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(ci).filter(a=>typeof a!="function");let s=e.changedRanges,r=je.extendWithRanges(s,af(i,this.stateDeco,e?e.changes:Q.empty(this.state.doc.length))),o=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2);let l=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(jl)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?J.RTL:J.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),h=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let a=0,c=0,f=parseInt(i.paddingTop)||0,u=parseInt(i.paddingBottom)||0;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,a|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(h=!0),this.editorWidth=e.scrollDOM.clientWidth,a|=8);let d=(this.printing?uf:ff)(t,this.paddingTop),p=d.top-this.pixelViewport.top,g=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(h=!0)),!this.inView&&!this.scrollTarget)return 0;let y=l.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,a|=8),h){let D=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(D)&&(o=!0),o||s.lineWrapping&&Math.abs(y-this.contentDOMWidth)>s.charWidth){let{lineHeight:x,charWidth:S}=e.docView.measureTextSize();o=x>0&&s.refresh(r,x,S,y/S,D),o&&(e.docView.minWidth=0,a|=8)}p>0&&g>0?c=Math.max(p,g):p<0&&g<0&&(c=Math.min(p,g)),s.heightChanged=!1;for(let x of this.viewports){let S=x.from==this.viewport.from?D:e.docView.measureVisibleLineHeights(x);this.heightMap=(o?ge.empty().applyChanges(this.stateDeco,I.empty,this.heightOracle,[new je(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new of(x.from,S))}s.heightChanged&&(a|=2)}let v=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return v&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(a&2||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),a|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),a}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,h=new Oi(s.lineAt(o-i*1e3,H.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,H.ByHeight,r,0,0).to);if(t){let{head:a}=t.range;if(ah.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(a,H.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&a=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=J.LTR&&!i)return[];let l=[],h=(a,c,f,u)=>{if(c-aa&&mm.from>=f.from&&m.to<=f.to&&Math.abs(m.from-a)m.fromy));if(!g){if(cm.from<=c&&m.to>=c)){let m=t.moveToLineBoundary(b.cursor(c),!1,!0).head;m>a&&(c=m)}g=new Hn(a,c,this.gapSize(f,a,c,u))}l.push(g)};for(let a of this.viewportLines){if(a.lengtha.from&&h(a.from,u,a,c),dt.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];j.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ei(this.heightMap.lineAt(e,H.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return ei(this.heightMap.lineAt(this.scaler.fromDOM(e),H.ByHeight,this.heightOracle,0,0),this.scaler)}elementAtHeight(e){return ei(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 Oi{constructor(e,t){this.from=e,this.to=t}}function pf(n,e,t){let i=[],s=n,r=0;return j.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Bi(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function gf(n,e){for(let t of n)if(e(t))return t}const ho={toDOM(n){return n},fromDOM(n){return n},scale:1};class mf{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:h})=>{let a=t.lineAt(l,H.ByPos,e,0,0).top,c=t.lineAt(h,H.ByPos,e,0,0).bottom;return s+=c-a,{from:l,to:h,top:a,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tei(s,e)):n.type)}const Pi=M.define({combine:n=>n.join(" ")}),Ms=M.define({combine:n=>n.indexOf(!0)>-1}),Ds=ot.newName(),ch=ot.newName(),fh=ot.newName(),uh={"&light":"."+ch,"&dark":"."+fh};function Os(n,e,t){return new ot(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const yf=Os("."+Ds,{"&":{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},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",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":{contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused .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:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused .cm-cursor":{display:"block"},"&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",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&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},"&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-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"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},uh);class bf{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="";let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:xf(e),h=new Ql(l,e.state);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=kf(l,this.bounds.from)}else{let l=e.observer.selectionRange,h=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Ft(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),a=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Ft(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=b.single(a,h)}}}function dh(n,e){let t,{newSel:i}=e,s=n.state.selection.main;if(e.bounds){let{from:r,to:o}=e.bounds,l=s.from,h=null;(n.inputState.lastKeyCode===8&&n.inputState.lastKeyTime>Date.now()-100||A.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(A.mac||A.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:I.of([" "])}):A.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` + `&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:I.of([" "])}),t){let r=n.state;if(A.ios&&n.inputState.flushIOSKey(n)||A.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&Et(n.contentDOM,"Enter",13)||t.from==s.from-1&&t.to==s.to&&t.insert.length==0&&Et(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&Et(n.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();if(n.state.facet(ql).some(a=>a(n,t.from,t.to,o)))return!0;n.inputState.composing>=0&&n.inputState.composing++;let l;if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let a=s.fromt.to?r.sliceDoc(t.to,s.to):"";l=r.replaceSelection(n.state.toText(a+t.insert.sliceString(0,void 0,n.state.lineBreak)+c))}else{let a=r.changes(t),c=i&&!r.selection.main.eq(i.main)&&i.main.to<=a.newLength?i.main:void 0;if(r.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=s.to&&t.to>=s.to-10){let f=n.state.sliceDoc(t.from,t.to),u=Zl(n)||n.state.doc.lineAt(s.head),d=s.to-t.to,p=s.to-s.from;l=r.changeByRange(g=>{if(g.from==s.from&&g.to==s.to)return{changes:a,range:c||g.map(a)};let m=g.to-d,y=m-f.length;if(g.to-g.from!=p||n.state.sliceDoc(y,m)!=f||u&&g.to>=u.from&&g.from<=u.to)return{range:g};let v=r.changes({from:y,to:m,insert:t.insert}),D=g.to-s.to;return{changes:v,range:c?b.range(Math.max(0,c.anchor+D),Math.max(0,c.head+D)):g.map(v)}})}else l={changes:a,selection:c&&r.selection.replaceRange(c)}}let h="input.type";return n.composing&&(h+=".compose",n.inputState.compositionFirstChange&&(h+=".start",n.inputState.compositionFirstChange=!1)),n.dispatch(l,{scrollIntoView:!0,userEvent:h}),!0}else if(i&&!i.main.eq(s)){let r=!1,o="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(r=!0),o=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:r,userEvent:o}),!0}else return!1}function wf(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let h=Math.max(0,r-Math.min(o,l));t-=o+h-r}if(o=o?r-t:0;r-=h,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=h,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function xf(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new $r(t,i)),(s!=t||r!=i)&&e.push(new $r(s,r))),e}function kf(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?b.single(t+e,i+e):null}const Sf={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},zn=A.ie&&A.ie_version<=11;class vf{constructor(e){this.view=e,this.active=!1,this.selectionRange=new gc,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.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(A.ie&&A.ie_version<=11||A.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),zn&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runScrollHandlers(this.view,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){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((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(Cn)?i.root.activeElement!=this.dom:!ji(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(A.ie&&A.ie_version<=11||A.android&&A.chrome)&&!i.state.selection.main.empty&&s.focusNode&&Zi(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=A.safari&&e.root.nodeType==11&&fc(this.dom.ownerDocument)==this.dom&&Cf(this.view)||Qi(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=ji(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),!this.flush()&&r.force&&Et(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}processRecords(){let e=this.queue;for(let r of this.observer.takeRecords())e.push(r);e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&ji(this.dom,this.selectionRange);return e<0&&!s?null:(e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new bf(this.view,e,t,i))}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let i=this.view.state,s=dh(this.view,t);return this.view.state==i&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.dirty|=4),e.type=="childList"){let i=ao(t,e.previousSibling||e.target.previousSibling,-1),s=ao(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.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),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),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i,s;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect(),(s=this.resizeContent)===null||s===void 0||s.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function ao(n,e,t){for(;e;){let i=q.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function Cf(n){let e=null;function t(h){h.preventDefault(),h.stopImmediatePropagation(),e=h.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return Zi(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}class O{constructor(e={}){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.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this._root=e.root||mc(e.parent)||document,this.viewState=new lo(e.state||N.create(e)),this.plugins=this.state.facet(Qt).map(t=>new Fn(t));for(let t of this.plugins)t.update(this);this.observer=new vf(this),this.inputState=new jc(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new Kr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}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.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}dispatch(...e){this._dispatch(e.length==1&&e[0]instanceof Z?e[0]:this.state.update(...e))}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let a of e){if(a.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=a.state}if(this.destroyed){this.viewState.state=r;return}let o=this.observer.delayedAndroidKey,l=null;if(o?(this.observer.clearDelayedAndroidKey(),l=this.observer.readChange(),(l&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(l=null)):this.observer.clear(),r.facet(N.phrases)!=this.state.facet(N.phrases))return this.setState(r);s=nn.create(this,r,e);let h=this.viewState.scrollTarget;try{this.updateState=2;for(let a of e){if(h&&(h=h.map(a.changes)),a.scrollIntoView){let{main:c}=a.state.selection;h=new tn(c.empty?c:b.cursor(c.head,c.head>c.anchor?-1:1))}for(let c of a.effects)c.is(zr)&&(h=c.value)}this.viewState.update(s,h),this.bidiCache=sn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Zt)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(a=>a.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Pi)!=s.state.facet(Pi)&&(this.viewState.mustMeasureContent=!0),(t||i||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let a of this.state.facet(xs))a(s);l&&!dh(this,l)&&o.force&&Et(this.contentDOM,o.key,o.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 t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new lo(e),this.plugins=e.facet(Qt).map(i=>new Fn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Kr(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Qt),i=e.state.facet(Qt);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Fn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,{scrollHeight:i,scrollTop:s,clientHeight:r}=this.scrollDOM,o=s>i-r-4?i:s;try{for(let l=0;;l++){this.updateState=1;let h=this.viewport,a=this.viewState.lineBlockAtHeight(o),c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];c&4||([this.measureRequests,f]=[f,this.measureRequests]);let u=f.map(m=>{try{return m.read(this)}catch(y){return Le(this.state,y),co}}),d=nn.create(this,this.state,[]),p=!1,g=!1;d.flags|=c,t?t.flags|=c:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),p=this.docView.update(d));for(let m=0;m1||m<-1)&&(this.scrollDOM.scrollTop+=m,g=!0)}if(p&&this.docView.updateSelection(!0),this.viewport.from==h.from&&this.viewport.to==h.to&&!g&&this.measureRequests.length==0)break}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(xs))l(t)}get themeClasses(){return Ds+" "+(this.state.facet(Ms)?fh:ch)+" "+this.state.facet(Pi)}updateAttrs(){let e=fo(this,Ul,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Cn)?"true":"false",class:"cm-content",style:`${A.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),fo(this,Qs,t);let i=this.observer.ignore(()=>{let s=bs(this.contentDOM,this.contentAttrs,t),r=bs(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(O.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Zt),ot.mount(this.root,this.styleModules.concat(yf).reverse())}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 t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}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,t,i){return Wn(this,e,Xr(this,e,t,i))}moveByGroup(e,t){return Wn(this,e,Xr(this,e,t,i=>$c(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return qc(this,e,t,i)}moveVertically(e,t,i){return Wn(this,e,Kc(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),th(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[It.find(r,e-s.from,-1,t)];return Js(i,o.dir==J.LTR==t>0)}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(Kl)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Af)return Xl(e.length);let t=this.textDirectionAt(e.from);for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t)return s.order;let i=Oc(e.text,t);return this.bidiCache.push(new sn(e.from,e.to,t,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||A.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Al(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(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return zr.of(new tn(typeof e=="number"?b.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return me.define(()=>({}),{eventHandlers:e})}static theme(e,t){let i=ot.newName(),s=[Pi.of(i),Zt.of(Os(`.${i}`,e))];return t&&t.dark&&s.push(Ms.of(!0)),s}static baseTheme(e){return Ct.lowest(Zt.of(Os("."+Ds,e,uh)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&q.get(i)||q.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}O.styleModule=Zt;O.inputHandler=ql;O.focusChangeEffect=$l;O.perLineTextDirection=Kl;O.exceptionSink=zl;O.updateListener=xs;O.editable=Cn;O.mouseSelectionStyle=Hl;O.dragMovesSelection=Wl;O.clickAddsSelectionRange=Vl;O.decorations=ci;O.atomicRanges=Gl;O.scrollMargins=Jl;O.darkTheme=Ms;O.contentAttributes=Qs;O.editorAttributes=Ul;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=E.define();const Af=4096,co={};class sn{constructor(e,t,i,s){this.from=e,this.to=t,this.dir=i,this.order=s}static update(e,t){if(t.empty)return e;let i=[],s=e.length?e[e.length-1].dir:J.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&ys(o,t)}return t}const Mf=A.mac?"mac":A.windows?"win":A.linux?"linux":"key";function Df(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let h=0;hi.concat(s),[]))),t}function Tf(n,e,t){return gh(ph(n.state),e,n,t)}let et=null;const Bf=4e3;function Pf(n,e=Mf){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let h=i[o];if(h==null)i[o]=l;else if(h!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,h,a)=>{var c,f;let u=t[o]||(t[o]=Object.create(null)),d=l.split(/ (?!$)/).map(m=>Df(m,e));for(let m=1;m{let D=et={view:v,prefix:y,scope:o};return setTimeout(()=>{et==D&&(et=null)},Bf),!0}]})}let p=d.join(" ");s(p,!1);let g=u[p]||(u[p]={preventDefault:!1,run:((f=(c=u._any)===null||c===void 0?void 0:c.run)===null||f===void 0?void 0:f.slice())||[]});h&&g.run.push(h),a&&(g.preventDefault=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let a of l){let c=t[a]||(t[a]=Object.create(null));c._any||(c._any={preventDefault:!1,run:[]});for(let f in c)c[f].run.push(o.any)}let h=o[e]||o.key;if(h)for(let a of l)r(a,h,o.run,o.preventDefault),o.shift&&r(a,"Shift-"+h,o.shift,o.preventDefault)}return t}function gh(n,e,t,i){let s=cc(e),r=se(s,0),o=Me(r)==s.length&&s!=" ",l="",h=!1;et&&et.view==t&&et.scope==i&&(l=et.prefix+" ",(h=nh.indexOf(e.keyCode)<0)&&(et=null));let a=new Set,c=p=>{if(p){for(let g of p.run)if(!a.has(g)&&(a.add(g),g(t,e)))return!0;p.preventDefault&&(h=!0)}return!1},f=n[i],u,d;if(f){if(c(f[l+Ri(s,e,!o)]))return!0;if(o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(A.windows&&e.ctrlKey&&e.altKey)&&(u=lt[e.keyCode])&&u!=s){if(c(f[l+Ri(u,e,!0)]))return!0;if(e.shiftKey&&(d=li[e.keyCode])!=s&&d!=u&&c(f[l+Ri(d,e,!1)]))return!0}else if(o&&e.shiftKey&&c(f[l+Ri(s,e,!0)]))return!0;if(c(f._any))return!0}return h}class wi{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.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,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=mh(e);return[new wi(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Rf(e,t,i)}}function mh(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==J.LTR?e.left:e.right-n.scrollDOM.clientWidth)-n.scrollDOM.scrollLeft,top:e.top-n.scrollDOM.scrollTop}}function po(n,e,t){let i=b.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:z.Text}}function go(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==z.Text))return i}return t}function Rf(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==J.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),h=mh(n),a=window.getComputedStyle(o.firstChild),c=l.left+parseInt(a.paddingLeft)+Math.min(0,parseInt(a.textIndent)),f=l.right-parseInt(a.paddingRight),u=go(n,i),d=go(n,s),p=u.type==z.Text?u:null,g=d.type==z.Text?d:null;if(n.lineWrapping&&(p&&(p=po(n,i,p)),g&&(g=po(n,s,g))),p&&g&&p.from==g.from)return y(v(t.from,t.to,p));{let x=p?v(t.from,null,p):D(u,!1),S=g?v(null,t.to,g):D(d,!0),C=[];return(p||u).to<(g||d).from-1?C.push(m(c,x.bottom,f,S.top)):x.bottomF&&Y.from=ue)break;_>fe&&R(Math.max(ie,fe),x==null&&ie<=F,Math.min(_,ue),S==null&&_>=X,Ye.dir)}if(fe=te.to+1,fe>=ue)break}return L.length==0&&R(F,x==null,X,S==null,n.textDirection),{top:B,bottom:V,horizontal:L}}function D(x,S){let C=l.top+(S?x.top:x.bottom);return{top:C,bottom:C,horizontal:[]}}}function Lf(n,e){return n.constructor==e.constructor&&n.eq(e)}class Ef{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],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"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Gi)!=e.state.facet(Gi)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&e.view.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(Gi);for(;t!Lf(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Gi=M.define();function yh(n){return[me.define(e=>new Ef(e,n)),Gi.of(n)]}const bh=!A.ios,fi=M.define({combine(n){return At(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Mg(n={}){return[fi.of(n),If,Nf,Ff,jl.of(!0)]}function wh(n){return n.startState.facet(fi)!=n.state.facet(fi)}const If=yh({above:!0,markers(n){let{state:e}=n,t=e.facet(fi),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||bh:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let h of wi.forRange(n,o,l))i.push(h)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=wh(n);return t&&mo(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){mo(e.state,n)},class:"cm-cursorLayer"});function mo(n,e){e.style.animationDuration=n.facet(fi).cursorBlinkRate+"ms"}const Nf=yh({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:wi.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||wh(n)},class:"cm-selectionLayer"}),xh={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};bh&&(xh[".cm-line"].caretColor="transparent !important");const Ff=Ct.highest(O.theme(xh)),kh=E.define({map(n,e){return n==null?null:e.mapPos(n)}}),ti=we.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(kh)?i.value:t,n)}}),Vf=me.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(ti);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(ti)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let n=this.view.state.field(ti),e=n!=null&&this.view.coordsAtPos(n);if(!e)return null;let t=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-t.left+this.view.scrollDOM.scrollLeft,top:e.top-t.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(n){this.cursor&&(n?(this.cursor.style.left=n.left+"px",this.cursor.style.top=n.top+"px",this.cursor.style.height=n.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(ti)!=n&&this.view.dispatch({effects:kh.of(n)})}},{eventHandlers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Dg(){return[ti,Vf]}function yo(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function Wf(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class Hf{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,h,a,c)=>s(c,a,a+l[0].length,l,h);else if(typeof i=="function")this.addMatch=(l,h,a,c)=>{let f=i(l,h,a);f&&c(a,a+l[0].length,f)};else if(i)this.addMatch=(l,h,a,c)=>c(a,a+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new xt,i=t.add.bind(t);for(let{from:s,to:r}of Wf(e,this.maxLength))yo(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,h)=>{h>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let h=e.state.doc.lineAt(o),a=h.toh.from;o--)if(this.boundary.test(h.text[o-1-h.from])){c=o;break}for(;lu.push(y.range(g,m));if(h==a)for(this.regexp.lastIndex=c-h.from;(d=this.regexp.exec(h.text))&&d.indexthis.addMatch(m,e,g,p));t=t.update({filterFrom:c,filterTo:f,filter:(g,m)=>gf,add:u})}}return t}}const Ts=/x/.unicode!=null?"gu":"g",zf=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Ts),qf={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 qn=null;function $f(){var n;if(qn==null&&typeof document<"u"&&document.body){let e=document.body.style;qn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return qn||!1}const Ji=M.define({combine(n){let e=At(n,{render:null,specialChars:zf,addSpecialChars:null});return(e.replaceTabs=!$f())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ts)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ts)),e}});function Og(n={}){return[Ji.of(n),Kf()]}let bo=null;function Kf(){return bo||(bo=me.fromClass(class{constructor(n){this.view=n,this.decorations=T.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ji)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Hf({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=se(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,h=yi(o.text,l,i-o.from);return T.replace({widget:new Jf((l-h%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=T.replace({widget:new Gf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ji);n.startState.facet(Ji)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const jf="•";function Uf(n){return n>=32?jf:n==10?"␤":String.fromCharCode(9216+n)}class Gf extends ct{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Uf(this.code),i=e.state.phrase("Control character")+" "+(qf[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Jf extends ct{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}}class _f extends ct{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function Tg(n){return me.fromClass(class{constructor(e){this.view=e,this.placeholder=T.set([T.widget({widget:new _f(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?T.none:this.placeholder}},{decorations:e=>e.decorations})}const Bs=2e3;function Xf(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Bs||t.off>Bs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let h=i;h<=s;h++){let a=n.doc.line(h);a.length<=l&&r.push(b.range(a.from+o,a.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let h=i;h<=s;h++){let a=n.doc.line(h),c=as(a.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(a.to));else{let f=as(a.text,l,n.tabSize);r.push(b.range(a.from+c,a.from+f))}}}return r}function Yf(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function wo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Bs?-1:s==i.length?Yf(n,e.clientX):yi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Qf(n,e){let t=wo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=wo(n,s);if(!l)return i;let h=Xf(n.state,t,l);return h.length?o?b.create(h.concat(i.ranges)):b.create(h):i}}:null}function Bg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?Qf(t,i):null)}const Li="-10000px";class Zf{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){var t;let i=e.state.facet(this.facet),s=i.filter(o=>o);if(i===this.input){for(let o of this.tooltipViews)o.update&&o.update(e);return!1}let r=[];for(let o=0;o{var e,t,i;return{position:A.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||eu}}}),xo=new WeakMap,Sh=me.fromClass(class{constructor(n){this.view=n,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet($n);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new Zf(n,vh,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet($n);if(i.position!=this.position){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Li,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect();return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet($n).tooltipSpace(this.view)}}writeMeasure(n){var e;let{editor:t,space:i}=n,s=[];for(let r=0;r=Math.min(t.bottom,i.bottom)||a.rightMath.min(t.right,i.right)+.1){h.style.top=Li;continue}let f=o.arrow?l.dom.querySelector(".cm-tooltip-arrow"):null,u=f?7:0,d=c.right-c.left,p=(e=xo.get(l))!==null&&e!==void 0?e:c.bottom-c.top,g=l.offset||iu,m=this.view.textDirection==J.LTR,y=c.width>i.right-i.left?m?i.left:i.right-c.width:m?Math.min(a.left-(f?14:0)+g.x,i.right-d):Math.max(i.left,a.left-d+(f?14:0)-g.x),v=!!o.above;!o.strictSide&&(v?a.top-(c.bottom-c.top)-g.yi.bottom)&&v==i.bottom-a.bottom>a.top-i.top&&(v=!v);let D=(v?a.top-i.top:i.bottom-a.bottom)-u;if(Dy&&C.topx&&(x=v?C.top-p-2-u:C.bottom+u+2);this.position=="absolute"?(h.style.top=x-n.parent.top+"px",h.style.left=y-n.parent.left+"px"):(h.style.top=x+"px",h.style.left=y+"px"),f&&(f.style.left=`${a.left+(m?g.x:-g.x)-(y+14-7)}px`),l.overlap!==!0&&s.push({left:y,top:x,right:S,bottom:x+p}),h.classList.toggle("cm-tooltip-above",v),h.classList.toggle("cm-tooltip-below",!v),l.positioned&&l.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Li}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),tu=O.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),iu={x:0,y:0},vh=M.define({enables:[Sh,tu]});function nu(n,e){let t=n.plugin(Sh);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const ko=M.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function rn(n,e){let t=n.plugin(Ch),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Ch=me.fromClass(class{constructor(n){this.input=n.state.facet(on),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(ko);this.top=new Ei(n,!0,e.topContainer),this.bottom=new Ei(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(ko);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ei(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ei(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(on);if(t!=this.input){let i=t.filter(h=>h),s=[],r=[],o=[],l=[];for(let h of i){let a=this.specs.indexOf(h),c;a<0?(c=h(n.view),l.push(c)):(c=this.panels[a],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let h of l)h.dom.classList.add("cm-panel"),h.mount&&h.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>O.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Ei{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.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 t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=So(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=So(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 So(n){let e=n.nextSibling;return n.remove(),e}const on=M.define({enables:Ch});class St extends wt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}St.prototype.elementClass="";St.prototype.toDOM=void 0;St.prototype.mapMode=he.TrackBefore;St.prototype.startSide=St.prototype.endSide=-1;St.prototype.point=!0;const su=M.define(),ru=new class extends St{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},ou=su.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(ru.range(s)))}return j.of(e)});function Pg(){return ou}const lu=1024;let hu=0;class De{constructor(e,t){this.from=e,this.to=t}}class P{constructor(e={}){this.id=hu++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ye.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}P.closedBy=new P({deserialize:n=>n.split(" ")});P.openedBy=new P({deserialize:n=>n.split(" ")});P.group=new P({deserialize:n=>n.split(" ")});P.contextHash=new P({perNode:!0});P.lookAhead=new P({perNode:!0});P.mounted=new P({perNode:!0});class au{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}}const cu=Object.create(null);class ye{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):cu,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ye(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}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 t=this.prop(P.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(P.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}ye.none=new ye("",Object.create(null),0,8);class tr{constructor(e){this.types=e;for(let t=0;t=s&&(o.type.isAnonymous||t(o)!==!1)){if(o.firstChild())continue;l=!0}for(;l&&i&&!o.type.isAnonymous&&i(o),!o.nextSibling();){if(!o.parent())return;l=!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 t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:sr(ye.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new W(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new W(ye.none,t,i,s)))}static build(e){return uu(e)}}W.empty=new W(ye.none,[],[],0);class ir{constructor(e,t){this.buffer=e,this.index=t}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 ir(this.buffer,this.index)}}class Mt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ye.none}toString(){let e=[];for(let t=0;t0));h=o[h+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,h=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Mh(n,e){let t=n.childBefore(e);for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(n=t,t=i.prevSibling):t=i}return n}function Ht(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=a;e+=t){let c=l[e],f=h[e]+o.from;if(Ah(s,i,f,f+c.length)){if(c instanceof Mt){if(r&U.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new ze(new fu(o,c,e,f),null,u)}else if(r&U.IncludeAnonymous||!c.type.isAnonymous||nr(c)){let u;if(!(r&U.IgnoreMounts)&&c.props&&(u=c.prop(P.mounted))&&!u.overlay)return new Be(u.tree,f,e,o);let d=new Be(c,f,e,o);return r&U.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&U.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<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)}enter(e,t,i=0){let s;if(!(i&U.IgnoreOverlays)&&(s=this._tree.prop(P.mounted))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new Be(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}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}cursor(e=0){return new ui(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return Ht(this,e,t,!1)}resolveInner(e,t=0){return Ht(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Mh(this,e)}getChild(e,t=null,i=null){let s=ln(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return ln(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return hn(this,e)}}function ln(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function hn(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class fu{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class ze{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,t,i){this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new ze(this.context,this,r)}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)}enter(e,t,i=0){if(i&U.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new ze(this.context,this,r)}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,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ze(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ze(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new ui(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new W(this.type,e,t,this.to-this.from)}resolve(e,t=0){return Ht(this,e,t,!1)}resolveInner(e,t=0){return Ht(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Mh(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let s=ln(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return ln(this,e,t,i)}get node(){return this}matchContext(e){return hn(this,e)}}class ui{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Be)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.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,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Be?(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,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}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,t,i=this.mode){return this.buffer?i&U.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&U.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&U.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:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<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 t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&U.IncludeAnonymous||l instanceof Mt||!l.type.isAnonymous||nr(l))return!1}return!0}move(e,t){if(t&&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,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}}for(let s=i;s=0;r--){if(r<0)return hn(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function nr(n){return n.children.some(e=>e instanceof Mt||!e.type.isAnonymous||nr(e))}function uu(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=lu,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new ir(t,t.length):t,h=i.types,a=0,c=0;function f(x,S,C,B,V){let{id:L,start:R,end:F,size:X}=l,Y=c;for(;X<0;)if(l.next(),X==-1){let ie=r[L];C.push(ie),B.push(R-x);return}else if(X==-3){a=L;return}else if(X==-4){c=L;return}else throw new RangeError(`Unrecognized record size: ${X}`);let fe=h[L],ue,te,Ye=R-x;if(F-R<=s&&(te=g(l.pos-S,V))){let ie=new Uint16Array(te.size-te.skip),_=l.pos-te.size,Je=ie.length;for(;l.pos>_;)Je=m(te.start,ie,Je);ue=new Mt(ie,F-te.start,i),Ye=te.start-x}else{let ie=l.pos-X;l.next();let _=[],Je=[],ut=L>=o?L:-1,Dt=0,Si=F;for(;l.pos>ie;)ut>=0&&l.id==ut&&l.size>=0?(l.end<=Si-s&&(d(_,Je,R,Dt,l.end,Si,ut,Y),Dt=_.length,Si=l.end),l.next()):f(R,ie,_,Je,ut);if(ut>=0&&Dt>0&&Dt<_.length&&d(_,Je,R,Dt,R,Si,ut,Y),_.reverse(),Je.reverse(),ut>-1&&Dt>0){let Sr=u(fe);ue=sr(fe,_,Je,0,_.length,0,F-R,Sr,Sr)}else ue=p(fe,_,Je,F-R,Y-F)}C.push(ue),B.push(Ye)}function u(x){return(S,C,B)=>{let V=0,L=S.length-1,R,F;if(L>=0&&(R=S[L])instanceof W){if(!L&&R.type==x&&R.length==B)return R;(F=R.prop(P.lookAhead))&&(V=C[L]+R.length+F)}return p(x,S,C,B,V)}}function d(x,S,C,B,V,L,R,F){let X=[],Y=[];for(;x.length>B;)X.push(x.pop()),Y.push(S.pop()+C-V);x.push(p(i.types[R],X,Y,L-V,F-L)),S.push(V-C)}function p(x,S,C,B,V=0,L){if(a){let R=[P.contextHash,a];L=L?[R].concat(L):[R]}if(V>25){let R=[P.lookAhead,V];L=L?[R].concat(L):[R]}return new W(x,S,C,B,L)}function g(x,S){let C=l.fork(),B=0,V=0,L=0,R=C.end-s,F={size:0,start:0,skip:0};e:for(let X=C.pos-x;C.pos>X;){let Y=C.size;if(C.id==S&&Y>=0){F.size=B,F.start=V,F.skip=L,L+=4,B+=4,C.next();continue}let fe=C.pos-Y;if(Y<0||fe=o?4:0,te=C.start;for(C.next();C.pos>fe;){if(C.size<0)if(C.size==-3)ue+=4;else break e;else C.id>=o&&(ue+=4);C.next()}V=te,B+=Y,L+=ue}return(S<0||B==x)&&(F.size=B,F.start=V,F.skip=L),F.size>4?F:void 0}function m(x,S,C){let{id:B,start:V,end:L,size:R}=l;if(l.next(),R>=0&&B4){let X=l.pos-(R-4);for(;l.pos>X;)C=m(x,S,C)}S[--C]=F,S[--C]=L-x,S[--C]=V-x,S[--C]=B}else R==-3?a=B:R==-4&&(c=B);return C}let y=[],v=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,v,-1);let D=(e=n.length)!==null&&e!==void 0?e:y.length?v[0]+y[0].length:0;return new W(h[n.topID],y.reverse(),v.reverse(),D)}const Co=new WeakMap;function _i(n,e){if(!n.isAnonymous||e instanceof Mt||e.type!=n)return 1;let t=Co.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof W)){t=1;break}t+=_i(n,i)}Co.set(e,t)}return t}function sr(n,e,t,i,s,r,o,l,h){let a=0;for(let p=i;p=c)break;C+=B}if(D==x+1){if(C>c){let B=p[x];d(B.children,B.positions,0,B.children.length,g[x]+v);continue}f.push(p[x])}else{let B=g[D-1]+p[D-1].length-S;f.push(sr(n,p,g,x,D,S,B,null,h))}u.push(S+v-r)}}return d(e,t,i,s,0),(l||h)(f,u,o)}class Rg{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof ze?this.setBuffer(e.context.buffer,e.index,t):e instanceof Be&&this.map.set(e.tree,t)}get(e){return e instanceof ze?this.getBuffer(e.context.buffer,e.index):e instanceof Be?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Xe{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Xe(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,h=0,a=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||a){let d=Math.max(u.from,h)-a,p=Math.min(u.to,f)-a;u=d>=p?null:new Xe(d,p,u.tree,u.offset+a,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew De(s.from,s.to)):[new De(0,0)]:[new De(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class du{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Lg(n){return(e,t,i,s)=>new gu(e,n,t,i,s)}class Ao{constructor(e,t,i,s,r){this.parser=e,this.parse=t,this.overlay=i,this.target=s,this.ranges=r}}class pu{constructor(e,t,i,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Ps=new P({perNode:!0});class gu{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new W(i.type,i.children,i.positions,i.length,i.propValues.concat([[Ps,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[P.mounted.id]=new au(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tc.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(a)for(let c of a.mount.overlay){let f=c.from+a.pos,u=c.to+a.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=mu(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&s.fromnew De(f.from-s.from,f.to-s.from)):null,s.tree,c)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else t&&(h=t.predicate(s))&&(h===!0&&(h=new De(s.from,s.to)),h.fromnew De(c.from-t.start,c.to-t.start)),t.target,a)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function mu(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Mo(n,e,t,i,s,r){if(e=e.to);i++);let o=s.children[i],l=o.buffer;function h(a,c,f,u,d){let p=a;for(;l[p+2]+r<=e.from;)p=l[p+3];let g=[],m=[];Mo(o,a,p,g,m,u);let y=l[p+1],v=l[p+2],D=y+r==e.from&&v+r==e.to&&l[p]==e.type.id;return g.push(D?e.toTree():h(p+4,l[p+3],o.set.types[l[p]],y,v-y)),m.push(y-u),Mo(o,l[p+3],c,g,m,u),new W(f,g,m,d)}s.children[i]=h(0,l.length,ye.none,0,o.length);for(let a=0;a<=t;a++)n.childAfter(e.from)}class Do{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(U.IncludeAnonymous|U.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,U.IgnoreOverlays|U.ExcludeBuffers)||t.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 t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof W)t=t.children[0];else break}return!1}}class bu{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Ps))!==null&&t!==void 0?t:i.to,this.inner=new Do(i.tree,-i.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 t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Ps))!==null&&e!==void 0?e:t.to,this.inner=new Do(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(P.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;h.tree==this.curFrag.tree&&s.push({frag:h,pos:r.from-h.offset,mount:o})}}}return s}}function Oo(n,e){let t=null,i=e;for(let s=1,r=0;s=l)break;h.to<=o||(t||(i=t=e.slice()),h.froml&&t.splice(r+1,0,new De(l,h.to))):h.to>l?t[r--]=new De(l,h.to):t.splice(r--,1))}}return i}function wu(n,e,t,i){let s=0,r=0,o=!1,l=!1,h=-1e9,a=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(h,t),d=Math.min(c,f,i);unew De(u.from+i,u.to+i)),f=wu(e,c,h,a);for(let u=0,d=h;;u++){let p=u==f.length,g=p?a:f[u].from;if(g>d&&t.push(new Xe(d,g,s.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else t.push(new Xe(h,a,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let xu=0;class We{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=xu++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new We([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new an;return t=>t.modified.indexOf(e)>-1?t:an.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let ku=0;class an{constructor(){this.instances=[],this.id=ku++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Su(t,l.modified));if(i)return i;let s=[],r=new We(s,e,t);for(let l of t)l.instances.push(r);let o=vu(t);for(let l of e.set)if(!l.modified.length)for(let h of o)s.push(an.get(l,h));return r}}function Su(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function vu(n){let e=[[]];for(let t=0;ti.length-t.length)}function Cu(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let h=r.length-1,a=r[h];if(!a)throw new RangeError("Invalid path: "+s);let c=new cn(i,o,h>0?r.slice(0,h):null);e[a]=c.sort(e[a])}}return Oh.add(e)}const Oh=new P;class cn{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let h of l.set){let a=t[h.id];if(a){o=o?o+" "+a:a;break}}return o},scope:i}}function Au(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function Mu(n,e,t,i=0,s=n.length){let r=new Du(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class Du{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:h}=e;if(l>=i||h<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let a=s,c=Ou(e)||cn.empty,f=Au(r,c.tags);if(f&&(a&&(a+=" "),a+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(e.from,a),c.opaque)return;let u=e.tree&&e.tree.prop(P.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=e.firstChild();for(let m=0,y=l;;m++){let v=m=D||!e.nextSibling())););if(!v||D>i)break;y=v.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,v.from+l),Math.min(i,y),s,p),this.startSpan(y,a))}g&&e.parent()}else if(e.firstChild()){do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),a)}while(e.nextSibling());e.parent()}}}function Ou(n){let e=n.type.prop(Oh);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const w=We.define,Ni=w(),Qe=w(),Bo=w(Qe),Po=w(Qe),Ze=w(),Fi=w(Ze),Kn=w(Ze),Ve=w(),dt=w(Ve),Ne=w(),Fe=w(),Rs=w(),_t=w(Rs),Vi=w(),k={comment:Ni,lineComment:w(Ni),blockComment:w(Ni),docComment:w(Ni),name:Qe,variableName:w(Qe),typeName:Bo,tagName:w(Bo),propertyName:Po,attributeName:w(Po),className:w(Qe),labelName:w(Qe),namespace:w(Qe),macroName:w(Qe),literal:Ze,string:Fi,docString:w(Fi),character:w(Fi),attributeValue:w(Fi),number:Kn,integer:w(Kn),float:w(Kn),bool:w(Ze),regexp:w(Ze),escape:w(Ze),color:w(Ze),url:w(Ze),keyword:Ne,self:w(Ne),null:w(Ne),atom:w(Ne),unit:w(Ne),modifier:w(Ne),operatorKeyword:w(Ne),controlKeyword:w(Ne),definitionKeyword:w(Ne),moduleKeyword:w(Ne),operator:Fe,derefOperator:w(Fe),arithmeticOperator:w(Fe),logicOperator:w(Fe),bitwiseOperator:w(Fe),compareOperator:w(Fe),updateOperator:w(Fe),definitionOperator:w(Fe),typeOperator:w(Fe),controlOperator:w(Fe),punctuation:Rs,separator:w(Rs),bracket:_t,angleBracket:w(_t),squareBracket:w(_t),paren:w(_t),brace:w(_t),content:Ve,heading:dt,heading1:w(dt),heading2:w(dt),heading3:w(dt),heading4:w(dt),heading5:w(dt),heading6:w(dt),contentSeparator:w(Ve),list:w(Ve),quote:w(Ve),emphasis:w(Ve),strong:w(Ve),link:w(Ve),monospace:w(Ve),strikethrough:w(Ve),inserted:w(),deleted:w(),changed:w(),invalid:w(),meta:Vi,documentMeta:w(Vi),annotation:w(Vi),processingInstruction:w(Vi),definition:We.defineModifier(),constant:We.defineModifier(),function:We.defineModifier(),standard:We.defineModifier(),local:We.defineModifier(),special:We.defineModifier()};Th([{tag:k.link,class:"tok-link"},{tag:k.heading,class:"tok-heading"},{tag:k.emphasis,class:"tok-emphasis"},{tag:k.strong,class:"tok-strong"},{tag:k.keyword,class:"tok-keyword"},{tag:k.atom,class:"tok-atom"},{tag:k.bool,class:"tok-bool"},{tag:k.url,class:"tok-url"},{tag:k.labelName,class:"tok-labelName"},{tag:k.inserted,class:"tok-inserted"},{tag:k.deleted,class:"tok-deleted"},{tag:k.literal,class:"tok-literal"},{tag:k.string,class:"tok-string"},{tag:k.number,class:"tok-number"},{tag:[k.regexp,k.escape,k.special(k.string)],class:"tok-string2"},{tag:k.variableName,class:"tok-variableName"},{tag:k.local(k.variableName),class:"tok-variableName tok-local"},{tag:k.definition(k.variableName),class:"tok-variableName tok-definition"},{tag:k.special(k.variableName),class:"tok-variableName2"},{tag:k.definition(k.propertyName),class:"tok-propertyName tok-definition"},{tag:k.typeName,class:"tok-typeName"},{tag:k.namespace,class:"tok-namespace"},{tag:k.className,class:"tok-className"},{tag:k.macroName,class:"tok-macroName"},{tag:k.propertyName,class:"tok-propertyName"},{tag:k.operator,class:"tok-operator"},{tag:k.comment,class:"tok-comment"},{tag:k.meta,class:"tok-meta"},{tag:k.invalid,class:"tok-invalid"},{tag:k.punctuation,class:"tok-punctuation"}]);var jn;const mt=new P;function Bh(n){return M.define({combine:n?e=>e.concat(n):void 0})}const Tu=new P;class Oe{constructor(e,t,i=[],s=""){this.data=e,this.name=s,N.prototype.hasOwnProperty("tree")||Object.defineProperty(N.prototype,"tree",{get(){return be(this)}}),this.parser=t,this.extension=[$t.of(this),N.languageData.of((r,o,l)=>{let h=Ro(r,o,l),a=h.type.prop(mt);if(!a)return[];let c=r.facet(a),f=h.type.prop(Tu);if(f){let u=h.resolve(o-h.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return Ro(e,t,i).type.prop(mt)==this.data}findRegions(e){let t=e.facet($t);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(mt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(P.mounted);if(l){if(l.tree.prop(mt)==this.data){if(l.overlay)for(let h of l.overlay)i.push({from:h.from+o,to:h.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let h=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>h)return}}for(let h=0;hi.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ls(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function be(n){let e=n.field(Oe.state,!1);return e?e.tree:W.empty}class Bu{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,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Xt=null;class zt{constructor(e,t,i=[],s,r,o,l,h){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=h,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new zt(e,t,[],W.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Bu(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=W.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Xe.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Xt;Xt=this;try{return e()}finally{Xt=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Lo(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let h=[];if(e.iterChangedRanges((a,c,f,u)=>h.push({fromA:a,toA:c,fromB:f,toB:u})),i=Xe.applyChanges(i,h),s=W.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let a of this.skipped){let c=e.mapPos(a.from,1),f=e.mapPos(a.to,-1);ce.from&&(this.fragments=Lo(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Dh{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let h=Xt;if(h){for(let a of s)h.tempSkipped.push(a);e&&(h.scheduleOn=h.scheduleOn?Promise.all([h.scheduleOn,e]):e)}return this.parsedPos=o,new W(ye.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Xt}}function Lo(n,e,t){return Xe.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class qt{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new qt(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=zt.create(e.facet($t).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new qt(i)}}Oe.state=we.define({create:qt.init,update(n,e){for(let t of e.effects)if(t.is(Oe.setState))return t.value;return e.startState.facet($t)!=e.state.facet($t)?qt.init(e.state):n.apply(e)}});let Ph=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Ph=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Un=typeof navigator<"u"&&(!((jn=navigator.scheduling)===null||jn===void 0)&&jn.isInputPending)?()=>navigator.scheduling.isInputPending():null,Pu=me.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 t=this.view.state.field(Oe.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Oe.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Ph(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,h=r.context.work(()=>Un&&Un()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(h||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Oe.setState.of(new qt(r.context))})),this.chunkBudget>0&&!(h&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Le(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),$t=M.define({combine(n){return n.length?n[0]:null},enables:n=>[Oe.state,Pu,O.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Ig{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Rh=M.define(),An=M.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function vt(n){let e=n.facet(An);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function fn(n,e){let t="",i=n.tabSize,s=n.facet(An)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return yi(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Ru=new P;function Lu(n,e,t){return Eh(e.resolveInner(t).enterUnfinishedNodesBefore(t),t,n)}function Eu(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Iu(n){let e=n.type.prop(Ru);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(P.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>Ih(o,!0,1,void 0,r&&!Eu(o)?s.from:void 0)}return n.parent==null?Nu:null}function Eh(n,e,t){for(;n;n=n.parent){let i=Iu(n);if(i)return i(rr.create(t,e,n))}return null}function Nu(){return 0}class rr extends Mn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.node=i}static create(e,t,i){return new rr(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(Fu(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?Eh(e,this.pos,this.base):0}}function Fu(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Vu(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let h=e.childAfter(l);if(!h||h==i)return null;if(!h.type.isSkipped)return h.fromIh(i,e,t,n)}function Ih(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,h=e?Vu(n):null;return h?l?n.column(h.from):n.column(h.to):n.baseIndent+(l?0:n.unit*t)}const Fg=n=>n.baseIndent;function Vg({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const Wg=new P;function Hg(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(mt)==o.data:o?l=>l==o:void 0,this.style=Th(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new ot(i):null,this.themeType=t.themeType}static define(e,t){return new Dn(e,t||{})}}const Es=M.define(),Nh=M.define({combine(n){return n.length?[n[0]]:null}});function Gn(n){let e=n.facet(Es);return e.length?e:n.facet(Nh)}function zg(n,e){let t=[Hu],i;return n instanceof Dn&&(n.module&&t.push(O.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Nh.of(n)):i?t.push(Es.computeN([O.darkTheme],s=>s.facet(O.darkTheme)==(i=="dark")?[n]:[])):t.push(Es.of(n)),t}class Wu{constructor(e){this.markCache=Object.create(null),this.tree=be(e.state),this.decorations=this.buildDeco(e,Gn(e.state))}update(e){let t=be(e.state),i=Gn(e.state),s=i!=Gn(e.startState);t.length{i.add(o,l,this.markCache[h]||(this.markCache[h]=T.mark({class:h})))},s,r);return i.finish()}}const Hu=Ct.high(me.fromClass(Wu,{decorations:n=>n.decorations})),qg=Dn.define([{tag:k.meta,color:"#404740"},{tag:k.link,textDecoration:"underline"},{tag:k.heading,textDecoration:"underline",fontWeight:"bold"},{tag:k.emphasis,fontStyle:"italic"},{tag:k.strong,fontWeight:"bold"},{tag:k.strikethrough,textDecoration:"line-through"},{tag:k.keyword,color:"#708"},{tag:[k.atom,k.bool,k.url,k.contentSeparator,k.labelName],color:"#219"},{tag:[k.literal,k.inserted],color:"#164"},{tag:[k.string,k.deleted],color:"#a11"},{tag:[k.regexp,k.escape,k.special(k.string)],color:"#e40"},{tag:k.definition(k.variableName),color:"#00f"},{tag:k.local(k.variableName),color:"#30a"},{tag:[k.typeName,k.namespace],color:"#085"},{tag:k.className,color:"#167"},{tag:[k.special(k.variableName),k.macroName],color:"#256"},{tag:k.definition(k.propertyName),color:"#00c"},{tag:k.comment,color:"#940"},{tag:k.invalid,color:"#f00"}]),zu=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Fh=1e4,Vh="()[]{}",Wh=M.define({combine(n){return At(n,{afterCursor:!0,brackets:Vh,maxScanDistance:Fh,renderMatch:Ku})}}),qu=T.mark({class:"cm-matchingBracket"}),$u=T.mark({class:"cm-nonmatchingBracket"});function Ku(n){let e=[],t=n.matched?qu:$u;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const ju=we.define({create(){return T.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Wh);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=qe(e.state,s.head,-1,i)||s.head>0&&qe(e.state,s.head-1,1,i)||i.afterCursor&&(qe(e.state,s.head,1,i)||s.headO.decorations.from(n)}),Uu=[ju,zu];function $g(n={}){return[Wh.of(n),Uu]}const Gu=new P;function Is(n,e,t){let i=n.prop(e<0?P.openedBy:P.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function Ns(n){let e=n.type.prop(Gu);return e?e(n.node):n}function qe(n,e,t,i={}){let s=i.maxScanDistance||Fh,r=i.brackets||Vh,o=be(n),l=o.resolveInner(e,t);for(let h=l;h;h=h.parent){let a=Is(h.type,t,r);if(a&&h.from0?e>=c.from&&ec.from&&e<=c.to))return Ju(n,e,t,h,c,a,r)}}return _u(n,e,t,o,l.type,s,r)}function Ju(n,e,t,i,s,r,o){let l=i.parent,h={from:s.from,to:s.to},a=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(a==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let a={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let g=t>0?0:d.length-1,m=t>0?d.length:-1;g!=m;g+=t){let y=o.indexOf(d[g]);if(!(y<0||i.resolveInner(p+g,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:a,end:{from:p+g,to:p+g+1},matched:y>>1==h>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:a,matched:!1}:null}function Eo(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}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 t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Xu(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Yu,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||lr}}function Yu(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const Io=new WeakMap;class zh extends Oe{constructor(e){let t=Bh(e.languageData),i=Xu(e),s,r=new class extends Dh{createParse(o,l,h){return new Zu(s,o,l,h)}};super(t,r,[Rh.of((o,l)=>this.getIndent(o,l))],e.name),this.topNode=id(t),s=this,this.streamParser=i,this.stateAfter=new P({perNode:!0}),this.tokenTable=e.tokenTable?new jh(i.tokenTable):td}static define(e){return new zh(e)}getIndent(e,t){let i=be(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r,{overrideIndentation:o}=e.options;o&&(r=Io.get(e.state),r!=null&&r1e4)return null;for(;h=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],h=t+e.positions[o],a=l instanceof W&&h=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],h;if(ot&&or(n,s.tree,0-s.offset,t,o),h;if(l&&(h=qh(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:h}}return{state:n.streamParser.startState(i?vt(i):4),tree:W.empty}}class Zu{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=zt.get(),o=s[0].from,{state:l,tree:h}=Qu(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+h.length;for(let a=0;a=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` +`&&(t="");else{let i=t.indexOf(` +`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Hh(t,e?e.state.tabSize:4,e?vt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=$h(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const lr=Object.create(null),di=[ye.none],ed=new tr(di),No=[],Kh=Object.create(null);for(let[n,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"]])Kh[n]=Uh(lr,e);class jh{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Kh)}resolve(e){return e?this.table[e]||(this.table[e]=Uh(this.extra,e)):0}}const td=new jh(lr);function Jn(n,e){No.indexOf(n)>-1||(No.push(n),console.warn(e))}function Uh(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||k[r];o?typeof o=="function"?t?t=o(t):Jn(r,`Modifier ${r} used at start of tag`):t?Jn(r,`Tag ${r} used as modifier`):t=o:Jn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=ye.define({id:di.length,name:i,props:[Cu({[i]:t})]});return di.push(s),s.id}function id(n){let e=ye.define({id:di.length,name:"Document",props:[mt.add(()=>n)]});return di.push(e),e}const nd=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.head),i=ar(n.state,t.from);return i.line?sd(n):i.block?od(n):!1};function hr(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const sd=hr(ad,0),rd=hr(Gh,0),od=hr((n,e)=>Gh(n,e,hd(e)),0);function ar(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Yt=50;function ld(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Yt,i),o=n.sliceDoc(s,s+Yt),l=/\s*$/.exec(r)[0].length,h=/^\s*/.exec(o)[0].length,a=r.length-l;if(r.slice(a-e.length,a)==e&&o.slice(h,h+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+h,margin:h&&1}};let c,f;s-i<=2*Yt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Yt),f=n.sliceDoc(s-Yt,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function hd(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from,to:s.to})}return e}function Gh(n,e,t=e.selection.ranges){let i=t.map(r=>ar(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>ld(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>c.from)){s=c.from;let f=ar(e,c.from).line;if(!f)continue;let u=/^\s*/.exec(c.text)[0].length,d=u==c.length,p=c.text.slice(u,u+f.length)==f?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:h,indent:a,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+a,insert:h+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:h}of i)if(l>=0){let a=o.from+l,c=a+h.length;o.text[c-o.from]==" "&&c++,r.push({from:a,to:c})}return{changes:r}}return null}const Fs=at.define(),cd=at.define(),fd=M.define(),Jh=M.define({combine(n){return At(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}});function ud(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const _h=we.define({create(){return $e.empty},update(n,e){let t=e.state.facet(Jh),i=e.annotation(Fs);if(i){let h=e.docChanged?b.single(ud(e.changes)):void 0,a=ke.fromTransaction(e,h),c=i.side,f=c==0?n.undone:n.done;return a?f=un(f,f.length,t.minDepth,a):f=Qh(f,e.startState.selection),new $e(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation(cd);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(Z.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=ke.fromTransaction(e),o=e.annotation(Z.time),l=e.annotation(Z.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new $e(n.done.map(ke.fromJSON),n.undone.map(ke.fromJSON))}});function Kg(n={}){return[_h,Jh.of(n),O.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Xh:e.inputType=="historyRedo"?Vs:null;return i?(e.preventDefault(),i(t)):!1}})]}function On(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(_h,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const Xh=On(0,!1),Vs=On(1,!1),dd=On(0,!0),pd=On(1,!0);class ke{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new ke(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new ke(e.changes&&Q.fromJSON(e.changes),[],e.mapped&&Ke.fromJSON(e.mapped),e.startSelection&&b.fromJSON(e.startSelection),e.selectionsAfter.map(b.fromJSON))}static fromTransaction(e,t){let i=Te;for(let s of e.startState.facet(fd)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new ke(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Te)}static selection(e){return new ke(void 0,Te,void 0,void 0,e)}}function un(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function gd(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let h=0;h=a&&o<=c&&(i=!0)}}),i}function md(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Yh(n,e){return n.length?e.length?n.concat(e):n:e}const Te=[],yd=200;function Qh(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-yd));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),un(n,n.length-1,1e9,t.setSelAfter(i)))}else return[ke.selection([e])]}function bd(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function _n(n,e){if(!n.length)return n;let t=n.length,i=Te;for(;t;){let s=wd(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[ke.selection(i)]:Te}function wd(n,e,t){let i=Yh(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Te,t);if(!n.changes)return ke.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new ke(s,E.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const xd=/^(input\.type|delete)($|\.)/;class $e{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new $e(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||xd.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Tn(t,e))}function ce(n){return n.textDirectionAt(n.state.selection.main.head)==J.LTR}const ea=n=>Zh(n,!ce(n)),ta=n=>Zh(n,ce(n));function ia(n,e){return Ee(n,t=>t.empty?n.moveByGroup(t,e):Tn(t,e))}const kd=n=>ia(n,!ce(n)),Sd=n=>ia(n,ce(n));function vd(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Bn(n,e,t){let i=be(n).resolveInner(e.head),s=t?P.closedBy:P.openedBy;for(let h=e.head;;){let a=t?i.childAfter(h):i.childBefore(h);if(!a)break;vd(n,a,s)?i=a:h=t?a.to:a.from}let r=i.type.prop(s),o,l;return r&&(o=t?qe(n,i.from,1):qe(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,b.cursor(l,t?-1:1)}const Cd=n=>Ee(n,e=>Bn(n.state,e,!ce(n))),Ad=n=>Ee(n,e=>Bn(n.state,e,ce(n)));function na(n,e){return Ee(n,t=>{if(!t.empty)return Tn(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const sa=n=>na(n,!1),ra=n=>na(n,!0);function oa(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Tn(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),h=l.top+t.marginTop,a=l.bottom-t.marginBottom;o&&o.top>h&&o.bottomla(n,!1),Ws=n=>la(n,!0);function ft(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const Md=n=>Ee(n,e=>ft(n,e,!0)),Dd=n=>Ee(n,e=>ft(n,e,!1)),Od=n=>Ee(n,e=>ft(n,e,!ce(n))),Td=n=>Ee(n,e=>ft(n,e,ce(n))),Bd=n=>Ee(n,e=>b.cursor(n.lineBlockAt(e.head).from,1)),Pd=n=>Ee(n,e=>b.cursor(n.lineBlockAt(e.head).to,-1));function Rd(n,e,t){let i=!1,s=jt(n.selection,r=>{let o=qe(n,r.head,-1)||qe(n,r.head,1)||r.head>0&&qe(n,r.head-1,1)||r.headRd(n,e,!1);function Re(n,e){let t=jt(n.state.selection,i=>{let s=e(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Ge(n.state,t)),!0)}function ha(n,e){return Re(n,t=>n.moveByChar(t,e))}const aa=n=>ha(n,!ce(n)),ca=n=>ha(n,ce(n));function fa(n,e){return Re(n,t=>n.moveByGroup(t,e))}const Ed=n=>fa(n,!ce(n)),Id=n=>fa(n,ce(n)),Nd=n=>Re(n,e=>Bn(n.state,e,!ce(n))),Fd=n=>Re(n,e=>Bn(n.state,e,ce(n)));function ua(n,e){return Re(n,t=>n.moveVertically(t,e))}const da=n=>ua(n,!1),pa=n=>ua(n,!0);function ga(n,e){return Re(n,t=>n.moveVertically(t,e,oa(n).height))}const Vo=n=>ga(n,!1),Wo=n=>ga(n,!0),Vd=n=>Re(n,e=>ft(n,e,!0)),Wd=n=>Re(n,e=>ft(n,e,!1)),Hd=n=>Re(n,e=>ft(n,e,!ce(n))),zd=n=>Re(n,e=>ft(n,e,ce(n))),qd=n=>Re(n,e=>b.cursor(n.lineBlockAt(e.head).from)),$d=n=>Re(n,e=>b.cursor(n.lineBlockAt(e.head).to)),Ho=({state:n,dispatch:e})=>(e(Ge(n,{anchor:0})),!0),zo=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.doc.length})),!0),qo=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.selection.main.anchor,head:0})),!0),$o=({state:n,dispatch:e})=>(e(Ge(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Kd=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),jd=({state:n,dispatch:e})=>{let t=Rn(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:b.create(t),userEvent:"select"})),!0},Ud=({state:n,dispatch:e})=>{let t=jt(n.selection,i=>{var s;let r=be(n).resolveInner(i.head,1);for(;!(r.from=i.to||r.to>i.to&&r.from<=i.from||!(!((s=r.parent)===null||s===void 0)&&s.parent));)r=r.parent;return b.range(r.to,r.from)});return e(Ge(n,t)),!0},Gd=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=b.create([t.main]):t.main.empty||(i=b.create([b.cursor(t.main.head)])),i?(e(Ge(n,i)),!0):!1};function Pn(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let h=e(o);ho&&(t="delete.forward",h=Wi(n,h,!0)),o=Math.min(o,h),l=Math.max(l,h)}else o=Wi(n,o,!1),l=Wi(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?O.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Wi(n,e,t){if(n instanceof O)for(let i of n.state.facet(O.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const ma=(n,e)=>Pn(n,t=>{let{state:i}=n,s=i.doc.lineAt(t),r,o;if(!e&&t>s.from&&tma(n,!1),ya=n=>ma(n,!0),ba=(n,e)=>Pn(n,t=>{let i=t,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let h=de(r.text,i-r.from,e)+r.from,a=r.text.slice(Math.min(i,h)-r.from,Math.max(i,h)-r.from),c=o(a);if(l!=null&&c!=l)break;(a!=" "||i!=t)&&(l=c),i=h}return i}),wa=n=>ba(n,!1),Jd=n=>ba(n,!0),xa=n=>Pn(n,e=>{let t=n.lineBlockAt(e).to;return ePn(n,e=>{let t=n.lineBlockAt(e).from;return e>t?t:Math.max(0,e-1)}),Xd=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:I.of(["",""])},range:b.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},Yd=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:de(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:de(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Rn(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function ka(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Rn(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let h of r.ranges)s.push(b.range(Math.min(n.doc.length,h.anchor+l),Math.min(n.doc.length,h.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let h of r.ranges)s.push(b.range(h.anchor-l,h.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Qd=({state:n,dispatch:e})=>ka(n,e,!1),Zd=({state:n,dispatch:e})=>ka(n,e,!0);function Sa(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Rn(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ep=({state:n,dispatch:e})=>Sa(n,e,!1),tp=({state:n,dispatch:e})=>Sa(n,e,!0),ip=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Rn(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function np(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=be(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(P.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from?{from:i.to,to:s.from}:null}const sp=va(!1),rp=va(!0);function va(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),h=!n&&r==o&&np(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let a=new Mn(e,{simulateBreak:r,simulateDoubleBreak:!!h}),c=Lh(a,r);for(c==null&&(c=/^\s*/.exec(e.doc.lineAt(r).text)[0].length);ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const op=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Mn(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=cr(n,(r,o,l)=>{let h=Lh(i,r.from);if(h==null)return;/\S/.test(r.text)||(h=0);let a=/^\s*/.exec(r.text)[0],c=fn(n,h);(a!=c||l.fromn.readOnly?!1:(e(n.update(cr(n,(t,i)=>{i.push({from:t.from,insert:n.facet(An)})}),{userEvent:"input.indent"})),!0),hp=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(cr(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=yi(s,n.tabSize),o=0,l=fn(n,Math.max(0,r-vt(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),Ug=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Cd,shift:Nd},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Ad,shift:Fd},{key:"Alt-ArrowUp",run:Qd},{key:"Shift-Alt-ArrowUp",run:ep},{key:"Alt-ArrowDown",run:Zd},{key:"Shift-Alt-ArrowDown",run:tp},{key:"Escape",run:Gd},{key:"Mod-Enter",run:rp},{key:"Alt-l",mac:"Ctrl-l",run:jd},{key:"Mod-i",run:Ud,preventDefault:!0},{key:"Mod-[",run:hp},{key:"Mod-]",run:lp},{key:"Mod-Alt-\\",run:op},{key:"Shift-Mod-k",run:ip},{key:"Shift-Mod-\\",run:Ld},{key:"Mod-/",run:nd},{key:"Alt-A",run:rd}].concat(cp);function oe(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class Kt{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(Ko(l)):Ko,this.query=this.normalize(t)}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 se(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 t=Ks(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Me(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),h=this.match(l,o);if(h)return this.value=h,this;if(r==s.length-1)break;o==i&&rthis.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 t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=dn(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new Nt(t,e.sliceString(t,i));return Xn.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=dn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Nt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Ma.prototype[Symbol.iterator]=Da.prototype[Symbol.iterator]=function(){return this});function fp(n){try{return new RegExp(n,fr),!0}catch{return!1}}function dn(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function zs(n){let e=oe("input",{class:"cm-textfield",name:"line"}),t=oe("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:pn.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},oe("label",n.state.phrase("Go to line"),": ",e)," ",oe("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!s)return;let{state:r}=n,o=r.doc.lineAt(r.selection.main.head),[,l,h,a,c]=s,f=a?+a.slice(1):0,u=h?+h:o.number;if(h&&c){let p=u/100;l&&(p=p*(l=="-"?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*p)}else h&&l&&(u=u*(l=="-"?-1:1)+o.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u)));n.dispatch({effects:pn.of(!1),selection:b.cursor(d.from+Math.max(0,Math.min(f,d.length))),scrollIntoView:!0}),n.focus()}return{dom:t}}const pn=E.define(),jo=we.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(pn)&&(n=t.value);return n},provide:n=>on.from(n,e=>e?zs:null)}),up=n=>{let e=rn(n,zs);if(!e){let t=[pn.of(!0)];n.state.field(jo,!1)==null&&t.push(E.appendConfig.of([jo,dp])),n.dispatch({effects:t}),e=rn(n,zs)}return e&&e.dom.querySelector("input").focus(),!0},dp=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),pp={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Oa=M.define({combine(n){return At(n,pp,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Gg(n){let e=[wp,bp];return n&&e.push(Oa.of(n)),e}const gp=T.mark({class:"cm-selectionMatch"}),mp=T.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Uo(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=$.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=$.Word)}function yp(n,e,t,i){return n(e.sliceDoc(t,t+1))==$.Word&&n(e.sliceDoc(i-1,i))==$.Word}const bp=me.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Oa),{state:t}=n,i=t.selection;if(i.ranges.length>1)return T.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return T.none;let h=t.wordAt(s.head);if(!h)return T.none;o=t.charCategorizer(s.head),r=t.sliceDoc(h.from,h.to)}else{let h=s.to-s.from;if(h200)return T.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Uo(o,t,s.from,s.to)&&yp(o,t,s.from,s.to)))return T.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return T.none}let l=[];for(let h of n.visibleRanges){let a=new Kt(t.doc,r,h.from,h.to);for(;!a.next().done;){let{from:c,to:f}=a.value;if((!o||Uo(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(mp.range(c,f)):(c>=s.to||f<=s.from)&&l.push(gp.range(c,f)),l.length>e.maxMatches))return T.none}}return T.set(l)}},{decorations:n=>n.decorations}),wp=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),xp=({state:n,dispatch:e})=>{let{selection:t}=n,i=b.create(t.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function kp(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new Kt(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Kt(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(h=>h.from==l.value.from))continue;if(r){let h=n.wordAt(l.value.from);if(!h||h.from!=l.value.from||h.to!=l.value.to)continue}return l.value}}const Sp=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return xp({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=kp(n,i);return s?(e(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:O.scrollIntoView(s.to)})),!0):!1},ur=M.define({combine(n){return At(n,{top:!1,caseSensitive:!1,literal:!1,wholeWord:!1,createPanel:e=>new Lp(e)})}});class Ta{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||fp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Mp(this):new Cp(this)}getCursor(e,t=0,i){let s=e.doc?e:N.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Bt(this,s,t,i):Tt(this,s,t,i)}}class Ba{constructor(e){this.spec=e}}function Tt(n,e,t,i){return new Kt(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?vp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function vp(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Tt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Bt(n,e,t,i){return new Ma(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Ap(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function gn(n,e){return n.slice(de(n,e,!1),e)}function mn(n,e){return n.slice(e,de(n,e))}function Ap(n){return(e,t,i)=>!i[0].length||(n(gn(i.input,i.index))!=$.Word||n(mn(i.input,i.index))!=$.Word)&&(n(mn(i.input,i.index+i[0].length))!=$.Word||n(gn(i.input,i.index+i[0].length))!=$.Word)}class Mp extends Ba{nextMatch(e,t,i){let s=Bt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Bt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Bt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Bt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const pi=E.define(),dr=E.define(),st=we.define({create(n){return new Yn(qs(n).create(),null)},update(n,e){for(let t of e.effects)t.is(pi)?n=new Yn(t.value.create(),n.panel):t.is(dr)&&(n=new Yn(n.query,t.value?pr:null));return n},provide:n=>on.from(n,e=>e.panel)});class Yn{constructor(e,t){this.query=e,this.panel=t}}const Dp=T.mark({class:"cm-searchMatch"}),Op=T.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Tp=me.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(st))}update(n){let e=n.state.field(st);(e!=n.startState.field(st)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return T.none;let{view:t}=this,i=new xt;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)h=r[++s].to;n.highlight(t.state,l,h,(a,c)=>{let f=t.state.selection.ranges.some(u=>u.from==a&&u.to==c);i.add(a,c,f?Op:Dp)})}return i.finish()}},{decorations:n=>n.decorations});function xi(n){return e=>{let t=e.state.field(st,!1);return t&&t.query.spec.valid?n(e,t):Pa(e)}}const yn=xi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);return i?(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:gr(n,i),userEvent:"select.search"}),!0):!1}),bn=xi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);return s?(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:gr(n,s),userEvent:"select.search"}),!0):!1}),Bp=xi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:b.create(t.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Pp=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Kt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return e(n.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},Go=xi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],l,h,a=[];if(r.from==i&&r.to==s&&(h=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:h}),r=e.nextMatch(t,r.from,r.to),a.push(O.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-h.length;l={anchor:r.from-c,head:r.to-c},a.push(gr(n,r))}return n.dispatch({changes:o,selection:l,scrollIntoView:!!l,effects:a,userEvent:"input.replace"}),!0}),Rp=xi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function pr(n){return n.state.facet(ur).createPanel(n)}function qs(n,e){var t,i,s,r;let o=n.selection.main,l=o.empty||o.to>o.from+100?"":n.sliceDoc(o.from,o.to);if(e&&!l)return e;let h=n.facet(ur);return new Ta({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:h.literal,wholeWord:(r=e==null?void 0:e.wholeWord)!==null&&r!==void 0?r:h.wholeWord})}const Pa=n=>{let e=n.state.field(st,!1);if(e&&e.panel){let t=rn(n,pr);if(!t)return!1;let i=t.dom.querySelector("[main-field]");if(i&&i!=n.root.activeElement){let s=qs(n.state,e.query.spec);s.valid&&n.dispatch({effects:pi.of(s)}),i.focus(),i.select()}}else n.dispatch({effects:[dr.of(!0),e?pi.of(qs(n.state,e.query.spec)):E.appendConfig.of(Ip)]});return!0},Ra=n=>{let e=n.state.field(st,!1);if(!e||!e.panel)return!1;let t=rn(n,pr);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:dr.of(!1)}),!0},Jg=[{key:"Mod-f",run:Pa,scope:"editor search-panel"},{key:"F3",run:yn,shift:bn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:yn,shift:bn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Ra,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Pp},{key:"Alt-g",run:up},{key:"Mod-d",run:Sp,preventDefault:!0}];class Lp{constructor(e){this.view=e;let t=this.query=e.state.field(st).query.spec;this.commit=this.commit.bind(this),this.searchField=oe("input",{value:t.search,placeholder:Se(e,"Find"),"aria-label":Se(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=oe("input",{value:t.replace,placeholder:Se(e,"Replace"),"aria-label":Se(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=oe("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=oe("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=oe("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return oe("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=oe("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>yn(e),[Se(e,"next")]),i("prev",()=>bn(e),[Se(e,"previous")]),i("select",()=>Bp(e),[Se(e,"all")]),oe("label",null,[this.caseField,Se(e,"match case")]),oe("label",null,[this.reField,Se(e,"regexp")]),oe("label",null,[this.wordField,Se(e,"by word")]),...e.state.readOnly?[]:[oe("br"),this.replaceField,i("replace",()=>Go(e),[Se(e,"replace")]),i("replaceAll",()=>Rp(e),[Se(e,"replace all")])],oe("button",{name:"close",onclick:()=>Ra(e),"aria-label":Se(e,"close"),type:"button"},["×"])])}commit(){let e=new Ta({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:pi.of(e)}))}keydown(e){Tf(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?bn:yn)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Go(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(pi)&&!i.value.eq(this.query)&&this.setQuery(i.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(ur).top}}function Se(n,e){return n.state.phrase(e)}const Hi=30,zi=/[\s\.,:;?!]/;function gr(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Hi),o=Math.min(s,t+Hi),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let h=0;hl.length-Hi;h--)if(!zi.test(l[h-1])&&zi.test(l[h])){l=l.slice(0,h);break}}return O.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const Ep=O.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"}}),Ip=[st,Ct.lowest(Tp),Ep];class La{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=be(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Ea(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function Jo(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Np(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Np(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function _g(n,e){return t=>{for(let i=be(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class _o{constructor(e,t,i){this.completion=e,this.source=t,this.match=i}}function rt(n){return n.selection.main.head}function Ea(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Vp=at.define();function Wp(n,e,t,i){return Object.assign(Object.assign({},n.changeByRange(s=>{if(s==n.selection.main)return{changes:{from:t,to:i,insert:e},range:b.cursor(t+e.length)};let r=i-t;return!s.empty||r&&n.sliceDoc(s.from-r,s.from)!=n.sliceDoc(t,i)?{range:s}:{changes:{from:s.from-r,to:s.from,insert:e},range:b.cursor(s.from-r+e.length)}})),{userEvent:"input.complete"})}function Ia(n,e){const t=e.completion.apply||e.completion.label;let i=e.source;typeof t=="string"?n.dispatch(Object.assign(Object.assign({},Wp(n.state,t,i.from,i.to)),{annotations:Vp.of(e.completion)})):t(n,e.completion,i.from,i.to)}const Xo=new WeakMap;function Hp(n){if(!Array.isArray(n))return n;let e=Xo.get(n);return e||Xo.set(n,e=Fp(n)),e}class zp{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(C=Ks(S))!=C.toLowerCase()?1:C!=C.toUpperCase()?2:0;(!v||B==1&&m||x==0&&B!=0)&&(t[f]==S||i[f]==S&&(u=!0)?o[f++]=v:o.length&&(y=!1)),x=B,v+=Me(S)}return f==h&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==h&&p==0?[-200-e.length+(g==e.length?0:-100),0,g]:l>-1?[-700-e.length,l,l+this.pattern.length]:d==h?[-200+-700-e.length,p,g]:f==h?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[e-i.length],r=1;for(let o of t){let l=o+(this.astral?Me(se(i,o)):1);r>1&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return s}}const Pe=M.define({combine(n){return At(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>Yo(e(i),t(i)),optionClass:(e,t)=>i=>Yo(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function Yo(n,e){return n?e?n+" "+e:n:e}function qp(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let{label:o}=t,l=0;for(let h=1;hl&&r.appendChild(document.createTextNode(o.slice(l,a)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(a,c))),f.className="cm-completionMatchedText",l=c}return lt.position-i.position).map(t=>t.render)}function Qo(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class $p{constructor(e,t){this.view=e,this.stateField=t,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:l=>this.positionInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:s,selected:r}=i.open,o=e.state.facet(Pe);this.optionContent=qp(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Qo(s.length,r,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{for(let h=l.target,a;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(a=/-(\d+)$/.exec(h.id))&&+a[1]{this.info&&this.view.requestMeasure(this.placeInfo)})}mount(){this.updateSel()}update(e){var t,i,s;let r=e.state.field(this.stateField),o=e.startState.field(this.stateField);this.updateTooltipClass(e.state),r!=o&&(this.updateSel(),((t=r.open)===null||t===void 0?void 0:t.disabled)!=((i=o.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((s=r.open)===null||s===void 0)&&s.disabled)))}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Qo(t.options.length,t.selected,this.view.state.facet(Pe).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o)}).catch(o=>Le(this.view.state,o,"completion info")):this.addInfoPane(r)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&jp(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let p=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:p.innerWidth,bottom:p.innerHeight}}if(s.top>Math.min(r.bottom,t.bottom)-10||s.bottom=i.height||p>t.top?c=s.bottom-t.top+"px":f=t.bottom-s.top+"px"}return{top:c,bottom:f,maxWidth:a,class:h?o?"left-narrow":"right-narrow":l?"left":"right"}}positionInfo(e){this.info&&(e?(this.info.style.top=e.top,this.info.style.bottom=e.bottom,this.info.style.maxWidth=e.maxWidth,this.info.className="cm-tooltip cm-completionInfo cm-completionInfo-"+e.class):this.info.style.top="-1e6px")}createListBox(e,t,i){const s=document.createElement("ul");s.id=t,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions"));for(let r=i.from;rnew $p(e,n)}function jp(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect();i.topt.bottom&&(n.scrollTop+=i.bottom-t.bottom)}function Zo(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function Up(n,e){let t=[],i=0;for(let l of n)if(l.hasResult())if(l.result.filter===!1){let h=l.result.getMatch;for(let a of l.result.options){let c=[1e9-i++];if(h)for(let f of h(a))c.push(f);t.push(new _o(a,l,c))}}else{let h=new zp(e.sliceDoc(l.from,l.to)),a;for(let c of l.result.options)(a=h.match(c.label))&&(c.boost!=null&&(a[0]+=c.boost),t.push(new _o(c,l,a)))}let s=[],r=null,o=e.facet(Pe).compareCompletions;for(let l of t.sort((h,a)=>a.match[0]-h.match[0]||o(h.completion,a.completion)))!r||r.label!=l.completion.label||r.detail!=l.completion.detail||r.type!=null&&l.completion.type!=null&&r.type!=l.completion.type||r.apply!=l.completion.apply?s.push(l):Zo(l.completion)>Zo(r)&&(s[s.length-1]=l),r=l.completion;return s}class Pt{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Pt(this.options,el(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=Up(e,t);if(!o.length)return s&&e.some(h=>h.state==1)?new Pt(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(Pe).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let h=s.options[s.selected].completion;for(let a=0;aa.hasResult()?Math.min(h,a.from):h,1e8),create:Kp(Ae),above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new Pt(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class wn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new wn(_p,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Pe),r=(i.override||t.languageDataAt("autocomplete",rt(t)).map(Hp)).map(l=>(this.active.find(a=>a.source==l)||new xe(l,this.active.some(a=>a.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,h)=>l==this.active[h])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!Gp(r,this.active)?o=Pt.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new xe(l.source,0):l));for(let l of e.effects)l.is(Fa)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new wn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Jp}}function Gp(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const _p=[];function $s(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class xe{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=$s(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new xe(s.source,0));for(let r of e.effects)if(r.is(mr))s=new xe(s.source,1,r.value?rt(e.state):-1);else if(r.is(xn))s=new xe(s.source,0);else if(r.is(Na))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new xe(this.source,1)}handleChange(e){return e.changes.touchesRange(rt(e.startState))?new xe(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new xe(this.source,this.state,e.mapPos(this.explicitPos))}}class si extends xe{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=rt(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&rt(e.startState)==this.from)return new xe(this.source,t=="input"&&i.activateOnTyping?1:0);let h=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),a;return Xp(this.result.validFor,e.state,r,o)?new si(this.source,h,this.result,r,o):this.result.update&&(a=this.result.update(this.result,r,o,new La(e.state,l,h>=0)))?new si(this.source,h,a,a.from,(s=a.to)!==null&&s!==void 0?s:rt(e.state)):new xe(this.source,1,h)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new xe(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new si(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function Xp(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Ea(n,!0).test(s)}const mr=E.define(),xn=E.define(),Na=E.define({map(n,e){return n.map(t=>t.map(e))}}),Fa=E.define(),Ae=we.define({create(){return wn.start()},update(n,e){return n.update(e)},provide:n=>[vh.from(n,e=>e.tooltip),O.contentAttributes.from(n,e=>e.attrs)]});function qi(n,e="option"){return t=>{let i=t.state.field(Ae,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Fa.of(l)}),!0}}const Yp=n=>{let e=n.state.field(Ae,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||Date.now()-e.open.timestampn.state.field(Ae,!1)?(n.dispatch({effects:mr.of(!0)}),!0):!1,Zp=n=>{let e=n.state.field(Ae,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:xn.of(null)}),!0)};class eg{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const tl=50,tg=50,ig=1e3,ng=me.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Ae).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Ae);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Ae)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!$s(i));for(let i=0;itg&&Date.now()-s.time>ig){for(let r of s.context.abortListeners)try{r()}catch(o){Le(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),tl):-1,this.composing!=0)for(let i of n.transactions)$s(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Ae);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=rt(e),i=new La(e,t,n.explicitPos==t),s=new eg(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:xn.of(null)}),Le(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),tl))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Pe);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new xe(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:Na.of(e)})}},{eventHandlers:{blur(){let n=this.view.state.field(Ae,!1);n&&n.tooltip&&this.view.state.facet(Pe).closeOnBlur&&this.view.dispatch({effects:xn.of(null)})},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:mr.of(!1)}),20),this.composing=0}}}),Va=O.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":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&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:`${400}px`,boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`${30}px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`${30}px`},"&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 sg{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class yr{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,he.TrackDel),i=e.mapPos(this.to,1,he.TrackDel);return t==null||i==null?null:new yr(this.field,t,i)}}class br{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let h of this.lines){if(i.length){let a=o,c=/^\t*/.exec(h)[0].length;for(let f=0;fnew yr(h.field,s[h.line]+h.from,s[h.line]+h.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,h=r[2]||r[3]||"",a=-1;for(let c=0;c=a&&f.field++}s.push(new sg(a,i.length,r.index,r.index+h.length)),o=o.slice(0,r.index)+h+o.slice(r.index+r[0].length)}for(let l;l=/\\([{}])/.exec(o);){o=o.slice(0,l.index)+l[1]+o.slice(l.index+l[0].length);for(let h of s)h.line==i.length&&h.from>l.index&&(h.from--,h.to--)}i.push(o)}return new br(i,s)}}let rg=T.widget({widget:new class extends ct{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),og=T.mark({class:"cm-snippetField"});class Ut{constructor(e,t){this.ranges=e,this.active=t,this.deco=T.set(e.map(i=>(i.from==i.to?rg:og).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new Ut(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const ki=E.define({map(n,e){return n&&n.map(e)}}),lg=E.define(),gi=we.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(ki))return t.value;if(t.is(lg)&&n)return new Ut(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>O.decorations.from(n,e=>e?e.deco:T.none)});function wr(n,e){return b.create(n.filter(t=>t.field==e).map(t=>b.range(t.from,t.to)))}function hg(n){let e=br.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),h={changes:{from:s,to:r,insert:I.of(o)},scrollIntoView:!0};if(l.length&&(h.selection=wr(l,0)),l.length>1){let a=new Ut(l,0),c=h.effects=[ki.of(a)];t.state.field(gi,!1)===void 0&&c.push(E.appendConfig.of([gi,dg,pg,Va]))}t.dispatch(t.state.update(h))}}function Wa(n){return({state:e,dispatch:t})=>{let i=e.field(gi,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:wr(i.ranges,s),effects:ki.of(r?null:new Ut(i.ranges,s))})),!0}}const ag=({state:n,dispatch:e})=>n.field(gi,!1)?(e(n.update({effects:ki.of(null)})),!0):!1,cg=Wa(1),fg=Wa(-1),ug=[{key:"Tab",run:cg,shift:fg},{key:"Escape",run:ag}],il=M.define({combine(n){return n.length?n[0]:ug}}),dg=Ct.highest(er.compute([il],n=>n.facet(il)));function Xg(n,e){return Object.assign(Object.assign({},e),{apply:hg(n)})}const pg=O.domEventHandlers({mousedown(n,e){let t=e.state.field(gi,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:wr(t.ranges,s.field),effects:ki.of(t.ranges.some(r=>r.field>s.field)?new Ut(t.ranges,s.field):null)}),!0)}}),mi={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},yt=E.define({map(n,e){let t=e.mapPos(n,-1,he.TrackAfter);return t??void 0}}),xr=E.define({map(n,e){return e.mapPos(n)}}),kr=new class extends wt{};kr.startSide=1;kr.endSide=-1;const Ha=we.define({create(){return j.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=j.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(yt)?n=n.update({add:[kr.range(t.value,t.value+1)]}):t.is(xr)&&(n=n.update({filter:i=>i!=t.value}));return n}});function Yg(){return[mg,Ha]}const Qn="()[]{}<>";function za(n){for(let e=0;e{if((gg?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Me(se(i,0))==1||e!=s.from||t!=s.to)return!1;let r=bg(n.state,i);return r?(n.dispatch(r),!0):!1}),yg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=qa(n,n.selection.main.head).brackets||mi.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=wg(n.doc,o.head);for(let h of i)if(h==l&&Ln(n.doc,o.head)==za(se(h,0)))return{changes:{from:o.head-h.length,to:o.head+h.length},range:b.cursor(o.head-h.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},Qg=[{key:"Backspace",run:yg}];function bg(n,e){let t=qa(n,n.selection.main.head),i=t.brackets||mi.brackets;for(let s of i){let r=za(se(s,0));if(e==s)return r==s?Sg(n,s,i.indexOf(s+s+s)>-1,t):xg(n,s,r,t.before||mi.before);if(e==r&&$a(n,n.selection.main.from))return kg(n,s,r)}return null}function $a(n,e){let t=!1;return n.field(Ha).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Ln(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Me(se(t,0)))}function wg(n,e){let t=n.sliceString(e-2,e);return Me(se(t,0))==t.length?t:t.slice(1)}function xg(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:yt.of(o.to+e.length),range:b.range(o.anchor+e.length,o.head+e.length)};let l=Ln(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:yt.of(o.head+e.length),range:b.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function kg(n,e,t){let i=null,s=n.selection.ranges.map(r=>r.empty&&Ln(n.doc,r.head)==t?b.cursor(r.head+t.length):i=r);return i?null:n.update({selection:b.create(s,n.selection.mainIndex),scrollIntoView:!0,effects:n.selection.ranges.map(({from:r})=>xr.of(r))})}function Sg(n,e,t,i){let s=i.stringPrefixes||mi.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:yt.of(l.to+e.length),range:b.range(l.anchor+e.length,l.head+e.length)};let h=l.head,a=Ln(n.doc,h),c;if(a==e){if(nl(n,h))return{changes:{insert:e+e,from:h},effects:yt.of(h+e.length),range:b.cursor(h+e.length)};if($a(n,h)){let f=t&&n.sliceDoc(h,h+e.length*3)==e+e+e;return{range:b.cursor(h+e.length*(f?3:1)),effects:xr.of(h)}}}else{if(t&&n.sliceDoc(h-2*e.length,h)==e+e&&(c=sl(n,h-2*e.length,s))>-1&&nl(n,c))return{changes:{insert:e+e+e+e,from:h},effects:yt.of(h+e.length),range:b.cursor(h+e.length)};if(n.charCategorizer(h)(a)!=$.Word&&sl(n,h,s)>-1&&!vg(n,h,e,s))return{changes:{insert:e+e,from:h},effects:yt.of(h+e.length),range:b.cursor(h+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function nl(n,e){let t=be(n).resolveInner(e+1);return t.parent&&t.from==e}function vg(n,e,t,i){let s=be(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),h=l.indexOf(t);if(!h||h>-1&&i.indexOf(l.slice(0,h))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+h;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let a=s.to==e&&s.parent;if(!a)break;s=a}return!1}function sl(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=$.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=$.Word)return r}return-1}function Zg(n={}){return[Ae,Pe.of(n),ng,Ag,Va]}const Cg=[{key:"Ctrl-Space",run:Qp},{key:"Escape",run:Zp},{key:"ArrowDown",run:qi(!0)},{key:"ArrowUp",run:qi(!1)},{key:"PageDown",run:qi(!0,"page")},{key:"PageUp",run:qi(!1,"page")},{key:"Enter",run:Yp}],Ag=Ct.highest(er.computeN([Pe],n=>n.facet(Pe).defaultKeymap?[Cg]:[]));export{Vg as A,Wg as B,kn as C,lu as D,O as E,Hg as F,Ig as G,be as H,U as I,_g as J,Fp as K,Ls as L,b as M,tr as N,Fg as O,Dh as P,Ng as Q,Tu as R,zh as S,W as T,Xg as U,Bh as V,Rg as W,Gu as X,N as a,Og as b,Kg as c,Mg as d,Dg as e,qg as f,$g as g,Pg as h,Yg as i,Gg as j,er as k,Qg as l,Ug as m,Jg as n,jg as o,Cg as p,Zg as q,Bg as r,zg as s,Tg as t,ye as u,P as v,Cu as w,k as x,Lg as y,Ru as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index 223d7194..f79ec944 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -44,7 +44,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - +