diff --git a/ui/dist/assets/AuthMethodsDocs-ec276195.js b/ui/dist/assets/AuthMethodsDocs-f25f00e8.js similarity index 98% rename from ui/dist/assets/AuthMethodsDocs-ec276195.js rename to ui/dist/assets/AuthMethodsDocs-f25f00e8.js index 886ed6e7..0c61b54a 100644 --- a/ui/dist/assets/AuthMethodsDocs-ec276195.js +++ b/ui/dist/assets/AuthMethodsDocs-f25f00e8.js @@ -1,4 +1,4 @@ -import{S as ke,i as be,s as ge,e as r,w as g,b as w,c as me,f as k,g as h,h as n,m as _e,x as H,N as re,O as we,k as ve,P 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 Q,u as je,M as Ae}from"./index-97145449.js";import{S as Be}from"./SdkTabs-259b2687.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"),_=g(s),f=w(),k(o,"class","tab-item"),Q(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+"")&&H(_,s),C&6&&Q(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),_=w(),k(o,"class","tab-item"),Q(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)&&Q(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,y,A,Z,V,z=a[0].name+"",E,x,I,B,J,S,O,b=[],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 g,b as w,c as me,f as k,g as h,h as n,m as _e,x as H,N as re,O as we,k as ve,P 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 Q,u as je,M as Ae}from"./index-1d58e6ce.js";import{S as Be}from"./SdkTabs-ea1c7c68.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"),_=g(s),f=w(),k(o,"class","tab-item"),Q(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+"")&&H(_,s),C&6&&Q(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),_=w(),k(o,"class","tab-item"),Q(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)&&Q(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,y,A,Z,V,z=a[0].name+"",E,x,I,B,J,S,O,b=[],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-9617aab2.js b/ui/dist/assets/AuthRefreshDocs-044488a5.js similarity index 98% rename from ui/dist/assets/AuthRefreshDocs-9617aab2.js rename to ui/dist/assets/AuthRefreshDocs-044488a5.js index 1a317dfd..51a65da4 100644 --- a/ui/dist/assets/AuthRefreshDocs-9617aab2.js +++ b/ui/dist/assets/AuthRefreshDocs-044488a5.js @@ -1,4 +1,4 @@ -import{S as ze,i as Ue,s as je,M as Ve,e as a,w as k,b as p,c as ae,f as b,g as d,h as o,m as ne,x as re,N as qe,O as xe,k as Je,P as Ke,n as Ie,t as U,a as j,o as u,d as ie,R as Qe,C as He,p as We,r as x,u as Ge}from"./index-97145449.js";import{S as Xe}from"./SdkTabs-259b2687.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){d(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&&u(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){d(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&&u(s),ie(n)}}}function Ye(r){var Ae,Be;let l,s,n=r[0].name+"",m,_,i,f,v,g,w,A,J,$,F,ce,L,B,de,K,N=r[0].name+"",I,ue,pe,V,Q,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,S=[],Te=new Map,Ce,H,y=[],Re=new Map,M;g=new Xe({props:{js:` +import{S as ze,i as Ue,s as je,M as Ve,e as a,w as k,b as p,c as ae,f as b,g as d,h as o,m as ne,x as re,N as qe,O as xe,k as Je,P as Ke,n as Ie,t as U,a as j,o as u,d as ie,R as Qe,C as He,p as We,r as x,u as Ge}from"./index-1d58e6ce.js";import{S as Xe}from"./SdkTabs-ea1c7c68.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){d(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&&u(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){d(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&&u(s),ie(n)}}}function Ye(r){var Ae,Be;let l,s,n=r[0].name+"",m,_,i,f,v,g,w,A,J,$,F,ce,L,B,de,K,N=r[0].name+"",I,ue,pe,V,Q,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,S=[],Te=new Map,Ce,H,y=[],Re=new Map,M;g=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-99dc3f64.js b/ui/dist/assets/AuthWithOAuth2Docs-a9549379.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-99dc3f64.js rename to ui/dist/assets/AuthWithOAuth2Docs-a9549379.js index 70db3568..dc72da90 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-99dc3f64.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-a9549379.js @@ -1,4 +1,4 @@ -import{S as je,i as ze,s as Fe,M as We,e as s,w,b as h,c as re,f as p,g as i,h as a,m as ce,x as de,N as De,O as Ve,k as Le,P as Ee,n as Je,t as L,a as E,o as r,d as ue,R as Ne,C as Ue,p as Ie,r as J,u as Ke}from"./index-97145449.js";import{S as Qe}from"./SdkTabs-259b2687.js";function Be(c,l,o){const n=c.slice();return n[5]=l[o],n}function Me(c,l,o){const n=c.slice();return n[5]=l[o],n}function Re(c,l){let o,n=l[5].code+"",m,v,d,b;function k(){return l[4](l[5])}return{key:c,first:null,c(){o=s("button"),m=w(n),v=h(),p(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(g,O){i(g,o,O),a(o,m),a(o,v),d||(b=Ke(o,"click",k),d=!0)},p(g,O){l=g,O&4&&n!==(n=l[5].code+"")&&de(m,n),O&6&&J(o,"active",l[1]===l[5].code)},d(g){g&&r(o),d=!1,b()}}}function He(c,l){let o,n,m,v;return n=new We({props:{content:l[5].body}}),{key:c,first:null,c(){o=s("div"),re(n.$$.fragment),m=h(),p(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(d,b){i(d,o,b),ce(n,o,null),a(o,m),v=!0},p(d,b){l=d;const k={};b&4&&(k.content=l[5].body),n.$set(k),(!v||b&6)&&J(o,"active",l[1]===l[5].code)},i(d){v||(L(n.$$.fragment,d),v=!0)},o(d){E(n.$$.fragment,d),v=!1},d(d){d&&r(o),ue(n)}}}function Ge(c){let l,o,n=c[0].name+"",m,v,d,b,k,g,O,x,N,A,j,he,z,P,pe,I,F=c[0].name+"",K,be,Q,D,G,U,X,B,Y,S,Z,fe,ee,T,te,me,ae,ve,f,we,C,ke,ge,_e,le,ye,oe,Oe,Ae,Se,se,Te,ne,M,ie,$,R,y=[],$e=new Map,Ce,H,_=[],qe=new Map,q;g=new Qe({props:{js:` +import{S as je,i as ze,s as Fe,M as We,e as s,w,b as h,c as re,f as p,g as i,h as a,m as ce,x as de,N as De,O as Ve,k as Le,P as Ee,n as Je,t as L,a as E,o as r,d as ue,R as Ne,C as Ue,p as Ie,r as J,u as Ke}from"./index-1d58e6ce.js";import{S as Qe}from"./SdkTabs-ea1c7c68.js";function Be(c,l,o){const n=c.slice();return n[5]=l[o],n}function Me(c,l,o){const n=c.slice();return n[5]=l[o],n}function Re(c,l){let o,n=l[5].code+"",m,v,d,b;function k(){return l[4](l[5])}return{key:c,first:null,c(){o=s("button"),m=w(n),v=h(),p(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(g,O){i(g,o,O),a(o,m),a(o,v),d||(b=Ke(o,"click",k),d=!0)},p(g,O){l=g,O&4&&n!==(n=l[5].code+"")&&de(m,n),O&6&&J(o,"active",l[1]===l[5].code)},d(g){g&&r(o),d=!1,b()}}}function He(c,l){let o,n,m,v;return n=new We({props:{content:l[5].body}}),{key:c,first:null,c(){o=s("div"),re(n.$$.fragment),m=h(),p(o,"class","tab-item"),J(o,"active",l[1]===l[5].code),this.first=o},m(d,b){i(d,o,b),ce(n,o,null),a(o,m),v=!0},p(d,b){l=d;const k={};b&4&&(k.content=l[5].body),n.$set(k),(!v||b&6)&&J(o,"active",l[1]===l[5].code)},i(d){v||(L(n.$$.fragment,d),v=!0)},o(d){E(n.$$.fragment,d),v=!1},d(d){d&&r(o),ue(n)}}}function Ge(c){let l,o,n=c[0].name+"",m,v,d,b,k,g,O,x,N,A,j,he,z,P,pe,I,F=c[0].name+"",K,be,Q,D,G,U,X,B,Y,S,Z,fe,ee,T,te,me,ae,ve,f,we,C,ke,ge,_e,le,ye,oe,Oe,Ae,Se,se,Te,ne,M,ie,$,R,y=[],$e=new Map,Ce,H,_=[],qe=new Map,q;g=new Qe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${c[3]}'); diff --git a/ui/dist/assets/AuthWithPasswordDocs-ae1991de.js b/ui/dist/assets/AuthWithPasswordDocs-0a891eec.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-ae1991de.js rename to ui/dist/assets/AuthWithPasswordDocs-0a891eec.js index 7ee7d7c4..6706e4da 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-ae1991de.js +++ b/ui/dist/assets/AuthWithPasswordDocs-0a891eec.js @@ -1,4 +1,4 @@ -import{S as Se,i as ve,s as we,M 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,N as ce,O as ye,k as ge,P as Pe,n as Re,t as tt,a as et,o as c,d as Mt,R as $e,C as de,p as Ce,r as lt,u as Oe}from"./index-97145449.js";import{S as Ae}from"./SdkTabs-259b2687.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 Me(n){let e;return{c(){e=f("username")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Ue(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),Mt(i)}}}function De(n){var se,ne;let e,l,i=n[0].name+"",S,m,p,d,_,$,C,O,B,Ut,ot,T,at,F,st,M,G,Dt,X,N,Et,nt,Z=n[0].name+"",it,Wt,rt,I,ct,U,dt,Lt,V,D,ut,Bt,ft,Ht,P,Yt,pt,bt,mt,qt,ht,_t,j,kt,E,St,Ft,vt,W,wt,Nt,yt,It,k,Vt,H,jt,Jt,Kt,gt,Qt,Pt,zt,Gt,Xt,Rt,Zt,$t,J,Ct,L,K,A=[],xt=new Map,te,Q,v=[],ee=new Map,Y;function le(t,a){if(t[1]&&t[2])return Ue;if(t[1])return Me;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,M 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,N as ce,O as ye,k as ge,P as Pe,n as Re,t as tt,a as et,o as c,d as Mt,R as $e,C as de,p as Ce,r as lt,u as Oe}from"./index-1d58e6ce.js";import{S as Ae}from"./SdkTabs-ea1c7c68.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 Me(n){let e;return{c(){e=f("username")},m(l,i){r(l,e,i)},d(l){l&&c(e)}}}function Ue(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),Mt(i)}}}function De(n){var se,ne;let e,l,i=n[0].name+"",S,m,p,d,_,$,C,O,B,Ut,ot,T,at,F,st,M,G,Dt,X,N,Et,nt,Z=n[0].name+"",it,Wt,rt,I,ct,U,dt,Lt,V,D,ut,Bt,ft,Ht,P,Yt,pt,bt,mt,qt,ht,_t,j,kt,E,St,Ft,vt,W,wt,Nt,yt,It,k,Vt,H,jt,Jt,Kt,gt,Qt,Pt,zt,Gt,Xt,Rt,Zt,$t,J,Ct,L,K,A=[],xt=new Map,te,Q,v=[],ee=new Map,Y;function le(t,a){if(t[1]&&t[2])return Ue;if(t[1])return Me;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-55647829.js b/ui/dist/assets/CodeEditor-c5150b8e.js similarity index 84% rename from ui/dist/assets/CodeEditor-55647829.js rename to ui/dist/assets/CodeEditor-c5150b8e.js index 5b5c0d89..ce5cc369 100644 --- a/ui/dist/assets/CodeEditor-55647829.js +++ b/ui/dist/assets/CodeEditor-c5150b8e.js @@ -1,4 +1,4 @@ -import{S as gt,i as Pt,s as mt,e as Xt,f as Zt,T as N,g as bt,y as RO,o as kt,I as xt,J as yt,K as wt,H as Yt,C as vt,L as Tt}from"./index-97145449.js";import{P as Ut,N as Wt,u as _t,D as Ct,v as wO,T as D,I as YO,w as rO,x as l,y as Vt,L as sO,z as nO,A as j,B as lO,F as ye,G as oO,H as C,J as we,K as Ye,M as ve,E as v,O as G,Q as qt,R as Rt,U as Te,V as X,W as zt,X as jt,a as V,h as Gt,b as At,c as It,d as Nt,e as Et,s as Bt,t as Dt,f as Jt,g as Lt,r as Mt,i as Ht,k as Ft,j as Kt,l as Oa,m as ea,n as ta,o as aa,p as ia,q as zO,C as E}from"./index-6f704b4c.js";class H{constructor(O,a,t,i,r,s,n,o,Q,u=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=i,this.pos=r,this.score=s,this.buffer=n,this.bufferBase=o,this.curContext=Q,this.lookAhead=u,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 i=O.parser.context;return new H(O,[],a,t,t,0,[],0,i?new jO(i,i.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,i=O&65535,{parser:r}=this.p,s=r.dynamicPrecedence(i);if(s&&(this.score+=s),t==0){this.pushState(r.getGoto(this.state,i,!0),this.reducePos),i=2e3&&!(!((a=this.p.parser.nodeSet.types[i])===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(i,o)}storeNode(O,a,t,i=4,r=!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(!r||this.pos==t)this.buffer.push(O,a,t,i);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,i>4&&(i-=4);this.buffer[s]=O,this.buffer[s+1]=a,this.buffer[s+2]=t,this.buffer[s+3]=i}}shift(O,a,t){let i=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=t,this.shiftContext(a,i),a<=this.p.parser.maxNode&&this.buffer.push(a,i,t,4);else{let r=O,{parser:s}=this.p;(t>this.pos||a<=s.maxNode)&&(this.pos=t,s.stateFlag(r,1)||(this.reducePos=t)),this.pushState(r,i),this.shiftContext(a,i),a<=s.maxNode&&this.buffer.push(a,i,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 i=this.pos;this.reducePos=this.pos=i+O.length,this.pushState(a,i),this.buffer.push(t,i,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),i=O.bufferBase+a;for(;O&&i==O.bufferBase;)O=O.parent;return new H(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,i,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 ra(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 i=[];for(let r=0,s;ro&1&&n==s)||i.push(a[r],s)}a=i}let t=[];for(let i=0;i>19,i=O&65535,r=this.stack.length-t*3;if(r<0||a.getGoto(this.stack[r],i,!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 jO{constructor(O,a){this.tracker=O,this.context=a,this.hash=O.strict?O.hash(a):0}}var GO;(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"})(GO||(GO={}));class ra{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 i=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=i}}class F{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 F(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 F(this.stack,this.pos,this.index)}}function z(e,O=Uint16Array){if(typeof e!="string")return e;let a=null;for(let t=0,i=0;t=92&&s--,s>=34&&s--;let o=s-32;if(o>=46&&(o-=46,n=!0),r+=o,n)break;r*=46}a?a[i++]=r:a=new O(r)}return a}class J{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 J;class sa{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,i=this.rangeIndex,r=this.pos+O;for(;rt.to:r>=t.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];r+=s.from-t.to,t=s}return r}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,i;if(a>=0&&a=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}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 i of this.ranges){if(i.from>=a)break;i.to>O&&(t+=this.input.read(Math.max(i.from,O),Math.min(i.to,a)))}return t}}class W{constructor(O,a){this.data=O,this.id=a}token(O,a){let{parser:t}=a.p;Ue(this.data,O,a,this.id,t.data,t.tokenPrecTable)}}W.prototype.contextual=W.prototype.fallback=W.prototype.extend=!1;class XO{constructor(O,a,t){this.precTable=a,this.elseToken=t,this.data=typeof O=="string"?z(O):O}token(O,a){let t=O.pos,i;for(;i=O.pos,Ue(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(i+1,O.token)}i>t&&(O.reset(t,O.token),O.acceptToken(this.elseToken,i-t))}}XO.prototype.contextual=W.prototype.fallback=W.prototype.extend=!1;class b{constructor(O,a={}){this.token=O,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function Ue(e,O,a,t,i,r){let s=0,n=1<0){let p=e[h];if(o.allows(p)&&(O.token.value==-1||O.token.value==p||na(p,O.token.value,i,r))){O.acceptToken(p);break}}let u=O.next,c=0,f=e[s+2];if(O.next<0&&f>c&&e[Q+f*3-3]==65535&&e[Q+f*3-3]==65535){s=e[Q+f*3-1];continue O}for(;c>1,p=Q+h+(h<<1),$=e[p],g=e[p+1]||65536;if(u<$)f=h;else if(u>=g)c=h+1;else{s=e[p+2],O.advance();continue O}}break}}function IO(e,O,a){for(let t=O,i;(i=e[t])!=65535;t++)if(i==a)return t-O;return-1}function na(e,O,a,t){let i=IO(a,t,O);return i<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 la{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?EO(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?EO(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(r instanceof D){if(s==O){if(s=Math.max(this.safeFrom,O)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[a]++,this.nextStart=s+r.length}}}class oa{constructor(O,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(t=>new J)}getActions(O){let a=0,t=null,{parser:i}=O.p,{tokenizers:r}=i,s=i.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 f=a;if(c.extended>-1&&(a=this.addActions(O,c.extended,c.end,a)),a=this.addActions(O,c.value,c.end,a),!u.extend&&(t=c,a>f))break}}for(;this.actions.length>a;)this.actions.pop();return o&&O.setLookAhead(o),!t&&O.pos==this.stream.end&&(t=new J,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 J,{pos:t,p:i}=O;return a.start=t,a.end=Math.min(t+1,i.stream.end),a.value=t==i.stream.end?i.parser.eofTerm:0,a}updateCachedToken(O,a,t){let i=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(i,O),t),O.value>-1){let{parser:r}=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(i+1)}putAction(O,a,t,i){for(let r=0;rO.bufferLength*4?new la(t,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,a=this.minStackPos,t=this.stacks=[],i,r;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;{i||(i=[],r=[]),i.push(n);let o=this.tokens.getMainToken(n);r.push(o.value,o.end)}}break}}if(!t.length){let s=i&&ha(i);if(s)return this.stackToTree(s);if(this.parser.strict)throw Z&&i&&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&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,r,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&&i>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(i);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?r.getGoto(O.state,c.type.id):-1;if(f>-1&&c.length&&(!Q||(c.prop(wO.contextHash)||0)==u))return O.useNode(c,f),Z&&console.log(s+this.stackID(O)+` (via reuse of ${r.getName(c.type.id)})`),!0;if(!(c instanceof D)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof D&&c.positions[0]==0)c=h;else break}}let n=r.stateSlot(O.state,4);if(n>0)return O.reduce(n),Z&&console.log(s+this.stackID(O)+` (via always-reduce ${r.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;Qi?a.push(p):t.push(p)}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 i=null,r=!1;for(let s=0;s ":"";if(n.deadEnd&&(r||(r=!0,n.restart(),Z&&console.log(u+this.stackID(n)+" (restarted)"),this.advanceFully(n,t))))continue;let c=n.split(),f=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));h++)Z&&(f=this.stackID(c)+" -> ");for(let h of n.recoverByInsert(o))Z&&console.log(u+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),Z&&console.log(u+this.stackID(n)+` (via recover-delete ${this.parser.getName(o)})`),DO(n,t)):(!i||i.scoree;class We{constructor(O){this.start=O.start,this.shift=O.shift||uO,this.reduce=O.reduce||uO,this.reuse=O.reuse||uO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class T extends Ut{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]),i=[];for(let n=0;n=0)r(u,o,n[Q++]);else{let c=n[Q+-u];for(let f=-u;f>0;f--)r(n[Q++],o,c);Q++}}}this.nodeSet=new Wt(a.map((n,o)=>_t.define({name:o>=this.minRepeatTerm?void 0:n,id:o,props:i[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=Ct;let s=z(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 W(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 i=new Qa(this,O,a,t);for(let r of this.wrappers)i=r(i,O,a,t);return i}getGoto(O,a,t=!1){let i=this.goto;if(a>=i[0])return-1;for(let r=i[a+1];;){let s=i[r++],n=s&1,o=i[r++];if(n&&t)return o;for(let Q=r+(s>>1);r0}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=k(this.data,t+2);else return!1;if(a==k(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=k(this.data,t+2);else break;if(!(this.data[t+2]&1)){let i=this.data[t+1];a.some((r,s)=>s&1&&r==i)||a.push(this.data[t],i)}}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 i=O.tokenizers.find(r=>r.from==t);return i?i.to:t})),O.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,i)=>{let r=O.specializers.find(n=>n.from==t.external);if(!r)return t;let s=Object.assign(Object.assign({},t),{external:r.to});return a.specializers[i]=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 r of O.split(" ")){let s=a.indexOf(r);s>=0&&(t[s]=!0)}let i=null;for(let r=0;rt)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.scoree.external(a,t)<<1|O}return e.get}const ua=54,fa=1,da=55,pa=2,Sa=56,$a=3,LO=4,ga=5,K=6,_e=7,Ce=8,Ve=9,qe=10,Pa=11,ma=12,Xa=13,fO=57,Za=14,MO=58,Re=20,ba=22,ze=23,ka=24,ZO=26,je=27,xa=28,ya=31,wa=34,Ya=36,va=37,Ta=0,Ua=1,Wa={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},_a={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 Ca(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 bO(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 i="";for(;Ca(t);)i+=String.fromCharCode(t),t=e.peek(++O);return KO=e,Oe=a,FO=i?i.toLowerCase():t==Va||t==qa?void 0:null}const Ae=60,OO=62,vO=47,Va=63,qa=33,Ra=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(bO(t,1)||"",e):e},reduce(e,O){return O==Re&&e?e.parent:e},reuse(e,O,a,t){let i=O.type.id;return i==K||i==Ya?new ee(bO(t,1)||"",e):e},hash(e){return e?e.hash:0},strict:!1}),Ga=new b((e,O)=>{if(e.next!=Ae){e.next<0&&O.context&&e.acceptToken(fO);return}e.advance();let a=e.next==vO;a&&e.advance();let t=bO(e,0);if(t===void 0)return;if(!t)return e.acceptToken(a?Za:K);let i=O.context?O.context.name:null;if(a){if(t==i)return e.acceptToken(Pa);if(i&&_a[i])return e.acceptToken(fO,-2);if(O.dialectEnabled(Ta))return e.acceptToken(ma);for(let r=O.context;r;r=r.parent)if(r.name==t)return;e.acceptToken(Xa)}else{if(t=="script")return e.acceptToken(_e);if(t=="style")return e.acceptToken(Ce);if(t=="textarea")return e.acceptToken(Ve);if(Wa.hasOwnProperty(t))return e.acceptToken(qe);i&&HO[i]&&HO[i][t]?e.acceptToken(fO,-1):e.acceptToken(K)}},{contextual:!0}),Aa=new b(e=>{for(let O=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(MO);break}if(e.next==Ra)O++;else if(e.next==OO&&O>=2){a>3&&e.acceptToken(MO,-2);break}else O=0;e.advance()}});function Ia(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Na=new b((e,O)=>{if(e.next==vO&&e.peek(1)==OO){let a=O.dialectEnabled(Ua)||Ia(O.context);e.acceptToken(a?ga:LO,2)}else e.next==OO&&e.acceptToken(LO,1)});function TO(e,O,a){let t=2+e.length;return new b(i=>{for(let r=0,s=0,n=0;;n++){if(i.next<0){n&&i.acceptToken(O);break}if(r==0&&i.next==Ae||r==1&&i.next==vO||r>=2&&rs?i.acceptToken(O,-s):i.acceptToken(a,-(s-2));break}else if((i.next==10||i.next==13)&&n){i.acceptToken(O,1);break}else r=s=0;i.advance()}})}const Ea=TO("script",ua,fa),Ba=TO("style",da,pa),Da=TO("textarea",Sa,$a),Ja=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}),La=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:[Ja],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:[Ea,Ba,Da,Na,Ga,Aa,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(ze)){let i=t.getChild(ka),r=t.getChild(ZO)||t.getChild(je);i&&(a[O.read(i.from,i.to)]=r?r.type.id==ZO?O.read(r.from+1,r.to-1):O.read(r.from,r.to):"")}return a}function te(e,O){let a=e.getChild(ba);return a?O.read(a.from,a.to):" "}function dO(e,O,a){let t;for(let i of a)if(!i.attrs||i.attrs(t||(t=Ie(e.node.parent.firstChild,O))))return{parser:i.parser};return null}function Ne(e=[],O=[]){let a=[],t=[],i=[],r=[];for(let n of e)(n.tag=="script"?a:n.tag=="style"?t:n.tag=="textarea"?i:r).push(n);let s=O.length?Object.create(null):null;for(let n of O)(s[n.name]||(s[n.name]=[])).push(n);return Vt((n,o)=>{let Q=n.type.id;if(Q==xa)return dO(n,o,a);if(Q==ya)return dO(n,o,t);if(Q==wa)return dO(n,o,i);if(Q==Re&&r.length){let u=n.node,c=u.firstChild,f=c&&te(c,o),h;if(f){for(let p of r)if(p.tag==f&&(!p.attrs||p.attrs(h||(h=Ie(u,o))))){let $=u.lastChild;return{parser:p.parser,overlay:[{from:c.to,to:$.type.id==va?$.from:u.to}]}}}}if(s&&Q==ze){let u=n.node,c;if(c=u.firstChild){let f=s[o.read(c.from,c.to)];if(f)for(let h of f){if(h.tagName&&h.tagName!=te(u.parent,o))continue;let p=u.lastChild;if(p.type.id==ZO){let $=p.from+1,g=p.lastChild,w=p.to-(g&&g.isError?0:1);if(w>$)return{parser:h.parser,overlay:[{from:$,to:w}]}}else if(p.type.id==je)return{parser:h.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}const Ma=94,ae=1,Ha=95,Fa=96,ie=2,Ee=[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],Ka=58,Oi=40,Be=95,ei=91,L=45,ti=46,ai=35,ii=37;function eO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function ri(e){return e>=48&&e<=57}const si=new b((e,O)=>{for(let a=!1,t=0,i=0;;i++){let{next:r}=e;if(eO(r)||r==L||r==Be||a&&ri(r))!a&&(r!=L||i>0)&&(a=!0),t===i&&r==L&&t++,e.advance();else{a&&e.acceptToken(r==Oi?Ha:t==2&&O.canShift(ie)?ie:Fa);break}}}),ni=new b(e=>{if(Ee.includes(e.peek(-1))){let{next:O}=e;(eO(O)||O==Be||O==ai||O==ti||O==ei||O==Ka||O==L)&&e.acceptToken(Ma)}}),li=new b(e=>{if(!Ee.includes(e.peek(-1))){let{next:O}=e;if(O==ii&&(e.advance(),e.acceptToken(ae)),eO(O)){do e.advance();while(eO(e.next));e.acceptToken(ae)}}}),oi=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}),Qi={__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},ci={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},hi={__proto__:null,not:128,only:128,from:158,to:160},ui=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:[ni,li,si,0,1,2,3],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:95,get:e=>Qi[e]||-1},{term:56,get:e=>ci[e]||-1},{term:96,get:e=>hi[e]||-1}],tokenPrec:1123});let pO=null;function SO(){if(!pO&&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,i=>"-"+i.toLowerCase())),a.has(t)||(O.push(t),a.add(t)));pO=O.sort().map(t=>({type:"property",label:t}))}return pO||[]}const re=["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}))),fi=["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})),y=/^(\w[\w-]*|-\w[\w-]*|)$/,di=/^-(-[\w-]*)?$/;function pi(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 ne=new we,Si=["Declaration"];function $i(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=ne.get(O);if(a)return a;let t=[],i=new Set,r=O.cursor(YO.IncludeAnonymous);if(r.firstChild())do for(let s of De(e,r.node))i.has(s.label)||(i.add(s.label),t.push(s));while(r.nextSibling());return ne.set(O,t),t}else{let a=[],t=new Set;return O.cursor().iterate(i=>{var r;if(i.name=="VariableName"&&i.matchContext(Si)&&((r=i.node.nextSibling)===null||r===void 0?void 0:r.name)==":"){let s=e.sliceString(i.from,i.to);t.has(s)||(t.add(s),a.push({label:s,type:"variable"}))}}),a}}const gi=e=>{let{state:O,pos:a}=e,t=C(O).resolveInner(a,-1),i=t.type.isError&&t.from==t.to-1&&O.doc.sliceString(t.from,t.to)=="-";if(t.name=="PropertyName"||(i||t.name=="TagName")&&/^(Block|Styles)$/.test(t.resolve(t.to).name))return{from:t.from,options:SO(),validFor:y};if(t.name=="ValueName")return{from:t.from,options:se,validFor:y};if(t.name=="PseudoClassName")return{from:t.from,options:re,validFor:y};if(t.name=="VariableName"||(e.explicit||i)&&pi(t,O.doc))return{from:t.name=="VariableName"?t.from:a,options:De(O.doc,$i(t)),validFor:di};if(t.name=="TagName"){for(let{parent:n}=t;n;n=n.parent)if(n.name=="Block")return{from:t.from,options:SO(),validFor:y};return{from:t.from,options:fi,validFor:y}}if(!e.explicit)return null;let r=t.resolve(a),s=r.childBefore(a);return s&&s.name==":"&&r.name=="PseudoClassSelector"?{from:a,options:re,validFor:y}:s&&s.name==":"&&r.name=="Declaration"||r.name=="ArgList"?{from:a,options:se,validFor:y}:r.name=="Block"||r.name=="Styles"?{from:a,options:SO(),validFor:y}:null},tO=sO.define({name:"css",parser:ui.configure({props:[nO.add({Declaration:j()}),lO.add({Block:ye})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Pi(){return new oO(tO,tO.data.of({autocomplete:gi}))}const le=302,oe=1,mi=2,Qe=303,Xi=305,Zi=306,bi=3,ki=4,xi=[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],Je=125,yi=59,ce=47,wi=42,Yi=43,vi=45,Ti=new We({start:!1,shift(e,O){return O==bi||O==ki||O==Xi?e:O==Zi},strict:!1}),Ui=new b((e,O)=>{let{next:a}=e;(a==Je||a==-1||O.context)&&O.canShift(Qe)&&e.acceptToken(Qe)},{contextual:!0,fallback:!0}),Wi=new b((e,O)=>{let{next:a}=e,t;xi.indexOf(a)>-1||a==ce&&((t=e.peek(1))==ce||t==wi)||a!=Je&&a!=yi&&a!=-1&&!O.context&&O.canShift(le)&&e.acceptToken(le)},{contextual:!0}),_i=new b((e,O)=>{let{next:a}=e;if((a==Yi||a==vi)&&(e.advance(),a==e.next)){e.advance();let t=!O.context&&O.canShift(oe);e.acceptToken(t?oe:mi)}},{contextual:!0}),Ci=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)}),Vi={__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:221,private:221,protected:221,readonly:223,instanceof:242,satisfies:245,in:246,const:248,import:280,keyof:335,unique:339,infer:345,is:381,abstract:401,implements:403,type:405,let:408,var:410,interface:417,enum:421,namespace:427,module:429,declare:433,global:437,for:458,of:467,while:470,with:474,do:478,if:482,else:484,switch:488,case:494,try:500,catch:504,finally:508,return:512,throw:516,break:520,continue:524,debugger:528},qi={__proto__:null,async:117,get:119,set:121,declare:181,public:183,private:183,protected:183,static:185,abstract:187,override:189,readonly:195,accessor:197,new:385},Ri={__proto__:null,"<":137},zi=T.deserialize({version:14,states:"$EnO`QUOOO%QQUOOO'TQWOOP(bOSOOO*pQ(CjO'#CfO*wOpO'#CgO+VO!bO'#CgO+eO07`O'#DZO-vQUO'#DaO.WQUO'#DlO%QQUO'#DvO0_QUO'#EOOOQ(CY'#EW'#EWO0uQSO'#ETOOQO'#I`'#I`O0}QSO'#GkOOQO'#Ei'#EiO1YQSO'#EhO1_QSO'#EhO3aQ(CjO'#JcO6QQ(CjO'#JdO6nQSO'#FWO6sQ#tO'#FoOOQ(CY'#F`'#F`O7OO&jO'#F`O7^Q,UO'#FvO8tQSO'#FuOOQ(CY'#Jd'#JdOOQ(CW'#Jc'#JcOOQQ'#J}'#J}O8yQSO'#IPO9OQ(C[O'#IQOOQQ'#JP'#JPOOQQ'#IU'#IUQ`QUOOO%QQUO'#DnO9WQUO'#DzO%QQUO'#D|O9_QSO'#GkO9dQ,UO'#ClO9rQSO'#EgO9}QSO'#ErO:SQ,UO'#F_O:qQSO'#GkO:vQSO'#GoO;RQSO'#GoO;aQSO'#GrO;aQSO'#GsO;aQSO'#GuO9_QSO'#GxOQQSO'#HoO>VQ(C]O'#HuO%QQUO'#HwO>bQ(C]O'#HyO>mQ(C]O'#H{O9OQ(C[O'#H}O>xQ(CjO'#CfO?zQWO'#DfQOQSOOO@bQSO'#EPO9dQ,UO'#EgO@mQSO'#EgO@xQ`O'#F_OOQQ'#Cd'#CdOOQ(CW'#Dk'#DkOOQ(CW'#Jg'#JgO%QQUO'#JgOBUQWO'#E`OOQ(CW'#E_'#E_OB`Q(C`O'#E`OBzQWO'#ESOOQO'#Jj'#JjOC`QWO'#ESOCmQWO'#E`ODTQWO'#EfODWQWO'#E`ODqQWO'#E`OAQQWO'#E`OBzQWO'#E`PEbO?MpO'#C`POOO)CDn)CDnOOOO'#IV'#IVOEmOpO,59ROOQ(CY,59R,59ROOOO'#IW'#IWOE{O!bO,59RO%QQUO'#D]OOOO'#IY'#IYOFZO07`O,59uOOQ(CY,59u,59uOFiQUO'#IZOF|QSO'#JeOIOQbO'#JeO+sQUO'#JeOIVQSO,59{OImQSO'#EiOIzQSO'#JrOJVQSO'#JqOJVQSO'#JqOJ_QSO,5;VOJdQSO'#JpOOQ(CY,5:W,5:WOJkQUO,5:WOLlQ(CjO,5:bOM]QSO,5:jOMbQSO'#JnON[Q(C[O'#JoO:vQSO'#JnONcQSO'#JnONkQSO,5;UONpQSO'#JnOOQ(CY'#Cf'#CfO%QQUO'#EOO! dQ`O,5:oOOQO'#Jk'#JkOOQO-E<^-E<^O9_QSO,5=VO! zQSO,5=VO!!PQUO,5;SO!$SQ,UO'#EdO!%gQSO,5;SO!'PQ,UO'#DpO!'WQUO'#DuO!'bQWO,5;]O!'jQWO,5;]O%QQUO,5;]OOQQ'#FO'#FOOOQQ'#FQ'#FQO%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'#FU'#FUO!'xQUO,5;oOOQ(CY,5;t,5;tOOQ(CY,5;u,5;uO!){QSO,5;uOOQ(CY,5;v,5;vO%QQUO'#IfO!*TQ(C[O,5kOOQQ'#JX'#JXOOQQ,5>l,5>lOOQQ-EQQWO,5;yO!>VQSO,5=rO!>[QSO,5=rO!>aQSO,5=rO9OQ(C[O,5=rO!>oQSO'#EkO!?iQWO'#ElOOQ(CW'#Jp'#JpO!?pQ(C[O'#KOO9OQ(C[O,5=ZO;aQSO,5=aOOQO'#Cr'#CrO!?{QWO,5=^O!@TQ,UO,5=_O!@`QSO,5=aO!@eQ`O,5=dO>QQSO'#G}O9_QSO'#HPO!@mQSO'#HPO9dQ,UO'#HSO!@rQSO'#HSOOQQ,5=g,5=gO!@wQSO'#HTO!APQSO'#ClO!AUQSO,58|O!A`QSO,58|O!ChQUO,58|OOQQ,58|,58|O!CuQ(C[O,58|O%QQUO,58|O!DQQUO'#H[OOQQ'#H]'#H]OOQQ'#H^'#H^O`QUO,5=tO!DbQSO,5=tO`QUO,5=zO`QUO,5=|O!DgQSO,5>OO`QUO,5>QO!DlQSO,5>TO!DqQUO,5>ZOOQQ,5>a,5>aO%QQUO,5>aO9OQ(C[O,5>cOOQQ,5>e,5>eO!HxQSO,5>eOOQQ,5>g,5>gO!HxQSO,5>gOOQQ,5>i,5>iO!H}QWO'#DXO%QQUO'#JgO!IlQWO'#JgO!JZQWO'#DgO!JlQWO'#DgO!L}QUO'#DgO!MUQSO'#JfO!M^QSO,5:QO!McQSO'#EmO!MqQSO'#JsO!MyQSO,5;WO!NOQWO'#DgO!N]QWO'#EROOQ(CY,5:k,5:kO%QQUO,5:kO!NdQSO,5:kO>QQSO,5;RO!uO+sQUO,5>uOOQO,5>{,5>{O#&oQUO'#IZOOQO-EUQ(CjO1G0xO#AUQ$IUO'#CfO#CSQ$IUO1G1ZO#EQQ$IUO'#JdO!*OQSO1G1aO#EeQ(CjO,5?QOOQ(CW-EQQSO'#HsOOQQ1G3u1G3uO$0}QUO1G3uO9OQ(C[O1G3{OOQQ1G3}1G3}OOQ(CW'#GW'#GWO9OQ(C[O1G4PO9OQ(C[O1G4RO$5RQSO,5@RO!'xQUO,5;XO:vQSO,5;XO>QQSO,5:RO!'xQUO,5:RO!QQSO1G0mO!uO$:qQSO1G5kO$:yQSO1G5wO$;RQbO1G5xO:vQSO,5>{O$;]QSO1G5tO$;]QSO1G5tO:vQSO1G5tO$;eQ(CjO1G5uO%QQUO1G5uO$;uQ(C[O1G5uO$}O:vQSO,5>}OOQO,5>},5>}O$}OOQO-EQQWO,59pO%QQUO,59pO% mQSO1G2SO!%lQ,UO1G2ZO% rQ(CjO7+'gOOQ(CY7+'g7+'gO!!PQUO7+'gOOQ(CY7+%`7+%`O%!fQ`O'#J|O!NgQSO7+(]O%!pQbO7+(]O$<}QSO7+(]O%!wQ(ChO'#CfO%#[Q(ChO,5<{O%#|QSO,5<{OOQ(CW1G5`1G5`OOQQ7+$^7+$^O!VOOQQ,5>V,5>VO%QQUO'#HlO%)^QSO'#HnOOQQ,5>],5>]O:vQSO,5>]OOQQ,5>_,5>_OOQQ7+)a7+)aOOQQ7+)g7+)gOOQQ7+)k7+)kOOQQ7+)m7+)mO%)cQWO1G5mO%)wQ$IUO1G0sO%*RQSO1G0sOOQO1G/m1G/mO%*^Q$IUO1G/mO>QQSO1G/mO!'xQUO'#DgOOQO,5>v,5>vOOQO-E|,5>|OOQO-E<`-E<`O!QQSO7+&XO!wOOQO-ExO%QQUO,5>xOOQO-E<[-E<[O%5iQSO1G5oOOQ(CY<}Q$IUO1G0xO%?UQ$IUO1G0xO%AYQ$IUO1G0xO%AaQ$IUO1G0xO%CXQ$IUO1G0xO%ClQ(CjO<WOOQQ,5>Y,5>YO&&aQSO1G3wO:vQSO7+&_O!'xQUO7+&_OOQO7+%X7+%XO&&fQ$IUO1G5xO>QQSO7+%XOOQ(CY<QQSO<[QWO,5=mO&>mQWO,5:zOOQQ<QQSO7+)cO&@ZQSO<zAN>zO%QQUOAN?WO!zO&@pQ(C[OAN?WO!zO&@{Q(C[OAN?WOBzQWOAN>zO&AZQ(C[OAN?WO&AoQ(C`OAN?WO&AyQWOAN>zOBzQWOAN?WOOQO<ROy)uO|)vO(h)xO(i)zO~O#d#Wa^#Wa#X#Wa'k#Wa!V#Wa!g#Wa!X#Wa!S#Wa~P#*rO#d(QXP(QXX(QX^(QXk(QXz(QX!e(QX!h(QX!l(QX#g(QX#h(QX#i(QX#j(QX#k(QX#l(QX#m(QX#n(QX#o(QX#q(QX#s(QX#u(QX#v(QX'k(QX(R(QX(a(QX!g(QX!S(QX'i(QXo(QX!X(QX%a(QX!a(QX~P!1}O!V.bOd([X~P!.aOd.dO~O!V.eO!g(]X~P!4aO!g.hO~O!S.jO~OP$ZOy#wOz#xO|#yO!f#uO!h#vO!l$ZO(RVOX#fi^#fik#fi!V#fi!e#fi#h#fi#i#fi#j#fi#k#fi#l#fi#m#fi#n#fi#o#fi#q#fi#s#fi#u#fi#v#fi'k#fi(a#fi(h#fi(i#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~O#g#fi~P#.nO#g#|O~P#.nOP$ZOy#wOz#xO|#yO!f#uO!h#vO!l$ZO#g#|O#h#}O#i#}O#j#}O(RVOX#fi^#fi!V#fi!e#fi#k#fi#l#fi#m#fi#n#fi#o#fi#q#fi#s#fi#u#fi#v#fi'k#fi(a#fi(h#fi(i#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~Ok#fi~P#1`Ok$OO~P#1`OP$ZOk$OOy#wOz#xO|#yO!f#uO!h#vO!l$ZO#g#|O#h#}O#i#}O#j#}O#k$PO(RVO^#fi!V#fi#q#fi#s#fi#u#fi#v#fi'k#fi(a#fi(h#fi(i#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~OX#fi!e#fi#l#fi#m#fi#n#fi#o#fi~P#4QOX$bO!e$QO#l$QO#m$QO#n$aO#o$QO~P#4QOP$ZOX$bOk$OOy#wOz#xO|#yO!e$QO!f#uO!h#vO!l$ZO#g#|O#h#}O#i#}O#j#}O#k$PO#l$QO#m$QO#n$aO#o$QO#q$RO(RVO^#fi!V#fi#s#fi#u#fi#v#fi'k#fi(a#fi(i#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~O(h#fi~P#7RO(h#zO~P#7ROP$ZOX$bOk$OOy#wOz#xO|#yO!e$QO!f#uO!h#vO!l$ZO#g#|O#h#}O#i#}O#j#}O#k$PO#l$QO#m$QO#n$aO#o$QO#q$RO#s$TO(RVO(h#zO^#fi!V#fi#u#fi#v#fi'k#fi(a#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~O(i#fi~P#9sO(i#{O~P#9sOP$ZOX$bOk$OOy#wOz#xO|#yO!e$QO!f#uO!h#vO!l$ZO#g#|O#h#}O#i#}O#j#}O#k$PO#l$QO#m$QO#n$aO#o$QO#q$RO#s$TO#u$VO(RVO(h#zO(i#{O~O^#fi!V#fi#v#fi'k#fi(a#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~P#SOy)uO|)vO(h)xO(i)zO~OP#fiX#fik#fiz#fi!e#fi!f#fi!h#fi!l#fi#g#fi#h#fi#i#fi#j#fi#k#fi#l#fi#m#fi#n#fi#o#fi#q#fi#s#fi#u#fi#v#fi#y#fi(R#fi(a#fi!V#fi!W#fi~P%D`O!f#uOP(QXX(QXg(QXk(QXy(QXz(QX|(QX!e(QX!h(QX!l(QX#g(QX#h(QX#i(QX#j(QX#k(QX#l(QX#m(QX#n(QX#o(QX#q(QX#s(QX#u(QX#v(QX#y(QX(R(QX(a(QX(h(QX(i(QX!V(QX!W(QX~O#y#zi!V#zi!W#zi~P#A]O#y!ni!W!ni~P$$jO!W6|O~O!V'Ya!W'Ya~P#A]O!a#sO(a'fO!V'Za!g'Za~O!V/YO!g(ni~O!V/YO!a#sO!g(ni~Od$uq!V$uq#X$uq#y$uq~P!.aO!S']a!V']a~P#*rO!a7TO~O!V/bO!S(oi~P#*rO!V/bO!S(oi~O!S7XO~O!a#sO#o7^O~Ok7_O!a#sO(a'fO~O!S7aO~Od$wq!V$wq#X$wq#y$wq~P!.aO^$iy!V$iy'k$iy'i$iy!S$iy!g$iyo$iy!X$iy%a$iy!a$iy~P!4aO!V4aO!X(pa~O^#[y!V#[y'k#[y'i#[y!S#[y!g#[yo#[y!X#[y%a#[y!a#[y~P!4aOX7fO~O!V0bO!W(vi~O]7lO~O!a6PO~O(U(sO!V'bX!W'bX~O!V4xO!W(sa~O!h%[O'}%PO^(ZX!a(ZX!l(ZX#X(ZX'k(ZX(a(ZX~O't7uO~P._O!xg#>v#>|#?`#?f#?l#?z#@a#Aq#BP#BV#B]#Bc#Bi#Bs#By#CP#CZ#Cm#CsPPPPPPPPPP#CyPPPPPPP#Dm#I^P#J}#KU#K^PPPP$ h$$^$+P$+S$+V$-g$-j$-m$-tPP$-z$.O$.w$/w$/{$0aPP$0e$0k$0oP$0r$0v$0y$1o$2V$2[$2_$2b$2h$2k$2o$2sR!zRmpOXr!X#b%^&e&g&h&j,`,e1j1mU!pQ'R-QQ%dtQ%lwQ%szQ&]!TS&y!c,xQ'X!f^'^!m!r!s!t!u!v!wS*^$z*cQ+W%mQ+e%uQ,P&VQ-O'QQ-Y'YY-b'_'`'a'b'cQ/s*eQ1X,QW2e-d-f-g-hS5R0}5UU6a2h2j2kU8R5Y5Z5]S8x6d6fS9u8S8TQ:c8{Q:z9xRO>R>SQ%vzQ&w!cS&}%x,{Q+]%oS/Q)v/SQ0O*rQ0g+^Q0l+dQ1`,VQ1a,WQ4i0bQ4r0nQ5l1[Q5m1_Q7h4jQ7k4oQ8b5oQ9j7lR:R8_pmOXr!T!X#b%^&[&e&g&h&j,`,e1j1mR,T&^&z`OPXYrstux!X!^!g!l#Q#b#l#r#v#y#|#}$O$P$Q$R$S$T$U$V$W$Y$_$c$k%^%d%q&^&a&b&e&g&h&j&n&v'T'h'z(Q([(m(q(u)i)t*v+O+j,[,`,e,q,t-U-^-r-{.X.e.l.t/}0S0a1Q1b1c1d1f1j1m1o2O2`2o2y3R3h4z4}5b5t5v5w6Q6Z6p8O8Y8g8s9k:Y:^;V;m;zO!d%iw!f!o%k%l%m&x'W'X'Y']'k*]+V+W,u-X-Y-a-c/k0`2T2[2c2g4U6_6c8v8z:a;YQ+P%gQ+p&OQ+s&PQ+}&VQ.Y(fQ1R+zU1V,O,P,QQ2z.ZQ5c1SS5g1W1XS7t4|5QQ8^5hU9s7z8P8QU:x9t9v9wQ;e:yQ;u;f!z=y#s$a$b$v$y)p)|*Z*}+Q+o+r.W/b/d0t0w1P2x3z4S4a4c5a6m7T7^8V9P9{:g:};^R>Sg=zO>R>ST)q$s)rV*o%TPR>O>Q'QkOPWXYZrstu!X!^!l#Q#U#X#b#l#r#v#y#|#}$O$P$Q$R$S$T$U$V$W$Y$_$c$k%^%d%q&^&a&b&e&g&h&j&n&v&z'T'h'x'z(Q([(m(q(u)i)t*v+O+j,[,`,e,q,t-U-^-r-{.X.e.l.t/}0S0a1Q1b1c1d1f1j1m1o2O2`2o2y3R3h4z4}5b5t5v5w6Q6Z6p8O8Y8g8s9k:Y:^;V;m;zO!z(l#s$a$b$v$y)p)|*Z*}+Q+o+r.W/b/d0t0w1P2x3z4S4a4c5a6m7T7^8V9P9{:g:};^R>SQ*s%XQ/P)ug3eOQ*V$xS*`$z*cQ*t%YQ/o*a!z=h#s$a$b$v$y)p)|*Z*}+Q+o+r.W/b/d0t0w1P2x3z4S4a4c5a6m7T7^8V9P9{:g:};^R>Sf=iO!z(l#s$a$b$v$y)p)|*Z*}+Q+o+r.W/b/d0t0w1P2x3z4S4a4c5a6m7T7^8V9P9{:g:};^R>Sg3eO>R>SQ+q&PQ0v+sQ4v0uR7o4wT*b$z*cS*b$z*cT5T0}5US/m*_4}T4W/u8OQ+R%hQ/n*`Q0]+SQ1T+|Q5e1UQ8[5fQ9n7sQ:O8]Q:t9oQ;P:PQ;c:wQ;s;dQP>Q]=P3d6x9U:i:j;|p){$t(n*u/U/`/w/x3O3w4^6}7`:k=g=s=t!Y=Q(j)Z*P*X._.{/W/e0U0s0u2{2}3x3|4u4w6q6r7U7Y7b7d9`9d;_>P>Q_=R3d6x9U9V:i:j;|pmOXr!T!X#b%^&[&e&g&h&j,`,e1j1mQ&X!SR,[&bpmOXr!T!X#b%^&[&e&g&h&j,`,e1j1mR&X!SQ+u&QR0r+nqmOXr!T!X#b%^&[&e&g&h&j,`,e1j1mQ1O+zS5`1R1SU8U5^5_5cS9z8W8XS:{9y9|Q;g:|R;v;hQ&`!TR,U&[R5l1[S%pz%uR0h+_Q&e!UR,`&fR,f&kT1k,e1mR,j&lQ,i&lR1t,jQ'o!yR-l'oQrOQ#bXT%ar#bQ!|TR'q!|Q#PUR's#PQ)r$sR.|)rQ#SVR'u#SQ#VWU'{#V'|-sQ'|#WR-s'}Q,y&{R2Q,yQ.c(nR3P.cQ.f(pS3S.f3TR3T.gQ-Q'RR2U-Qr_OXr!T!X#b%^&[&^&e&g&h&j,`,e1j1mU!mQ'R-QS#eZ%[Y#o_!m#e-}5OQ-}(_T5O0}5US#]W%wU(S#](T-tQ(T#^R-t(OQ,|'OR2S,|Q(`#hQ-w(XW.R(`-w2l6gQ2l-xR6g2mQ)d$iR.u)dQ$mhR)j$mQ$`cU)Y$`-oP>QQ/c*XU3{/c3}7VQ3}/eR7V3|Q*c$zR/q*cQ*l%OR/z*lQ4b0UR7c4bQ+l%zR0q+lQ4y0xS7q4y9lR9l7rQ+w&RR0{+wQ5U0}R7|5UQ1Z,RS5j1Z8`R8`5lQ0c+ZW4k0c4m7i9hQ4m0fQ7i4lR9h7jQ+`%pR0i+`Q1m,eR5z1mWqOXr#bQ&i!XQ*x%^Q,_&eQ,a&gQ,b&hQ,d&jQ1h,`S1k,e1mR5y1jQ%`oQ&m!]Q&p!_Q&r!`Q&t!aU'g!o5P5QQ+T%jQ+g%vQ+m%{Q,T&`Q,l&oY-]']'i'j'm8QQ-j'eQ/p*bQ0^+US1^,U,XQ1u,kQ1v,nQ1w,oQ2]-[[2_-_-`-c-i-k9wQ4d0_Q4p0lQ4t0sQ5d1TQ5n1`Q5x1iY6X2^2a2d2f2gQ6[2bQ7e4eQ7m4rQ7n4uQ7{5TQ8Z5eQ8a5mY8p6Y6^6`6b6cQ8r6]Q9i7kQ9m7sQ9}8[Q:S8bY:Z8q8u8w8y8zQ:]8tQ:q9jS:s9n9oQ;O:OW;S:[:`:b:dQ;U:_S;a:t:wQ;i;PU;j;T;X;ZQ;l;WS;r;c;dS;w;k;oQ;y;nS;};s;tQOQ>P>RR>Q>SloOXr!X#b%^&e&g&h&j,`,e1j1mQ!dPS#dZ#lQ&o!^U'Z!l4}8OQ't#QQ(w#yQ)h$kS,X&^&aQ,]&bQ,k&nQ,p&vQ-S'TQ.i(uQ.y)iQ0X+OQ0o+jQ1e,[Q2X-UQ2v.XQ3k.tQ4[/}Q5_1QQ5p1bQ5q1cQ5s1dQ5u1fQ5|1oQ6l2yQ6{3hQ8X5bQ8f5tQ8h5vQ8i5wQ9R6pQ9|8YR:U8g#UcOPXZr!X!^!l#b#l#y%^&^&a&b&e&g&h&j&n&v'T(u+O+j,[,`,e-U.X/}1Q1b1c1d1f1j1m1o2y4}5b5t5v5w6p8O8Y8gQ#WWQ#cYQ%bsQ%ctQ%euS'w#U'zQ'}#XQ(i#rQ(p#vQ(x#|Q(y#}Q(z$OQ({$PQ(|$QQ(}$RQ)O$SQ)P$TQ)Q$UQ)R$VQ)S$WQ)U$YQ)X$_Q)]$cW)g$k)i.t3hQ*{%dQ+a%qS,v&z2OQ-k'hS-p'x-rQ-u(QQ-z([Q.a(mQ.g(qQ.k 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 declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies 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:363,context:Ti,nodeProps:[["group",-26,6,14,16,62,199,203,206,207,209,212,215,226,228,234,236,238,240,243,249,255,257,259,261,263,265,266,"Statement",-32,10,11,25,28,29,35,45,48,49,51,56,64,72,76,78,80,81,103,104,113,114,131,134,136,137,138,139,141,142,162,163,165,"Expression",-23,24,26,30,34,36,38,166,168,170,171,173,174,175,177,178,179,181,182,183,193,195,197,198,"Type",-3,84,96,102,"ClassItem"],["openedBy",31,"InterpolationStart",50,"[",54,"{",69,"(",143,"JSXStartTag",155,"JSXStartTag JSXStartCloseTag"],["closedBy",33,"InterpolationEnd",44,"]",55,"}",70,")",144,"JSXSelfCloseEndTag JSXEndTag",160,"JSXEndTag"]],propSources:[Ci],skippedNodes:[0,3,4,269],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_$d&j'wp'z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$d&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$d&j'z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$d&j'wpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'wpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'wp'z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$d&j'wp'z!b'm(;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'x#S$d&j'n(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$d&j'wp'z!b'n(;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`$d&j!l$Ip'wp'z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#q$Id$d&j'wp'z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#q$Id$d&j'wp'z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'v$(n$d&j'z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$d&j'z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$d&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$_#t$d&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$d&j'z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$_#t'z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hg$d&j'wp'z!bOY%ZYZ&cZr%Zrs&}st%Ztu`k$d&j'wp'z!b(U!LY't&;d$W#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$d&j'wp'z!b$W#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`$d&j'wp'z!b#i$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_$d&j#{$Id'wp'z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%DfETa(i%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$d&j'wp'z!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$d&j#y%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$d&j'wp'z!b'n(;d(U!LY't&;d$W#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:[Wi,_i,2,3,4,5,6,7,8,9,10,11,12,13,Ui,new XO("$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(T~~",141,326),new XO("j~RQYZXz{^~^O'q~~aP!P!Qd~iO'r~~",25,308)],topRules:{Script:[0,5],SingleExpression:[1,267],SingleClassItem:[2,268]},dialects:{jsx:13525,ts:13527},dynamicPrecedences:{76:1,78:1,163:1,191:1},specialized:[{term:312,get:e=>Vi[e]||-1},{term:328,get:e=>qi[e]||-1},{term:67,get:e=>Ri[e]||-1}],tokenPrec:13551}),ji=[X("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),X("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),X("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),X("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),X("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),X(`try { +import{S as gt,i as Pt,s as mt,e as Xt,f as Zt,T as N,g as bt,y as RO,o as kt,I as xt,J as yt,K as wt,H as Yt,C as vt,L as Tt}from"./index-1d58e6ce.js";import{P as Ut,N as Wt,u as _t,D as Ct,v as wO,T as D,I as YO,w as rO,x as l,y as Vt,L as sO,z as nO,A as j,B as lO,F as ye,G as oO,H as C,J as we,K as Ye,M as ve,E as v,O as G,Q as qt,R as Rt,U as Te,V as X,W as zt,X as jt,a as V,h as Gt,b as At,c as It,d as Nt,e as Et,s as Bt,t as Dt,f as Jt,g as Lt,r as Mt,i as Ht,k as Ft,j as Kt,l as Oa,m as ea,n as ta,o as aa,p as ia,q as zO,C as E}from"./index-c4d2d831.js";class H{constructor(O,a,t,i,r,s,n,o,Q,u=0,c){this.p=O,this.stack=a,this.state=t,this.reducePos=i,this.pos=r,this.score=s,this.buffer=n,this.bufferBase=o,this.curContext=Q,this.lookAhead=u,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 i=O.parser.context;return new H(O,[],a,t,t,0,[],0,i?new jO(i,i.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,i=O&65535,{parser:r}=this.p,s=r.dynamicPrecedence(i);if(s&&(this.score+=s),t==0){this.pushState(r.getGoto(this.state,i,!0),this.reducePos),i=2e3&&!(!((a=this.p.parser.nodeSet.types[i])===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(i,o)}storeNode(O,a,t,i=4,r=!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(!r||this.pos==t)this.buffer.push(O,a,t,i);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,i>4&&(i-=4);this.buffer[s]=O,this.buffer[s+1]=a,this.buffer[s+2]=t,this.buffer[s+3]=i}}shift(O,a,t){let i=this.pos;if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=t,this.shiftContext(a,i),a<=this.p.parser.maxNode&&this.buffer.push(a,i,t,4);else{let r=O,{parser:s}=this.p;(t>this.pos||a<=s.maxNode)&&(this.pos=t,s.stateFlag(r,1)||(this.reducePos=t)),this.pushState(r,i),this.shiftContext(a,i),a<=s.maxNode&&this.buffer.push(a,i,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 i=this.pos;this.reducePos=this.pos=i+O.length,this.pushState(a,i),this.buffer.push(t,i,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),i=O.bufferBase+a;for(;O&&i==O.bufferBase;)O=O.parent;return new H(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,i,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 ra(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 i=[];for(let r=0,s;ro&1&&n==s)||i.push(a[r],s)}a=i}let t=[];for(let i=0;i>19,i=O&65535,r=this.stack.length-t*3;if(r<0||a.getGoto(this.stack[r],i,!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 jO{constructor(O,a){this.tracker=O,this.context=a,this.hash=O.strict?O.hash(a):0}}var GO;(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"})(GO||(GO={}));class ra{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 i=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=i}}class F{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 F(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 F(this.stack,this.pos,this.index)}}function z(e,O=Uint16Array){if(typeof e!="string")return e;let a=null;for(let t=0,i=0;t=92&&s--,s>=34&&s--;let o=s-32;if(o>=46&&(o-=46,n=!0),r+=o,n)break;r*=46}a?a[i++]=r:a=new O(r)}return a}class J{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 J;class sa{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,i=this.rangeIndex,r=this.pos+O;for(;rt.to:r>=t.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];r+=s.from-t.to,t=s}return r}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,i;if(a>=0&&a=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}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 i of this.ranges){if(i.from>=a)break;i.to>O&&(t+=this.input.read(Math.max(i.from,O),Math.min(i.to,a)))}return t}}class W{constructor(O,a){this.data=O,this.id=a}token(O,a){let{parser:t}=a.p;Ue(this.data,O,a,this.id,t.data,t.tokenPrecTable)}}W.prototype.contextual=W.prototype.fallback=W.prototype.extend=!1;class XO{constructor(O,a,t){this.precTable=a,this.elseToken=t,this.data=typeof O=="string"?z(O):O}token(O,a){let t=O.pos,i;for(;i=O.pos,Ue(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(i+1,O.token)}i>t&&(O.reset(t,O.token),O.acceptToken(this.elseToken,i-t))}}XO.prototype.contextual=W.prototype.fallback=W.prototype.extend=!1;class b{constructor(O,a={}){this.token=O,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function Ue(e,O,a,t,i,r){let s=0,n=1<0){let p=e[h];if(o.allows(p)&&(O.token.value==-1||O.token.value==p||na(p,O.token.value,i,r))){O.acceptToken(p);break}}let u=O.next,c=0,f=e[s+2];if(O.next<0&&f>c&&e[Q+f*3-3]==65535&&e[Q+f*3-3]==65535){s=e[Q+f*3-1];continue O}for(;c>1,p=Q+h+(h<<1),$=e[p],g=e[p+1]||65536;if(u<$)f=h;else if(u>=g)c=h+1;else{s=e[p+2],O.advance();continue O}}break}}function IO(e,O,a){for(let t=O,i;(i=e[t])!=65535;t++)if(i==a)return t-O;return-1}function na(e,O,a,t){let i=IO(a,t,O);return i<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 la{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?EO(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?EO(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(r instanceof D){if(s==O){if(s=Math.max(this.safeFrom,O)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[a]++,this.nextStart=s+r.length}}}class oa{constructor(O,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(t=>new J)}getActions(O){let a=0,t=null,{parser:i}=O.p,{tokenizers:r}=i,s=i.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 f=a;if(c.extended>-1&&(a=this.addActions(O,c.extended,c.end,a)),a=this.addActions(O,c.value,c.end,a),!u.extend&&(t=c,a>f))break}}for(;this.actions.length>a;)this.actions.pop();return o&&O.setLookAhead(o),!t&&O.pos==this.stream.end&&(t=new J,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 J,{pos:t,p:i}=O;return a.start=t,a.end=Math.min(t+1,i.stream.end),a.value=t==i.stream.end?i.parser.eofTerm:0,a}updateCachedToken(O,a,t){let i=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(i,O),t),O.value>-1){let{parser:r}=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(i+1)}putAction(O,a,t,i){for(let r=0;rO.bufferLength*4?new la(t,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,a=this.minStackPos,t=this.stacks=[],i,r;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;{i||(i=[],r=[]),i.push(n);let o=this.tokens.getMainToken(n);r.push(o.value,o.end)}}break}}if(!t.length){let s=i&&ha(i);if(s)return this.stackToTree(s);if(this.parser.strict)throw Z&&i&&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&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,r,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&&i>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let Q=O.curContext&&O.curContext.tracker.strict,u=Q?O.curContext.hash:0;for(let c=this.fragments.nodeAt(i);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?r.getGoto(O.state,c.type.id):-1;if(f>-1&&c.length&&(!Q||(c.prop(wO.contextHash)||0)==u))return O.useNode(c,f),Z&&console.log(s+this.stackID(O)+` (via reuse of ${r.getName(c.type.id)})`),!0;if(!(c instanceof D)||c.children.length==0||c.positions[0]>0)break;let h=c.children[0];if(h instanceof D&&c.positions[0]==0)c=h;else break}}let n=r.stateSlot(O.state,4);if(n>0)return O.reduce(n),Z&&console.log(s+this.stackID(O)+` (via always-reduce ${r.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;Qi?a.push(p):t.push(p)}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 i=null,r=!1;for(let s=0;s ":"";if(n.deadEnd&&(r||(r=!0,n.restart(),Z&&console.log(u+this.stackID(n)+" (restarted)"),this.advanceFully(n,t))))continue;let c=n.split(),f=u;for(let h=0;c.forceReduce()&&h<10&&(Z&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));h++)Z&&(f=this.stackID(c)+" -> ");for(let h of n.recoverByInsert(o))Z&&console.log(u+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),Z&&console.log(u+this.stackID(n)+` (via recover-delete ${this.parser.getName(o)})`),DO(n,t)):(!i||i.scoree;class We{constructor(O){this.start=O.start,this.shift=O.shift||uO,this.reduce=O.reduce||uO,this.reuse=O.reuse||uO,this.hash=O.hash||(()=>0),this.strict=O.strict!==!1}}class T extends Ut{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]),i=[];for(let n=0;n=0)r(u,o,n[Q++]);else{let c=n[Q+-u];for(let f=-u;f>0;f--)r(n[Q++],o,c);Q++}}}this.nodeSet=new Wt(a.map((n,o)=>_t.define({name:o>=this.minRepeatTerm?void 0:n,id:o,props:i[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=Ct;let s=z(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 W(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 i=new Qa(this,O,a,t);for(let r of this.wrappers)i=r(i,O,a,t);return i}getGoto(O,a,t=!1){let i=this.goto;if(a>=i[0])return-1;for(let r=i[a+1];;){let s=i[r++],n=s&1,o=i[r++];if(n&&t)return o;for(let Q=r+(s>>1);r0}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=k(this.data,t+2);else return!1;if(a==k(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=k(this.data,t+2);else break;if(!(this.data[t+2]&1)){let i=this.data[t+1];a.some((r,s)=>s&1&&r==i)||a.push(this.data[t],i)}}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 i=O.tokenizers.find(r=>r.from==t);return i?i.to:t})),O.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,i)=>{let r=O.specializers.find(n=>n.from==t.external);if(!r)return t;let s=Object.assign(Object.assign({},t),{external:r.to});return a.specializers[i]=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 r of O.split(" ")){let s=a.indexOf(r);s>=0&&(t[s]=!0)}let i=null;for(let r=0;rt)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.scoree.external(a,t)<<1|O}return e.get}const ua=54,fa=1,da=55,pa=2,Sa=56,$a=3,LO=4,ga=5,K=6,_e=7,Ce=8,Ve=9,qe=10,Pa=11,ma=12,Xa=13,fO=57,Za=14,MO=58,Re=20,ba=22,ze=23,ka=24,ZO=26,je=27,xa=28,ya=31,wa=34,Ya=36,va=37,Ta=0,Ua=1,Wa={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},_a={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 Ca(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 bO(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 i="";for(;Ca(t);)i+=String.fromCharCode(t),t=e.peek(++O);return KO=e,Oe=a,FO=i?i.toLowerCase():t==Va||t==qa?void 0:null}const Ae=60,OO=62,vO=47,Va=63,qa=33,Ra=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(bO(t,1)||"",e):e},reduce(e,O){return O==Re&&e?e.parent:e},reuse(e,O,a,t){let i=O.type.id;return i==K||i==Ya?new ee(bO(t,1)||"",e):e},hash(e){return e?e.hash:0},strict:!1}),Ga=new b((e,O)=>{if(e.next!=Ae){e.next<0&&O.context&&e.acceptToken(fO);return}e.advance();let a=e.next==vO;a&&e.advance();let t=bO(e,0);if(t===void 0)return;if(!t)return e.acceptToken(a?Za:K);let i=O.context?O.context.name:null;if(a){if(t==i)return e.acceptToken(Pa);if(i&&_a[i])return e.acceptToken(fO,-2);if(O.dialectEnabled(Ta))return e.acceptToken(ma);for(let r=O.context;r;r=r.parent)if(r.name==t)return;e.acceptToken(Xa)}else{if(t=="script")return e.acceptToken(_e);if(t=="style")return e.acceptToken(Ce);if(t=="textarea")return e.acceptToken(Ve);if(Wa.hasOwnProperty(t))return e.acceptToken(qe);i&&HO[i]&&HO[i][t]?e.acceptToken(fO,-1):e.acceptToken(K)}},{contextual:!0}),Aa=new b(e=>{for(let O=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(MO);break}if(e.next==Ra)O++;else if(e.next==OO&&O>=2){a>3&&e.acceptToken(MO,-2);break}else O=0;e.advance()}});function Ia(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const Na=new b((e,O)=>{if(e.next==vO&&e.peek(1)==OO){let a=O.dialectEnabled(Ua)||Ia(O.context);e.acceptToken(a?ga:LO,2)}else e.next==OO&&e.acceptToken(LO,1)});function TO(e,O,a){let t=2+e.length;return new b(i=>{for(let r=0,s=0,n=0;;n++){if(i.next<0){n&&i.acceptToken(O);break}if(r==0&&i.next==Ae||r==1&&i.next==vO||r>=2&&rs?i.acceptToken(O,-s):i.acceptToken(a,-(s-2));break}else if((i.next==10||i.next==13)&&n){i.acceptToken(O,1);break}else r=s=0;i.advance()}})}const Ea=TO("script",ua,fa),Ba=TO("style",da,pa),Da=TO("textarea",Sa,$a),Ja=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}),La=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:[Ja],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:[Ea,Ba,Da,Na,Ga,Aa,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(ze)){let i=t.getChild(ka),r=t.getChild(ZO)||t.getChild(je);i&&(a[O.read(i.from,i.to)]=r?r.type.id==ZO?O.read(r.from+1,r.to-1):O.read(r.from,r.to):"")}return a}function te(e,O){let a=e.getChild(ba);return a?O.read(a.from,a.to):" "}function dO(e,O,a){let t;for(let i of a)if(!i.attrs||i.attrs(t||(t=Ie(e.node.parent.firstChild,O))))return{parser:i.parser};return null}function Ne(e=[],O=[]){let a=[],t=[],i=[],r=[];for(let n of e)(n.tag=="script"?a:n.tag=="style"?t:n.tag=="textarea"?i:r).push(n);let s=O.length?Object.create(null):null;for(let n of O)(s[n.name]||(s[n.name]=[])).push(n);return Vt((n,o)=>{let Q=n.type.id;if(Q==xa)return dO(n,o,a);if(Q==ya)return dO(n,o,t);if(Q==wa)return dO(n,o,i);if(Q==Re&&r.length){let u=n.node,c=u.firstChild,f=c&&te(c,o),h;if(f){for(let p of r)if(p.tag==f&&(!p.attrs||p.attrs(h||(h=Ie(u,o))))){let $=u.lastChild;return{parser:p.parser,overlay:[{from:c.to,to:$.type.id==va?$.from:u.to}]}}}}if(s&&Q==ze){let u=n.node,c;if(c=u.firstChild){let f=s[o.read(c.from,c.to)];if(f)for(let h of f){if(h.tagName&&h.tagName!=te(u.parent,o))continue;let p=u.lastChild;if(p.type.id==ZO){let $=p.from+1,g=p.lastChild,w=p.to-(g&&g.isError?0:1);if(w>$)return{parser:h.parser,overlay:[{from:$,to:w}]}}else if(p.type.id==je)return{parser:h.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}const Ma=94,ae=1,Ha=95,Fa=96,ie=2,Ee=[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],Ka=58,Oi=40,Be=95,ei=91,L=45,ti=46,ai=35,ii=37;function eO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function ri(e){return e>=48&&e<=57}const si=new b((e,O)=>{for(let a=!1,t=0,i=0;;i++){let{next:r}=e;if(eO(r)||r==L||r==Be||a&&ri(r))!a&&(r!=L||i>0)&&(a=!0),t===i&&r==L&&t++,e.advance();else{a&&e.acceptToken(r==Oi?Ha:t==2&&O.canShift(ie)?ie:Fa);break}}}),ni=new b(e=>{if(Ee.includes(e.peek(-1))){let{next:O}=e;(eO(O)||O==Be||O==ai||O==ti||O==ei||O==Ka||O==L)&&e.acceptToken(Ma)}}),li=new b(e=>{if(!Ee.includes(e.peek(-1))){let{next:O}=e;if(O==ii&&(e.advance(),e.acceptToken(ae)),eO(O)){do e.advance();while(eO(e.next));e.acceptToken(ae)}}}),oi=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}),Qi={__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},ci={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},hi={__proto__:null,not:128,only:128,from:158,to:160},ui=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:[ni,li,si,0,1,2,3],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:95,get:e=>Qi[e]||-1},{term:56,get:e=>ci[e]||-1},{term:96,get:e=>hi[e]||-1}],tokenPrec:1123});let pO=null;function SO(){if(!pO&&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,i=>"-"+i.toLowerCase())),a.has(t)||(O.push(t),a.add(t)));pO=O.sort().map(t=>({type:"property",label:t}))}return pO||[]}const re=["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}))),fi=["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})),y=/^(\w[\w-]*|-\w[\w-]*|)$/,di=/^-(-[\w-]*)?$/;function pi(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 ne=new we,Si=["Declaration"];function $i(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=ne.get(O);if(a)return a;let t=[],i=new Set,r=O.cursor(YO.IncludeAnonymous);if(r.firstChild())do for(let s of De(e,r.node))i.has(s.label)||(i.add(s.label),t.push(s));while(r.nextSibling());return ne.set(O,t),t}else{let a=[],t=new Set;return O.cursor().iterate(i=>{var r;if(i.name=="VariableName"&&i.matchContext(Si)&&((r=i.node.nextSibling)===null||r===void 0?void 0:r.name)==":"){let s=e.sliceString(i.from,i.to);t.has(s)||(t.add(s),a.push({label:s,type:"variable"}))}}),a}}const gi=e=>{let{state:O,pos:a}=e,t=C(O).resolveInner(a,-1),i=t.type.isError&&t.from==t.to-1&&O.doc.sliceString(t.from,t.to)=="-";if(t.name=="PropertyName"||(i||t.name=="TagName")&&/^(Block|Styles)$/.test(t.resolve(t.to).name))return{from:t.from,options:SO(),validFor:y};if(t.name=="ValueName")return{from:t.from,options:se,validFor:y};if(t.name=="PseudoClassName")return{from:t.from,options:re,validFor:y};if(t.name=="VariableName"||(e.explicit||i)&&pi(t,O.doc))return{from:t.name=="VariableName"?t.from:a,options:De(O.doc,$i(t)),validFor:di};if(t.name=="TagName"){for(let{parent:n}=t;n;n=n.parent)if(n.name=="Block")return{from:t.from,options:SO(),validFor:y};return{from:t.from,options:fi,validFor:y}}if(!e.explicit)return null;let r=t.resolve(a),s=r.childBefore(a);return s&&s.name==":"&&r.name=="PseudoClassSelector"?{from:a,options:re,validFor:y}:s&&s.name==":"&&r.name=="Declaration"||r.name=="ArgList"?{from:a,options:se,validFor:y}:r.name=="Block"||r.name=="Styles"?{from:a,options:SO(),validFor:y}:null},tO=sO.define({name:"css",parser:ui.configure({props:[nO.add({Declaration:j()}),lO.add({Block:ye})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Pi(){return new oO(tO,tO.data.of({autocomplete:gi}))}const le=302,oe=1,mi=2,Qe=303,Xi=305,Zi=306,bi=3,ki=4,xi=[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],Je=125,yi=59,ce=47,wi=42,Yi=43,vi=45,Ti=new We({start:!1,shift(e,O){return O==bi||O==ki||O==Xi?e:O==Zi},strict:!1}),Ui=new b((e,O)=>{let{next:a}=e;(a==Je||a==-1||O.context)&&O.canShift(Qe)&&e.acceptToken(Qe)},{contextual:!0,fallback:!0}),Wi=new b((e,O)=>{let{next:a}=e,t;xi.indexOf(a)>-1||a==ce&&((t=e.peek(1))==ce||t==wi)||a!=Je&&a!=yi&&a!=-1&&!O.context&&O.canShift(le)&&e.acceptToken(le)},{contextual:!0}),_i=new b((e,O)=>{let{next:a}=e;if((a==Yi||a==vi)&&(e.advance(),a==e.next)){e.advance();let t=!O.context&&O.canShift(oe);e.acceptToken(t?oe:mi)}},{contextual:!0}),Ci=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)}),Vi={__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:221,private:221,protected:221,readonly:223,instanceof:242,satisfies:245,in:246,const:248,import:280,keyof:335,unique:339,infer:345,is:381,abstract:401,implements:403,type:405,let:408,var:410,interface:417,enum:421,namespace:427,module:429,declare:433,global:437,for:458,of:467,while:470,with:474,do:478,if:482,else:484,switch:488,case:494,try:500,catch:504,finally:508,return:512,throw:516,break:520,continue:524,debugger:528},qi={__proto__:null,async:117,get:119,set:121,declare:181,public:183,private:183,protected:183,static:185,abstract:187,override:189,readonly:195,accessor:197,new:385},Ri={__proto__:null,"<":137},zi=T.deserialize({version:14,states:"$EnO`QUOOO%QQUOOO'TQWOOP(bOSOOO*pQ(CjO'#CfO*wOpO'#CgO+VO!bO'#CgO+eO07`O'#DZO-vQUO'#DaO.WQUO'#DlO%QQUO'#DvO0_QUO'#EOOOQ(CY'#EW'#EWO0uQSO'#ETOOQO'#I`'#I`O0}QSO'#GkOOQO'#Ei'#EiO1YQSO'#EhO1_QSO'#EhO3aQ(CjO'#JcO6QQ(CjO'#JdO6nQSO'#FWO6sQ#tO'#FoOOQ(CY'#F`'#F`O7OO&jO'#F`O7^Q,UO'#FvO8tQSO'#FuOOQ(CY'#Jd'#JdOOQ(CW'#Jc'#JcOOQQ'#J}'#J}O8yQSO'#IPO9OQ(C[O'#IQOOQQ'#JP'#JPOOQQ'#IU'#IUQ`QUOOO%QQUO'#DnO9WQUO'#DzO%QQUO'#D|O9_QSO'#GkO9dQ,UO'#ClO9rQSO'#EgO9}QSO'#ErO:SQ,UO'#F_O:qQSO'#GkO:vQSO'#GoO;RQSO'#GoO;aQSO'#GrO;aQSO'#GsO;aQSO'#GuO9_QSO'#GxOQQSO'#HoO>VQ(C]O'#HuO%QQUO'#HwO>bQ(C]O'#HyO>mQ(C]O'#H{O9OQ(C[O'#H}O>xQ(CjO'#CfO?zQWO'#DfQOQSOOO@bQSO'#EPO9dQ,UO'#EgO@mQSO'#EgO@xQ`O'#F_OOQQ'#Cd'#CdOOQ(CW'#Dk'#DkOOQ(CW'#Jg'#JgO%QQUO'#JgOBUQWO'#E`OOQ(CW'#E_'#E_OB`Q(C`O'#E`OBzQWO'#ESOOQO'#Jj'#JjOC`QWO'#ESOCmQWO'#E`ODTQWO'#EfODWQWO'#E`ODqQWO'#E`OAQQWO'#E`OBzQWO'#E`PEbO?MpO'#C`POOO)CDn)CDnOOOO'#IV'#IVOEmOpO,59ROOQ(CY,59R,59ROOOO'#IW'#IWOE{O!bO,59RO%QQUO'#D]OOOO'#IY'#IYOFZO07`O,59uOOQ(CY,59u,59uOFiQUO'#IZOF|QSO'#JeOIOQbO'#JeO+sQUO'#JeOIVQSO,59{OImQSO'#EiOIzQSO'#JrOJVQSO'#JqOJVQSO'#JqOJ_QSO,5;VOJdQSO'#JpOOQ(CY,5:W,5:WOJkQUO,5:WOLlQ(CjO,5:bOM]QSO,5:jOMbQSO'#JnON[Q(C[O'#JoO:vQSO'#JnONcQSO'#JnONkQSO,5;UONpQSO'#JnOOQ(CY'#Cf'#CfO%QQUO'#EOO! dQ`O,5:oOOQO'#Jk'#JkOOQO-E<^-E<^O9_QSO,5=VO! zQSO,5=VO!!PQUO,5;SO!$SQ,UO'#EdO!%gQSO,5;SO!'PQ,UO'#DpO!'WQUO'#DuO!'bQWO,5;]O!'jQWO,5;]O%QQUO,5;]OOQQ'#FO'#FOOOQQ'#FQ'#FQO%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'#FU'#FUO!'xQUO,5;oOOQ(CY,5;t,5;tOOQ(CY,5;u,5;uO!){QSO,5;uOOQ(CY,5;v,5;vO%QQUO'#IfO!*TQ(C[O,5kOOQQ'#JX'#JXOOQQ,5>l,5>lOOQQ-EQQWO,5;yO!>VQSO,5=rO!>[QSO,5=rO!>aQSO,5=rO9OQ(C[O,5=rO!>oQSO'#EkO!?iQWO'#ElOOQ(CW'#Jp'#JpO!?pQ(C[O'#KOO9OQ(C[O,5=ZO;aQSO,5=aOOQO'#Cr'#CrO!?{QWO,5=^O!@TQ,UO,5=_O!@`QSO,5=aO!@eQ`O,5=dO>QQSO'#G}O9_QSO'#HPO!@mQSO'#HPO9dQ,UO'#HSO!@rQSO'#HSOOQQ,5=g,5=gO!@wQSO'#HTO!APQSO'#ClO!AUQSO,58|O!A`QSO,58|O!ChQUO,58|OOQQ,58|,58|O!CuQ(C[O,58|O%QQUO,58|O!DQQUO'#H[OOQQ'#H]'#H]OOQQ'#H^'#H^O`QUO,5=tO!DbQSO,5=tO`QUO,5=zO`QUO,5=|O!DgQSO,5>OO`QUO,5>QO!DlQSO,5>TO!DqQUO,5>ZOOQQ,5>a,5>aO%QQUO,5>aO9OQ(C[O,5>cOOQQ,5>e,5>eO!HxQSO,5>eOOQQ,5>g,5>gO!HxQSO,5>gOOQQ,5>i,5>iO!H}QWO'#DXO%QQUO'#JgO!IlQWO'#JgO!JZQWO'#DgO!JlQWO'#DgO!L}QUO'#DgO!MUQSO'#JfO!M^QSO,5:QO!McQSO'#EmO!MqQSO'#JsO!MyQSO,5;WO!NOQWO'#DgO!N]QWO'#EROOQ(CY,5:k,5:kO%QQUO,5:kO!NdQSO,5:kO>QQSO,5;RO!uO+sQUO,5>uOOQO,5>{,5>{O#&oQUO'#IZOOQO-EUQ(CjO1G0xO#AUQ$IUO'#CfO#CSQ$IUO1G1ZO#EQQ$IUO'#JdO!*OQSO1G1aO#EeQ(CjO,5?QOOQ(CW-EQQSO'#HsOOQQ1G3u1G3uO$0}QUO1G3uO9OQ(C[O1G3{OOQQ1G3}1G3}OOQ(CW'#GW'#GWO9OQ(C[O1G4PO9OQ(C[O1G4RO$5RQSO,5@RO!'xQUO,5;XO:vQSO,5;XO>QQSO,5:RO!'xQUO,5:RO!QQSO1G0mO!uO$:qQSO1G5kO$:yQSO1G5wO$;RQbO1G5xO:vQSO,5>{O$;]QSO1G5tO$;]QSO1G5tO:vQSO1G5tO$;eQ(CjO1G5uO%QQUO1G5uO$;uQ(C[O1G5uO$}O:vQSO,5>}OOQO,5>},5>}O$}OOQO-EQQWO,59pO%QQUO,59pO% mQSO1G2SO!%lQ,UO1G2ZO% rQ(CjO7+'gOOQ(CY7+'g7+'gO!!PQUO7+'gOOQ(CY7+%`7+%`O%!fQ`O'#J|O!NgQSO7+(]O%!pQbO7+(]O$<}QSO7+(]O%!wQ(ChO'#CfO%#[Q(ChO,5<{O%#|QSO,5<{OOQ(CW1G5`1G5`OOQQ7+$^7+$^O!VOOQQ,5>V,5>VO%QQUO'#HlO%)^QSO'#HnOOQQ,5>],5>]O:vQSO,5>]OOQQ,5>_,5>_OOQQ7+)a7+)aOOQQ7+)g7+)gOOQQ7+)k7+)kOOQQ7+)m7+)mO%)cQWO1G5mO%)wQ$IUO1G0sO%*RQSO1G0sOOQO1G/m1G/mO%*^Q$IUO1G/mO>QQSO1G/mO!'xQUO'#DgOOQO,5>v,5>vOOQO-E|,5>|OOQO-E<`-E<`O!QQSO7+&XO!wOOQO-ExO%QQUO,5>xOOQO-E<[-E<[O%5iQSO1G5oOOQ(CY<}Q$IUO1G0xO%?UQ$IUO1G0xO%AYQ$IUO1G0xO%AaQ$IUO1G0xO%CXQ$IUO1G0xO%ClQ(CjO<WOOQQ,5>Y,5>YO&&aQSO1G3wO:vQSO7+&_O!'xQUO7+&_OOQO7+%X7+%XO&&fQ$IUO1G5xO>QQSO7+%XOOQ(CY<QQSO<[QWO,5=mO&>mQWO,5:zOOQQ<QQSO7+)cO&@ZQSO<zAN>zO%QQUOAN?WO!zO&@pQ(C[OAN?WO!zO&@{Q(C[OAN?WOBzQWOAN>zO&AZQ(C[OAN?WO&AoQ(C`OAN?WO&AyQWOAN>zOBzQWOAN?WOOQO<ROy)uO|)vO(h)xO(i)zO~O#d#Wa^#Wa#X#Wa'k#Wa!V#Wa!g#Wa!X#Wa!S#Wa~P#*rO#d(QXP(QXX(QX^(QXk(QXz(QX!e(QX!h(QX!l(QX#g(QX#h(QX#i(QX#j(QX#k(QX#l(QX#m(QX#n(QX#o(QX#q(QX#s(QX#u(QX#v(QX'k(QX(R(QX(a(QX!g(QX!S(QX'i(QXo(QX!X(QX%a(QX!a(QX~P!1}O!V.bOd([X~P!.aOd.dO~O!V.eO!g(]X~P!4aO!g.hO~O!S.jO~OP$ZOy#wOz#xO|#yO!f#uO!h#vO!l$ZO(RVOX#fi^#fik#fi!V#fi!e#fi#h#fi#i#fi#j#fi#k#fi#l#fi#m#fi#n#fi#o#fi#q#fi#s#fi#u#fi#v#fi'k#fi(a#fi(h#fi(i#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~O#g#fi~P#.nO#g#|O~P#.nOP$ZOy#wOz#xO|#yO!f#uO!h#vO!l$ZO#g#|O#h#}O#i#}O#j#}O(RVOX#fi^#fi!V#fi!e#fi#k#fi#l#fi#m#fi#n#fi#o#fi#q#fi#s#fi#u#fi#v#fi'k#fi(a#fi(h#fi(i#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~Ok#fi~P#1`Ok$OO~P#1`OP$ZOk$OOy#wOz#xO|#yO!f#uO!h#vO!l$ZO#g#|O#h#}O#i#}O#j#}O#k$PO(RVO^#fi!V#fi#q#fi#s#fi#u#fi#v#fi'k#fi(a#fi(h#fi(i#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~OX#fi!e#fi#l#fi#m#fi#n#fi#o#fi~P#4QOX$bO!e$QO#l$QO#m$QO#n$aO#o$QO~P#4QOP$ZOX$bOk$OOy#wOz#xO|#yO!e$QO!f#uO!h#vO!l$ZO#g#|O#h#}O#i#}O#j#}O#k$PO#l$QO#m$QO#n$aO#o$QO#q$RO(RVO^#fi!V#fi#s#fi#u#fi#v#fi'k#fi(a#fi(i#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~O(h#fi~P#7RO(h#zO~P#7ROP$ZOX$bOk$OOy#wOz#xO|#yO!e$QO!f#uO!h#vO!l$ZO#g#|O#h#}O#i#}O#j#}O#k$PO#l$QO#m$QO#n$aO#o$QO#q$RO#s$TO(RVO(h#zO^#fi!V#fi#u#fi#v#fi'k#fi(a#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~O(i#fi~P#9sO(i#{O~P#9sOP$ZOX$bOk$OOy#wOz#xO|#yO!e$QO!f#uO!h#vO!l$ZO#g#|O#h#}O#i#}O#j#}O#k$PO#l$QO#m$QO#n$aO#o$QO#q$RO#s$TO#u$VO(RVO(h#zO(i#{O~O^#fi!V#fi#v#fi'k#fi(a#fi'i#fi!S#fi!g#fio#fi!X#fi%a#fi!a#fi~P#SOy)uO|)vO(h)xO(i)zO~OP#fiX#fik#fiz#fi!e#fi!f#fi!h#fi!l#fi#g#fi#h#fi#i#fi#j#fi#k#fi#l#fi#m#fi#n#fi#o#fi#q#fi#s#fi#u#fi#v#fi#y#fi(R#fi(a#fi!V#fi!W#fi~P%D`O!f#uOP(QXX(QXg(QXk(QXy(QXz(QX|(QX!e(QX!h(QX!l(QX#g(QX#h(QX#i(QX#j(QX#k(QX#l(QX#m(QX#n(QX#o(QX#q(QX#s(QX#u(QX#v(QX#y(QX(R(QX(a(QX(h(QX(i(QX!V(QX!W(QX~O#y#zi!V#zi!W#zi~P#A]O#y!ni!W!ni~P$$jO!W6|O~O!V'Ya!W'Ya~P#A]O!a#sO(a'fO!V'Za!g'Za~O!V/YO!g(ni~O!V/YO!a#sO!g(ni~Od$uq!V$uq#X$uq#y$uq~P!.aO!S']a!V']a~P#*rO!a7TO~O!V/bO!S(oi~P#*rO!V/bO!S(oi~O!S7XO~O!a#sO#o7^O~Ok7_O!a#sO(a'fO~O!S7aO~Od$wq!V$wq#X$wq#y$wq~P!.aO^$iy!V$iy'k$iy'i$iy!S$iy!g$iyo$iy!X$iy%a$iy!a$iy~P!4aO!V4aO!X(pa~O^#[y!V#[y'k#[y'i#[y!S#[y!g#[yo#[y!X#[y%a#[y!a#[y~P!4aOX7fO~O!V0bO!W(vi~O]7lO~O!a6PO~O(U(sO!V'bX!W'bX~O!V4xO!W(sa~O!h%[O'}%PO^(ZX!a(ZX!l(ZX#X(ZX'k(ZX(a(ZX~O't7uO~P._O!xg#>v#>|#?`#?f#?l#?z#@a#Aq#BP#BV#B]#Bc#Bi#Bs#By#CP#CZ#Cm#CsPPPPPPPPPP#CyPPPPPPP#Dm#I^P#J}#KU#K^PPPP$ h$$^$+P$+S$+V$-g$-j$-m$-tPP$-z$.O$.w$/w$/{$0aPP$0e$0k$0oP$0r$0v$0y$1o$2V$2[$2_$2b$2h$2k$2o$2sR!zRmpOXr!X#b%^&e&g&h&j,`,e1j1mU!pQ'R-QQ%dtQ%lwQ%szQ&]!TS&y!c,xQ'X!f^'^!m!r!s!t!u!v!wS*^$z*cQ+W%mQ+e%uQ,P&VQ-O'QQ-Y'YY-b'_'`'a'b'cQ/s*eQ1X,QW2e-d-f-g-hS5R0}5UU6a2h2j2kU8R5Y5Z5]S8x6d6fS9u8S8TQ:c8{Q:z9xRO>R>SQ%vzQ&w!cS&}%x,{Q+]%oS/Q)v/SQ0O*rQ0g+^Q0l+dQ1`,VQ1a,WQ4i0bQ4r0nQ5l1[Q5m1_Q7h4jQ7k4oQ8b5oQ9j7lR:R8_pmOXr!T!X#b%^&[&e&g&h&j,`,e1j1mR,T&^&z`OPXYrstux!X!^!g!l#Q#b#l#r#v#y#|#}$O$P$Q$R$S$T$U$V$W$Y$_$c$k%^%d%q&^&a&b&e&g&h&j&n&v'T'h'z(Q([(m(q(u)i)t*v+O+j,[,`,e,q,t-U-^-r-{.X.e.l.t/}0S0a1Q1b1c1d1f1j1m1o2O2`2o2y3R3h4z4}5b5t5v5w6Q6Z6p8O8Y8g8s9k:Y:^;V;m;zO!d%iw!f!o%k%l%m&x'W'X'Y']'k*]+V+W,u-X-Y-a-c/k0`2T2[2c2g4U6_6c8v8z:a;YQ+P%gQ+p&OQ+s&PQ+}&VQ.Y(fQ1R+zU1V,O,P,QQ2z.ZQ5c1SS5g1W1XS7t4|5QQ8^5hU9s7z8P8QU:x9t9v9wQ;e:yQ;u;f!z=y#s$a$b$v$y)p)|*Z*}+Q+o+r.W/b/d0t0w1P2x3z4S4a4c5a6m7T7^8V9P9{:g:};^R>Sg=zO>R>ST)q$s)rV*o%TPR>O>Q'QkOPWXYZrstu!X!^!l#Q#U#X#b#l#r#v#y#|#}$O$P$Q$R$S$T$U$V$W$Y$_$c$k%^%d%q&^&a&b&e&g&h&j&n&v&z'T'h'x'z(Q([(m(q(u)i)t*v+O+j,[,`,e,q,t-U-^-r-{.X.e.l.t/}0S0a1Q1b1c1d1f1j1m1o2O2`2o2y3R3h4z4}5b5t5v5w6Q6Z6p8O8Y8g8s9k:Y:^;V;m;zO!z(l#s$a$b$v$y)p)|*Z*}+Q+o+r.W/b/d0t0w1P2x3z4S4a4c5a6m7T7^8V9P9{:g:};^R>SQ*s%XQ/P)ug3eOQ*V$xS*`$z*cQ*t%YQ/o*a!z=h#s$a$b$v$y)p)|*Z*}+Q+o+r.W/b/d0t0w1P2x3z4S4a4c5a6m7T7^8V9P9{:g:};^R>Sf=iO!z(l#s$a$b$v$y)p)|*Z*}+Q+o+r.W/b/d0t0w1P2x3z4S4a4c5a6m7T7^8V9P9{:g:};^R>Sg3eO>R>SQ+q&PQ0v+sQ4v0uR7o4wT*b$z*cS*b$z*cT5T0}5US/m*_4}T4W/u8OQ+R%hQ/n*`Q0]+SQ1T+|Q5e1UQ8[5fQ9n7sQ:O8]Q:t9oQ;P:PQ;c:wQ;s;dQP>Q]=P3d6x9U:i:j;|p){$t(n*u/U/`/w/x3O3w4^6}7`:k=g=s=t!Y=Q(j)Z*P*X._.{/W/e0U0s0u2{2}3x3|4u4w6q6r7U7Y7b7d9`9d;_>P>Q_=R3d6x9U9V:i:j;|pmOXr!T!X#b%^&[&e&g&h&j,`,e1j1mQ&X!SR,[&bpmOXr!T!X#b%^&[&e&g&h&j,`,e1j1mR&X!SQ+u&QR0r+nqmOXr!T!X#b%^&[&e&g&h&j,`,e1j1mQ1O+zS5`1R1SU8U5^5_5cS9z8W8XS:{9y9|Q;g:|R;v;hQ&`!TR,U&[R5l1[S%pz%uR0h+_Q&e!UR,`&fR,f&kT1k,e1mR,j&lQ,i&lR1t,jQ'o!yR-l'oQrOQ#bXT%ar#bQ!|TR'q!|Q#PUR's#PQ)r$sR.|)rQ#SVR'u#SQ#VWU'{#V'|-sQ'|#WR-s'}Q,y&{R2Q,yQ.c(nR3P.cQ.f(pS3S.f3TR3T.gQ-Q'RR2U-Qr_OXr!T!X#b%^&[&^&e&g&h&j,`,e1j1mU!mQ'R-QS#eZ%[Y#o_!m#e-}5OQ-}(_T5O0}5US#]W%wU(S#](T-tQ(T#^R-t(OQ,|'OR2S,|Q(`#hQ-w(XW.R(`-w2l6gQ2l-xR6g2mQ)d$iR.u)dQ$mhR)j$mQ$`cU)Y$`-oP>QQ/c*XU3{/c3}7VQ3}/eR7V3|Q*c$zR/q*cQ*l%OR/z*lQ4b0UR7c4bQ+l%zR0q+lQ4y0xS7q4y9lR9l7rQ+w&RR0{+wQ5U0}R7|5UQ1Z,RS5j1Z8`R8`5lQ0c+ZW4k0c4m7i9hQ4m0fQ7i4lR9h7jQ+`%pR0i+`Q1m,eR5z1mWqOXr#bQ&i!XQ*x%^Q,_&eQ,a&gQ,b&hQ,d&jQ1h,`S1k,e1mR5y1jQ%`oQ&m!]Q&p!_Q&r!`Q&t!aU'g!o5P5QQ+T%jQ+g%vQ+m%{Q,T&`Q,l&oY-]']'i'j'm8QQ-j'eQ/p*bQ0^+US1^,U,XQ1u,kQ1v,nQ1w,oQ2]-[[2_-_-`-c-i-k9wQ4d0_Q4p0lQ4t0sQ5d1TQ5n1`Q5x1iY6X2^2a2d2f2gQ6[2bQ7e4eQ7m4rQ7n4uQ7{5TQ8Z5eQ8a5mY8p6Y6^6`6b6cQ8r6]Q9i7kQ9m7sQ9}8[Q:S8bY:Z8q8u8w8y8zQ:]8tQ:q9jS:s9n9oQ;O:OW;S:[:`:b:dQ;U:_S;a:t:wQ;i;PU;j;T;X;ZQ;l;WS;r;c;dS;w;k;oQ;y;nS;};s;tQOQ>P>RR>Q>SloOXr!X#b%^&e&g&h&j,`,e1j1mQ!dPS#dZ#lQ&o!^U'Z!l4}8OQ't#QQ(w#yQ)h$kS,X&^&aQ,]&bQ,k&nQ,p&vQ-S'TQ.i(uQ.y)iQ0X+OQ0o+jQ1e,[Q2X-UQ2v.XQ3k.tQ4[/}Q5_1QQ5p1bQ5q1cQ5s1dQ5u1fQ5|1oQ6l2yQ6{3hQ8X5bQ8f5tQ8h5vQ8i5wQ9R6pQ9|8YR:U8g#UcOPXZr!X!^!l#b#l#y%^&^&a&b&e&g&h&j&n&v'T(u+O+j,[,`,e-U.X/}1Q1b1c1d1f1j1m1o2y4}5b5t5v5w6p8O8Y8gQ#WWQ#cYQ%bsQ%ctQ%euS'w#U'zQ'}#XQ(i#rQ(p#vQ(x#|Q(y#}Q(z$OQ({$PQ(|$QQ(}$RQ)O$SQ)P$TQ)Q$UQ)R$VQ)S$WQ)U$YQ)X$_Q)]$cW)g$k)i.t3hQ*{%dQ+a%qS,v&z2OQ-k'hS-p'x-rQ-u(QQ-z([Q.a(mQ.g(qQ.k 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 declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies 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:363,context:Ti,nodeProps:[["group",-26,6,14,16,62,199,203,206,207,209,212,215,226,228,234,236,238,240,243,249,255,257,259,261,263,265,266,"Statement",-32,10,11,25,28,29,35,45,48,49,51,56,64,72,76,78,80,81,103,104,113,114,131,134,136,137,138,139,141,142,162,163,165,"Expression",-23,24,26,30,34,36,38,166,168,170,171,173,174,175,177,178,179,181,182,183,193,195,197,198,"Type",-3,84,96,102,"ClassItem"],["openedBy",31,"InterpolationStart",50,"[",54,"{",69,"(",143,"JSXStartTag",155,"JSXStartTag JSXStartCloseTag"],["closedBy",33,"InterpolationEnd",44,"]",55,"}",70,")",144,"JSXSelfCloseEndTag JSXEndTag",160,"JSXEndTag"]],propSources:[Ci],skippedNodes:[0,3,4,269],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_$d&j'wp'z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$d&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$d&j'z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$d&j'wpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'wpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'wp'z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$d&j'wp'z!b'm(;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'x#S$d&j'n(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$d&j'wp'z!b'n(;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`$d&j!l$Ip'wp'z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#q$Id$d&j'wp'z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#q$Id$d&j'wp'z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'v$(n$d&j'z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$d&j'z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$d&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$_#t$d&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$d&j'z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$_#t'z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hg$d&j'wp'z!bOY%ZYZ&cZr%Zrs&}st%Ztu`k$d&j'wp'z!b(U!LY't&;d$W#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$d&j'wp'z!b$W#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`$d&j'wp'z!b#i$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_$d&j#{$Id'wp'z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%DfETa(i%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$d&j'wp'z!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$d&j#y%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$d&j'wp'z!b'n(;d(U!LY't&;d$W#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:[Wi,_i,2,3,4,5,6,7,8,9,10,11,12,13,Ui,new XO("$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(T~~",141,326),new XO("j~RQYZXz{^~^O'q~~aP!P!Qd~iO'r~~",25,308)],topRules:{Script:[0,5],SingleExpression:[1,267],SingleClassItem:[2,268]},dialects:{jsx:13525,ts:13527},dynamicPrecedences:{76:1,78:1,163:1,191:1},specialized:[{term:312,get:e=>Vi[e]||-1},{term:328,get:e=>qi[e]||-1},{term:67,get:e=>Ri[e]||-1}],tokenPrec:13551}),ji=[X("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),X("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),X("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),X("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),X("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),X(`try { \${} } catch (\${error}) { \${} @@ -10,5 +10,5 @@ import{S as gt,i as Pt,s as mt,e as Xt,f as Zt,T as N,g as bt,y as RO,o as kt,I constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),X('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),X('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],he=new we,Le=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 Gi=["FunctionDeclaration"],Ai={FunctionDeclaration:q("function"),ClassDeclaration:q("class"),ClassExpression:()=>!0,EnumDeclaration:q("constant"),TypeAliasDeclaration:q("type"),NamespaceDeclaration:q("namespace"),VariableDefinition(e,O){e.matchContext(Gi)||O(e,"variable")},TypeDefinition(e,O){O(e,"type")},__proto__:null};function Me(e,O){let a=he.get(O);if(a)return a;let t=[],i=!0;function r(s,n){let o=e.sliceString(s.from,s.to);t.push({label:o,type:n})}return O.cursor(YO.IncludeAnonymous).iterate(s=>{if(i)i=!1;else if(s.name){let n=Ai[s.name];if(n&&n(s,r)||Le.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}}),he.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 Ii(e){let O=C(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 i=O;i;i=i.parent)Le.has(i.name)&&(t=t.concat(Me(e.state.doc,i)));return{options:t,from:a?O.from:e.pos,validFor:ue}}const x=sO.define({name:"javascript",parser:zi.configure({props:[nO.add({IfStatement:j({except:/^\s*({|else\b)/}),TryStatement:j({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:qt,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:Rt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":j({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}}),lO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":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:"$"}}),Fe={test:e=>/^JSX/.test(e.name),facet:zt({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"),Ni="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 oO(O,[x.data.of({autocomplete:Ye(He,ve(ji.concat(Ni)))}),x.data.of({autocomplete:Ii}),e.jsx?Di:[]])}function Ei(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(!e.parent)return null;e=e.parent}}function fe(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 Bi=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Di=v.inputHandler.of((e,O,a,t)=>{if((Bi?e.composing:e.compositionStarted)||e.state.readOnly||O!=a||t!=">"&&t!="/"||!x.isActiveAt(e.state,O,-1))return!1;let{state:i}=e,r=i.changeByRange(s=>{var n,o;let{head:Q}=s,u=C(i).resolveInner(Q,-1),c;if(u.name=="JSXStartTag"&&(u=u.parent),t==">"&&u.name=="JSXFragmentTag")return{range:G.cursor(Q+1),changes:{from:Q,insert:">"}};if(t=="/"&&u.name=="JSXFragmentTag"){let f=u.parent,h=f==null?void 0:f.parent;if(f.from==Q-1&&((n=h.lastChild)===null||n===void 0?void 0:n.name)!="JSXEndTag"&&(c=fe(i.doc,h==null?void 0:h.firstChild,Q))){let p=`/${c}>`;return{range:G.cursor(Q+p.length),changes:{from:Q,insert:p}}}}else if(t==">"){let f=Ei(u);if(f&&((o=f.lastChild)===null||o===void 0?void 0:o.name)!="JSXEndTag"&&i.sliceDoc(Q,Q+2)!="`}}}return{range:s}});return r.changes.empty?!1:(e.dispatch(r,{userEvent:"input.type",scrollIntoView:!0}),!0)}),R=["_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"],d={},Ji={a:{attrs:{href:null,ping:null,type:null,media:null,target:R,hreflang:null}},abbr:d,address:d,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:d,aside:d,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:d,base:{attrs:{href:null,target:R}},bdi:d,bdo:d,blockquote:{attrs:{cite:null}},body:d,br:d,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:PO,formmethod:gO,formnovalidate:["novalidate"],formtarget:R,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:d,center:d,cite:d,code:d,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:d,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:d,div:d,dl:d,dt:d,em:d,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:d,figure:d,footer:d,form:{attrs:{action:null,name:null,"accept-charset":$O,autocomplete:["on","off"],enctype:PO,method:gO,novalidate:["novalidate"],target:R}},h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:d,hgroup:d,hr:d,html:{attrs:{manifest:null}},i:d,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:R,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:d,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:d,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:d,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:d,noscript:d,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:d,param:{attrs:{name:null,value:null}},pre:d,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:d,rt:d,ruby:d,samp:d,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:$O}},section:d,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:d,source:{attrs:{src:null,type:null,media:null}},span:d,strong:d,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:d,summary:d,sup:d,table:d,tbody:d,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:d,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:d,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:d,time:{attrs:{datetime:null}},title:d,tr:d,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:d,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:d},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},it="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 it)at[e]=null;class aO{constructor(O,a){this.tags=Object.assign(Object.assign({},Ji),O),this.globalAttrs=Object.assign(Object.assign({},at),a),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}aO.default=new aO;function _(e,O,a=e.length){if(!O)return"";let t=O.firstChild,i=t&&t.getChild("TagName");return i?e.sliceString(i.from,Math.min(i.to,a)):""}function QO(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 rt(e,O,a){let t=a.tags[_(e,QO(O,!0))];return(t==null?void 0:t.children)||a.allTags}function UO(e,O){let a=[];for(let t=O;t=QO(t);){let i=_(e,t);if(i&&t.lastChild.name=="CloseTag")break;i&&a.indexOf(i)<0&&(O.name=="EndTag"||O.from>=t.firstChild.to)&&a.push(i)}return a}const st=/^[:\-\.\w\u00b7-\uffff]*$/;function de(e,O,a,t,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:rt(e.doc,a,O).map(s=>({label:s,type:"type"})).concat(UO(e.doc,a).map((s,n)=>({label:"/"+s,apply:"/"+s+r,type:"type",boost:99-n}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function pe(e,O,a,t){let i=/\s*>/.test(e.sliceDoc(t,t+5))?"":">";return{from:a,to:t,options:UO(e.doc,O).map((r,s)=>({label:r,apply:r+i,type:"type",boost:99-s})),validFor:st}}function Li(e,O,a,t){let i=[],r=0;for(let s of rt(e.doc,a,O))i.push({label:"<"+s,type:"type"});for(let s of UO(e.doc,a))i.push({label:"",type:"type",boost:99-r++});return{from:t,to:t,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Mi(e,O,a,t,i){let r=QO(a),s=r?O.tags[_(e.doc,r)]: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:i,options:o.map(Q=>({label:Q,type:"property"})),validFor:st}}function Hi(e,O,a,t,i){var r;let s=(r=a.parent)===null||r===void 0?void 0:r.getChild("AttributeName"),n=[],o;if(s){let Q=e.sliceDoc(s.from,s.to),u=O.globalAttrs[Q];if(!u){let c=QO(a),f=c?O.tags[_(e.doc,c)]:null;u=(f==null?void 0:f.attrs)&&f.attrs[Q]}if(u){let c=e.sliceDoc(t,i).toLowerCase(),f='"',h='"';/^['"]/.test(c)?(o=c[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",h=e.sliceDoc(i,i+1)==c[0]?"":c[0],c=c.slice(1),t++):o=/^[^\s<>='"]*$/;for(let p of u)n.push({label:p,apply:f+p+h,type:"constant"})}}return{from:t,to:i,options:n,validFor:o}}function Fi(e,O){let{state:a,pos:t}=O,i=C(a).resolveInner(t),r=i.resolve(t,-1);for(let s=t,n;i==r&&(n=r.childBefore(s));){let o=n.lastChild;if(!o||!o.type.isError||o.fromFi(t,i)}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:tO.parser}],lt=[{name:"style",parser:tO.parser.configure({top:"Styles"})}].concat(it.map(e=>({name:e,parser:x.parser}))),ot=sO.define({name:"html",parser:La.configure({props:[nO.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")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),M=ot.configure({wrap:Ne(nt,lt)});function Or(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=Ne((e.nestedLanguages||[]).concat(nt),(e.nestedAttributes||[]).concat(lt)));let t=a?ot.configure({wrap:a,dialect:O}):O?M.configure({dialect:O}):M;return new oO(t,[M.data.of({autocomplete:Ki(e)}),e.autoCloseTags!==!1?er:[],tt().support,Pi().support])}const Se=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),er=v.inputHandler.of((e,O,a,t)=>{if(e.composing||e.state.readOnly||O!=a||t!=">"&&t!="/"||!M.isActiveAt(e.state,O,-1))return!1;let{state:i}=e,r=i.changeByRange(s=>{var n,o,Q;let{head:u}=s,c=C(i).resolveInner(u,-1),f;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"&&(f=_(i.doc,c.parent,u))&&!Se.has(f)){let h=e.state.doc.sliceString(u,u+1)===">",p=`${h?"":">"}`;return{range:G.cursor(u+1),changes:{from:u+(h?1:0),insert:p}}}}else if(t=="/"&&c.name=="OpenTag"){let h=c.parent,p=h==null?void 0:h.parent;if(h.from==u-1&&((Q=p.lastChild)===null||Q===void 0?void 0:Q.name)!="CloseTag"&&(f=_(i.doc,p,u))&&!Se.has(f)){let $=e.state.doc.sliceString(u,u+1)===">",g=`/${f}${$?"":">"}`,w=u+g.length+($?1:0);return{range:G.cursor(w),changes:{from:u,insert:g}}}}return{range:s}});return r.changes.empty?!1:(e.dispatch(r,{userEvent:"input.type",scrollIntoView:!0}),!0)}),tr=36,$e=1,ar=2,B=3,mO=4,ir=5,rr=6,sr=7,nr=8,lr=9,or=10,Qr=11,cr=12,hr=13,ur=14,fr=15,dr=16,pr=17,ge=18,Sr=19,Qt=20,ct=21,Pe=22,$r=23,gr=24;function kO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Pr(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 mr(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 ht(e,O){for(;!(e.next!=95&&!kO(e.next));)O!=null&&(O+=String.fromCharCode(e.next)),e.advance();return O}function Xr(e){if(e.next==39||e.next==34||e.next==96){let O=e.next;e.advance(),Y(e,O,!1)}else ht(e)}function me(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 U(e,O){for(let a=0;a!=&|~^/",specialVar:"?",identifierQuotes:'"',words:ut(br,Zr)};function kr(e,O,a,t){let i={};for(let r in xO)i[r]=(e.hasOwnProperty(r)?e:xO)[r];return O&&(i.words=ut(O,a||"",t)),i}function ft(e){return new b(O=>{var a;let{next:t}=O;if(O.advance(),U(t,be)){for(;U(O.next,be);)O.advance();O.acceptToken(tr)}else if(t==36&&O.next==36&&e.doubleDollarQuotedStrings)mr(O),O.acceptToken(B);else if(t==39||t==34&&e.doubleQuotedStrings)Y(O,t,e.backslashEscapes),O.acceptToken(B);else if(t==35&&e.hashComments||t==47&&O.next==47&&e.slashComments)Ze(O),O.acceptToken($e);else if(t==45&&O.next==45&&(!e.spaceAfterDashes||O.peek(1)==32))Ze(O),O.acceptToken($e);else if(t==47&&O.next==42){O.advance();for(let i=-1,r=1;!(O.next<0);)if(O.advance(),i==42&&O.next==47){if(r--,!r){O.advance();break}i=-1}else i==47&&O.next==42?(r++,i=-1):i=O.next;O.acceptToken(ar)}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(B);else if(t==95&&e.charSetCasts)for(let i=0;;i++){if(O.next==39&&i>1){O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(B);break}if(!kO(O.next))break;O.advance()}else if(t==40)O.acceptToken(sr);else if(t==41)O.acceptToken(nr);else if(t==123)O.acceptToken(lr);else if(t==125)O.acceptToken(or);else if(t==91)O.acceptToken(Qr);else if(t==93)O.acceptToken(cr);else if(t==59)O.acceptToken(hr);else if(e.unquotedBitLiterals&&t==48&&O.next==98)O.advance(),me(O),O.acceptToken(Pe);else if((t==98||t==66)&&(O.next==39||O.next==34)){const i=O.next;O.advance(),e.treatBitsAsBytes?(Y(O,i,e.backslashEscapes),O.acceptToken($r)):(me(O,i),O.acceptToken(Pe))}else if(t==48&&(O.next==120||O.next==88)||(t==120||t==88)&&O.next==39){let i=O.next==39;for(O.advance();Pr(O.next);)O.advance();i&&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(ur);else if(t>=48&&t<=57)Xe(O,!1),O.acceptToken(mO);else if(U(t,e.operatorChars)){for(;U(O.next,e.operatorChars);)O.advance();O.acceptToken(fr)}else if(U(t,e.specialVar))O.next==t&&O.advance(),Xr(O),O.acceptToken(pr);else if(U(t,e.identifierQuotes))Y(O,t,!1),O.acceptToken(Sr);else if(t==58||t==44)O.acceptToken(dr);else if(kO(t)){let i=ht(O,String.fromCharCode(t));O.acceptToken(O.next==46?ge:(a=e.words[i.toLowerCase()])!==null&&a!==void 0?a:ge)}})}const dt=ft(xO),xr=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,dt],topRules:{Script:[0,25]},tokenPrec:0});function yO(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 iO(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function yr(e,O){if(O.name=="CompositeIdentifier"){let a=[];for(let t=O.firstChild;t;t=t.nextSibling)iO(t)&&a.push(A(e,t));return a}return[A(e,O)]}function ke(e,O){for(let a=[];;){if(!O||O.name!=".")return a;let t=yO(O);if(!iO(t))return a;a.unshift(A(e,t)),O=yO(t)}}function wr(e,O){let a=C(e).resolveInner(O,-1),t=vr(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:ke(e.doc,yO(a)),aliases:t}:a.name=="."?{from:O,quoted:null,parents:ke(e.doc,a),aliases:t}:{from:O,quoted:null,parents:[],empty:!0,aliases:t}}const Yr=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function vr(e,O){let a;for(let i=O;!a;i=i.parent){if(!i)return null;i.name=="Statement"&&(a=i)}let t=null;for(let i=a.firstChild,r=!1,s=null;i;i=i.nextSibling){let n=i.name=="Keyword"?e.sliceString(i.from,i.to).toLowerCase():null,o=null;if(!r)r=n=="from";else if(n=="as"&&s&&iO(i.nextSibling))o=A(e,i.nextSibling);else{if(n&&Yr.has(n))break;s&&iO(i)&&(o=A(e,i))}o&&(t||(t=Object.create(null)),t[o]=yr(e,s)),s=/Identifier$/.test(i.name)?i:null}return t}function Tr(e,O){return e?O.map(a=>Object.assign(Object.assign({},a),{label:e+a.label+e,apply:void 0})):O}const Ur=/^\w*$/,Wr=/^[`'"]?\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 _r(e,O,a,t,i){let r=new WO,s=r.child(i||"");for(let n in e){let o=n.indexOf("."),u=(o>-1?r.child(n.slice(0,o)):s).child(o>-1?n.slice(o+1):n);u.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 r.children){let o=r.child(n);o.list.length||(o.list=o.childCompletions("type"))}return r.list=s.list.concat(a||r.childCompletions("type")),n=>{let{parents:o,from:Q,quoted:u,empty:c,aliases:f}=wr(n.state,n.pos);if(c&&!n.explicit)return null;f&&o.length==1&&(o=f[o[0]]||o);let h=r;for(let g of o){for(;!h.children||!h.children[g];)if(h==r)h=s;else if(h==s&&t)h=h.child(t);else return null;h=h.child(g)}let p=u&&n.state.sliceDoc(n.pos,n.pos+1)==u,$=h.list;return h==r&&f&&($=$.concat(Object.keys(f).map(g=>({label:g,type:"constant"})))),{from:Q,to:p?n.pos+1:void 0,options:Tr(u,$),validFor:u?Wr:Ur}}}function Cr(e,O){let a=Object.keys(e).map(t=>({label:O?t.toUpperCase():t,type:e[t]==ct?"type":e[t]==Qt?"keyword":"variable",boost:-1}));return Ye(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],ve(a))}let Vr=xr.configure({props:[nO.add({Statement:j()}),lO.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 I{constructor(O,a){this.dialect=O,this.language=a}get extension(){return this.language.extension}static define(O){let a=kr(O,O.keywords,O.types,O.builtin),t=sO.define({name:"sql",parser:Vr.configure({tokenizers:[{from:dt,to:ft(a)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new I(a,t)}}function qr(e,O=!1){return Cr(e.dialect.words,O)}function Rr(e,O=!1){return e.language.data.of({autocomplete:qr(e,O)})}function zr(e){return e.schema?_r(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema):()=>null}function jr(e){return e.schema?(e.dialect||pt).language.data.of({autocomplete:zr(e)}):[]}function xe(e={}){let O=e.dialect||pt;return new oO(O.language,[jr(e),Rr(O,!!e.upperCaseKeywords)])}const pt=I.define({});function Gr(e){let O;return{c(){O=Xt("div"),Zt(O,"class","code-editor"),N(O,"min-height",e[0]?e[0]+"px":null),N(O,"max-height",e[1]?e[1]+"px":"auto")},m(a,t){bt(a,O,t),e[11](O)},p(a,[t]){t&1&&N(O,"min-height",a[0]?a[0]+"px":null),t&2&&N(O,"max-height",a[1]?a[1]+"px":"auto")},i:RO,o:RO,d(a){a&&kt(O),e[11](null)}}}function Ar(e,O,a){let t;xt(e,yt,S=>a(12,t=S));const i=wt();let{id:r=""}=O,{value:s=""}=O,{minHeight:n=null}=O,{maxHeight:o=null}=O,{disabled:Q=!1}=O,{placeholder:u=""}=O,{language:c="javascript"}=O,{singleLine:f=!1}=O,h,p,$=new E,g=new E,w=new E,_O=new E;function cO(){h==null||h.focus()}function St(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0})),i("change",s)}function CO(){if(!r)return;const S=document.querySelectorAll('[for="'+r+'"]');for(let P of S)P.removeEventListener("click",cO)}function VO(){if(!r)return;CO();const S=document.querySelectorAll('[for="'+r+'"]');for(let P of S)P.addEventListener("click",cO)}function qO(){switch(c){case"html":return Or();case"sql-create-index":return xe({dialect:I.define({keywords:"create unique index if not exists on collate asc desc where like isnull notnull date time datetime unixepoch strftime lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let S={};for(let P of t)S[P.name]=vt.getAllCollectionIdentifiers(P);return xe({dialect:I.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:S,upperCaseKeywords:!0});default:return tt()}}Yt(()=>{const S={key:"Enter",run:P=>{f&&i("submit",s)}};return VO(),a(10,h=new v({parent:p,state:V.create({doc:s,extensions:[Gt(),At(),It(),Nt(),Et(),V.allowMultipleSelections.of(!0),Bt(Dt,{fallback:!0}),Jt(),Lt(),Mt(),Ht(),Ft.of([S,...Kt,...Oa,ea.find(P=>P.key==="Mod-d"),...ta,...aa]),v.lineWrapping,ia({icons:!1}),$.of(qO()),_O.of(zO(u)),g.of(v.editable.of(!0)),w.of(V.readOnly.of(!1)),V.transactionFilter.of(P=>f&&P.newDoc.lines>1?[]:P),v.updateListener.of(P=>{!P.docChanged||Q||(a(3,s=P.state.doc.toString()),St())})]})})),()=>{CO(),h==null||h.destroy()}});function $t(S){Tt[S?"unshift":"push"](()=>{p=S,a(2,p)})}return e.$$set=S=>{"id"in S&&a(4,r=S.id),"value"in S&&a(3,s=S.value),"minHeight"in S&&a(0,n=S.minHeight),"maxHeight"in S&&a(1,o=S.maxHeight),"disabled"in S&&a(5,Q=S.disabled),"placeholder"in S&&a(6,u=S.placeholder),"language"in S&&a(7,c=S.language),"singleLine"in S&&a(8,f=S.singleLine)},e.$$.update=()=>{e.$$.dirty&16&&r&&VO(),e.$$.dirty&1152&&h&&c&&h.dispatch({effects:[$.reconfigure(qO())]}),e.$$.dirty&1056&&h&&typeof Q<"u"&&h.dispatch({effects:[g.reconfigure(v.editable.of(!Q)),w.reconfigure(V.readOnly.of(Q))]}),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 u<"u"&&h.dispatch({effects:[_O.reconfigure(zO(u))]})},[n,o,p,s,r,Q,u,c,f,cO,h,$t]}class Er extends gt{constructor(O){super(),Pt(this,O,Ar,Gr,mt,{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{Er as default}; +}`,{label:"class",detail:"definition",type:"keyword"}),X('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),X('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],he=new we,Le=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 Gi=["FunctionDeclaration"],Ai={FunctionDeclaration:q("function"),ClassDeclaration:q("class"),ClassExpression:()=>!0,EnumDeclaration:q("constant"),TypeAliasDeclaration:q("type"),NamespaceDeclaration:q("namespace"),VariableDefinition(e,O){e.matchContext(Gi)||O(e,"variable")},TypeDefinition(e,O){O(e,"type")},__proto__:null};function Me(e,O){let a=he.get(O);if(a)return a;let t=[],i=!0;function r(s,n){let o=e.sliceString(s.from,s.to);t.push({label:o,type:n})}return O.cursor(YO.IncludeAnonymous).iterate(s=>{if(i)i=!1;else if(s.name){let n=Ai[s.name];if(n&&n(s,r)||Le.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}}),he.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 Ii(e){let O=C(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 i=O;i;i=i.parent)Le.has(i.name)&&(t=t.concat(Me(e.state.doc,i)));return{options:t,from:a?O.from:e.pos,validFor:ue}}const x=sO.define({name:"javascript",parser:zi.configure({props:[nO.add({IfStatement:j({except:/^\s*({|else\b)/}),TryStatement:j({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:qt,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:Rt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":j({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}}),lO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":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:"$"}}),Fe={test:e=>/^JSX/.test(e.name),facet:zt({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"),Ni="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 oO(O,[x.data.of({autocomplete:Ye(He,ve(ji.concat(Ni)))}),x.data.of({autocomplete:Ii}),e.jsx?Di:[]])}function Ei(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function fe(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 Bi=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Di=v.inputHandler.of((e,O,a,t)=>{if((Bi?e.composing:e.compositionStarted)||e.state.readOnly||O!=a||t!=">"&&t!="/"||!x.isActiveAt(e.state,O,-1))return!1;let{state:i}=e,r=i.changeByRange(s=>{var n,o;let{head:Q}=s,u=C(i).resolveInner(Q,-1),c;if(u.name=="JSXStartTag"&&(u=u.parent),t==">"&&u.name=="JSXFragmentTag")return{range:G.cursor(Q+1),changes:{from:Q,insert:">"}};if(t=="/"&&u.name=="JSXFragmentTag"){let f=u.parent,h=f==null?void 0:f.parent;if(f.from==Q-1&&((n=h.lastChild)===null||n===void 0?void 0:n.name)!="JSXEndTag"&&(c=fe(i.doc,h==null?void 0:h.firstChild,Q))){let p=`/${c}>`;return{range:G.cursor(Q+p.length),changes:{from:Q,insert:p}}}}else if(t==">"){let f=Ei(u);if(f&&((o=f.lastChild)===null||o===void 0?void 0:o.name)!="JSXEndTag"&&i.sliceDoc(Q,Q+2)!="`}}}return{range:s}});return r.changes.empty?!1:(e.dispatch(r,{userEvent:"input.type",scrollIntoView:!0}),!0)}),R=["_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"],d={},Ji={a:{attrs:{href:null,ping:null,type:null,media:null,target:R,hreflang:null}},abbr:d,address:d,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:d,aside:d,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:d,base:{attrs:{href:null,target:R}},bdi:d,bdo:d,blockquote:{attrs:{cite:null}},body:d,br:d,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:PO,formmethod:gO,formnovalidate:["novalidate"],formtarget:R,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:d,center:d,cite:d,code:d,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:d,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:d,div:d,dl:d,dt:d,em:d,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:d,figure:d,footer:d,form:{attrs:{action:null,name:null,"accept-charset":$O,autocomplete:["on","off"],enctype:PO,method:gO,novalidate:["novalidate"],target:R}},h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:d,hgroup:d,hr:d,html:{attrs:{manifest:null}},i:d,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:R,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:d,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:d,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:d,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:d,noscript:d,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:d,param:{attrs:{name:null,value:null}},pre:d,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:d,rt:d,ruby:d,samp:d,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:$O}},section:d,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:d,source:{attrs:{src:null,type:null,media:null}},span:d,strong:d,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:d,summary:d,sup:d,table:d,tbody:d,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:d,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:d,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:d,time:{attrs:{datetime:null}},title:d,tr:d,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:d,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:d},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},it="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 it)at[e]=null;class aO{constructor(O,a){this.tags=Object.assign(Object.assign({},Ji),O),this.globalAttrs=Object.assign(Object.assign({},at),a),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}aO.default=new aO;function _(e,O,a=e.length){if(!O)return"";let t=O.firstChild,i=t&&t.getChild("TagName");return i?e.sliceString(i.from,Math.min(i.to,a)):""}function QO(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 rt(e,O,a){let t=a.tags[_(e,QO(O,!0))];return(t==null?void 0:t.children)||a.allTags}function UO(e,O){let a=[];for(let t=O;t=QO(t);){let i=_(e,t);if(i&&t.lastChild.name=="CloseTag")break;i&&a.indexOf(i)<0&&(O.name=="EndTag"||O.from>=t.firstChild.to)&&a.push(i)}return a}const st=/^[:\-\.\w\u00b7-\uffff]*$/;function de(e,O,a,t,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:rt(e.doc,a,O).map(s=>({label:s,type:"type"})).concat(UO(e.doc,a).map((s,n)=>({label:"/"+s,apply:"/"+s+r,type:"type",boost:99-n}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function pe(e,O,a,t){let i=/\s*>/.test(e.sliceDoc(t,t+5))?"":">";return{from:a,to:t,options:UO(e.doc,O).map((r,s)=>({label:r,apply:r+i,type:"type",boost:99-s})),validFor:st}}function Li(e,O,a,t){let i=[],r=0;for(let s of rt(e.doc,a,O))i.push({label:"<"+s,type:"type"});for(let s of UO(e.doc,a))i.push({label:"",type:"type",boost:99-r++});return{from:t,to:t,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Mi(e,O,a,t,i){let r=QO(a),s=r?O.tags[_(e.doc,r)]: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:i,options:o.map(Q=>({label:Q,type:"property"})),validFor:st}}function Hi(e,O,a,t,i){var r;let s=(r=a.parent)===null||r===void 0?void 0:r.getChild("AttributeName"),n=[],o;if(s){let Q=e.sliceDoc(s.from,s.to),u=O.globalAttrs[Q];if(!u){let c=QO(a),f=c?O.tags[_(e.doc,c)]:null;u=(f==null?void 0:f.attrs)&&f.attrs[Q]}if(u){let c=e.sliceDoc(t,i).toLowerCase(),f='"',h='"';/^['"]/.test(c)?(o=c[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",h=e.sliceDoc(i,i+1)==c[0]?"":c[0],c=c.slice(1),t++):o=/^[^\s<>='"]*$/;for(let p of u)n.push({label:p,apply:f+p+h,type:"constant"})}}return{from:t,to:i,options:n,validFor:o}}function Fi(e,O){let{state:a,pos:t}=O,i=C(a).resolveInner(t),r=i.resolve(t,-1);for(let s=t,n;i==r&&(n=r.childBefore(s));){let o=n.lastChild;if(!o||!o.type.isError||o.fromFi(t,i)}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:tO.parser}],lt=[{name:"style",parser:tO.parser.configure({top:"Styles"})}].concat(it.map(e=>({name:e,parser:x.parser}))),ot=sO.define({name:"html",parser:La.configure({props:[nO.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")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),M=ot.configure({wrap:Ne(nt,lt)});function Or(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=Ne((e.nestedLanguages||[]).concat(nt),(e.nestedAttributes||[]).concat(lt)));let t=a?ot.configure({wrap:a,dialect:O}):O?M.configure({dialect:O}):M;return new oO(t,[M.data.of({autocomplete:Ki(e)}),e.autoCloseTags!==!1?er:[],tt().support,Pi().support])}const Se=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),er=v.inputHandler.of((e,O,a,t)=>{if(e.composing||e.state.readOnly||O!=a||t!=">"&&t!="/"||!M.isActiveAt(e.state,O,-1))return!1;let{state:i}=e,r=i.changeByRange(s=>{var n,o,Q;let{head:u}=s,c=C(i).resolveInner(u,-1),f;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"&&(f=_(i.doc,c.parent,u))&&!Se.has(f)){let h=e.state.doc.sliceString(u,u+1)===">",p=`${h?"":">"}`;return{range:G.cursor(u+1),changes:{from:u+(h?1:0),insert:p}}}}else if(t=="/"&&c.name=="OpenTag"){let h=c.parent,p=h==null?void 0:h.parent;if(h.from==u-1&&((Q=p.lastChild)===null||Q===void 0?void 0:Q.name)!="CloseTag"&&(f=_(i.doc,p,u))&&!Se.has(f)){let $=e.state.doc.sliceString(u,u+1)===">",g=`/${f}${$?"":">"}`,w=u+g.length+($?1:0);return{range:G.cursor(w),changes:{from:u,insert:g}}}}return{range:s}});return r.changes.empty?!1:(e.dispatch(r,{userEvent:"input.type",scrollIntoView:!0}),!0)}),tr=36,$e=1,ar=2,B=3,mO=4,ir=5,rr=6,sr=7,nr=8,lr=9,or=10,Qr=11,cr=12,hr=13,ur=14,fr=15,dr=16,pr=17,ge=18,Sr=19,Qt=20,ct=21,Pe=22,$r=23,gr=24;function kO(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Pr(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 mr(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 ht(e,O){for(;!(e.next!=95&&!kO(e.next));)O!=null&&(O+=String.fromCharCode(e.next)),e.advance();return O}function Xr(e){if(e.next==39||e.next==34||e.next==96){let O=e.next;e.advance(),Y(e,O,!1)}else ht(e)}function me(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 U(e,O){for(let a=0;a!=&|~^/",specialVar:"?",identifierQuotes:'"',words:ut(br,Zr)};function kr(e,O,a,t){let i={};for(let r in xO)i[r]=(e.hasOwnProperty(r)?e:xO)[r];return O&&(i.words=ut(O,a||"",t)),i}function ft(e){return new b(O=>{var a;let{next:t}=O;if(O.advance(),U(t,be)){for(;U(O.next,be);)O.advance();O.acceptToken(tr)}else if(t==36&&O.next==36&&e.doubleDollarQuotedStrings)mr(O),O.acceptToken(B);else if(t==39||t==34&&e.doubleQuotedStrings)Y(O,t,e.backslashEscapes),O.acceptToken(B);else if(t==35&&e.hashComments||t==47&&O.next==47&&e.slashComments)Ze(O),O.acceptToken($e);else if(t==45&&O.next==45&&(!e.spaceAfterDashes||O.peek(1)==32))Ze(O),O.acceptToken($e);else if(t==47&&O.next==42){O.advance();for(let i=1;;){let r=O.next;if(O.next<0)break;if(O.advance(),r==42&&O.next==47){if(i--,O.advance(),!i)break}else r==47&&O.next==42&&(i++,O.advance())}O.acceptToken(ar)}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(B);else if(t==95&&e.charSetCasts)for(let i=0;;i++){if(O.next==39&&i>1){O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(B);break}if(!kO(O.next))break;O.advance()}else if(t==40)O.acceptToken(sr);else if(t==41)O.acceptToken(nr);else if(t==123)O.acceptToken(lr);else if(t==125)O.acceptToken(or);else if(t==91)O.acceptToken(Qr);else if(t==93)O.acceptToken(cr);else if(t==59)O.acceptToken(hr);else if(e.unquotedBitLiterals&&t==48&&O.next==98)O.advance(),me(O),O.acceptToken(Pe);else if((t==98||t==66)&&(O.next==39||O.next==34)){const i=O.next;O.advance(),e.treatBitsAsBytes?(Y(O,i,e.backslashEscapes),O.acceptToken($r)):(me(O,i),O.acceptToken(Pe))}else if(t==48&&(O.next==120||O.next==88)||(t==120||t==88)&&O.next==39){let i=O.next==39;for(O.advance();Pr(O.next);)O.advance();i&&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(ur);else if(t>=48&&t<=57)Xe(O,!1),O.acceptToken(mO);else if(U(t,e.operatorChars)){for(;U(O.next,e.operatorChars);)O.advance();O.acceptToken(fr)}else if(U(t,e.specialVar))O.next==t&&O.advance(),Xr(O),O.acceptToken(pr);else if(U(t,e.identifierQuotes))Y(O,t,!1),O.acceptToken(Sr);else if(t==58||t==44)O.acceptToken(dr);else if(kO(t)){let i=ht(O,String.fromCharCode(t));O.acceptToken(O.next==46?ge:(a=e.words[i.toLowerCase()])!==null&&a!==void 0?a:ge)}})}const dt=ft(xO),xr=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,dt],topRules:{Script:[0,25]},tokenPrec:0});function yO(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 iO(e){return e&&(e.name=="Identifier"||e.name=="QuotedIdentifier")}function yr(e,O){if(O.name=="CompositeIdentifier"){let a=[];for(let t=O.firstChild;t;t=t.nextSibling)iO(t)&&a.push(A(e,t));return a}return[A(e,O)]}function ke(e,O){for(let a=[];;){if(!O||O.name!=".")return a;let t=yO(O);if(!iO(t))return a;a.unshift(A(e,t)),O=yO(t)}}function wr(e,O){let a=C(e).resolveInner(O,-1),t=vr(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:ke(e.doc,yO(a)),aliases:t}:a.name=="."?{from:O,quoted:null,parents:ke(e.doc,a),aliases:t}:{from:O,quoted:null,parents:[],empty:!0,aliases:t}}const Yr=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function vr(e,O){let a;for(let i=O;!a;i=i.parent){if(!i)return null;i.name=="Statement"&&(a=i)}let t=null;for(let i=a.firstChild,r=!1,s=null;i;i=i.nextSibling){let n=i.name=="Keyword"?e.sliceString(i.from,i.to).toLowerCase():null,o=null;if(!r)r=n=="from";else if(n=="as"&&s&&iO(i.nextSibling))o=A(e,i.nextSibling);else{if(n&&Yr.has(n))break;s&&iO(i)&&(o=A(e,i))}o&&(t||(t=Object.create(null)),t[o]=yr(e,s)),s=/Identifier$/.test(i.name)?i:null}return t}function Tr(e,O){return e?O.map(a=>Object.assign(Object.assign({},a),{label:e+a.label+e,apply:void 0})):O}const Ur=/^\w*$/,Wr=/^[`'"]?\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 _r(e,O,a,t,i){let r=new WO,s=r.child(i||"");for(let n in e){let o=n.indexOf("."),u=(o>-1?r.child(n.slice(0,o)):s).child(o>-1?n.slice(o+1):n);u.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 r.children){let o=r.child(n);o.list.length||(o.list=o.childCompletions("type"))}return r.list=s.list.concat(a||r.childCompletions("type")),n=>{let{parents:o,from:Q,quoted:u,empty:c,aliases:f}=wr(n.state,n.pos);if(c&&!n.explicit)return null;f&&o.length==1&&(o=f[o[0]]||o);let h=r;for(let g of o){for(;!h.children||!h.children[g];)if(h==r)h=s;else if(h==s&&t)h=h.child(t);else return null;h=h.child(g)}let p=u&&n.state.sliceDoc(n.pos,n.pos+1)==u,$=h.list;return h==r&&f&&($=$.concat(Object.keys(f).map(g=>({label:g,type:"constant"})))),{from:Q,to:p?n.pos+1:void 0,options:Tr(u,$),validFor:u?Wr:Ur}}}function Cr(e,O){let a=Object.keys(e).map(t=>({label:O?t.toUpperCase():t,type:e[t]==ct?"type":e[t]==Qt?"keyword":"variable",boost:-1}));return Ye(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],ve(a))}let Vr=xr.configure({props:[nO.add({Statement:j()}),lO.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 I{constructor(O,a){this.dialect=O,this.language=a}get extension(){return this.language.extension}static define(O){let a=kr(O,O.keywords,O.types,O.builtin),t=sO.define({name:"sql",parser:Vr.configure({tokenizers:[{from:dt,to:ft(a)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new I(a,t)}}function qr(e,O=!1){return Cr(e.dialect.words,O)}function Rr(e,O=!1){return e.language.data.of({autocomplete:qr(e,O)})}function zr(e){return e.schema?_r(e.schema,e.tables,e.schemas,e.defaultTable,e.defaultSchema):()=>null}function jr(e){return e.schema?(e.dialect||pt).language.data.of({autocomplete:zr(e)}):[]}function xe(e={}){let O=e.dialect||pt;return new oO(O.language,[jr(e),Rr(O,!!e.upperCaseKeywords)])}const pt=I.define({});function Gr(e){let O;return{c(){O=Xt("div"),Zt(O,"class","code-editor"),N(O,"min-height",e[0]?e[0]+"px":null),N(O,"max-height",e[1]?e[1]+"px":"auto")},m(a,t){bt(a,O,t),e[11](O)},p(a,[t]){t&1&&N(O,"min-height",a[0]?a[0]+"px":null),t&2&&N(O,"max-height",a[1]?a[1]+"px":"auto")},i:RO,o:RO,d(a){a&&kt(O),e[11](null)}}}function Ar(e,O,a){let t;xt(e,yt,S=>a(12,t=S));const i=wt();let{id:r=""}=O,{value:s=""}=O,{minHeight:n=null}=O,{maxHeight:o=null}=O,{disabled:Q=!1}=O,{placeholder:u=""}=O,{language:c="javascript"}=O,{singleLine:f=!1}=O,h,p,$=new E,g=new E,w=new E,_O=new E;function cO(){h==null||h.focus()}function St(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0})),i("change",s)}function CO(){if(!r)return;const S=document.querySelectorAll('[for="'+r+'"]');for(let P of S)P.removeEventListener("click",cO)}function VO(){if(!r)return;CO();const S=document.querySelectorAll('[for="'+r+'"]');for(let P of S)P.addEventListener("click",cO)}function qO(){switch(c){case"html":return Or();case"sql-create-index":return xe({dialect:I.define({keywords:"create unique index if not exists on collate asc desc where like isnull notnull date time datetime unixepoch strftime lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let S={};for(let P of t)S[P.name]=vt.getAllCollectionIdentifiers(P);return xe({dialect:I.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:S,upperCaseKeywords:!0});default:return tt()}}Yt(()=>{const S={key:"Enter",run:P=>{f&&i("submit",s)}};return VO(),a(10,h=new v({parent:p,state:V.create({doc:s,extensions:[Gt(),At(),It(),Nt(),Et(),V.allowMultipleSelections.of(!0),Bt(Dt,{fallback:!0}),Jt(),Lt(),Mt(),Ht(),Ft.of([S,...Kt,...Oa,ea.find(P=>P.key==="Mod-d"),...ta,...aa]),v.lineWrapping,ia({icons:!1}),$.of(qO()),_O.of(zO(u)),g.of(v.editable.of(!0)),w.of(V.readOnly.of(!1)),V.transactionFilter.of(P=>f&&P.newDoc.lines>1?[]:P),v.updateListener.of(P=>{!P.docChanged||Q||(a(3,s=P.state.doc.toString()),St())})]})})),()=>{CO(),h==null||h.destroy()}});function $t(S){Tt[S?"unshift":"push"](()=>{p=S,a(2,p)})}return e.$$set=S=>{"id"in S&&a(4,r=S.id),"value"in S&&a(3,s=S.value),"minHeight"in S&&a(0,n=S.minHeight),"maxHeight"in S&&a(1,o=S.maxHeight),"disabled"in S&&a(5,Q=S.disabled),"placeholder"in S&&a(6,u=S.placeholder),"language"in S&&a(7,c=S.language),"singleLine"in S&&a(8,f=S.singleLine)},e.$$.update=()=>{e.$$.dirty&16&&r&&VO(),e.$$.dirty&1152&&h&&c&&h.dispatch({effects:[$.reconfigure(qO())]}),e.$$.dirty&1056&&h&&typeof Q<"u"&&h.dispatch({effects:[g.reconfigure(v.editable.of(!Q)),w.reconfigure(V.readOnly.of(Q))]}),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 u<"u"&&h.dispatch({effects:[_O.reconfigure(zO(u))]})},[n,o,p,s,r,Q,u,c,f,cO,h,$t]}class Er extends gt{constructor(O){super(),Pt(this,O,Ar,Gr,mt,{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{Er as default}; diff --git a/ui/dist/assets/ConfirmEmailChangeDocs-683ed386.js b/ui/dist/assets/ConfirmEmailChangeDocs-aeccb441.js similarity index 97% rename from ui/dist/assets/ConfirmEmailChangeDocs-683ed386.js rename to ui/dist/assets/ConfirmEmailChangeDocs-aeccb441.js index 48529876..ca1bc963 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-683ed386.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-aeccb441.js @@ -1,4 +1,4 @@ -import{S as Ce,i as $e,s as we,e as r,w as g,b as h,c as he,f as b,g as f,h as n,m as ve,x as Y,N as pe,O as Pe,k as Se,P as Oe,n as Re,t as Z,a as x,o as m,d as ge,R as Te,C as Ee,p as ye,r as j,u as Be,M as qe}from"./index-97145449.js";import{S as Ae}from"./SdkTabs-259b2687.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=r("button"),_=g(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){f(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&&m(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=r("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){f(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&&m(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,M,te,N,T,le,z,K=o[0].name+"",G,se,J,E,Q,y,V,B,X,S,q,v=[],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 r,w as g,b as h,c as he,f as b,g as f,h as n,m as ve,x as Y,N as pe,O as Pe,k as Se,P as Oe,n as Re,t as Z,a as x,o as m,d as ge,R as Te,C as Ee,p as ye,r as j,u as Be,M as qe}from"./index-1d58e6ce.js";import{S as Ae}from"./SdkTabs-ea1c7c68.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=r("button"),_=g(a),u=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(C,$){f(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&&m(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=r("div"),he(a.$$.fragment),_=h(),b(s,"class","tab-item"),j(s,"active",l[1]===l[5].code),this.first=s},m(i,d){f(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&&m(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,M,te,N,T,le,z,K=o[0].name+"",G,se,J,E,Q,y,V,B,X,S,q,v=[],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-c75c630b.js b/ui/dist/assets/ConfirmPasswordResetDocs-b73e2d36.js similarity index 98% rename from ui/dist/assets/ConfirmPasswordResetDocs-c75c630b.js rename to ui/dist/assets/ConfirmPasswordResetDocs-b73e2d36.js index 2c151219..528d9c70 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-c75c630b.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-b73e2d36.js @@ -1,4 +1,4 @@ -import{S as Se,i as he,s as Re,e as r,w as P,b as v,c as ve,f as b,g as d,h as n,m as we,x as K,N as me,O as Oe,k as Ne,P as Ce,n as We,t as Z,a as x,o as f,d as Pe,R as $e,C as Ee,p as Te,r as U,u as ge,M as Ae}from"./index-97145449.js";import{S as De}from"./SdkTabs-259b2687.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=r("button"),_=P(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){d(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&&f(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=r("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(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&&f(l),Pe(a)}}}function ye(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,M=o[0].name+"",j,ee,H,R,L,W,z,O,q,te,B,$,se,G,F=o[0].name+"",J,le,Q,E,V,T,X,g,Y,N,A,w=[],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 r,w as P,b as v,c as ve,f as b,g as d,h as n,m as we,x as K,N as me,O as Oe,k as Ne,P as Ce,n as We,t as Z,a as x,o as f,d as Pe,R as $e,C as Ee,p as Te,r as U,u as ge,M as Ae}from"./index-1d58e6ce.js";import{S as De}from"./SdkTabs-ea1c7c68.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=r("button"),_=P(a),u=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(S,h){d(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&&f(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=r("div"),ve(a.$$.fragment),_=v(),b(l,"class","tab-item"),U(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(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&&f(l),Pe(a)}}}function ye(o){var re,de;let s,l,a=o[0].name+"",_,u,i,p,m,S,h,M=o[0].name+"",j,ee,H,R,L,W,z,O,q,te,B,$,se,G,F=o[0].name+"",J,le,Q,E,V,T,X,g,Y,N,A,w=[],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-2fa1a3fb.js b/ui/dist/assets/ConfirmVerificationDocs-2c3a2637.js similarity index 97% rename from ui/dist/assets/ConfirmVerificationDocs-2fa1a3fb.js rename to ui/dist/assets/ConfirmVerificationDocs-2c3a2637.js index 77e2242a..f47a2da1 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-2fa1a3fb.js +++ b/ui/dist/assets/ConfirmVerificationDocs-2c3a2637.js @@ -1,4 +1,4 @@ -import{S as we,i as Ce,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as n,m as he,x as D,N as de,O as Te,k as ge,P as ye,n as Be,t as Z,a as x,o as m,d as $e,R as qe,C as Oe,p as Se,r as H,u as Ee,M as Me}from"./index-97145449.js";import{S as Ne}from"./SdkTabs-259b2687.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=r("button"),_=$(o),u=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(w,C){f(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&&m(s),a=!1,p()}}}function ke(i,l){let s,o,_,u;return o=new Me({props:{content:l[5].body}}),{key:i,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(a,p){f(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&&m(s),$e(o)}}}function Ve(i){var re,fe;let l,s,o=i[0].name+"",_,u,a,p,d,w,C,K=i[0].name+"",F,ee,I,P,L,B,z,T,A,te,R,q,le,G,U=i[0].name+"",J,se,Q,O,W,S,X,E,Y,g,M,h=[],oe=new Map,ie,N,k=[],ne=new Map,y;P=new Ne({props:{js:` +import{S as we,i as Ce,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as n,m as he,x as D,N as de,O as Te,k as ge,P as ye,n as Be,t as Z,a as x,o as m,d as $e,R as qe,C as Oe,p as Se,r as H,u as Ee,M as Me}from"./index-1d58e6ce.js";import{S as Ne}from"./SdkTabs-ea1c7c68.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=r("button"),_=$(o),u=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(w,C){f(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&&m(s),a=!1,p()}}}function ke(i,l){let s,o,_,u;return o=new Me({props:{content:l[5].body}}),{key:i,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(a,p){f(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&&m(s),$e(o)}}}function Ve(i){var re,fe;let l,s,o=i[0].name+"",_,u,a,p,d,w,C,K=i[0].name+"",F,ee,I,P,L,B,z,T,A,te,R,q,le,G,U=i[0].name+"",J,se,Q,O,W,S,X,E,Y,g,M,h=[],oe=new Map,ie,N,k=[],ne=new Map,y;P=new Ne({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[3]}'); diff --git a/ui/dist/assets/CreateApiDocs-b9e14de9.js b/ui/dist/assets/CreateApiDocs-17994c62.js similarity index 99% rename from ui/dist/assets/CreateApiDocs-b9e14de9.js rename to ui/dist/assets/CreateApiDocs-17994c62.js index 0d38b8a6..09489eb6 100644 --- a/ui/dist/assets/CreateApiDocs-b9e14de9.js +++ b/ui/dist/assets/CreateApiDocs-17994c62.js @@ -1,4 +1,4 @@ -import{S as Ht,i as Lt,s as Pt,C as z,M 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,N as Le,O as ht,k as Rt,P 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-97145449.js";import{S as Nt}from"./SdkTabs-259b2687.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,v,T,w,M,g,D,E,L,I,j,F,S,N,q,C,_;function O(u,$){var ee,Q;return(Q=(ee=u[0])==null?void 0:ee.options)!=null&&Q.requireEmail?Jt:Vt}let K=O(o),P=K(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 z,M 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,N as Le,O as ht,k as Rt,P 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-1d58e6ce.js";import{S as Nt}from"./SdkTabs-ea1c7c68.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,v,T,w,M,g,D,E,L,I,j,F,S,N,q,C,_;function O(u,$){var ee,Q;return(Q=(ee=u[0])==null?void 0:ee.options)!=null&&Q.requireEmail?Jt:Vt}let K=O(o),P=K(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-dd93a5e5.js b/ui/dist/assets/DeleteApiDocs-ec495d28.js similarity index 97% rename from ui/dist/assets/DeleteApiDocs-dd93a5e5.js rename to ui/dist/assets/DeleteApiDocs-ec495d28.js index 34171524..8fc5d6c8 100644 --- a/ui/dist/assets/DeleteApiDocs-dd93a5e5.js +++ b/ui/dist/assets/DeleteApiDocs-ec495d28.js @@ -1,4 +1,4 @@ -import{S as Ce,i as Re,s as Pe,e as c,w as $,b as h,c as $e,f as m,g as f,h as n,m as we,x,N as _e,O as Ee,k as Oe,P as Te,n as Be,t as ee,a as te,o as u,d as ge,R as Ie,C as Me,p as Ae,r as N,u as Se,M as qe}from"./index-97145449.js";import{S as He}from"./SdkTabs-259b2687.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){f(s,l,a)},d(s){s&&u(l)}}}function ye(o,l){let s,a=l[6].code+"",v,i,r,p;function w(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),v=$(a),i=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){f(b,s,g),n(s,v),n(s,i),r||(p=Se(s,"click",w),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&u(s),r=!1,p()}}}function De(o,l){let s,a,v,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),v=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,p){f(r,s,p),we(a,s,null),n(s,v),i=!0},p(r,p){l=r,(!i||p&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&&u(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",v,i,r,p,w,b,g,q=o[0].name+"",z,le,F,C,K,O,G,y,H,se,L,E,oe,J,U=o[0].name+"",Q,ae,V,ne,W,T,X,B,Y,I,Z,R,M,D=[],ie=new Map,re,A,_=[],ce=new Map,P;C=new He({props:{js:` +import{S as Ce,i as Re,s as Pe,e as c,w as $,b as h,c as $e,f as m,g as f,h as n,m as we,x,N as _e,O as Ee,k as Oe,P as Te,n as Be,t as ee,a as te,o as u,d as ge,R as Ie,C as Me,p as Ae,r as N,u as Se,M as qe}from"./index-1d58e6ce.js";import{S as He}from"./SdkTabs-ea1c7c68.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){f(s,l,a)},d(s){s&&u(l)}}}function ye(o,l){let s,a=l[6].code+"",v,i,r,p;function w(){return l[5](l[6])}return{key:o,first:null,c(){s=c("button"),v=$(a),i=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(b,g){f(b,s,g),n(s,v),n(s,i),r||(p=Se(s,"click",w),r=!0)},p(b,g){l=b,g&20&&N(s,"active",l[2]===l[6].code)},d(b){b&&u(s),r=!1,p()}}}function De(o,l){let s,a,v,i;return a=new qe({props:{content:l[6].body}}),{key:o,first:null,c(){s=c("div"),$e(a.$$.fragment),v=h(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(r,p){f(r,s,p),we(a,s,null),n(s,v),i=!0},p(r,p){l=r,(!i||p&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&&u(s),ge(a)}}}function Le(o){var ue,pe;let l,s,a=o[0].name+"",v,i,r,p,w,b,g,q=o[0].name+"",z,le,F,C,K,O,G,y,H,se,L,E,oe,J,U=o[0].name+"",Q,ae,V,ne,W,T,X,B,Y,I,Z,R,M,D=[],ie=new Map,re,A,_=[],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-89bda33f.js b/ui/dist/assets/FilterAutocompleteInput-773533b0.js similarity index 98% rename from ui/dist/assets/FilterAutocompleteInput-89bda33f.js rename to ui/dist/assets/FilterAutocompleteInput-773533b0.js index 3ad47451..83e06316 100644 --- a/ui/dist/assets/FilterAutocompleteInput-89bda33f.js +++ b/ui/dist/assets/FilterAutocompleteInput-773533b0.js @@ -1 +1 @@ -import{S as oe,i as ae,s as le,e as ue,f as ce,g as fe,y as H,o as de,I as he,J as ge,K as pe,H as ye,C as q,L as me}from"./index-97145449.js";import{E as S,a as w,h as be,b as ke,c as xe,d as Ke,e as Ce,s as qe,f as Se,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 He,t as De}from"./index-6f704b4c.js";function Me(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,M=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&&q.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=q.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.headers."),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)q.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 He.define(Me({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:q.escapeRegExp("@now"),token:"keyword"},{regex:q.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:r=>{b&&p("submit",o)}};return V(),n(11,f=new S({parent:k,state:w.create({doc:o,extensions:[be(),ke(),xe(),Ke(),Ce(),w.allowMultipleSelections.of(!0),qe(De,{fallback:!0}),Se(),we(),Le(),Ie(),Ee.of([t,...Re,...Ae,Be.find(r=>r.key==="Mod-d"),...Oe,..._e]),S.lineWrapping,ve({override:[se],icons:!1}),T.of(Y(l)),M.of(S.editable.of(!s)),F.of(w.readOnly.of(s)),D.of(G()),w.transactionFilter.of(r=>b&&r.newDoc.lines>1?[]:r),S.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:[M.reconfigure(S.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 H,o as de,I as he,J as ge,K as pe,H as ye,C as q,L as me}from"./index-1d58e6ce.js";import{E as S,a as w,h as be,b as ke,c as xe,d as Ke,e as Ce,s as qe,f as Se,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 He,t as De}from"./index-c4d2d831.js";function Me(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,M=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&&q.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=q.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.headers."),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)q.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 He.define(Me({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:q.escapeRegExp("@now"),token:"keyword"},{regex:q.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:r=>{b&&p("submit",o)}};return V(),n(11,f=new S({parent:k,state:w.create({doc:o,extensions:[be(),ke(),xe(),Ke(),Ce(),w.allowMultipleSelections.of(!0),qe(De,{fallback:!0}),Se(),we(),Le(),Ie(),Ee.of([t,...Re,...Ae,Be.find(r=>r.key==="Mod-d"),...Oe,..._e]),S.lineWrapping,ve({override:[se],icons:!1}),T.of(Y(l)),M.of(S.editable.of(!s)),F.of(w.readOnly.of(s)),D.of(G()),w.transactionFilter.of(r=>b&&r.newDoc.lines>1?[]:r),S.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:[M.reconfigure(S.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-b8dd0881.js b/ui/dist/assets/ListApiDocs-c17b41f3.js similarity index 99% rename from ui/dist/assets/ListApiDocs-b8dd0881.js rename to ui/dist/assets/ListApiDocs-c17b41f3.js index 178bb7f1..8b11dae3 100644 --- a/ui/dist/assets/ListApiDocs-b8dd0881.js +++ b/ui/dist/assets/ListApiDocs-c17b41f3.js @@ -1,4 +1,4 @@ -import{S as Ke,i as Ve,s as We,e,b as s,E as Ye,f as i,g as u,u as Xe,y as De,o as m,w,h as t,M as $e,c as Zt,m as te,x as Ce,N as He,O as Ze,k as tl,P as el,n as ll,t as Gt,a as Ut,d as ee,Q as sl,R as nl,C as ge,p as ol,r as ke}from"./index-97145449.js";import{S as il}from"./SdkTabs-259b2687.js";function al(c){let n,o,a;return{c(){n=e("span"),n.textContent="Show details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-down-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function rl(c){let n,o,a;return{c(){n=e("span"),n.textContent="Hide details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-up-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function Ie(c){let n,o,a,p,b,d,h,C,x,_,f,et,kt,jt,S,Qt,D,ct,R,lt,le,U,j,se,dt,vt,st,yt,ne,ft,pt,nt,E,zt,Ft,T,ot,Lt,Jt,At,Q,it,Tt,Kt,Pt,L,ut,Rt,oe,mt,ie,H,Ot,at,St,O,bt,ae,z,Et,Vt,Nt,re,N,Wt,J,ht,ce,I,de,B,fe,P,qt,K,_t,pe,xt,ue,$,Mt,rt,Dt,me,Ht,Xt,V,wt,be,It,he,Ct,_e,G,W,Yt,q,gt,A,xe,X,Y,y,Bt,Z,v,tt,k;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Ke,i as Ve,s as We,e,b as s,E as Ye,f as i,g as u,u as Xe,y as De,o as m,w,h as t,M as $e,c as Zt,m as te,x as Ce,N as He,O as Ze,k as tl,P as el,n as ll,t as Gt,a as Ut,d as ee,Q as sl,R as nl,C as ge,p as ol,r as ke}from"./index-1d58e6ce.js";import{S as il}from"./SdkTabs-ea1c7c68.js";function al(c){let n,o,a;return{c(){n=e("span"),n.textContent="Show details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-down-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function rl(c){let n,o,a;return{c(){n=e("span"),n.textContent="Hide details",o=s(),a=e("i"),i(n,"class","txt"),i(a,"class","ri-arrow-up-s-line")},m(p,b){u(p,n,b),u(p,o,b),u(p,a,b)},d(p){p&&m(n),p&&m(o),p&&m(a)}}}function Ie(c){let n,o,a,p,b,d,h,C,x,_,f,et,kt,jt,S,Qt,D,ct,R,lt,le,U,j,se,dt,vt,st,yt,ne,ft,pt,nt,E,zt,Ft,T,ot,Lt,Jt,At,Q,it,Tt,Kt,Pt,L,ut,Rt,oe,mt,ie,H,Ot,at,St,O,bt,ae,z,Et,Vt,Nt,re,N,Wt,J,ht,ce,I,de,B,fe,P,qt,K,_t,pe,xt,ue,$,Mt,rt,Dt,me,Ht,Xt,V,wt,be,It,he,Ct,_e,G,W,Yt,q,gt,A,xe,X,Y,y,Bt,Z,v,tt,k;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),a=e("ul"),p=e("li"),p.innerHTML=`OPERAND - could be any of the above field literal, string (single diff --git a/ui/dist/assets/ListExternalAuthsDocs-6141ba63.js b/ui/dist/assets/ListExternalAuthsDocs-57438e41.js similarity index 98% rename from ui/dist/assets/ListExternalAuthsDocs-6141ba63.js rename to ui/dist/assets/ListExternalAuthsDocs-57438e41.js index eea8ea61..8cb3b499 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-6141ba63.js +++ b/ui/dist/assets/ListExternalAuthsDocs-57438e41.js @@ -1,4 +1,4 @@ -import{S as Be,i as qe,s as Me,e as i,w as v,b as _,c as Se,f as b,g as d,h as s,m as Ee,x as U,N as Pe,O as Oe,k as Le,P as Re,n as We,t as te,a as le,o as u,d as Ie,R as ze,C as De,p as He,r as j,u as Ue,M as je}from"./index-97145449.js";import{S as Ne}from"./SdkTabs-259b2687.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,p;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){d(g,o,P),s(o,f),s(o,h),c||(p=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&&u(o),c=!1,p()}}}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,p){d(c,o,p),Ee(n,o,null),s(o,f),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),n.$set(m),(!h||p&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&&u(o),Ie(n)}}}function Ge(a){var be,he,_e,ke;let l,o,n=a[0].name+"",f,h,c,p,m,g,P,L=a[0].name+"",N,oe,se,G,K,y,F,S,J,$,R,ae,W,A,ne,Q,z=a[0].name+"",V,ie,X,ce,re,D,Y,E,Z,I,x,B,ee,C,q,w=[],de=new Map,ue,M,k=[],pe=new Map,T;y=new Ne({props:{js:` +import{S as Be,i as qe,s as Me,e as i,w as v,b as _,c as Se,f as b,g as d,h as s,m as Ee,x as U,N as Pe,O as Oe,k as Le,P as Re,n as We,t as te,a as le,o as u,d as Ie,R as ze,C as De,p as He,r as j,u as Ue,M as je}from"./index-1d58e6ce.js";import{S as Ne}from"./SdkTabs-ea1c7c68.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,p;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){d(g,o,P),s(o,f),s(o,h),c||(p=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&&u(o),c=!1,p()}}}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,p){d(c,o,p),Ee(n,o,null),s(o,f),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),n.$set(m),(!h||p&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&&u(o),Ie(n)}}}function Ge(a){var be,he,_e,ke;let l,o,n=a[0].name+"",f,h,c,p,m,g,P,L=a[0].name+"",N,oe,se,G,K,y,F,S,J,$,R,ae,W,A,ne,Q,z=a[0].name+"",V,ie,X,ce,re,D,Y,E,Z,I,x,B,ee,C,q,w=[],de=new Map,ue,M,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-155951ba.js b/ui/dist/assets/PageAdminConfirmPasswordReset-a37f07c4.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset-155951ba.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-a37f07c4.js index 760781fe..602cda8e 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-155951ba.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-a37f07c4.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-97145449.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-1d58e6ce.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-874c1447.js b/ui/dist/assets/PageAdminRequestPasswordReset-15f3c583.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset-874c1447.js rename to ui/dist/assets/PageAdminRequestPasswordReset-15f3c583.js index 6db8f879..c59c6274 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset-874c1447.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset-15f3c583.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-97145449.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-1d58e6ce.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/PageOAuth2Redirect-213658ff.js b/ui/dist/assets/PageOAuth2Redirect-9cc021cb.js similarity index 83% rename from ui/dist/assets/PageOAuth2Redirect-213658ff.js rename to ui/dist/assets/PageOAuth2Redirect-9cc021cb.js index 795d21d5..c5942089 100644 --- a/ui/dist/assets/PageOAuth2Redirect-213658ff.js +++ b/ui/dist/assets/PageOAuth2Redirect-9cc021cb.js @@ -1 +1 @@ -import{S as o,i,s as r,e as c,f as l,g as u,y as n,o as d,H as f}from"./index-97145449.js";function m(s){let t;return{c(){t=c("div"),t.textContent="Loading...",l(t,"class","block txt-hint txt-center")},m(e,a){u(e,t,a)},p:n,i:n,o:n,d(e){e&&d(t)}}}function p(s){return f(()=>{window.close()}),[]}class g extends o{constructor(t){super(),i(this,t,p,m,r,{})}}export{g as default}; +import{S as o,i,s as r,e as c,f as l,g as u,y as n,o as d,H as f}from"./index-1d58e6ce.js";function m(s){let t;return{c(){t=c("div"),t.textContent="Loading...",l(t,"class","block txt-hint txt-center")},m(e,a){u(e,t,a)},p:n,i:n,o:n,d(e){e&&d(t)}}}function p(s){return f(()=>{window.close()}),[]}class g extends o{constructor(t){super(),i(this,t,p,m,r,{})}}export{g as default}; diff --git a/ui/dist/assets/PageRecordConfirmEmailChange-3c9392e7.js b/ui/dist/assets/PageRecordConfirmEmailChange-39094301.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmEmailChange-3c9392e7.js rename to ui/dist/assets/PageRecordConfirmEmailChange-39094301.js index 1e9138bd..8e8d41eb 100644 --- a/ui/dist/assets/PageRecordConfirmEmailChange-3c9392e7.js +++ b/ui/dist/assets/PageRecordConfirmEmailChange-39094301.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 m,k as W,n as Y,o as b,_ as j,G as A,p as B,q as D,e as _,w as C,b as h,f as d,r as T,h as k,u as P,v as K,y as E,x as O,z as F}from"./index-97145449.js";function Q(r){let e,t,l,s,n,o,c,a,i,u,g,$,p=r[3]&&H(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=_("form"),t=_("div"),l=_("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 m,k as W,n as Y,o as b,_ as j,G as A,p as B,q as D,e as _,w as C,b as h,f as d,r as T,h as k,u as P,v as K,y as E,x as O,z as F}from"./index-1d58e6ce.js";function Q(r){let e,t,l,s,n,o,c,a,i,u,g,$,p=r[3]&&H(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=_("form"),t=_("div"),l=_("h5"),s=C(`Type your password to confirm changing your email address `),p&&p.c(),n=h(),S(o.$$.fragment),c=h(),a=_("button"),i=_("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],T(a,"btn-loading",r[1])},m(f,w){m(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=H(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)&&T(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=_("div"),e.innerHTML=`

Successfully changed the user email address.

You can now sign in with your new email address.

`,t=h(),l=_("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){m(o,e,c),m(o,t,c),m(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 H(r){let e,t,l;return{c(){e=C("to "),t=_("strong"),l=C(r[3]),d(t,"class","txt-nowrap")},m(s,n){m(s,e,n),m(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=_("label"),t=C("Password"),s=h(),n=_("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){m(i,e,u),k(e,t),m(i,s,u),m(i,n,u),F(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]&&F(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),m(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-a2b650c0.js b/ui/dist/assets/PageRecordConfirmPasswordReset-bcc17010.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmPasswordReset-a2b650c0.js rename to ui/dist/assets/PageRecordConfirmPasswordReset-bcc17010.js index e499239a..5ef344c2 100644 --- a/ui/dist/assets/PageRecordConfirmPasswordReset-a2b650c0.js +++ b/ui/dist/assets/PageRecordConfirmPasswordReset-bcc17010.js @@ -1,4 +1,4 @@ -import{S as J,i as M,s as W,F as Y,c as H,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,_ as K,G 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 S,v as U,y as F,x as V,z as h}from"./index-97145449.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 H,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,_ as K,G 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 S,v as U,y as F,x as V,z as h}from"./index-1d58e6ce.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(),H(o.$$.fragment),c=P(),H(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=S(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=S(s,"click",r[7]),n=!0)},p:F,i:F,o:F,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=S(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=S(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(){H(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-5fcbd066.js b/ui/dist/assets/PageRecordConfirmVerification-71878ead.js similarity index 97% rename from ui/dist/assets/PageRecordConfirmVerification-5fcbd066.js rename to ui/dist/assets/PageRecordConfirmVerification-71878ead.js index dfaced12..685568f4 100644 --- a/ui/dist/assets/PageRecordConfirmVerification-5fcbd066.js +++ b/ui/dist/assets/PageRecordConfirmVerification-71878ead.js @@ -1,3 +1,3 @@ -import{S as v,i as y,s as w,F as g,c as x,m as C,t as $,a as L,d as P,_ as T,G as H,E as M,g as r,o as a,e as u,b as m,f,u as b,y as p}from"./index-97145449.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 g,c as x,m as C,t as $,a as L,d as P,_ as T,G as H,E as M,g as r,o as a,e as u,b as m,f,u as b,y as p}from"./index-1d58e6ce.js";function S(o){let t,s,e,n,l;return{c(){t=u("div"),t.innerHTML=`

Invalid or expired verification token.

`,s=m(),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=m(),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 g({props:{nobranding:!0,$$slots:{default:[V]},$$scope:{ctx:o}}}),{c(){x(t.$$.fragment)},m(e,n){C(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){L(t.$$.fragment,e),s=!1},d(e){P(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 T("../");try{const _=H(e==null?void 0:e.token);await d.collection(_.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-bced41f9.js b/ui/dist/assets/RealtimeApiDocs-889519a5.js similarity index 98% rename from ui/dist/assets/RealtimeApiDocs-bced41f9.js rename to ui/dist/assets/RealtimeApiDocs-889519a5.js index 6ed24183..17322121 100644 --- a/ui/dist/assets/RealtimeApiDocs-bced41f9.js +++ b/ui/dist/assets/RealtimeApiDocs-889519a5.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,M 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-97145449.js";import{S as fe}from"./SdkTabs-259b2687.js";function $e(o){var B,U,W,A,H,L,M,T,q,j,J,N;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,M 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-1d58e6ce.js";import{S as fe}from"./SdkTabs-ea1c7c68.js";function $e(o){var B,U,W,A,H,L,M,T,q,j,J,N;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-722c2a76.js b/ui/dist/assets/RequestEmailChangeDocs-255e4d9a.js similarity index 98% rename from ui/dist/assets/RequestEmailChangeDocs-722c2a76.js rename to ui/dist/assets/RequestEmailChangeDocs-255e4d9a.js index 618e1da2..ecd839c7 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-722c2a76.js +++ b/ui/dist/assets/RequestEmailChangeDocs-255e4d9a.js @@ -1,4 +1,4 @@ -import{S as Te,i as Ee,s as Be,e as r,w,b as k,c as Pe,f,g as m,h as n,m as Ce,x as L,N as ve,O as Se,k as Me,P as Re,n as Ae,t as x,a as ee,o as d,d as ye,R as We,C as ze,p as He,r as N,u as Oe,M as Ue}from"./index-97145449.js";import{S as je}from"./SdkTabs-259b2687.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=r("button"),_=w(a),b=k(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m($,q){m($,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($){$&&d(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=r("div"),Pe(a.$$.fragment),_=k(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m(i,p){m(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&&d(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,G,g,H,le,O,E,se,J,U=o[0].name+"",Q,ae,oe,j,V,B,X,S,Y,M,Z,C,R,v=[],ne=new Map,ie,A,h=[],ce=new Map,y;P=new je({props:{js:` +import{S as Te,i as Ee,s as Be,e as r,w,b as k,c as Pe,f,g as m,h as n,m as Ce,x as L,N as ve,O as Se,k as Me,P as Re,n as Ae,t as x,a as ee,o as d,d as ye,R as We,C as ze,p as He,r as N,u as Oe,M as Ue}from"./index-1d58e6ce.js";import{S as je}from"./SdkTabs-ea1c7c68.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=r("button"),_=w(a),b=k(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m($,q){m($,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($){$&&d(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=r("div"),Pe(a.$$.fragment),_=k(),f(s,"class","tab-item"),N(s,"active",l[1]===l[5].code),this.first=s},m(i,p){m(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&&d(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,G,g,H,le,O,E,se,J,U=o[0].name+"",Q,ae,oe,j,V,B,X,S,Y,M,Z,C,R,v=[],ne=new Map,ie,A,h=[],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-a862cf14.js b/ui/dist/assets/RequestPasswordResetDocs-47c14851.js similarity index 97% rename from ui/dist/assets/RequestPasswordResetDocs-a862cf14.js rename to ui/dist/assets/RequestPasswordResetDocs-47c14851.js index d180014c..d36e957c 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-a862cf14.js +++ b/ui/dist/assets/RequestPasswordResetDocs-47c14851.js @@ -1,4 +1,4 @@ -import{S as Pe,i as $e,s as qe,e as r,w as h,b as v,c as ve,f as b,g as d,h as n,m as we,x as I,N as me,O as Re,k as ge,P as ye,n as Be,t as Z,a as x,o as f,d as he,R as Ce,C as Se,p as Te,r as L,u as Me,M as Ae}from"./index-97145449.js";import{S as Ue}from"./SdkTabs-259b2687.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=r("button"),_=h(o),u=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(P,$){d(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&&f(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=r("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(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&&f(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,z,q,G,B,J,R,H,te,O,C,se,K,E=a[0].name+"",Q,le,V,S,W,T,X,M,Y,g,A,w=[],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 r,w as h,b as v,c as ve,f as b,g as d,h as n,m as we,x as I,N as me,O as Re,k as ge,P as ye,n as Be,t as Z,a as x,o as f,d as he,R as Ce,C as Se,p as Te,r as L,u as Me,M as Ae}from"./index-1d58e6ce.js";import{S as Ue}from"./SdkTabs-ea1c7c68.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=r("button"),_=h(o),u=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(P,$){d(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&&f(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=r("div"),ve(o.$$.fragment),_=v(),b(l,"class","tab-item"),L(l,"active",s[1]===s[5].code),this.first=l},m(i,p){d(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&&f(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,z,q,G,B,J,R,H,te,O,C,se,K,E=a[0].name+"",Q,le,V,S,W,T,X,M,Y,g,A,w=[],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-22ab5e9b.js b/ui/dist/assets/RequestVerificationDocs-a0cadc33.js similarity index 97% rename from ui/dist/assets/RequestVerificationDocs-22ab5e9b.js rename to ui/dist/assets/RequestVerificationDocs-a0cadc33.js index b10b78dd..151fad5d 100644 --- a/ui/dist/assets/RequestVerificationDocs-22ab5e9b.js +++ b/ui/dist/assets/RequestVerificationDocs-a0cadc33.js @@ -1,4 +1,4 @@ -import{S as qe,i as we,s as Pe,e as r,w as $,b as v,c as ve,f as b,g as f,h as i,m as he,x as F,N as de,O as ge,k as ye,P as Be,n as Ce,t as Z,a as x,o as m,d as $e,R as Se,C as Te,p as Me,r as I,u as Re,M as Ve}from"./index-97145449.js";import{S as Ae}from"./SdkTabs-259b2687.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=r("button"),_=$(o),p=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(q,w){f(q,s,w),i(s,_),i(s,p),n||(u=Re(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&&m(s),n=!1,u()}}}function ke(a,l){let s,o,_,p;return o=new Ve({props:{content:l[5].body}}),{key:a,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(n,u){f(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&&m(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,z,C,G,g,D,te,H,S,le,J,O=a[0].name+"",K,se,Q,T,W,M,X,R,Y,y,V,h=[],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 r,w as $,b as v,c as ve,f as b,g as f,h as i,m as he,x as F,N as de,O as ge,k as ye,P as Be,n as Ce,t as Z,a as x,o as m,d as $e,R as Se,C as Te,p as Me,r as I,u as Re,M as Ve}from"./index-1d58e6ce.js";import{S as Ae}from"./SdkTabs-ea1c7c68.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=r("button"),_=$(o),p=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(q,w){f(q,s,w),i(s,_),i(s,p),n||(u=Re(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&&m(s),n=!1,u()}}}function ke(a,l){let s,o,_,p;return o=new Ve({props:{content:l[5].body}}),{key:a,first:null,c(){s=r("div"),ve(o.$$.fragment),_=v(),b(s,"class","tab-item"),I(s,"active",l[1]===l[5].code),this.first=s},m(n,u){f(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&&m(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,z,C,G,g,D,te,H,S,le,J,O=a[0].name+"",K,se,Q,T,W,M,X,R,Y,y,V,h=[],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-259b2687.js b/ui/dist/assets/SdkTabs-ea1c7c68.js similarity index 96% rename from ui/dist/assets/SdkTabs-259b2687.js rename to ui/dist/assets/SdkTabs-ea1c7c68.js index a8a250d7..e0b9a0b4 100644 --- a/ui/dist/assets/SdkTabs-259b2687.js +++ b/ui/dist/assets/SdkTabs-ea1c7c68.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,N as C,O as J,k as O,P as Y,n as z,t as N,a as P,o as w,w as E,r as S,u as A,x as R,M as G,c as H,m as L,d as Q}from"./index-97145449.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 M(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(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&R(r,g),f&6&&S(l,"active",e[1]===e[6].language)},d(_){_&&w(l),n=!1,k()}}}function T(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=j(),h(n,"href",f=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),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!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),(!d||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&w(l),Q(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=o[2];const p=t=>t[6].language;for(let t=0;tt[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(I,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,N as C,O as J,k as O,P as Y,n as z,t as N,a as P,o as w,w as E,r as S,u as A,x as R,M as G,c as H,m as L,d as Q}from"./index-1d58e6ce.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 M(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(_,f){y(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&R(r,g),f&6&&S(l,"active",e[1]===e[6].language)},d(_){_&&w(l),n=!1,k()}}}function T(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=j(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=j(),h(n,"href",f=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),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!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),(!d||t&4)&&k!==(k=e[6].title+"")&&R(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&S(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&w(l),Q(s)}}}function U(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=o[2];const p=t=>t[6].language;for(let t=0;tt[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(I,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-574393fc.js b/ui/dist/assets/UnlinkExternalAuthDocs-6ea2668d.js similarity index 98% rename from ui/dist/assets/UnlinkExternalAuthDocs-574393fc.js rename to ui/dist/assets/UnlinkExternalAuthDocs-6ea2668d.js index 75121971..9b0ec4b7 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs-574393fc.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-6ea2668d.js @@ -1,4 +1,4 @@ -import{S as qe,i as Me,s as Oe,e as i,w as v,b as h,c as Se,f,g as d,h as s,m as Be,x as j,N as ye,O as De,k as We,P as ze,n as He,t as le,a as oe,o as u,d as Ue,R as Le,C as Re,p as je,r as I,u as Ie,M as Ne}from"./index-97145449.js";import{S as Ke}from"./SdkTabs-259b2687.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,p;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){d($,o,P),s(o,_),s(o,b),c||(p=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($){$&&u(o),c=!1,p()}}}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,p){d(c,o,p),Be(a,o,null),s(o,_),b=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),a.$set(m),(!b||p&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&&u(o),Ue(a)}}}function Fe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,p,m,$,P,D=n[0].name+"",N,se,ae,K,F,A,G,E,J,w,W,ne,z,y,ie,Q,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,C,q,g=[],ue=new Map,pe,M,k=[],me=new Map,T;A=new Ke({props:{js:` +import{S as qe,i as Me,s as Oe,e as i,w as v,b as h,c as Se,f,g as d,h as s,m as Be,x as j,N as ye,O as De,k as We,P as ze,n as He,t as le,a as oe,o as u,d as Ue,R as Le,C as Re,p as je,r as I,u as Ie,M as Ne}from"./index-1d58e6ce.js";import{S as Ke}from"./SdkTabs-ea1c7c68.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,p;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){d($,o,P),s(o,_),s(o,b),c||(p=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($){$&&u(o),c=!1,p()}}}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,p){d(c,o,p),Be(a,o,null),s(o,_),b=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),a.$set(m),(!b||p&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&&u(o),Ue(a)}}}function Fe(n){var he,_e,ke,ve;let l,o,a=n[0].name+"",_,b,c,p,m,$,P,D=n[0].name+"",N,se,ae,K,F,A,G,E,J,w,W,ne,z,y,ie,Q,H=n[0].name+"",V,ce,X,re,Y,de,L,Z,S,x,B,ee,U,te,C,q,g=[],ue=new Map,pe,M,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-36690f06.js b/ui/dist/assets/UpdateApiDocs-ede3b5de.js similarity index 99% rename from ui/dist/assets/UpdateApiDocs-36690f06.js rename to ui/dist/assets/UpdateApiDocs-ede3b5de.js index 5f5d3517..474af8f3 100644 --- a/ui/dist/assets/UpdateApiDocs-36690f06.js +++ b/ui/dist/assets/UpdateApiDocs-ede3b5de.js @@ -1,4 +1,4 @@ -import{S as Ct,i as St,s as Ot,C as U,M 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,N as Pe,O as ut,k as Mt,P as $t,n as Rt,t as fe,a as pe,o,d as Fe,R as qt,p as Dt,r as ce,u as Ht,y as G}from"./index-97145449.js";import{S as Lt}from"./SdkTabs-259b2687.js";function bt(f,t,l){const s=f.slice();return s[7]=t[l],s}function mt(f,t,l){const s=f.slice();return s[7]=t[l],s}function _t(f,t,l){const s=f.slice();return s[12]=t[l],s}function yt(f){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(f){let t,l,s,b,u,d,p,k,C,w,O,H,A,j,M,E,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,M 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,N as Pe,O as ut,k as Mt,P as $t,n as Rt,t as fe,a as pe,o,d as Fe,R as qt,p as Dt,r as ce,u as Ht,y as G}from"./index-1d58e6ce.js";import{S as Lt}from"./SdkTabs-ea1c7c68.js";function bt(f,t,l){const s=f.slice();return s[7]=t[l],s}function mt(f,t,l){const s=f.slice();return s[7]=t[l],s}function _t(f,t,l){const s=f.slice();return s[12]=t[l],s}function yt(f){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(f){let t,l,s,b,u,d,p,k,C,w,O,H,A,j,M,E,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-ae021a6a.js b/ui/dist/assets/ViewApiDocs-e9c275a8.js similarity index 98% rename from ui/dist/assets/ViewApiDocs-ae021a6a.js rename to ui/dist/assets/ViewApiDocs-e9c275a8.js index b11f1d3c..9522f1ac 100644 --- a/ui/dist/assets/ViewApiDocs-ae021a6a.js +++ b/ui/dist/assets/ViewApiDocs-e9c275a8.js @@ -1,4 +1,4 @@ -import{S as Ze,i as et,s as tt,M as Ye,e as o,w as m,b as u,c as _e,f as _,g as r,h as l,m as ke,x as me,N as ze,O as lt,k as st,P as nt,n as ot,t as G,a as J,o as d,d as he,R as it,C as Ge,p as at,r as K,u as rt}from"./index-97145449.js";import{S as dt}from"./SdkTabs-259b2687.js";function Je(i,s,n){const a=i.slice();return a[6]=s[n],a}function Ke(i,s,n){const a=i.slice();return a[6]=s[n],a}function Qe(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+"",y,c,f,b;function R(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),y=m(a),c=u(),_(n,"class","tab-item"),K(n,"active",s[2]===s[6].code),this.first=n},m(h,F){r(h,n,F),l(n,y),l(n,c),f||(b=rt(n,"click",R),f=!0)},p(h,F){s=h,F&20&&K(n,"active",s[2]===s[6].code)},d(h){h&&d(n),f=!1,b()}}}function Xe(i,s){let n,a,y,c;return a=new Ye({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),_e(a.$$.fragment),y=u(),_(n,"class","tab-item"),K(n,"active",s[2]===s[6].code),this.first=n},m(f,b){r(f,n,b),ke(a,n,null),l(n,y),c=!0},p(f,b){s=f,(!c||b&20)&&K(n,"active",s[2]===s[6].code)},i(f){c||(G(a.$$.fragment,f),c=!0)},o(f){J(a.$$.fragment,f),c=!1},d(f){f&&d(n),he(a)}}}function ct(i){var Ne,Ue;let s,n,a=i[0].name+"",y,c,f,b,R,h,F,N=i[0].name+"",Q,ve,W,g,X,B,Y,$,U,we,j,E,ye,Z,V=i[0].name+"",ee,$e,te,Ce,le,M,se,x,ne,A,oe,O,ie,Re,ae,D,re,Fe,de,ge,k,Oe,S,De,Pe,Te,ce,Ee,fe,Se,Be,Me,pe,xe,ue,I,be,P,H,C=[],Ae=new Map,Ie,q,v=[],He=new Map,T;g=new dt({props:{js:` +import{S as Ze,i as et,s as tt,M as Ye,e as o,w as m,b as u,c as _e,f as _,g as r,h as l,m as ke,x as me,N as ze,O as lt,k as st,P as nt,n as ot,t as G,a as J,o as d,d as he,R as it,C as Ge,p as at,r as K,u as rt}from"./index-1d58e6ce.js";import{S as dt}from"./SdkTabs-ea1c7c68.js";function Je(i,s,n){const a=i.slice();return a[6]=s[n],a}function Ke(i,s,n){const a=i.slice();return a[6]=s[n],a}function Qe(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+"",y,c,f,b;function R(){return s[5](s[6])}return{key:i,first:null,c(){n=o("button"),y=m(a),c=u(),_(n,"class","tab-item"),K(n,"active",s[2]===s[6].code),this.first=n},m(h,F){r(h,n,F),l(n,y),l(n,c),f||(b=rt(n,"click",R),f=!0)},p(h,F){s=h,F&20&&K(n,"active",s[2]===s[6].code)},d(h){h&&d(n),f=!1,b()}}}function Xe(i,s){let n,a,y,c;return a=new Ye({props:{content:s[6].body}}),{key:i,first:null,c(){n=o("div"),_e(a.$$.fragment),y=u(),_(n,"class","tab-item"),K(n,"active",s[2]===s[6].code),this.first=n},m(f,b){r(f,n,b),ke(a,n,null),l(n,y),c=!0},p(f,b){s=f,(!c||b&20)&&K(n,"active",s[2]===s[6].code)},i(f){c||(G(a.$$.fragment,f),c=!0)},o(f){J(a.$$.fragment,f),c=!1},d(f){f&&d(n),he(a)}}}function ct(i){var Ne,Ue;let s,n,a=i[0].name+"",y,c,f,b,R,h,F,N=i[0].name+"",Q,ve,W,g,X,B,Y,$,U,we,j,E,ye,Z,V=i[0].name+"",ee,$e,te,Ce,le,M,se,x,ne,A,oe,O,ie,Re,ae,D,re,Fe,de,ge,k,Oe,S,De,Pe,Te,ce,Ee,fe,Se,Be,Me,pe,xe,ue,I,be,P,H,C=[],Ae=new Map,Ie,q,v=[],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-97145449.js b/ui/dist/assets/index-1d58e6ce.js similarity index 82% rename from ui/dist/assets/index-97145449.js rename to ui/dist/assets/index-1d58e6ce.js index 20ef3880..dccb359b 100644 --- a/ui/dist/assets/index-97145449.js +++ b/ui/dist/assets/index-1d58e6ce.js @@ -1,44 +1,44 @@ -(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 Q(){}const $l=n=>n;function Re(n,e){for(const t in e)n[t]=e[t];return n}function yb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function L_(n){return n()}function cu(){return Object.create(null)}function De(n){n.forEach(L_)}function Ut(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ql;function Dn(n,e){return ql||(ql=document.createElement("a")),ql.href=e,n===ql.href}function kb(n){return Object.keys(n).length===0}function N_(n,...e){if(n==null)return Q;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ke(n,e,t){n.$$.on_destroy.push(N_(e,t))}function Tt(n,e,t,i){if(n){const s=F_(n,e,t,i);return n[0](s)}}function F_(n,e,t,i){return n[1]&&i?Re(t.ctx.slice(),n[1](i(e))):t.ctx}function Ct(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(),_a=R_?n=>requestAnimationFrame(n):Q;const ys=new Set;function q_(n){ys.forEach(e=>{e.c(n)||(ys.delete(e),e.f())}),ys.size!==0&&_a(q_)}function qo(n){let e;return ys.size===0&&_a(q_),{promise:new Promise(t=>{ys.add(e={c:n,f:t})}),abort(){ys.delete(e)}}}function v(n,e){n.appendChild(e)}function j_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function wb(n){const e=y("style");return Sb(j_(n),e),e.sheet}function Sb(n,e){return v(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 dt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function ft(n){return function(e){return e.preventDefault(),n.call(this,e)}}function En(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function h(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ni(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]:h(n,i,e[i])}function $b(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function _t(n){return n===""?null:+n}function Tb(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.data!==e&&(n.data=e)}function ue(n,e){n.value=e??""}function qr(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 V_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function Pt(n,e){return new n(e)}const ho=new Map;let _o=0;function Cb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Mb(n,e){const t={stylesheet:wb(e),rules:{}};return ho.set(n,t),t}function cl(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 Q(){}const $l=n=>n;function Re(n,e){for(const t in e)n[t]=e[t];return n}function kb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function N_(n){return n()}function cu(){return Object.create(null)}function De(n){n.forEach(N_)}function Ut(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ql;function Dn(n,e){return ql||(ql=document.createElement("a")),ql.href=e,n===ql.href}function wb(n){return Object.keys(n).length===0}function F_(n,...e){if(n==null)return Q;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ke(n,e,t){n.$$.on_destroy.push(F_(e,t))}function Tt(n,e,t,i){if(n){const s=R_(n,e,t,i);return n[0](s)}}function R_(n,e,t,i){return n[1]&&i?Re(t.ctx.slice(),n[1](i(e))):t.ctx}function Ct(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(),_a=q_?n=>requestAnimationFrame(n):Q;const ys=new Set;function j_(n){ys.forEach(e=>{e.c(n)||(ys.delete(e),e.f())}),ys.size!==0&&_a(j_)}function qo(n){let e;return ys.size===0&&_a(j_),{promise:new Promise(t=>{ys.add(e={c:n,f:t})}),abort(){ys.delete(e)}}}function v(n,e){n.appendChild(e)}function V_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Sb(n){const e=y("style");return $b(V_(n),e),e.sheet}function $b(n,e){return v(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 dt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function ft(n){return function(e){return e.preventDefault(),n.call(this,e)}}function En(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function h(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ni(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]:h(n,i,e[i])}function Tb(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function _t(n){return n===""?null:+n}function Cb(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.data!==e&&(n.data=e)}function ue(n,e){n.value=e??""}function qr(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 H_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function Pt(n,e){return new n(e)}const ho=new Map;let _o=0;function Mb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Ob(n,e){const t={stylesheet:Sb(e),rules:{}};return ho.set(n,t),t}function cl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ `;for(let b=0;b<=1;b+=a){const k=e+(t-e)*l(b);u+=b*100+`%{${o(k,1-k)}} `}const f=u+`100% {${o(t,1-t)}} -}`,d=`__svelte_${Cb(f)}_${r}`,p=j_(n),{stylesheet:m,rules:_}=ho.get(p)||Mb(p,n);_[d]||(_[d]=!0,m.insertRule(`@keyframes ${d} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${d} ${i}ms linear ${s}ms 1 both`,_o+=1,d}function dl(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(", "),_o-=s,_o||Ob())}function Ob(){_a(()=>{_o||(ho.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),ho.clear())})}function Db(n,e,t,i){if(!e)return Q;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return Q;const{delay:l=0,duration:o=300,easing:r=$l,start:a=Ro()+l,end:u=a+o,tick:f=Q,css:d}=t(n,{from:e,to:s},i);let p=!0,m=!1,_;function g(){d&&(_=cl(n,0,1,o,l,r,d)),l||(m=!0)}function b(){d&&dl(n,_),p=!1}return qo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),b()),!p)return!1;if(m){const $=k-a,T=0+1*r($/o);f(T,1-T)}return!0}),g(),f(0,1),b}function Eb(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,H_(n,s)}}function H_(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 pl;function ci(n){pl=n}function Tl(){if(!pl)throw new Error("Function called outside component initialization");return pl}function xt(n){Tl().$$.on_mount.push(n)}function Ab(n){Tl().$$.after_update.push(n)}function z_(n){Tl().$$.on_destroy.push(n)}function kt(){const n=Tl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=V_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function pe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const vs=[],se=[];let ks=[];const jr=[],B_=Promise.resolve();let Vr=!1;function U_(){Vr||(Vr=!0,B_.then(ga))}function ln(){return U_(),B_}function nt(n){ks.push(n)}function ke(n){jr.push(n)}const ir=new Set;let ps=0;function ga(){if(ps!==0)return;const n=pl;do{try{for(;psn.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ks=e}let Vs;function ba(){return Vs||(Vs=Promise.resolve(),Vs.then(()=>{Vs=null})),Vs}function xi(n,e,t){n.dispatchEvent(V_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let xn;function re(){xn={r:0,c:[],p:xn}}function ae(){xn.r||De(xn.c),xn=xn.p}function A(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),xn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const va={duration:0};function Lb(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&dl(n,o)}function f(){const{delay:p=0,duration:m=300,easing:_=$l,tick:g=Q,css:b}=s||va;b&&(o=cl(n,0,1,m,p,_,b,a++)),g(0,1);const k=Ro()+p,$=k+m;r&&r.abort(),l=!0,nt(()=>xi(n,!0,"start")),r=qo(T=>{if(l){if(T>=$)return g(1,0),xi(n,!0,"end"),u(),l=!1;if(T>=k){const C=_((T-k)/m);g(C,1-C)}}return l})}let d=!1;return{start(){d||(d=!0,dl(n),Ut(s)?(s=s(i),ba().then(f)):f())},invalidate(){d=!1},end(){l&&(u(),l=!1)}}}function Nb(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=xn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:d=$l,tick:p=Q,css:m}=s||va;m&&(o=cl(n,1,0,f,u,d,m));const _=Ro()+u,g=_+f;nt(()=>xi(n,!1,"start")),qo(b=>{if(l){if(b>=g)return p(0,1),xi(n,!1,"end"),--r.r||De(r.c),!1;if(b>=_){const k=d((b-_)/f);p(1-k,k)}}return l})}return Ut(s)?ba().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&dl(n,o),l=!1)}}}function Ve(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&&dl(n,u)}function d(m,_){const g=m.b-o;return _*=Math.abs(g),{a:o,b:m.b,d:g,duration:_,start:m.start,end:m.start+_,group:m.group}}function p(m){const{delay:_=0,duration:g=300,easing:b=$l,tick:k=Q,css:$}=l||va,T={start:Ro()+_,b:m};m||(T.group=xn,xn.r+=1),r||a?a=T:($&&(f(),u=cl(n,o,m,g,_,b,$)),m&&k(0,1),r=d(T,g),nt(()=>xi(n,m,"start")),qo(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,xi(n,r.b,"start"),$&&(f(),u=cl(n,o,r.b,r.duration,0,b,l.css))),r){if(C>=r.end)k(o=r.b,1-o),xi(n,r.b,"end"),a||(r.b?f():--r.group.r||De(r.group.c)),r=null;else if(C>=r.start){const D=C-r.start;o=r.a+r.d*b(D/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(m){Ut(l)?ba().then(()=>{l=l(s),p(m)}):p(m)},end(){f(),r=a=null}}}function pu(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((d,p)=>{p!==l&&d&&(re(),P(d,1,1,()=>{e.blocks[p]===d&&(e.blocks[p]=null)}),ae())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&ga()}if(yb(n)){const s=Tl();if(n.then(l=>{ci(s),i(e.then,1,e.value,l),ci(null)},l=>{if(ci(s),i(e.catch,2,e.error,l),ci(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 Fb(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 ls(n,e){n.d(1),e.delete(n.key)}function Zt(n,e){P(n,1,1,()=>{e.delete(n.key)})}function Rb(n,e){n.f(),Zt(n,e)}function yt(n,e,t,i,s,l,o,r,a,u,f,d){let p=n.length,m=l.length,_=p;const g={};for(;_--;)g[n[_].key]=_;const b=[],k=new Map,$=new Map,T=[];for(_=m;_--;){const O=d(s,l,_),I=t(O);let L=o.get(I);L?i&&T.push(()=>L.p(O,e)):(L=u(I,O),L.c()),k.set(I,b[_]=L),I in g&&$.set(I,Math.abs(_-g[I]))}const C=new Set,D=new Set;function M(O){A(O,1),O.m(r,f),o.set(O.key,O),f=O.first,m--}for(;p&&m;){const O=b[m-1],I=n[p-1],L=O.key,F=I.key;O===I?(f=O.first,p--,m--):k.has(F)?!o.has(L)||C.has(L)?M(O):D.has(F)?p--:$.get(L)>$.get(F)?(D.add(L),M(O)):(C.add(F),p--):(a(I,o),p--)}for(;p--;){const O=n[p];k.has(O.key)||a(O,o)}for(;m;)M(b[m-1]);return De(T),b}function St(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 Kt(n){return typeof n=="object"&&n!==null?n:{}}function he(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function z(n){n&&n.c()}function V(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||nt(()=>{const o=n.$$.on_mount.map(L_).filter(Ut);n.$$.on_destroy?n.$$.on_destroy.push(...o):De(o),n.$$.on_mount=[]}),l.forEach(nt)}function H(n,e){const t=n.$$;t.fragment!==null&&(Pb(t.after_update),De(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function qb(n,e){n.$$.dirty[0]===-1&&(vs.push(n),U_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const _=m.length?m[0]:p;return u.ctx&&s(u.ctx[d],u.ctx[d]=_)&&(!u.skip_bound&&u.bound[d]&&u.bound[d](_),f&&qb(n,d)),p}):[],u.update(),f=!0,De(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const d=Tb(e.target);u.fragment&&u.fragment.l(d),d.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),V(n,e.target,e.anchor,e.customElement),ga()}ci(a)}class ve{$destroy(){H(this,1),this.$destroy=Q}$on(e,t){if(!Ut(t))return Q;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&&!kb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Rt(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(),t=null)}}return{set:s,update:l,subscribe:o}}function Y_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return W_(t,o=>{let r=!1;const a=[];let u=0,f=Q;const d=()=>{if(u)return;f();const m=e(i?a[0]:a,o);l?o(m):f=Ut(m)?m:Q},p=s.map((m,_)=>N_(m,g=>{a[_]=g,u&=~(1<<_),r&&d()},()=>{u|=1<<_}));return r=!0,d(),function(){De(p),f(),r=!1}})}function K_(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,s,l,o=[],r="",a=n.split("/");for(a[0]||a.shift();s=a.shift();)t=s[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=s.indexOf("?",1),l=s.indexOf(".",1),o.push(s.substring(1,~i?i:~l?l:s.length)),r+=~i&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(r+=(~i?"?":"")+"\\"+s.substring(l))):r+="/"+s;return{keys:o,pattern:new RegExp("^"+r+(e?"(?=$|/)":"/?$"),"i")}}function jb(n){let e,t,i;const s=[n[2]];var l=n[0];function o(r){let a={};for(let u=0;u{H(f,1)}),ae()}l?(e=Pt(l,o()),e.$on("routeEvent",r[7]),z(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function Vb(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{H(f,1)}),ae()}l?(e=Pt(l,o()),e.$on("routeEvent",r[6]),z(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function Hb(n){let e,t,i,s;const l=[Vb,jb],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},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()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function mu(){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 jo=W_(null,function(e){e(mu());const t=()=>{e(mu())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Y_(jo,n=>n.location);const ya=Y_(jo,n=>n.querystring),hu=An(void 0);async function Li(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await ln();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 an(n,e){if(e=gu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return _u(n,e),{update(t){t=gu(t),_u(n,t)}}}function zb(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function _u(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||Bb(i.currentTarget.getAttribute("href"))})}function gu(n){return n&&typeof n=="string"?{href:n}:n||{}}function Bb(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Ub(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(D,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!D||typeof D=="string"&&(D.length<1||D.charAt(0)!="/"&&D.charAt(0)!="*")||typeof D=="object"&&!(D instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:I}=K_(D);this.path=D,typeof M=="object"&&M._sveltesparouter===!0?(this.component=M.component,this.conditions=M.conditions||[],this.userData=M.userData,this.props=M.props||{}):(this.component=()=>Promise.resolve(M),this.conditions=[],this.props={}),this._pattern=O,this._keys=I}match(D){if(s){if(typeof s=="string")if(D.startsWith(s))D=D.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const L=D.match(s);if(L&&L[0])D=D.substr(L[0].length)||"/";else return null}}const M=this._pattern.exec(D);if(M===null)return null;if(this._keys===!1)return M;const O={};let I=0;for(;I{r.push(new o(D,C))}):Object.keys(i).forEach(C=>{r.push(new o(C,i[C]))});let a=null,u=null,f={};const d=kt();async function p(C,D){await ln(),d(C,D)}let m=null,_=null;l&&(_=C=>{C.state&&(C.state.__svelte_spa_router_scrollY||C.state.__svelte_spa_router_scrollX)?m=C.state:m=null},window.addEventListener("popstate",_),Ab(()=>{zb(m)}));let g=null,b=null;const k=jo.subscribe(async C=>{g=C;let D=0;for(;D{hu.set(u)});return}t(0,a=null),b=null,hu.set(void 0)});z_(()=>{k(),_&&window.removeEventListener("popstate",_)});function $(C){pe.call(this,n,C)}function T(C){pe.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,$,T]}class Wb extends ve{constructor(e){super(),be(this,e,Ub,Hb,_e,{routes:3,prefix:4,restoreScrollState:5})}}const ao=[];let J_;function Z_(n){const e=n.pattern.test(J_);bu(n,n.className,e),bu(n,n.inactiveClassName,!e)}function bu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}jo.subscribe(n=>{J_=n.location+(n.querystring?"?"+n.querystring:""),ao.map(Z_)});function Yn(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"?K_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ao.push(i),Z_(i),{destroy(){ao.splice(ao.indexOf(i),1)}}}const Yb="modulepreload",Kb=function(n,e){return new URL(n,e).href},vu={},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=Kb(l,i),l in vu)return;vu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const d=s[f];if(d.href===l&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":Yb,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e())};var Hr=function(n,e){return Hr=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])},Hr(n,e)};function Qt(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}Hr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var zr=function(){return zr=Object.assign||function(e){for(var t,i=1,s=arguments.length;i0&&s[s.length-1])||d[0]!==6&&d[0]!==2)){o=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0&&(!t.exp||t.exp-e>Date.now()/1e3))}G_=typeof atob=="function"?atob:function(n){var e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};var Cl=function(){function n(e){e===void 0&&(e={}),this.$load(e||{})}return n.prototype.load=function(e){return this.$load(e)},n.prototype.$load=function(e){for(var t=0,i=Object.entries(e);t4096&&(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 pi&&(a.model.username=this.model.username,a.model.verified=this.model.verified,a.model.collectionId=this.model.collectionId),u=yu(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||[]},ka=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Qt(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 Qt(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 un(l,void 0,void 0,function(){return fn(this,function(u){return[2,this._getList(t,a,i||200,s).then(function(f){var d=f,p=d.items,m=d.totalItems;return o=o.concat(p),p.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 un(this,void 0,void 0,function(){return fn(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 un(t,void 0,void 0,function(){var l;return fn(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 ml({url:M.url,status:M.status,data:O});return[2,O]}})})}).catch(function(M){throw new ml(M)})]}})})},n.prototype.getFileUrl=function(e,t,i){return i===void 0&&(i={}),this.files.getUrl(e,t,i)},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 es(n){return typeof n=="number"}function Ho(n){return typeof n=="number"&&n%1===0}function c0(n){return typeof n=="string"}function d0(n){return Object.prototype.toString.call(n)==="[object Date]"}function kg(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function p0(n){return Array.isArray(n)?n:[n]}function ku(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 m0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ms(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function di(n,e,t){return Ho(n)&&n>=e&&n<=t}function h0(n,e){return n-e*Math.floor(n/e)}function Ht(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Si(n){if(!(it(n)||n===null||n===""))return parseInt(n,10)}function zi(n){if(!(it(n)||n===null||n===""))return parseFloat(n)}function wa(n){if(!(it(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Sa(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Ml(n){return n%4===0&&(n%100!==0||n%400===0)}function nl(n){return Ml(n)?366:365}function go(n,e){const t=h0(e-1,12)+1,i=n+(e-t)/12;return t===2?Ml(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function $a(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 bo(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 Wr(n){return n>99?n:n>60?1900+n:2e3+n}function wg(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 zo(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 Sg(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new qn(`Invalid unit value ${n}`);return e}function vo(n,e){const t={};for(const i in n)if(Ms(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=Sg(s)}return t}function il(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}${Ht(t,2)}:${Ht(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Ht(t,2)}${Ht(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Bo(n){return m0(n,["hour","minute","second","millisecond"])}const $g=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,_0=["January","February","March","April","May","June","July","August","September","October","November","December"],Tg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g0=["J","F","M","A","M","J","J","A","S","O","N","D"];function Cg(n){switch(n){case"narrow":return[...g0];case"short":return[...Tg];case"long":return[..._0];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 Mg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Og=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],b0=["M","T","W","T","F","S","S"];function Dg(n){switch(n){case"narrow":return[...b0];case"short":return[...Og];case"long":return[...Mg];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Eg=["AM","PM"],v0=["Before Christ","Anno Domini"],y0=["BC","AD"],k0=["B","A"];function Ag(n){switch(n){case"narrow":return[...k0];case"short":return[...y0];case"long":return[...v0];default:return null}}function w0(n){return Eg[n.hour<12?0:1]}function S0(n,e){return Dg(e)[n.weekday-1]}function $0(n,e){return Cg(e)[n.month-1]}function T0(n,e){return Ag(e)[n.year<0?0:1]}function C0(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 d=n==="days";switch(e){case 1:return d?"tomorrow":`next ${s[n][0]}`;case-1:return d?"yesterday":`last ${s[n][0]}`;case 0:return d?"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 wu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const M0={D:Ur,DD:ng,DDD:ig,DDDD:sg,t:lg,tt:og,ttt:rg,tttt:ag,T:ug,TT:fg,TTT:cg,TTTT:dg,f:pg,ff:hg,fff:gg,ffff:vg,F:mg,FF:_g,FFF:bg,FFFF:yg};class yn{static create(e,t={}){return new yn(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 M0[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 Ht(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,_)=>this.loc.extract(e,m,_),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?w0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,_)=>i?$0(e,m):l(_?{month:m}:{month:m,day:"numeric"},"month"),u=(m,_)=>i?S0(e,m):l(_?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const _=yn.macroTokenToFormatOpts(m);return _?this.formatWithSystemDefault(e,_):m},d=m=>i?T0(e,m):l({era:m},"era"),p=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 d("short");case"GG":return d("long");case"GGGGG":return d("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 wu(yn.parseFormat(t),p)}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=yn.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 wu(l,s(r))}}class Kn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ol{get type(){throw new ki}get name(){throw new ki}get ianaName(){return this.name}get isUniversal(){throw new ki}offsetName(e,t){throw new ki}formatOffset(e,t){throw new ki}offset(e){throw new ki}equals(e){throw new ki}get isValid(){throw new ki}}let sr=null;class Ta extends Ol{static get instance(){return sr===null&&(sr=new Ta),sr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return wg(e,t,i)}formatOffset(e,t){return il(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let uo={};function O0(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 D0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function E0(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 A0(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?_:1e3+_,(p-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let lr=null;class cn extends Ol{static get utcInstance(){return lr===null&&(lr=new cn(0)),lr}static instance(e){return e===0?cn.utcInstance:new cn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new cn(zo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${il(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${il(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return il(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 I0 extends Ol{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 $i(n,e){if(it(n)||n===null)return e;if(n instanceof Ol)return n;if(c0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?cn.utcInstance:cn.parseSpecifier(t)||mi.create(n)}else return es(n)?cn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new I0(n)}let Su=()=>Date.now(),$u="system",Tu=null,Cu=null,Mu=null,Ou;class Wt{static get now(){return Su}static set now(e){Su=e}static set defaultZone(e){$u=e}static get defaultZone(){return $i($u,Ta.instance)}static get defaultLocale(){return Tu}static set defaultLocale(e){Tu=e}static get defaultNumberingSystem(){return Cu}static set defaultNumberingSystem(e){Cu=e}static get defaultOutputCalendar(){return Mu}static set defaultOutputCalendar(e){Mu=e}static get throwOnInvalid(){return Ou}static set throwOnInvalid(e){Ou=e}static resetCaches(){$t.resetCache(),mi.resetCache()}}let Du={};function P0(n,e={}){const t=JSON.stringify([n,e]);let i=Du[t];return i||(i=new Intl.ListFormat(n,e),Du[t]=i),i}let Yr={};function Kr(n,e={}){const t=JSON.stringify([n,e]);let i=Yr[t];return i||(i=new Intl.DateTimeFormat(n,e),Yr[t]=i),i}let Jr={};function L0(n,e={}){const t=JSON.stringify([n,e]);let i=Jr[t];return i||(i=new Intl.NumberFormat(n,e),Jr[t]=i),i}let Zr={};function N0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Zr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Zr[s]=l),l}let xs=null;function F0(){return xs||(xs=new Intl.DateTimeFormat().resolvedOptions().locale,xs)}function R0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Kr(n).resolvedOptions()}catch{t=Kr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function q0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function j0(n){const e=[];for(let t=1;t<=12;t++){const i=ze.utc(2016,t,1);e.push(n(i))}return e}function V0(n){const e=[];for(let t=1;t<=7;t++){const i=ze.utc(2016,11,13+t);e.push(n(i))}return e}function Hl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function H0(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 z0{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=L0(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):Sa(e,3);return Ht(t,this.padTo)}}}class B0{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&&mi.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:ze.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=Kr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class U0{constructor(e,t,i){this.opts={style:"long",...i},!t&&kg()&&(this.rtf=N0(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):C0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class $t{static fromOpts(e){return $t.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Wt.defaultLocale,o=l||(s?"en-US":F0()),r=t||Wt.defaultNumberingSystem,a=i||Wt.defaultOutputCalendar;return new $t(o,r,a,l)}static resetCache(){xs=null,Yr={},Jr={},Zr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return $t.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=R0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=q0(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=H0(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:$t.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 Hl(this,e,i,Cg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=j0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Hl(this,e,i,Dg,()=>{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]=V0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Hl(this,void 0,e,()=>Eg,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ze.utc(2016,11,13,9),ze.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Hl(this,e,t,Ag,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[ze.utc(-40,1,1),ze.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 z0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new B0(e,this.intl,t)}relFormatter(e={}){return new U0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return P0(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 Ls(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ns(...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 Fs(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 Ig(...n){return(e,t)=>{const i={};let s;for(s=0;sm!==void 0&&(_||m&&f)?-m:m;return[{years:p(zi(t)),months:p(zi(i)),weeks:p(zi(s)),days:p(zi(l)),hours:p(zi(o)),minutes:p(zi(r)),seconds:p(zi(a),a==="-0"),milliseconds:p(wa(u),d)}]}const iv={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 Oa(n,e,t,i,s,l,o){const r={year:e.length===2?Wr(Si(e)):Si(e),month:Tg.indexOf(t)+1,day:Si(i),hour:Si(s),minute:Si(l)};return o&&(r.second=Si(o)),n&&(r.weekday=n.length>3?Mg.indexOf(n)+1:Og.indexOf(n)+1),r}const sv=/^(?:(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 lv(n){const[,e,t,i,s,l,o,r,a,u,f,d]=n,p=Oa(e,s,i,t,l,o,r);let m;return a?m=iv[a]:u?m=0:m=zo(f,d),[p,new cn(m)]}function ov(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const rv=/^(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$/,av=/^(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$/,uv=/^(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 Eu(n){const[,e,t,i,s,l,o,r]=n;return[Oa(e,s,i,t,l,o,r),cn.utcInstance]}function fv(n){const[,e,t,i,s,l,o,r]=n;return[Oa(e,r,t,i,s,l,o),cn.utcInstance]}const cv=Ls(Y0,Ma),dv=Ls(K0,Ma),pv=Ls(J0,Ma),mv=Ls(Lg),Fg=Ns(x0,Rs,Dl,El),hv=Ns(Z0,Rs,Dl,El),_v=Ns(G0,Rs,Dl,El),gv=Ns(Rs,Dl,El);function bv(n){return Fs(n,[cv,Fg],[dv,hv],[pv,_v],[mv,gv])}function vv(n){return Fs(ov(n),[sv,lv])}function yv(n){return Fs(n,[rv,Eu],[av,Eu],[uv,fv])}function kv(n){return Fs(n,[tv,nv])}const wv=Ns(Rs);function Sv(n){return Fs(n,[ev,wv])}const $v=Ls(X0,Q0),Tv=Ls(Ng),Cv=Ns(Rs,Dl,El);function Mv(n){return Fs(n,[$v,Fg],[Tv,Cv])}const Ov="Invalid Duration",Rg={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}},Dv={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},...Rg},Pn=146097/400,hs=146097/4800,Ev={years:{quarters:4,months:12,weeks:Pn/7,days:Pn,hours:Pn*24,minutes:Pn*24*60,seconds:Pn*24*60*60,milliseconds:Pn*24*60*60*1e3},quarters:{months:3,weeks:Pn/28,days:Pn/4,hours:Pn*24/4,minutes:Pn*24*60/4,seconds:Pn*24*60*60/4,milliseconds:Pn*24*60*60*1e3/4},months:{weeks:hs/7,days:hs,hours:hs*24,minutes:hs*24*60,seconds:hs*24*60*60,milliseconds:hs*24*60*60*1e3},...Rg},Ji=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Av=Ji.slice(0).reverse();function Bi(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 ot(i)}function Iv(n){return n<0?Math.floor(n):Math.ceil(n)}function qg(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?Iv(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function Pv(n,e){Av.reduce((t,i)=>it(e[i])?t:(t&&qg(n,e,t,e,i),i),null)}class ot{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||$t.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Ev:Dv,this.isLuxonDuration=!0}static fromMillis(e,t){return ot.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new qn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:vo(e,ot.normalizeUnit),loc:$t.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(es(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new qn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=kv(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Sv(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new qn("need to specify a reason the Duration is invalid");const i=e instanceof Kn?e:new Kn(e,t);if(Wt.throwOnInvalid)throw new a0(i);return new ot({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 tg(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?yn.create(this.loc,i).formatDurationFromString(this,e):Ov}toHuman(e={}){const t=Ji.map(i=>{const s=this.values[i];return it(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+=Sa(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=ot.fromDurationLike(e),i={};for(const s of Ji)(Ms(t.values,s)||Ms(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Bi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=ot.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]=Sg(e(this.values[i],i));return Bi(this,{values:t},!0)}get(e){return this[ot.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...vo(e,ot.normalizeUnit)};return Bi(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),Bi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Pv(this.matrix,e),Bi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ot.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Ji)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;es(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)Ji.indexOf(u)>Ji.indexOf(o)&&qg(this.matrix,s,u,t,o)}else es(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 Bi(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 Bi(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 Ji)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Hs="Invalid Interval";function Lv(n,e){return!n||!n.isValid?Et.invalid("missing or invalid start"):!e||!e.isValid?Et.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?Et.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Us).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Et.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=ot.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(Et.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:Et.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Et.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(Et.fromDateTimes(t,a.time)),t=null);return Et.merge(s)}difference(...e){return Et.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Hs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Hs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Hs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Hs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Hs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ot.invalid(this.invalidReason)}mapEndpoints(e){return Et.fromDateTimes(e(this.s),e(this.e))}}class zl{static hasDST(e=Wt.defaultZone){const t=ze.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return mi.isValidZone(e)}static normalizeZone(e){return $i(e,Wt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||$t.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||$t.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||$t.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||$t.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return $t.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return $t.create(t,null,"gregory").eras(e)}static features(){return{relative:kg()}}}function Au(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ot.fromMillis(i).as("days"))}function Nv(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=Au(r,a);return(u-u%7)/7}],["days",Au]],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 Fv(n,e,t,i){let[s,l,o,r]=Nv(n,e,t);const a=e-s,u=t.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(o0?ot.fromMillis(a,i).shiftTo(...u).plus(f):f}const Da={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Iu={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]},Rv=Da.hanidec.replace(/[\[|\]]/g,"").split("");function qv(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 Un({numberingSystem:n},e=""){return new RegExp(`${Da[n||"latn"]}${e}`)}const jv="missing Intl.DateTimeFormat.formatToParts support";function at(n,e=t=>t){return{regex:n,deser:([t])=>e(qv(t))}}const Vv=String.fromCharCode(160),jg=`[ ${Vv}]`,Vg=new RegExp(jg,"g");function Hv(n){return n.replace(/\./g,"\\.?").replace(Vg,jg)}function Pu(n){return n.replace(/\./g,"").replace(Vg," ").toLowerCase()}function Wn(n,e){return n===null?null:{regex:RegExp(n.map(Hv).join("|")),deser:([t])=>n.findIndex(i=>Pu(t)===Pu(i))+e}}function Lu(n,e){return{regex:n,deser:([,t,i])=>zo(t,i),groups:e}}function or(n){return{regex:n,deser:([e])=>e}}function zv(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Bv(n,e){const t=Un(e),i=Un(e,"{2}"),s=Un(e,"{3}"),l=Un(e,"{4}"),o=Un(e,"{6}"),r=Un(e,"{1,2}"),a=Un(e,"{1,3}"),u=Un(e,"{1,6}"),f=Un(e,"{1,9}"),d=Un(e,"{2,4}"),p=Un(e,"{4,6}"),m=b=>({regex:RegExp(zv(b.val)),deser:([k])=>k,literal:!0}),g=(b=>{if(n.literal)return m(b);switch(b.val){case"G":return Wn(e.eras("short",!1),0);case"GG":return Wn(e.eras("long",!1),0);case"y":return at(u);case"yy":return at(d,Wr);case"yyyy":return at(l);case"yyyyy":return at(p);case"yyyyyy":return at(o);case"M":return at(r);case"MM":return at(i);case"MMM":return Wn(e.months("short",!0,!1),1);case"MMMM":return Wn(e.months("long",!0,!1),1);case"L":return at(r);case"LL":return at(i);case"LLL":return Wn(e.months("short",!1,!1),1);case"LLLL":return Wn(e.months("long",!1,!1),1);case"d":return at(r);case"dd":return at(i);case"o":return at(a);case"ooo":return at(s);case"HH":return at(i);case"H":return at(r);case"hh":return at(i);case"h":return at(r);case"mm":return at(i);case"m":return at(r);case"q":return at(r);case"qq":return at(i);case"s":return at(r);case"ss":return at(i);case"S":return at(a);case"SSS":return at(s);case"u":return or(f);case"uu":return or(r);case"uuu":return at(t);case"a":return Wn(e.meridiems(),0);case"kkkk":return at(l);case"kk":return at(d,Wr);case"W":return at(r);case"WW":return at(i);case"E":case"c":return at(t);case"EEE":return Wn(e.weekdays("short",!1,!1),1);case"EEEE":return Wn(e.weekdays("long",!1,!1),1);case"ccc":return Wn(e.weekdays("short",!0,!1),1);case"cccc":return Wn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Lu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Lu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return or(/[a-z_+-/]{1,256}?/i);default:return m(b)}})(n)||{invalidReason:jv};return g.token=n,g}const Uv={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 Wv(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=Uv[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function Yv(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Kv(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Ms(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 Jv(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 it(n.z)||(t=mi.create(n.z)),it(n.Z)||(t||(t=new cn(n.Z)),i=n.Z),it(n.q)||(n.M=(n.q-1)*3+1),it(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),it(n.u)||(n.S=wa(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let rr=null;function Zv(){return rr||(rr=ze.fromMillis(1555555555555)),rr}function Gv(n,e){if(n.literal)return n;const t=yn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=yn.create(e,t).formatDateTimeParts(Zv()).map(o=>Wv(o,e,t));return l.includes(void 0)?n:l}function Xv(n,e){return Array.prototype.concat(...n.map(t=>Gv(t,e)))}function Hg(n,e,t){const i=Xv(yn.parseFormat(t),n),s=i.map(o=>Bv(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=Yv(s),a=RegExp(o,"i"),[u,f]=Kv(e,a,r),[d,p,m]=f?Jv(f):[null,null,void 0];if(Ms(f,"a")&&Ms(f,"H"))throw new Qs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:d,zone:p,specificOffset:m}}}function Qv(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=Hg(n,e,t);return[i,s,l,o]}const zg=[0,31,59,90,120,151,181,212,243,273,304,334],Bg=[0,31,60,91,121,152,182,213,244,274,305,335];function Vn(n,e){return new Kn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Ug(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 Wg(n,e,t){return t+(Ml(n)?Bg:zg)[e-1]}function Yg(n,e){const t=Ml(n)?Bg:zg,i=t.findIndex(l=>lbo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Bo(n)}}function Nu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Ug(e,1,4),l=nl(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=nl(r)):o>l?(r=e+1,o-=nl(e)):r=e;const{month:a,day:u}=Yg(r,o);return{year:r,month:a,day:u,...Bo(n)}}function ar(n){const{year:e,month:t,day:i}=n,s=Wg(e,t,i);return{year:e,ordinal:s,...Bo(n)}}function Fu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Yg(e,t);return{year:e,month:i,day:s,...Bo(n)}}function xv(n){const e=Ho(n.weekYear),t=di(n.weekNumber,1,bo(n.weekYear)),i=di(n.weekday,1,7);return e?t?i?!1:Vn("weekday",n.weekday):Vn("week",n.week):Vn("weekYear",n.weekYear)}function ey(n){const e=Ho(n.year),t=di(n.ordinal,1,nl(n.year));return e?t?!1:Vn("ordinal",n.ordinal):Vn("year",n.year)}function Kg(n){const e=Ho(n.year),t=di(n.month,1,12),i=di(n.day,1,go(n.year,n.month));return e?t?i?!1:Vn("day",n.day):Vn("month",n.month):Vn("year",n.year)}function Jg(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=di(e,0,23)||e===24&&t===0&&i===0&&s===0,o=di(t,0,59),r=di(i,0,59),a=di(s,0,999);return l?o?r?a?!1:Vn("millisecond",s):Vn("second",i):Vn("minute",t):Vn("hour",e)}const ur="Invalid DateTime",Ru=864e13;function Bl(n){return new Kn("unsupported zone",`the zone "${n.name}" is not supported`)}function fr(n){return n.weekData===null&&(n.weekData=Gr(n.c)),n.weekData}function zs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new ze({...t,...e,old:t})}function Zg(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 qu(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 Zg($a(n),e,t)}function ju(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,go(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ot.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=$a(l);let[a,u]=Zg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Bs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=ze.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return ze.invalid(new Kn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Ul(n,e,t=!0){return n.isValid?yn.create($t.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function cr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Ht(n.c.year,t?6:4),e?(i+="-",i+=Ht(n.c.month),i+="-",i+=Ht(n.c.day)):(i+=Ht(n.c.month),i+=Ht(n.c.day)),i}function Vu(n,e,t,i,s,l){let o=Ht(n.c.hour);return e?(o+=":",o+=Ht(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Ht(n.c.minute),(n.c.second!==0||!t)&&(o+=Ht(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Ht(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Ht(Math.trunc(-n.o/60)),o+=":",o+=Ht(Math.trunc(-n.o%60))):(o+="+",o+=Ht(Math.trunc(n.o/60)),o+=":",o+=Ht(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Gg={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ty={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ny={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Xg=["year","month","day","hour","minute","second","millisecond"],iy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],sy=["year","ordinal","hour","minute","second","millisecond"];function Hu(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 tg(n);return e}function zu(n,e){const t=$i(e.zone,Wt.defaultZone),i=$t.fromObject(e),s=Wt.now();let l,o;if(it(n.year))l=s;else{for(const u of Xg)it(n[u])&&(n[u]=Gg[u]);const r=Kg(n)||Jg(n);if(r)return ze.invalid(r);const a=t.offset(s);[l,o]=fo(n,a,t)}return new ze({ts:l,zone:t,loc:i,o})}function Bu(n,e,t){const i=it(t.round)?!0:t.round,s=(o,r)=>(o=Sa(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 Uu(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 ze{constructor(e){const t=e.zone||Wt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Kn("invalid input"):null)||(t.isValid?null:Bl(t));this.ts=it(e.ts)?Wt.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=qu(this.ts,r),i=Number.isNaN(s.year)?new Kn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||$t.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new ze({})}static local(){const[e,t]=Uu(arguments),[i,s,l,o,r,a,u]=t;return zu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Uu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=cn.utcInstance,zu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=d0(e)?e.valueOf():NaN;if(Number.isNaN(i))return ze.invalid("invalid input");const s=$i(t.zone,Wt.defaultZone);return s.isValid?new ze({ts:i,zone:s,loc:$t.fromObject(t)}):ze.invalid(Bl(s))}static fromMillis(e,t={}){if(es(e))return e<-Ru||e>Ru?ze.invalid("Timestamp out of range"):new ze({ts:e,zone:$i(t.zone,Wt.defaultZone),loc:$t.fromObject(t)});throw new qn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(es(e))return new ze({ts:e*1e3,zone:$i(t.zone,Wt.defaultZone),loc:$t.fromObject(t)});throw new qn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=$i(t.zone,Wt.defaultZone);if(!i.isValid)return ze.invalid(Bl(i));const s=Wt.now(),l=it(t.specificOffset)?i.offset(s):t.specificOffset,o=vo(e,Hu),r=!it(o.ordinal),a=!it(o.year),u=!it(o.month)||!it(o.day),f=a||u,d=o.weekYear||o.weekNumber,p=$t.fromObject(t);if((f||r)&&d)throw new Qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Qs("Can't mix ordinal dates with month/day");const m=d||o.weekday&&!f;let _,g,b=qu(s,l);m?(_=iy,g=ty,b=Gr(b)):r?(_=sy,g=ny,b=ar(b)):(_=Xg,g=Gg);let k=!1;for(const I of _){const L=o[I];it(L)?k?o[I]=g[I]:o[I]=b[I]:k=!0}const $=m?xv(o):r?ey(o):Kg(o),T=$||Jg(o);if(T)return ze.invalid(T);const C=m?Nu(o):r?Fu(o):o,[D,M]=fo(C,l,i),O=new ze({ts:D,zone:i,o:M,loc:p});return o.weekday&&f&&e.weekday!==O.weekday?ze.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,s]=bv(e);return Bs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=vv(e);return Bs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=yv(e);return Bs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new qn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=$t.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=Qv(o,e,t);return f?ze.invalid(f):Bs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return ze.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=Mv(e);return Bs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new qn("need to specify a reason the DateTime is invalid");const i=e instanceof Kn?e:new Kn(e,t);if(Wt.throwOnInvalid)throw new o0(i);return new ze({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?fr(this).weekYear:NaN}get weekNumber(){return this.isValid?fr(this).weekNumber:NaN}get weekday(){return this.isValid?fr(this).weekday:NaN}get ordinal(){return this.isValid?ar(this.c).ordinal:NaN}get monthShort(){return this.isValid?zl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?zl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?zl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?zl.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 Ml(this.year)}get daysInMonth(){return go(this.year,this.month)}get daysInYear(){return this.isValid?nl(this.year):NaN}get weeksInWeekYear(){return this.isValid?bo(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=yn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(cn.instance(e),t)}toLocal(){return this.setZone(Wt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=$i(e,Wt.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 zs(this,{ts:s,zone:e})}else return ze.invalid(Bl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return zs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=vo(e,Hu),i=!it(t.weekYear)||!it(t.weekNumber)||!it(t.weekday),s=!it(t.ordinal),l=!it(t.year),o=!it(t.month)||!it(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Qs("Can't mix ordinal dates with month/day");let u;i?u=Nu({...Gr(this.c),...t}):it(t.ordinal)?(u={...this.toObject(),...t},it(t.day)&&(u.day=Math.min(go(u.year,u.month),u.day))):u=Fu({...ar(this.c),...t});const[f,d]=fo(u,this.o,this.zone);return zs(this,{ts:f,o:d})}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return zs(this,ju(this,t))}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e).negate();return zs(this,ju(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=ot.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?yn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ur}toLocaleString(e=Ur,t={}){return this.isValid?yn.create(this.loc.clone(t),e).formatDateTime(this):ur}toLocaleParts(e={}){return this.isValid?yn.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=cr(this,o);return r+="T",r+=Vu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?cr(this,e==="extended"):null}toISOWeekDate(){return Ul(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":"")+Vu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Ul(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ul(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?cr(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")),Ul(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ur}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 ot.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=p0(t).map(ot.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=Fv(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(ze.now(),e,t)}until(e){return this.isValid?Et.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||ze.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(ze.isDateTime))throw new qn("max requires all arguments be DateTimes");return ku(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=$t.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return Hg(o,e,t)}static fromStringExplain(e,t,i={}){return ze.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Ur}static get DATE_MED(){return ng}static get DATE_MED_WITH_WEEKDAY(){return u0}static get DATE_FULL(){return ig}static get DATE_HUGE(){return sg}static get TIME_SIMPLE(){return lg}static get TIME_WITH_SECONDS(){return og}static get TIME_WITH_SHORT_OFFSET(){return rg}static get TIME_WITH_LONG_OFFSET(){return ag}static get TIME_24_SIMPLE(){return ug}static get TIME_24_WITH_SECONDS(){return fg}static get TIME_24_WITH_SHORT_OFFSET(){return cg}static get TIME_24_WITH_LONG_OFFSET(){return dg}static get DATETIME_SHORT(){return pg}static get DATETIME_SHORT_WITH_SECONDS(){return mg}static get DATETIME_MED(){return hg}static get DATETIME_MED_WITH_SECONDS(){return _g}static get DATETIME_MED_WITH_WEEKDAY(){return f0}static get DATETIME_FULL(){return gg}static get DATETIME_FULL_WITH_SECONDS(){return bg}static get DATETIME_HUGE(){return vg}static get DATETIME_HUGE_WITH_SECONDS(){return yg}}function Us(n){if(ze.isDateTime(n))return n;if(n&&n.valueOf&&es(n.valueOf()))return ze.fromJSDate(n);if(n&&typeof n=="object")return ze.fromObject(n);throw new qn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const ly=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],oy=[".mp4",".avi",".mov",".3gp",".wmv"],ry=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],ay=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}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||j.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 j.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.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){j.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]=j.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(!j.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)(!j.isObject(l)&&!Array.isArray(l)||!j.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)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):j.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||j.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.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 ze.fromFormat(e,i,{zone:"UTC"})}return ze.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.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!!ly.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!oy.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!ry.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!ay.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.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,d=r.height;return a.width=t,a.height=i,u.drawImage(r,f>d?(f-d)/2:0,0,f>d?d:f,f>d?d: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(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)j.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var o,r,a,u,f,d,p;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)||j.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)||j.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 _=null;m.type==="number"?_=123:m.type==="date"?_="2022-01-01 10:00:00.123Z":m.type==="bool"?_=!0:m.type==="email"?_="test@example.com":m.type==="url"?_="https://example.com":m.type==="json"?_="JSON":m.type==="file"?(_="filename.jpg",((a=m.options)==null?void 0:a.maxSelect)!==1&&(_=[_])):m.type==="select"?(_=(f=(u=m.options)==null?void 0:u.values)==null?void 0:f[0],((d=m.options)==null?void 0:d.maxSelect)!==1&&(_=[_])):m.type==="relation"?(_="RELATION_RECORD_ID",((p=m.options)==null?void 0:p.maxSelect)!==1&&(_=[_])):_="test",i[m.name]=_}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)&&!j.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=j.isObject(u)&&j.findByKey(s,"id",u.id);if(!f)return!1;for(let d in f)if(JSON.stringify(u[d])!=JSON.stringify(f[d]))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],d=u.create(a,o,f);u.add(d),e(d.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"||(j.isEmpty(r)?s.push(i):typeof r=="boolean"?s.push(r?"True":"False"):typeof r=="string"?(r=r.indexOf("<")>=0?j.plainText(r):r,s.push(j.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(!j.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 j.extractColumnsFromQuery(e.options.query))j.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)j.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,u,f,d,p;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s+\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const g=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((g==null?void 0:g.length)!=4)continue;const b=(d=(f=g[1])==null?void 0:f.trim())==null?void 0:d.replace(l,"");b&&t.columns.push({name:b,collate:g[2]||"",sort:((p=g[3])==null?void 0:p.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` +}`,d=`__svelte_${Mb(f)}_${r}`,p=V_(n),{stylesheet:m,rules:_}=ho.get(p)||Ob(p,n);_[d]||(_[d]=!0,m.insertRule(`@keyframes ${d} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${d} ${i}ms linear ${s}ms 1 both`,_o+=1,d}function dl(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(", "),_o-=s,_o||Db())}function Db(){_a(()=>{_o||(ho.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),ho.clear())})}function Eb(n,e,t,i){if(!e)return Q;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return Q;const{delay:l=0,duration:o=300,easing:r=$l,start:a=Ro()+l,end:u=a+o,tick:f=Q,css:d}=t(n,{from:e,to:s},i);let p=!0,m=!1,_;function g(){d&&(_=cl(n,0,1,o,l,r,d)),l||(m=!0)}function b(){d&&dl(n,_),p=!1}return qo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),b()),!p)return!1;if(m){const $=k-a,T=0+1*r($/o);f(T,1-T)}return!0}),g(),f(0,1),b}function Ab(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,z_(n,s)}}function z_(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 pl;function ci(n){pl=n}function Tl(){if(!pl)throw new Error("Function called outside component initialization");return pl}function xt(n){Tl().$$.on_mount.push(n)}function Ib(n){Tl().$$.after_update.push(n)}function B_(n){Tl().$$.on_destroy.push(n)}function kt(){const n=Tl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=H_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function pe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const vs=[],se=[];let ks=[];const jr=[],U_=Promise.resolve();let Vr=!1;function W_(){Vr||(Vr=!0,U_.then(ga))}function ln(){return W_(),U_}function nt(n){ks.push(n)}function ke(n){jr.push(n)}const ir=new Set;let ps=0;function ga(){if(ps!==0)return;const n=pl;do{try{for(;psn.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ks=e}let Vs;function ba(){return Vs||(Vs=Promise.resolve(),Vs.then(()=>{Vs=null})),Vs}function xi(n,e,t){n.dispatchEvent(H_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let xn;function re(){xn={r:0,c:[],p:xn}}function ae(){xn.r||De(xn.c),xn=xn.p}function A(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),xn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const va={duration:0};function Nb(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&dl(n,o)}function f(){const{delay:p=0,duration:m=300,easing:_=$l,tick:g=Q,css:b}=s||va;b&&(o=cl(n,0,1,m,p,_,b,a++)),g(0,1);const k=Ro()+p,$=k+m;r&&r.abort(),l=!0,nt(()=>xi(n,!0,"start")),r=qo(T=>{if(l){if(T>=$)return g(1,0),xi(n,!0,"end"),u(),l=!1;if(T>=k){const C=_((T-k)/m);g(C,1-C)}}return l})}let d=!1;return{start(){d||(d=!0,dl(n),Ut(s)?(s=s(i),ba().then(f)):f())},invalidate(){d=!1},end(){l&&(u(),l=!1)}}}function Fb(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=xn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:d=$l,tick:p=Q,css:m}=s||va;m&&(o=cl(n,1,0,f,u,d,m));const _=Ro()+u,g=_+f;nt(()=>xi(n,!1,"start")),qo(b=>{if(l){if(b>=g)return p(0,1),xi(n,!1,"end"),--r.r||De(r.c),!1;if(b>=_){const k=d((b-_)/f);p(1-k,k)}}return l})}return Ut(s)?ba().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&dl(n,o),l=!1)}}}function Ve(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&&dl(n,u)}function d(m,_){const g=m.b-o;return _*=Math.abs(g),{a:o,b:m.b,d:g,duration:_,start:m.start,end:m.start+_,group:m.group}}function p(m){const{delay:_=0,duration:g=300,easing:b=$l,tick:k=Q,css:$}=l||va,T={start:Ro()+_,b:m};m||(T.group=xn,xn.r+=1),r||a?a=T:($&&(f(),u=cl(n,o,m,g,_,b,$)),m&&k(0,1),r=d(T,g),nt(()=>xi(n,m,"start")),qo(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,xi(n,r.b,"start"),$&&(f(),u=cl(n,o,r.b,r.duration,0,b,l.css))),r){if(C>=r.end)k(o=r.b,1-o),xi(n,r.b,"end"),a||(r.b?f():--r.group.r||De(r.group.c)),r=null;else if(C>=r.start){const D=C-r.start;o=r.a+r.d*b(D/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(m){Ut(l)?ba().then(()=>{l=l(s),p(m)}):p(m)},end(){f(),r=a=null}}}function pu(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((d,p)=>{p!==l&&d&&(re(),P(d,1,1,()=>{e.blocks[p]===d&&(e.blocks[p]=null)}),ae())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&ga()}if(kb(n)){const s=Tl();if(n.then(l=>{ci(s),i(e.then,1,e.value,l),ci(null)},l=>{if(ci(s),i(e.catch,2,e.error,l),ci(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 Rb(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 ls(n,e){n.d(1),e.delete(n.key)}function Zt(n,e){P(n,1,1,()=>{e.delete(n.key)})}function qb(n,e){n.f(),Zt(n,e)}function yt(n,e,t,i,s,l,o,r,a,u,f,d){let p=n.length,m=l.length,_=p;const g={};for(;_--;)g[n[_].key]=_;const b=[],k=new Map,$=new Map,T=[];for(_=m;_--;){const O=d(s,l,_),I=t(O);let L=o.get(I);L?i&&T.push(()=>L.p(O,e)):(L=u(I,O),L.c()),k.set(I,b[_]=L),I in g&&$.set(I,Math.abs(_-g[I]))}const C=new Set,D=new Set;function M(O){A(O,1),O.m(r,f),o.set(O.key,O),f=O.first,m--}for(;p&&m;){const O=b[m-1],I=n[p-1],L=O.key,F=I.key;O===I?(f=O.first,p--,m--):k.has(F)?!o.has(L)||C.has(L)?M(O):D.has(F)?p--:$.get(L)>$.get(F)?(D.add(L),M(O)):(C.add(F),p--):(a(I,o),p--)}for(;p--;){const O=n[p];k.has(O.key)||a(O,o)}for(;m;)M(b[m-1]);return De(T),b}function St(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 Kt(n){return typeof n=="object"&&n!==null?n:{}}function he(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function z(n){n&&n.c()}function V(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||nt(()=>{const o=n.$$.on_mount.map(N_).filter(Ut);n.$$.on_destroy?n.$$.on_destroy.push(...o):De(o),n.$$.on_mount=[]}),l.forEach(nt)}function H(n,e){const t=n.$$;t.fragment!==null&&(Lb(t.after_update),De(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function jb(n,e){n.$$.dirty[0]===-1&&(vs.push(n),W_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const _=m.length?m[0]:p;return u.ctx&&s(u.ctx[d],u.ctx[d]=_)&&(!u.skip_bound&&u.bound[d]&&u.bound[d](_),f&&jb(n,d)),p}):[],u.update(),f=!0,De(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const d=Cb(e.target);u.fragment&&u.fragment.l(d),d.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),V(n,e.target,e.anchor,e.customElement),ga()}ci(a)}class ve{$destroy(){H(this,1),this.$destroy=Q}$on(e,t){if(!Ut(t))return Q;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&&!wb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Rt(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(),t=null)}}return{set:s,update:l,subscribe:o}}function K_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return Y_(t,o=>{let r=!1;const a=[];let u=0,f=Q;const d=()=>{if(u)return;f();const m=e(i?a[0]:a,o);l?o(m):f=Ut(m)?m:Q},p=s.map((m,_)=>F_(m,g=>{a[_]=g,u&=~(1<<_),r&&d()},()=>{u|=1<<_}));return r=!0,d(),function(){De(p),f(),r=!1}})}function J_(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,s,l,o=[],r="",a=n.split("/");for(a[0]||a.shift();s=a.shift();)t=s[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=s.indexOf("?",1),l=s.indexOf(".",1),o.push(s.substring(1,~i?i:~l?l:s.length)),r+=~i&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(r+=(~i?"?":"")+"\\"+s.substring(l))):r+="/"+s;return{keys:o,pattern:new RegExp("^"+r+(e?"(?=$|/)":"/?$"),"i")}}function Vb(n){let e,t,i;const s=[n[2]];var l=n[0];function o(r){let a={};for(let u=0;u{H(f,1)}),ae()}l?(e=Pt(l,o()),e.$on("routeEvent",r[7]),z(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function Hb(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{H(f,1)}),ae()}l?(e=Pt(l,o()),e.$on("routeEvent",r[6]),z(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function zb(n){let e,t,i,s;const l=[Hb,Vb],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},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()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function mu(){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 jo=Y_(null,function(e){e(mu());const t=()=>{e(mu())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});K_(jo,n=>n.location);const ya=K_(jo,n=>n.querystring),hu=An(void 0);async function Li(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await ln();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 an(n,e){if(e=gu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return _u(n,e),{update(t){t=gu(t),_u(n,t)}}}function Bb(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function _u(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||Ub(i.currentTarget.getAttribute("href"))})}function gu(n){return n&&typeof n=="string"?{href:n}:n||{}}function Ub(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Wb(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(D,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!D||typeof D=="string"&&(D.length<1||D.charAt(0)!="/"&&D.charAt(0)!="*")||typeof D=="object"&&!(D instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:I}=J_(D);this.path=D,typeof M=="object"&&M._sveltesparouter===!0?(this.component=M.component,this.conditions=M.conditions||[],this.userData=M.userData,this.props=M.props||{}):(this.component=()=>Promise.resolve(M),this.conditions=[],this.props={}),this._pattern=O,this._keys=I}match(D){if(s){if(typeof s=="string")if(D.startsWith(s))D=D.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const L=D.match(s);if(L&&L[0])D=D.substr(L[0].length)||"/";else return null}}const M=this._pattern.exec(D);if(M===null)return null;if(this._keys===!1)return M;const O={};let I=0;for(;I{r.push(new o(D,C))}):Object.keys(i).forEach(C=>{r.push(new o(C,i[C]))});let a=null,u=null,f={};const d=kt();async function p(C,D){await ln(),d(C,D)}let m=null,_=null;l&&(_=C=>{C.state&&(C.state.__svelte_spa_router_scrollY||C.state.__svelte_spa_router_scrollX)?m=C.state:m=null},window.addEventListener("popstate",_),Ib(()=>{Bb(m)}));let g=null,b=null;const k=jo.subscribe(async C=>{g=C;let D=0;for(;D{hu.set(u)});return}t(0,a=null),b=null,hu.set(void 0)});B_(()=>{k(),_&&window.removeEventListener("popstate",_)});function $(C){pe.call(this,n,C)}function T(C){pe.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,$,T]}class Yb extends ve{constructor(e){super(),be(this,e,Wb,zb,_e,{routes:3,prefix:4,restoreScrollState:5})}}const ao=[];let Z_;function G_(n){const e=n.pattern.test(Z_);bu(n,n.className,e),bu(n,n.inactiveClassName,!e)}function bu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}jo.subscribe(n=>{Z_=n.location+(n.querystring?"?"+n.querystring:""),ao.map(G_)});function Yn(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"?J_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ao.push(i),G_(i),{destroy(){ao.splice(ao.indexOf(i),1)}}}const Kb="modulepreload",Jb=function(n,e){return new URL(n,e).href},vu={},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=Jb(l,i),l in vu)return;vu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const d=s[f];if(d.href===l&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":Kb,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e())};var Hr=function(n,e){return Hr=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])},Hr(n,e)};function Qt(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}Hr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var zr=function(){return zr=Object.assign||function(e){for(var t,i=1,s=arguments.length;i0&&s[s.length-1])||d[0]!==6&&d[0]!==2)){o=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0&&(!t.exp||t.exp-e>Date.now()/1e3))}X_=typeof atob=="function"?atob:function(n){var e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};var Cl=function(){function n(e){e===void 0&&(e={}),this.$load(e||{})}return n.prototype.load=function(e){return this.$load(e)},n.prototype.$load=function(e){for(var t=0,i=Object.entries(e);t4096&&(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 pi&&(a.model.username=this.model.username,a.model.verified=this.model.verified,a.model.collectionId=this.model.collectionId),u=yu(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||[]},ka=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Qt(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 Qt(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 un(l,void 0,void 0,function(){return fn(this,function(u){return[2,this._getList(t,a,i||200,s).then(function(f){var d=f,p=d.items,m=d.totalItems;return o=o.concat(p),p.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 un(this,void 0,void 0,function(){return fn(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 un(t,void 0,void 0,function(){var l;return fn(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 ml({url:M.url,status:M.status,data:O});return[2,O]}})})}).catch(function(M){throw new ml(M)})]}})})},n.prototype.getFileUrl=function(e,t,i){return i===void 0&&(i={}),this.files.getUrl(e,t,i)},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 es(n){return typeof n=="number"}function Ho(n){return typeof n=="number"&&n%1===0}function d0(n){return typeof n=="string"}function p0(n){return Object.prototype.toString.call(n)==="[object Date]"}function wg(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function m0(n){return Array.isArray(n)?n:[n]}function ku(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 h0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ms(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function di(n,e,t){return Ho(n)&&n>=e&&n<=t}function _0(n,e){return n-e*Math.floor(n/e)}function Ht(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Si(n){if(!(it(n)||n===null||n===""))return parseInt(n,10)}function zi(n){if(!(it(n)||n===null||n===""))return parseFloat(n)}function wa(n){if(!(it(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Sa(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Ml(n){return n%4===0&&(n%100!==0||n%400===0)}function nl(n){return Ml(n)?366:365}function go(n,e){const t=_0(e-1,12)+1,i=n+(e-t)/12;return t===2?Ml(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function $a(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 bo(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 Wr(n){return n>99?n:n>60?1900+n:2e3+n}function Sg(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 zo(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 $g(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new qn(`Invalid unit value ${n}`);return e}function vo(n,e){const t={};for(const i in n)if(Ms(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=$g(s)}return t}function il(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}${Ht(t,2)}:${Ht(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Ht(t,2)}${Ht(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Bo(n){return h0(n,["hour","minute","second","millisecond"])}const Tg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,g0=["January","February","March","April","May","June","July","August","September","October","November","December"],Cg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],b0=["J","F","M","A","M","J","J","A","S","O","N","D"];function Mg(n){switch(n){case"narrow":return[...b0];case"short":return[...Cg];case"long":return[...g0];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 Og=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Dg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],v0=["M","T","W","T","F","S","S"];function Eg(n){switch(n){case"narrow":return[...v0];case"short":return[...Dg];case"long":return[...Og];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ag=["AM","PM"],y0=["Before Christ","Anno Domini"],k0=["BC","AD"],w0=["B","A"];function Ig(n){switch(n){case"narrow":return[...w0];case"short":return[...k0];case"long":return[...y0];default:return null}}function S0(n){return Ag[n.hour<12?0:1]}function $0(n,e){return Eg(e)[n.weekday-1]}function T0(n,e){return Mg(e)[n.month-1]}function C0(n,e){return Ig(e)[n.year<0?0:1]}function M0(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 d=n==="days";switch(e){case 1:return d?"tomorrow":`next ${s[n][0]}`;case-1:return d?"yesterday":`last ${s[n][0]}`;case 0:return d?"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 wu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const O0={D:Ur,DD:ig,DDD:sg,DDDD:lg,t:og,tt:rg,ttt:ag,tttt:ug,T:fg,TT:cg,TTT:dg,TTTT:pg,f:mg,ff:_g,fff:bg,ffff:yg,F:hg,FF:gg,FFF:vg,FFFF:kg};class yn{static create(e,t={}){return new yn(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 O0[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 Ht(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,_)=>this.loc.extract(e,m,_),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?S0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,_)=>i?T0(e,m):l(_?{month:m}:{month:m,day:"numeric"},"month"),u=(m,_)=>i?$0(e,m):l(_?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const _=yn.macroTokenToFormatOpts(m);return _?this.formatWithSystemDefault(e,_):m},d=m=>i?C0(e,m):l({era:m},"era"),p=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 d("short");case"GG":return d("long");case"GGGGG":return d("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 wu(yn.parseFormat(t),p)}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=yn.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 wu(l,s(r))}}class Kn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ol{get type(){throw new ki}get name(){throw new ki}get ianaName(){return this.name}get isUniversal(){throw new ki}offsetName(e,t){throw new ki}formatOffset(e,t){throw new ki}offset(e){throw new ki}equals(e){throw new ki}get isValid(){throw new ki}}let sr=null;class Ta extends Ol{static get instance(){return sr===null&&(sr=new Ta),sr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Sg(e,t,i)}formatOffset(e,t){return il(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let uo={};function D0(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 E0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function A0(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?_:1e3+_,(p-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let lr=null;class cn extends Ol{static get utcInstance(){return lr===null&&(lr=new cn(0)),lr}static instance(e){return e===0?cn.utcInstance:new cn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new cn(zo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${il(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${il(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return il(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 P0 extends Ol{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 $i(n,e){if(it(n)||n===null)return e;if(n instanceof Ol)return n;if(d0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?cn.utcInstance:cn.parseSpecifier(t)||mi.create(n)}else return es(n)?cn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new P0(n)}let Su=()=>Date.now(),$u="system",Tu=null,Cu=null,Mu=null,Ou;class Wt{static get now(){return Su}static set now(e){Su=e}static set defaultZone(e){$u=e}static get defaultZone(){return $i($u,Ta.instance)}static get defaultLocale(){return Tu}static set defaultLocale(e){Tu=e}static get defaultNumberingSystem(){return Cu}static set defaultNumberingSystem(e){Cu=e}static get defaultOutputCalendar(){return Mu}static set defaultOutputCalendar(e){Mu=e}static get throwOnInvalid(){return Ou}static set throwOnInvalid(e){Ou=e}static resetCaches(){$t.resetCache(),mi.resetCache()}}let Du={};function L0(n,e={}){const t=JSON.stringify([n,e]);let i=Du[t];return i||(i=new Intl.ListFormat(n,e),Du[t]=i),i}let Yr={};function Kr(n,e={}){const t=JSON.stringify([n,e]);let i=Yr[t];return i||(i=new Intl.DateTimeFormat(n,e),Yr[t]=i),i}let Jr={};function N0(n,e={}){const t=JSON.stringify([n,e]);let i=Jr[t];return i||(i=new Intl.NumberFormat(n,e),Jr[t]=i),i}let Zr={};function F0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Zr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Zr[s]=l),l}let xs=null;function R0(){return xs||(xs=new Intl.DateTimeFormat().resolvedOptions().locale,xs)}function q0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Kr(n).resolvedOptions()}catch{t=Kr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function j0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function V0(n){const e=[];for(let t=1;t<=12;t++){const i=ze.utc(2016,t,1);e.push(n(i))}return e}function H0(n){const e=[];for(let t=1;t<=7;t++){const i=ze.utc(2016,11,13+t);e.push(n(i))}return e}function Hl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function z0(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 B0{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=N0(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):Sa(e,3);return Ht(t,this.padTo)}}}class U0{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&&mi.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:ze.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=Kr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class W0{constructor(e,t,i){this.opts={style:"long",...i},!t&&wg()&&(this.rtf=F0(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):M0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class $t{static fromOpts(e){return $t.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Wt.defaultLocale,o=l||(s?"en-US":R0()),r=t||Wt.defaultNumberingSystem,a=i||Wt.defaultOutputCalendar;return new $t(o,r,a,l)}static resetCache(){xs=null,Yr={},Jr={},Zr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return $t.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=q0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=j0(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=z0(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:$t.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 Hl(this,e,i,Mg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=V0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Hl(this,e,i,Eg,()=>{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]=H0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Hl(this,void 0,e,()=>Ag,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ze.utc(2016,11,13,9),ze.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Hl(this,e,t,Ig,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[ze.utc(-40,1,1),ze.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 B0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new U0(e,this.intl,t)}relFormatter(e={}){return new W0(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 Ls(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ns(...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 Fs(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 Pg(...n){return(e,t)=>{const i={};let s;for(s=0;sm!==void 0&&(_||m&&f)?-m:m;return[{years:p(zi(t)),months:p(zi(i)),weeks:p(zi(s)),days:p(zi(l)),hours:p(zi(o)),minutes:p(zi(r)),seconds:p(zi(a),a==="-0"),milliseconds:p(wa(u),d)}]}const sv={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 Oa(n,e,t,i,s,l,o){const r={year:e.length===2?Wr(Si(e)):Si(e),month:Cg.indexOf(t)+1,day:Si(i),hour:Si(s),minute:Si(l)};return o&&(r.second=Si(o)),n&&(r.weekday=n.length>3?Og.indexOf(n)+1:Dg.indexOf(n)+1),r}const lv=/^(?:(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 ov(n){const[,e,t,i,s,l,o,r,a,u,f,d]=n,p=Oa(e,s,i,t,l,o,r);let m;return a?m=sv[a]:u?m=0:m=zo(f,d),[p,new cn(m)]}function rv(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const av=/^(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$/,uv=/^(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$/,fv=/^(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 Eu(n){const[,e,t,i,s,l,o,r]=n;return[Oa(e,s,i,t,l,o,r),cn.utcInstance]}function cv(n){const[,e,t,i,s,l,o,r]=n;return[Oa(e,r,t,i,s,l,o),cn.utcInstance]}const dv=Ls(K0,Ma),pv=Ls(J0,Ma),mv=Ls(Z0,Ma),hv=Ls(Ng),Rg=Ns(ev,Rs,Dl,El),_v=Ns(G0,Rs,Dl,El),gv=Ns(X0,Rs,Dl,El),bv=Ns(Rs,Dl,El);function vv(n){return Fs(n,[dv,Rg],[pv,_v],[mv,gv],[hv,bv])}function yv(n){return Fs(rv(n),[lv,ov])}function kv(n){return Fs(n,[av,Eu],[uv,Eu],[fv,cv])}function wv(n){return Fs(n,[nv,iv])}const Sv=Ns(Rs);function $v(n){return Fs(n,[tv,Sv])}const Tv=Ls(Q0,x0),Cv=Ls(Fg),Mv=Ns(Rs,Dl,El);function Ov(n){return Fs(n,[Tv,Rg],[Cv,Mv])}const Dv="Invalid Duration",qg={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}},Ev={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},...qg},Pn=146097/400,hs=146097/4800,Av={years:{quarters:4,months:12,weeks:Pn/7,days:Pn,hours:Pn*24,minutes:Pn*24*60,seconds:Pn*24*60*60,milliseconds:Pn*24*60*60*1e3},quarters:{months:3,weeks:Pn/28,days:Pn/4,hours:Pn*24/4,minutes:Pn*24*60/4,seconds:Pn*24*60*60/4,milliseconds:Pn*24*60*60*1e3/4},months:{weeks:hs/7,days:hs,hours:hs*24,minutes:hs*24*60,seconds:hs*24*60*60,milliseconds:hs*24*60*60*1e3},...qg},Ji=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Iv=Ji.slice(0).reverse();function Bi(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 ot(i)}function Pv(n){return n<0?Math.floor(n):Math.ceil(n)}function jg(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?Pv(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function Lv(n,e){Iv.reduce((t,i)=>it(e[i])?t:(t&&jg(n,e,t,e,i),i),null)}class ot{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||$t.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Av:Ev,this.isLuxonDuration=!0}static fromMillis(e,t){return ot.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new qn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:vo(e,ot.normalizeUnit),loc:$t.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(es(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new qn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=wv(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=$v(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new qn("need to specify a reason the Duration is invalid");const i=e instanceof Kn?e:new Kn(e,t);if(Wt.throwOnInvalid)throw new u0(i);return new ot({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 ng(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?yn.create(this.loc,i).formatDurationFromString(this,e):Dv}toHuman(e={}){const t=Ji.map(i=>{const s=this.values[i];return it(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+=Sa(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=ot.fromDurationLike(e),i={};for(const s of Ji)(Ms(t.values,s)||Ms(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Bi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=ot.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]=$g(e(this.values[i],i));return Bi(this,{values:t},!0)}get(e){return this[ot.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...vo(e,ot.normalizeUnit)};return Bi(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),Bi(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),Bi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ot.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Ji)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;es(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)Ji.indexOf(u)>Ji.indexOf(o)&&jg(this.matrix,s,u,t,o)}else es(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 Bi(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 Bi(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 Ji)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Hs="Invalid Interval";function Nv(n,e){return!n||!n.isValid?Et.invalid("missing or invalid start"):!e||!e.isValid?Et.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?Et.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Us).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Et.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=ot.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(Et.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:Et.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Et.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(Et.fromDateTimes(t,a.time)),t=null);return Et.merge(s)}difference(...e){return Et.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Hs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Hs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Hs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Hs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Hs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ot.invalid(this.invalidReason)}mapEndpoints(e){return Et.fromDateTimes(e(this.s),e(this.e))}}class zl{static hasDST(e=Wt.defaultZone){const t=ze.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return mi.isValidZone(e)}static normalizeZone(e){return $i(e,Wt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||$t.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||$t.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||$t.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||$t.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return $t.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return $t.create(t,null,"gregory").eras(e)}static features(){return{relative:wg()}}}function Au(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ot.fromMillis(i).as("days"))}function Fv(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=Au(r,a);return(u-u%7)/7}],["days",Au]],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 Rv(n,e,t,i){let[s,l,o,r]=Fv(n,e,t);const a=e-s,u=t.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(o0?ot.fromMillis(a,i).shiftTo(...u).plus(f):f}const Da={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Iu={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]},qv=Da.hanidec.replace(/[\[|\]]/g,"").split("");function jv(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 Un({numberingSystem:n},e=""){return new RegExp(`${Da[n||"latn"]}${e}`)}const Vv="missing Intl.DateTimeFormat.formatToParts support";function at(n,e=t=>t){return{regex:n,deser:([t])=>e(jv(t))}}const Hv=String.fromCharCode(160),Vg=`[ ${Hv}]`,Hg=new RegExp(Vg,"g");function zv(n){return n.replace(/\./g,"\\.?").replace(Hg,Vg)}function Pu(n){return n.replace(/\./g,"").replace(Hg," ").toLowerCase()}function Wn(n,e){return n===null?null:{regex:RegExp(n.map(zv).join("|")),deser:([t])=>n.findIndex(i=>Pu(t)===Pu(i))+e}}function Lu(n,e){return{regex:n,deser:([,t,i])=>zo(t,i),groups:e}}function or(n){return{regex:n,deser:([e])=>e}}function Bv(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Uv(n,e){const t=Un(e),i=Un(e,"{2}"),s=Un(e,"{3}"),l=Un(e,"{4}"),o=Un(e,"{6}"),r=Un(e,"{1,2}"),a=Un(e,"{1,3}"),u=Un(e,"{1,6}"),f=Un(e,"{1,9}"),d=Un(e,"{2,4}"),p=Un(e,"{4,6}"),m=b=>({regex:RegExp(Bv(b.val)),deser:([k])=>k,literal:!0}),g=(b=>{if(n.literal)return m(b);switch(b.val){case"G":return Wn(e.eras("short",!1),0);case"GG":return Wn(e.eras("long",!1),0);case"y":return at(u);case"yy":return at(d,Wr);case"yyyy":return at(l);case"yyyyy":return at(p);case"yyyyyy":return at(o);case"M":return at(r);case"MM":return at(i);case"MMM":return Wn(e.months("short",!0,!1),1);case"MMMM":return Wn(e.months("long",!0,!1),1);case"L":return at(r);case"LL":return at(i);case"LLL":return Wn(e.months("short",!1,!1),1);case"LLLL":return Wn(e.months("long",!1,!1),1);case"d":return at(r);case"dd":return at(i);case"o":return at(a);case"ooo":return at(s);case"HH":return at(i);case"H":return at(r);case"hh":return at(i);case"h":return at(r);case"mm":return at(i);case"m":return at(r);case"q":return at(r);case"qq":return at(i);case"s":return at(r);case"ss":return at(i);case"S":return at(a);case"SSS":return at(s);case"u":return or(f);case"uu":return or(r);case"uuu":return at(t);case"a":return Wn(e.meridiems(),0);case"kkkk":return at(l);case"kk":return at(d,Wr);case"W":return at(r);case"WW":return at(i);case"E":case"c":return at(t);case"EEE":return Wn(e.weekdays("short",!1,!1),1);case"EEEE":return Wn(e.weekdays("long",!1,!1),1);case"ccc":return Wn(e.weekdays("short",!0,!1),1);case"cccc":return Wn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Lu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Lu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return or(/[a-z_+-/]{1,256}?/i);default:return m(b)}})(n)||{invalidReason:Vv};return g.token=n,g}const Wv={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 Yv(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=Wv[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function Kv(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Jv(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Ms(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 Zv(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 it(n.z)||(t=mi.create(n.z)),it(n.Z)||(t||(t=new cn(n.Z)),i=n.Z),it(n.q)||(n.M=(n.q-1)*3+1),it(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),it(n.u)||(n.S=wa(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let rr=null;function Gv(){return rr||(rr=ze.fromMillis(1555555555555)),rr}function Xv(n,e){if(n.literal)return n;const t=yn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=yn.create(e,t).formatDateTimeParts(Gv()).map(o=>Yv(o,e,t));return l.includes(void 0)?n:l}function Qv(n,e){return Array.prototype.concat(...n.map(t=>Xv(t,e)))}function zg(n,e,t){const i=Qv(yn.parseFormat(t),n),s=i.map(o=>Uv(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=Kv(s),a=RegExp(o,"i"),[u,f]=Jv(e,a,r),[d,p,m]=f?Zv(f):[null,null,void 0];if(Ms(f,"a")&&Ms(f,"H"))throw new Qs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:d,zone:p,specificOffset:m}}}function xv(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=zg(n,e,t);return[i,s,l,o]}const Bg=[0,31,59,90,120,151,181,212,243,273,304,334],Ug=[0,31,60,91,121,152,182,213,244,274,305,335];function Vn(n,e){return new Kn("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 Yg(n,e,t){return t+(Ml(n)?Ug:Bg)[e-1]}function Kg(n,e){const t=Ml(n)?Ug:Bg,i=t.findIndex(l=>lbo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Bo(n)}}function Nu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Wg(e,1,4),l=nl(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=nl(r)):o>l?(r=e+1,o-=nl(e)):r=e;const{month:a,day:u}=Kg(r,o);return{year:r,month:a,day:u,...Bo(n)}}function ar(n){const{year:e,month:t,day:i}=n,s=Yg(e,t,i);return{year:e,ordinal:s,...Bo(n)}}function Fu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Kg(e,t);return{year:e,month:i,day:s,...Bo(n)}}function ey(n){const e=Ho(n.weekYear),t=di(n.weekNumber,1,bo(n.weekYear)),i=di(n.weekday,1,7);return e?t?i?!1:Vn("weekday",n.weekday):Vn("week",n.week):Vn("weekYear",n.weekYear)}function ty(n){const e=Ho(n.year),t=di(n.ordinal,1,nl(n.year));return e?t?!1:Vn("ordinal",n.ordinal):Vn("year",n.year)}function Jg(n){const e=Ho(n.year),t=di(n.month,1,12),i=di(n.day,1,go(n.year,n.month));return e?t?i?!1:Vn("day",n.day):Vn("month",n.month):Vn("year",n.year)}function Zg(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=di(e,0,23)||e===24&&t===0&&i===0&&s===0,o=di(t,0,59),r=di(i,0,59),a=di(s,0,999);return l?o?r?a?!1:Vn("millisecond",s):Vn("second",i):Vn("minute",t):Vn("hour",e)}const ur="Invalid DateTime",Ru=864e13;function Bl(n){return new Kn("unsupported zone",`the zone "${n.name}" is not supported`)}function fr(n){return n.weekData===null&&(n.weekData=Gr(n.c)),n.weekData}function zs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new ze({...t,...e,old:t})}function Gg(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 qu(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 Gg($a(n),e,t)}function ju(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,go(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ot.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=$a(l);let[a,u]=Gg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Bs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=ze.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return ze.invalid(new Kn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Ul(n,e,t=!0){return n.isValid?yn.create($t.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function cr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Ht(n.c.year,t?6:4),e?(i+="-",i+=Ht(n.c.month),i+="-",i+=Ht(n.c.day)):(i+=Ht(n.c.month),i+=Ht(n.c.day)),i}function Vu(n,e,t,i,s,l){let o=Ht(n.c.hour);return e?(o+=":",o+=Ht(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Ht(n.c.minute),(n.c.second!==0||!t)&&(o+=Ht(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Ht(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Ht(Math.trunc(-n.o/60)),o+=":",o+=Ht(Math.trunc(-n.o%60))):(o+="+",o+=Ht(Math.trunc(n.o/60)),o+=":",o+=Ht(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Xg={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ny={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},iy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Qg=["year","month","day","hour","minute","second","millisecond"],sy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ly=["year","ordinal","hour","minute","second","millisecond"];function Hu(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 ng(n);return e}function zu(n,e){const t=$i(e.zone,Wt.defaultZone),i=$t.fromObject(e),s=Wt.now();let l,o;if(it(n.year))l=s;else{for(const u of Qg)it(n[u])&&(n[u]=Xg[u]);const r=Jg(n)||Zg(n);if(r)return ze.invalid(r);const a=t.offset(s);[l,o]=fo(n,a,t)}return new ze({ts:l,zone:t,loc:i,o})}function Bu(n,e,t){const i=it(t.round)?!0:t.round,s=(o,r)=>(o=Sa(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 Uu(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 ze{constructor(e){const t=e.zone||Wt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Kn("invalid input"):null)||(t.isValid?null:Bl(t));this.ts=it(e.ts)?Wt.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=qu(this.ts,r),i=Number.isNaN(s.year)?new Kn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||$t.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new ze({})}static local(){const[e,t]=Uu(arguments),[i,s,l,o,r,a,u]=t;return zu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Uu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=cn.utcInstance,zu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=p0(e)?e.valueOf():NaN;if(Number.isNaN(i))return ze.invalid("invalid input");const s=$i(t.zone,Wt.defaultZone);return s.isValid?new ze({ts:i,zone:s,loc:$t.fromObject(t)}):ze.invalid(Bl(s))}static fromMillis(e,t={}){if(es(e))return e<-Ru||e>Ru?ze.invalid("Timestamp out of range"):new ze({ts:e,zone:$i(t.zone,Wt.defaultZone),loc:$t.fromObject(t)});throw new qn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(es(e))return new ze({ts:e*1e3,zone:$i(t.zone,Wt.defaultZone),loc:$t.fromObject(t)});throw new qn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=$i(t.zone,Wt.defaultZone);if(!i.isValid)return ze.invalid(Bl(i));const s=Wt.now(),l=it(t.specificOffset)?i.offset(s):t.specificOffset,o=vo(e,Hu),r=!it(o.ordinal),a=!it(o.year),u=!it(o.month)||!it(o.day),f=a||u,d=o.weekYear||o.weekNumber,p=$t.fromObject(t);if((f||r)&&d)throw new Qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Qs("Can't mix ordinal dates with month/day");const m=d||o.weekday&&!f;let _,g,b=qu(s,l);m?(_=sy,g=ny,b=Gr(b)):r?(_=ly,g=iy,b=ar(b)):(_=Qg,g=Xg);let k=!1;for(const I of _){const L=o[I];it(L)?k?o[I]=g[I]:o[I]=b[I]:k=!0}const $=m?ey(o):r?ty(o):Jg(o),T=$||Zg(o);if(T)return ze.invalid(T);const C=m?Nu(o):r?Fu(o):o,[D,M]=fo(C,l,i),O=new ze({ts:D,zone:i,o:M,loc:p});return o.weekday&&f&&e.weekday!==O.weekday?ze.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,s]=vv(e);return Bs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=yv(e);return Bs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=kv(e);return Bs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new qn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=$t.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=xv(o,e,t);return f?ze.invalid(f):Bs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return ze.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=Ov(e);return Bs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new qn("need to specify a reason the DateTime is invalid");const i=e instanceof Kn?e:new Kn(e,t);if(Wt.throwOnInvalid)throw new r0(i);return new ze({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?fr(this).weekYear:NaN}get weekNumber(){return this.isValid?fr(this).weekNumber:NaN}get weekday(){return this.isValid?fr(this).weekday:NaN}get ordinal(){return this.isValid?ar(this.c).ordinal:NaN}get monthShort(){return this.isValid?zl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?zl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?zl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?zl.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 Ml(this.year)}get daysInMonth(){return go(this.year,this.month)}get daysInYear(){return this.isValid?nl(this.year):NaN}get weeksInWeekYear(){return this.isValid?bo(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=yn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(cn.instance(e),t)}toLocal(){return this.setZone(Wt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=$i(e,Wt.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 zs(this,{ts:s,zone:e})}else return ze.invalid(Bl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return zs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=vo(e,Hu),i=!it(t.weekYear)||!it(t.weekNumber)||!it(t.weekday),s=!it(t.ordinal),l=!it(t.year),o=!it(t.month)||!it(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Qs("Can't mix ordinal dates with month/day");let u;i?u=Nu({...Gr(this.c),...t}):it(t.ordinal)?(u={...this.toObject(),...t},it(t.day)&&(u.day=Math.min(go(u.year,u.month),u.day))):u=Fu({...ar(this.c),...t});const[f,d]=fo(u,this.o,this.zone);return zs(this,{ts:f,o:d})}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return zs(this,ju(this,t))}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e).negate();return zs(this,ju(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=ot.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?yn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ur}toLocaleString(e=Ur,t={}){return this.isValid?yn.create(this.loc.clone(t),e).formatDateTime(this):ur}toLocaleParts(e={}){return this.isValid?yn.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=cr(this,o);return r+="T",r+=Vu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?cr(this,e==="extended"):null}toISOWeekDate(){return Ul(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":"")+Vu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Ul(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ul(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?cr(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")),Ul(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ur}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 ot.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=m0(t).map(ot.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=Rv(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(ze.now(),e,t)}until(e){return this.isValid?Et.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||ze.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(ze.isDateTime))throw new qn("max requires all arguments be DateTimes");return ku(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=$t.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return zg(o,e,t)}static fromStringExplain(e,t,i={}){return ze.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Ur}static get DATE_MED(){return ig}static get DATE_MED_WITH_WEEKDAY(){return f0}static get DATE_FULL(){return sg}static get DATE_HUGE(){return lg}static get TIME_SIMPLE(){return og}static get TIME_WITH_SECONDS(){return rg}static get TIME_WITH_SHORT_OFFSET(){return ag}static get TIME_WITH_LONG_OFFSET(){return ug}static get TIME_24_SIMPLE(){return fg}static get TIME_24_WITH_SECONDS(){return cg}static get TIME_24_WITH_SHORT_OFFSET(){return dg}static get TIME_24_WITH_LONG_OFFSET(){return pg}static get DATETIME_SHORT(){return mg}static get DATETIME_SHORT_WITH_SECONDS(){return hg}static get DATETIME_MED(){return _g}static get DATETIME_MED_WITH_SECONDS(){return gg}static get DATETIME_MED_WITH_WEEKDAY(){return c0}static get DATETIME_FULL(){return bg}static get DATETIME_FULL_WITH_SECONDS(){return vg}static get DATETIME_HUGE(){return yg}static get DATETIME_HUGE_WITH_SECONDS(){return kg}}function Us(n){if(ze.isDateTime(n))return n;if(n&&n.valueOf&&es(n.valueOf()))return ze.fromJSDate(n);if(n&&typeof n=="object")return ze.fromObject(n);throw new qn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const oy=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],ry=[".mp4",".avi",".mov",".3gp",".wmv"],ay=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],uy=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}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||j.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 j.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.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){j.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]=j.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(!j.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)(!j.isObject(l)&&!Array.isArray(l)||!j.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)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):j.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||j.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.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 ze.fromFormat(e,i,{zone:"UTC"})}return ze.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.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!!oy.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!ry.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!ay.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!uy.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.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,d=r.height;return a.width=t,a.height=i,u.drawImage(r,f>d?(f-d)/2:0,0,f>d?d:f,f>d?d: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(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)j.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var o,r,a,u,f,d,p;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)||j.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)||j.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 _=null;m.type==="number"?_=123:m.type==="date"?_="2022-01-01 10:00:00.123Z":m.type==="bool"?_=!0:m.type==="email"?_="test@example.com":m.type==="url"?_="https://example.com":m.type==="json"?_="JSON":m.type==="file"?(_="filename.jpg",((a=m.options)==null?void 0:a.maxSelect)!==1&&(_=[_])):m.type==="select"?(_=(f=(u=m.options)==null?void 0:u.values)==null?void 0:f[0],((d=m.options)==null?void 0:d.maxSelect)!==1&&(_=[_])):m.type==="relation"?(_="RELATION_RECORD_ID",((p=m.options)==null?void 0:p.maxSelect)!==1&&(_=[_])):_="test",i[m.name]=_}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)&&!j.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=j.isObject(u)&&j.findByKey(s,"id",u.id);if(!f)return!1;for(let d in f)if(JSON.stringify(u[d])!=JSON.stringify(f[d]))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],d=u.create(a,o,f);u.add(d),e(d.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"||(j.isEmpty(r)?s.push(i):typeof r=="boolean"?s.push(r?"True":"False"):typeof r=="string"?(r=r.indexOf("<")>=0?j.plainText(r):r,s.push(j.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(!j.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 j.extractColumnsFromQuery(e.options.query))j.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)j.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,u,f,d,p;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s+\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const g=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((g==null?void 0:g.length)!=4)continue;const b=(d=(f=g[1])==null?void 0:f.trim())==null?void 0:d.replace(l,"");b&&t.columns.push({name:b,collate:g[2]||"",sort:((p=g[3])==null?void 0:p.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` `),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+c.sort.toUpperCase()),l}).join(`, `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=j.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?j.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}}const Uo=An([]);function Qg(n,e=4e3){return Wo(n,"info",e)}function Jt(n,e=3e3){return Wo(n,"success",e)}function hl(n,e=4500){return Wo(n,"error",e)}function uy(n,e=4500){return Wo(n,"warning",e)}function Wo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{xg(i)},t)};Uo.update(s=>(Aa(s,i.message),j.pushOrReplaceByKey(s,i,"message"),s))}function xg(n){Uo.update(e=>(Aa(e,n),e))}function Ea(){Uo.update(n=>{for(let e of n)Aa(n,e);return[]})}function Aa(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const gi=An({});function dn(n){gi.set(n||{})}function Ai(n){gi.update(e=>(j.deleteByPath(e,n),e))}const Ia=An({});function Xr(n){Ia.set(n||{})}const dr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Li("/login")};Vo.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&&hl(l)}if(j.isEmpty(s.data)||dn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Li("/")};Vo.prototype.getAdminFileToken=async function(){let n=localStorage.getItem(dr)||"";return(!n||Q_(n,15))&&(n&&localStorage.removeItem(dr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),n=await this._adminFileTokenRequest,localStorage.setItem(dr,n),this._adminFileTokenRequest=null),n};class fy extends x_{save(e,t){super.save(e,t),t instanceof is&&Xr(t)}clear(){super.clear(),Xr(null)}}const me=new Vo("../",new fy("pb_admin_auth"));me.authStore.model instanceof is&&Xr(me.authStore.model);function cy(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=n[3].default,_=Tt(m,n,n[2],null);return{c(){e=y("div"),t=y("main"),_&&_.c(),i=E(),s=y("footer"),l=y("a"),l.innerHTML=` - Docs`,o=E(),r=y("span"),r.textContent="|",a=E(),u=y("a"),f=y("span"),f.textContent="PocketBase v0.15.0-WIP",h(t,"class","page-content"),h(l,"href","https://pocketbase.io/docs/"),h(l,"target","_blank"),h(l,"rel","noopener noreferrer"),h(r,"class","delimiter"),h(f,"class","txt"),h(u,"href","https://github.com/pocketbase/pocketbase/releases"),h(u,"target","_blank"),h(u,"rel","noopener noreferrer"),h(u,"title","Releases"),h(s,"class","page-footer"),h(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(g,b){S(g,e,b),v(e,t),_&&_.m(t,null),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(u,f),p=!0},p(g,[b]){_&&_.p&&(!p||b&4)&&Mt(_,m,g,g[2],p?Ct(m,g[2],b,null):Ot(g[2]),null),(!p||b&2&&d!==(d="page-wrapper "+g[1]))&&h(e,"class",d),(!p||b&3)&&x(e,"center-content",g[0])},i(g){p||(A(_,g),p=!0)},o(g){P(_,g),p=!1},d(g){g&&w(e),_&&_.d(g)}}}function dy(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 In extends ve{constructor(e){super(),be(this,e,dy,cy,_e,{center:0,class:1})}}function Wu(n){let e,t,i;return{c(){e=y("div"),e.innerHTML=``,t=E(),i=y("div"),h(e,"class","block txt-center m-b-lg"),h(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function py(n){let e,t,i,s=!n[0]&&Wu();const l=n[1].default,o=Tt(l,n,n[2],null);return{c(){e=y("div"),s&&s.c(),t=E(),o&&o.c(),h(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),v(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Wu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Mt(o,l,r,r[2],i?Ct(l,r[2],a,null):Ot(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function my(n){let e,t;return e=new In({props:{class:"full-page",center:!0,$$slots:{default:[py]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function hy(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class e1 extends ve{constructor(e){super(),be(this,e,hy,my,_e,{nobranding:0})}}function Yo(n){const e=n-1;return e*e*e+1}function yo(n,{delay:e=0,duration:t=400,easing:i=$l}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ii(n,{delay:e=0,duration:t=400,easing:i=Yo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[d,p]=du(s),[m,_]=du(l);return{delay:e,duration:t,easing:i,css:(g,b)=>` +`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=j.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?j.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}}const Uo=An([]);function xg(n,e=4e3){return Wo(n,"info",e)}function Jt(n,e=3e3){return Wo(n,"success",e)}function hl(n,e=4500){return Wo(n,"error",e)}function fy(n,e=4500){return Wo(n,"warning",e)}function Wo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{e1(i)},t)};Uo.update(s=>(Aa(s,i.message),j.pushOrReplaceByKey(s,i,"message"),s))}function e1(n){Uo.update(e=>(Aa(e,n),e))}function Ea(){Uo.update(n=>{for(let e of n)Aa(n,e);return[]})}function Aa(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const gi=An({});function dn(n){gi.set(n||{})}function Ai(n){gi.update(e=>(j.deleteByPath(e,n),e))}const Ia=An({});function Xr(n){Ia.set(n||{})}const dr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Li("/login")};Vo.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&&hl(l)}if(j.isEmpty(s.data)||dn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Li("/")};Vo.prototype.getAdminFileToken=async function(){let n=localStorage.getItem(dr)||"";return(!n||x_(n,15))&&(n&&localStorage.removeItem(dr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),n=await this._adminFileTokenRequest,localStorage.setItem(dr,n),this._adminFileTokenRequest=null),n};class cy extends eg{save(e,t){super.save(e,t),t instanceof is&&Xr(t)}clear(){super.clear(),Xr(null)}}const me=new Vo("../",new cy("pb_admin_auth"));me.authStore.model instanceof is&&Xr(me.authStore.model);function dy(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=n[3].default,_=Tt(m,n,n[2],null);return{c(){e=y("div"),t=y("main"),_&&_.c(),i=E(),s=y("footer"),l=y("a"),l.innerHTML=` + Docs`,o=E(),r=y("span"),r.textContent="|",a=E(),u=y("a"),f=y("span"),f.textContent="PocketBase v0.15.0-WIP",h(t,"class","page-content"),h(l,"href","https://pocketbase.io/docs/"),h(l,"target","_blank"),h(l,"rel","noopener noreferrer"),h(r,"class","delimiter"),h(f,"class","txt"),h(u,"href","https://github.com/pocketbase/pocketbase/releases"),h(u,"target","_blank"),h(u,"rel","noopener noreferrer"),h(u,"title","Releases"),h(s,"class","page-footer"),h(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(g,b){S(g,e,b),v(e,t),_&&_.m(t,null),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(u,f),p=!0},p(g,[b]){_&&_.p&&(!p||b&4)&&Mt(_,m,g,g[2],p?Ct(m,g[2],b,null):Ot(g[2]),null),(!p||b&2&&d!==(d="page-wrapper "+g[1]))&&h(e,"class",d),(!p||b&3)&&x(e,"center-content",g[0])},i(g){p||(A(_,g),p=!0)},o(g){P(_,g),p=!1},d(g){g&&w(e),_&&_.d(g)}}}function py(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 In extends ve{constructor(e){super(),be(this,e,py,dy,_e,{center:0,class:1})}}function Wu(n){let e,t,i;return{c(){e=y("div"),e.innerHTML=``,t=E(),i=y("div"),h(e,"class","block txt-center m-b-lg"),h(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function my(n){let e,t,i,s=!n[0]&&Wu();const l=n[1].default,o=Tt(l,n,n[2],null);return{c(){e=y("div"),s&&s.c(),t=E(),o&&o.c(),h(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),v(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Wu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Mt(o,l,r,r[2],i?Ct(l,r[2],a,null):Ot(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function hy(n){let e,t;return e=new In({props:{class:"full-page",center:!0,$$slots:{default:[my]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _y(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class t1 extends ve{constructor(e){super(),be(this,e,_y,hy,_e,{nobranding:0})}}function Yo(n){const e=n-1;return e*e*e+1}function yo(n,{delay:e=0,duration:t=400,easing:i=$l}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ii(n,{delay:e=0,duration:t=400,easing:i=Yo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[d,p]=du(s),[m,_]=du(l);return{delay:e,duration:t,easing:i,css:(g,b)=>` transform: ${u} translate(${(1-g)*d}${p}, ${(1-g)*m}${_}); opacity: ${a-f*b}`}}function wt(n,{delay:e=0,duration:t=400,easing:i=Yo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),d=parseFloat(l[`padding${f[0]}`]),p=parseFloat(l[`padding${f[1]}`]),m=parseFloat(l[`margin${f[0]}`]),_=parseFloat(l[`margin${f[1]}`]),g=parseFloat(l[`border${f[0]}Width`]),b=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*d}px;padding-${u[1]}: ${k*p}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*_}px;border-${u[0]}-width: ${k*g}px;border-${u[1]}-width: ${k*b}px;`}}function Bt(n,{delay:e=0,duration:t=400,easing:i=Yo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(d,p)=>` transform: ${a} scale(${1-u*p}); opacity: ${r-f*p} - `}}let Qr,Ui;const xr="app-tooltip";function Yu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Oi(){return Ui=Ui||document.querySelector("."+xr),Ui||(Ui=document.createElement("div"),Ui.classList.add(xr),document.body.appendChild(Ui)),Ui}function t1(n,e){let t=Oi();if(!t.classList.contains("active")||!(e!=null&&e.text)){ea();return}t.textContent=e.text,t.className=xr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function ea(){clearTimeout(Qr),Oi().classList.remove("active"),Oi().activeNode=void 0}function _y(n,e){Oi().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Oi().classList.add("active"),t1(n,e)},isNaN(e.delay)?0:e.delay)}function Ue(n,e){let t=Yu(e);function i(){_y(n,t)}function s(){ea()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",s),Oi(),{update(l){var o,r;t=Yu(l),(r=(o=Oi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&t1(n,t)},destroy(){var l,o;(o=(l=Oi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&ea(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Ku(n,e,t){const i=n.slice();return i[12]=e[t],i}const gy=n=>({}),Ju=n=>({uniqueId:n[4]});function by(n){let e,t,i=n[3],s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;odocument.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function ea(){clearTimeout(Qr),Oi().classList.remove("active"),Oi().activeNode=void 0}function gy(n,e){Oi().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Oi().classList.add("active"),n1(n,e)},isNaN(e.delay)?0:e.delay)}function Ue(n,e){let t=Yu(e);function i(){gy(n,t)}function s(){ea()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",s),Oi(),{update(l){var o,r;t=Yu(l),(r=(o=Oi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&n1(n,t)},destroy(){var l,o;(o=(l=Oi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&ea(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Ku(n,e,t){const i=n.slice();return i[12]=e[t],i}const by=n=>({}),Ju=n=>({uniqueId:n[4]});function vy(n){let e,t,i=n[3],s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{l&&(s||(s=Ve(t,Bt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=Ve(t,Bt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&w(e),a&&s&&s.end(),o=!1,r()}}}function Zu(n){let e,t,i=ko(n[12])+"",s,l,o,r;return{c(){e=y("div"),t=y("pre"),s=U(i),l=E(),h(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),v(e,t),v(t,s),v(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=ko(a[12])+"")&&le(s,i)},i(a){r||(a&&nt(()=>{r&&(o||(o=Ve(e,wt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Ve(e,wt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&w(e),a&&o&&o.end()}}}function yy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Tt(a,n,n[8],Ju),f=[vy,by],d=[];function p(m,_){return m[0]&&m[3].length?0:1}return i=p(n),s=d[i]=f[i](n),{c(){e=y("div"),u&&u.c(),t=E(),s.c(),h(e,"class",n[1]),x(e,"error",n[3].length)},m(m,_){S(m,e,_),u&&u.m(e,null),v(e,t),d[i].m(e,null),n[11](e),l=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[_]){u&&u.p&&(!l||_&256)&&Mt(u,a,m,m[8],l?Ct(a,m[8],_,gy):Ot(m[8]),Ju);let g=i;i=p(m),i===g?d[i].p(m,_):(re(),P(d[g],1,1,()=>{d[g]=null}),ae(),s=d[i],s?s.p(m,_):(s=d[i]=f[i](m),s.c()),A(s,1),s.m(e,null)),(!l||_&2)&&h(e,"class",m[1]),(!l||_&10)&&x(e,"error",m[3].length)},i(m){l||(A(u,m),A(s),l=!0)},o(m){P(u,m),P(s),l=!1},d(m){m&&w(e),u&&u.d(m),d[i].d(),n[11](null),o=!1,r()}}}const Gu="Invalid value";function ko(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Gu:n||Gu}function ky(n,e,t){let i;Ke(n,gi,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,d=[];function p(){Ai(r)}xt(()=>(f.addEventListener("input",p),f.addEventListener("change",p),()=>{f.removeEventListener("input",p),f.removeEventListener("change",p)}));function m(g){pe.call(this,n,g)}function _(g){se[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,d=j.toArray(j.getNestedVal(i,r)))},[a,u,f,d,o,r,p,i,l,s,m,_]}class de extends ve{constructor(e){super(),be(this,e,ky,yy,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function wy(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=E(),l=y("input"),h(e,"for",i=n[9]),h(l,"type","email"),h(l,"autocomplete","off"),h(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Sy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Password"),s=E(),l=y("input"),r=E(),a=y("div"),a.textContent="Minimum 10 characters.",h(e,"for",i=n[9]),h(l,"type","password"),h(l,"autocomplete","new-password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0,h(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[1]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[6]),u=!0)},p(d,p){p&512&&i!==(i=d[9])&&h(e,"for",i),p&512&&o!==(o=d[9])&&h(l,"id",o),p&2&&l.value!==d[1]&&ue(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function $y(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Password confirm"),s=E(),l=y("input"),h(e,"for",i=n[9]),h(l,"type","password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[2]),r||(a=J(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&4&&l.value!==u[2]&&ue(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Ty(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;return s=new de({props:{class:"form-field required",name:"email",$$slots:{default:[wy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[Sy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[$y,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),t.innerHTML="

Create your first admin account in order to continue

",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=y("button"),f.innerHTML=`Create and login - `,h(t,"class","content txt-center m-b-base"),h(f,"type","submit"),h(f,"class","btn btn-lg btn-block btn-next"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),h(e,"class","block"),h(e,"autocomplete","off")},m(_,g){S(_,e,g),v(e,t),v(e,i),V(s,e,null),v(e,l),V(o,e,null),v(e,r),V(a,e,null),v(e,u),v(e,f),d=!0,p||(m=J(e,"submit",ft(n[4])),p=!0)},p(_,[g]){const b={};g&1537&&(b.$$scope={dirty:g,ctx:_}),s.$set(b);const k={};g&1538&&(k.$$scope={dirty:g,ctx:_}),o.$set(k);const $={};g&1540&&($.$$scope={dirty:g,ctx:_}),a.$set($),(!d||g&8)&&x(f,"btn-disabled",_[3]),(!d||g&8)&&x(f,"btn-loading",_[3])},i(_){d||(A(s.$$.fragment,_),A(o.$$.fragment,_),A(a.$$.fragment,_),d=!0)},o(_){P(s.$$.fragment,_),P(o.$$.fragment,_),P(a.$$.fragment,_),d=!1},d(_){_&&w(e),H(s),H(o),H(a),p=!1,m()}}}function Cy(n,e,t){const i=kt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await me.admins.create({email:s,password:l,passwordConfirm:o}),await me.admins.authWithPassword(s,l),i("submit")}catch(p){me.errorResponseHandler(p)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function d(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,d]}class My extends ve{constructor(e){super(),be(this,e,Cy,Ty,_e,{})}}function Xu(n){let e,t;return e=new e1({props:{$$slots:{default:[Oy]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Oy(n){let e,t;return e=new My({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p:Q,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Dy(n){let e,t,i=n[0]&&Xu(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Xu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),P(i,1,1,()=>{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Ey(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Li("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await ln(),window.location.search=""}]}class Ay extends ve{constructor(e){super(),be(this,e,Ey,Dy,_e,{})}}const Lt=An(""),wo=An(""),Os=An(!1);function Iy(n){let e,t,i,s;return{c(){e=y("input"),h(e,"type","text"),h(e,"id",n[8]),h(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),ue(e,n[7]),i||(s=J(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&h(e,"placeholder",t),o&128&&e.value!==l[7]&&ue(e,l[7])},i:Q,o:Q,d(l){l&&w(e),n[13](null),i=!1,s()}}}function Py(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>he(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ke(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>he(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function Qu(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Search',h(e,"type","submit"),h(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&nt(()=>{i&&(t||(t=Ve(e,ii,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,ii,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function xu(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='Clear',h(e,"type","button"),h(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){S(o,e,r),i=!0,s||(l=J(e,"click",n[15]),s=!0)},p:Q,i(o){i||(o&&nt(()=>{i&&(t||(t=Ve(e,ii,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,ii,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Ly(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[Py,Iy],m=[];function _(k,$){return k[4]&&!k[5]?0:1}l=_(n),o=m[l]=p[l](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&Qu(),b=(n[0].length||n[7].length)&&xu(n);return{c(){e=y("form"),t=y("label"),i=y("i"),s=E(),o.c(),r=E(),g&&g.c(),a=E(),b&&b.c(),h(i,"class","ri-search-line"),h(t,"for",n[8]),h(t,"class","m-l-10 txt-xl"),h(e,"class","searchbar")},m(k,$){S(k,e,$),v(e,t),v(t,i),v(e,s),m[l].m(e,null),v(e,r),g&&g.m(e,null),v(e,a),b&&b.m(e,null),u=!0,f||(d=[J(e,"click",En(n[11])),J(e,"submit",ft(n[10]))],f=!0)},p(k,[$]){let T=l;l=_(k),l===T?m[l].p(k,$):(re(),P(m[T],1,1,()=>{m[T]=null}),ae(),o=m[l],o?o.p(k,$):(o=m[l]=p[l](k),o.c()),A(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?g?$&129&&A(g,1):(g=Qu(),g.c(),A(g,1),g.m(e,a)):g&&(re(),P(g,1,1,()=>{g=null}),ae()),k[0].length||k[7].length?b?(b.p(k,$),$&129&&A(b,1)):(b=xu(k),b.c(),A(b,1),b.m(e,null)):b&&(re(),P(b,1,1,()=>{b=null}),ae())},i(k){u||(A(o),A(g),A(b),u=!0)},o(k){P(o),P(g),P(b),u=!1},d(k){k&&w(e),m[l].d(),g&&g.d(),b&&b.d(),f=!1,De(d)}}}function Ny(n,e,t){const i=kt(),s="search_"+j.randomString(7);let{value:l=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=new kn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,d,p="";function m(D=!0){t(7,p=""),D&&(d==null||d.focus()),i("clear")}function _(){t(0,l=p),i("submit",l)}async function g(){u||f||(t(5,f=!0),t(4,u=(await rt(()=>import("./FilterAutocompleteInput-89bda33f.js"),["./FilterAutocompleteInput-89bda33f.js","./index-6f704b4c.js"],import.meta.url)).default),t(5,f=!1))}xt(()=>{g()});function b(D){pe.call(this,n,D)}function k(D){p=D,t(7,p),t(0,l)}function $(D){se[D?"unshift":"push"](()=>{d=D,t(6,d)})}function T(){p=this.value,t(7,p),t(0,l)}const C=()=>{m(!1),_()};return n.$$set=D=>{"value"in D&&t(0,l=D.value),"placeholder"in D&&t(1,o=D.placeholder),"autocompleteCollection"in D&&t(2,r=D.autocompleteCollection),"extraAutocompleteKeys"in D&&t(3,a=D.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,p=l)},[l,o,r,a,u,f,d,p,s,m,_,b,k,$,T,C]}class Ko extends ve{constructor(e){super(),be(this,e,Ny,Ly,_e,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Fy(n){let e,t,i,s;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"aria-label","Refresh"),h(e,"class","btn btn-transparent btn-circle svelte-1bvelc2"),x(e,"refreshing",n[1])},m(l,o){S(l,e,o),i||(s=[Ee(t=Ue.call(null,e,n[0])),J(e,"click",n[2])],i=!0)},p(l,[o]){t&&Ut(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&x(e,"refreshing",l[1])},i:Q,o:Q,d(l){l&&w(e),i=!1,De(s)}}}function Ry(n,e,t){const i=kt();let{tooltip:s={text:"Refresh",position:"right"}}=e,l=null;function o(){i("refresh");const r=s;t(0,s=null),clearTimeout(l),t(1,l=setTimeout(()=>{t(1,l=null),t(0,s=r)},150))}return xt(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class Pa extends ve{constructor(e){super(),be(this,e,Ry,Fy,_e,{tooltip:0})}}function qy(n){let e,t,i,s,l;const o=n[6].default,r=Tt(o,n,n[5],null);return{c(){e=y("th"),r&&r.c(),h(e,"tabindex","0"),h(e,"title",n[2]),h(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){S(a,e,u),r&&r.m(e,null),i=!0,s||(l=[J(e,"click",n[7]),J(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Mt(r,o,a,a[5],i?Ct(o,a[5],u,null):Ot(a[5]),null),(!i||u&4)&&h(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&h(e,"class",t),(!i||u&10)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&w(e),r&&r.d(a),s=!1,De(l)}}}function jy(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),d=p=>{(p.code==="Enter"||p.code==="Space")&&(p.preventDefault(),u())};return n.$$set=p=>{"class"in p&&t(1,l=p.class),"name"in p&&t(2,o=p.name),"sort"in p&&t(0,r=p.sort),"disable"in p&&t(3,a=p.disable),"$$scope"in p&&t(5,s=p.$$scope)},[r,l,o,a,u,s,i,f,d]}class tn extends ve{constructor(e){super(),be(this,e,jy,qy,_e,{class:1,name:2,sort:0,disable:3})}}function Vy(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt txt-hint")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Hy(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("div"),i=U(n[2]),s=E(),l=y("div"),o=U(n[1]),r=U(" UTC"),h(t,"class","date"),h(l,"class","time svelte-zdiknu"),h(e,"class","datetime svelte-zdiknu")},m(a,u){S(a,e,u),v(e,t),v(t,i),v(e,s),v(e,l),v(l,o),v(l,r)},p(a,u){u&4&&le(i,a[2]),u&2&&le(o,a[1])},d(a){a&&w(e)}}}function zy(n){let e;function t(l,o){return l[0]?Hy:Vy}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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:Q,o:Q,d(l){s.d(l),l&&w(e)}}}function By(n,e,t){let i,s,{date:l=""}=e;return n.$$set=o=>{"date"in o&&t(0,l=o.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i]}class hi extends ve{constructor(e){super(),be(this,e,By,zy,_e,{date:0})}}const Uy=n=>({}),ef=n=>({}),Wy=n=>({}),tf=n=>({});function Yy(n){let e,t,i,s,l,o,r,a;const u=n[5].before,f=Tt(u,n,n[4],tf),d=n[5].default,p=Tt(d,n,n[4],null),m=n[5].after,_=Tt(m,n,n[4],ef);return{c(){e=y("div"),f&&f.c(),t=E(),i=y("div"),p&&p.c(),l=E(),_&&_.c(),h(i,"class",s="horizontal-scroller "+n[0]+" "+n[3]+" svelte-wc2j9h"),h(e,"class","horizontal-scroller-wrapper svelte-wc2j9h")},m(g,b){S(g,e,b),f&&f.m(e,null),v(e,t),v(e,i),p&&p.m(i,null),n[6](i),v(e,l),_&&_.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(g,[b]){f&&f.p&&(!o||b&16)&&Mt(f,u,g,g[4],o?Ct(u,g[4],b,Wy):Ot(g[4]),tf),p&&p.p&&(!o||b&16)&&Mt(p,d,g,g[4],o?Ct(d,g[4],b,null):Ot(g[4]),null),(!o||b&9&&s!==(s="horizontal-scroller "+g[0]+" "+g[3]+" svelte-wc2j9h"))&&h(i,"class",s),_&&_.p&&(!o||b&16)&&Mt(_,m,g,g[4],o?Ct(m,g[4],b,Uy):Ot(g[4]),ef)},i(g){o||(A(f,g),A(p,g),A(_,g),o=!0)},o(g){P(f,g),P(p,g),P(_,g),o=!1},d(g){g&&w(e),f&&f.d(g),p&&p.d(g),n[6](null),_&&_.d(g),r=!1,De(a)}}}function Ky(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o=null,r="",a=null,u;function f(){o&&(clearTimeout(a),a=setTimeout(()=>{const p=o.offsetWidth,m=o.scrollWidth;m-p?(t(3,r="scrollable"),o.scrollLeft===0?t(3,r+=" scroll-start"):o.scrollLeft+p==m&&t(3,r+=" scroll-end")):t(3,r="")},100))}xt(()=>(f(),u=new MutationObserver(()=>{f()}),u.observe(o,{attributeFilter:["width"],childList:!0,subtree:!0}),()=>{u==null||u.disconnect(),clearTimeout(a)}));function d(p){se[p?"unshift":"push"](()=>{o=p,t(2,o)})}return n.$$set=p=>{"class"in p&&t(0,l=p.class),"$$scope"in p&&t(4,s=p.$$scope)},[l,f,o,r,s,i,d]}class La extends ve{constructor(e){super(),be(this,e,Ky,Yy,_e,{class:0,refresh:1})}get refresh(){return this.$$.ctx[1]}}function nf(n,e,t){const i=n.slice();return i[23]=e[t],i}function Jy(n){let e;return{c(){e=y("div"),e.innerHTML=` - Method`,h(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Zy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="URL",h(t,"class",j.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Gy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Referer",h(t,"class",j.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Xy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="User IP",h(t,"class",j.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Qy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Status",h(t,"class",j.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function xy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Created",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function sf(n){let e;function t(l,o){return l[6]?t2:e2}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 e2(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&lf(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=lf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function t2(n){let e;return{c(){e=y("tr"),e.innerHTML=` - `},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function lf(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[19]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function of(n){let e;return{c(){e=y("i"),h(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),h(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function rf(n,e){var Ce,Je,mt;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,d=e[23].url+"",p,m,_,g,b,k,$=(e[23].referer||"N/A")+"",T,C,D,M,O,I=(e[23].userIp||"N/A")+"",L,F,R,N,q,Y=e[23].status+"",B,Z,ee,ie,X,fe,G,ce,ge,Me,qe=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((mt=e[23].meta)==null?void 0:mt.errorData))&&of();ie=new hi({props:{date:e[23].created}});function He(){return e[17](e[23])}function we(...Ze){return e[18](e[23],...Ze)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("span"),o=U(l),a=E(),u=y("td"),f=y("span"),p=U(d),_=E(),qe&&qe.c(),g=E(),b=y("td"),k=y("span"),T=U($),D=E(),M=y("td"),O=y("span"),L=U(I),R=E(),N=y("td"),q=y("span"),B=U(Y),Z=E(),ee=y("td"),z(ie.$$.fragment),X=E(),fe=y("td"),fe.innerHTML='',G=E(),h(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",m=e[23].url),h(u,"class","col-type-text col-field-url"),h(k,"class","txt txt-ellipsis"),h(k,"title",C=e[23].referer),x(k,"txt-hint",!e[23].referer),h(b,"class","col-type-text col-field-referer"),h(O,"class","txt txt-ellipsis"),h(O,"title",F=e[23].userIp),x(O,"txt-hint",!e[23].userIp),h(M,"class","col-type-number col-field-userIp"),h(q,"class","label"),x(q,"label-danger",e[23].status>=400),h(N,"class","col-type-number col-field-status"),h(ee,"class","col-type-date col-field-created"),h(fe,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Ze,We){S(Ze,t,We),v(t,i),v(i,s),v(s,o),v(t,a),v(t,u),v(u,f),v(f,p),v(u,_),qe&&qe.m(u,null),v(t,g),v(t,b),v(b,k),v(k,T),v(t,D),v(t,M),v(M,O),v(O,L),v(t,R),v(t,N),v(N,q),v(q,B),v(t,Z),v(t,ee),V(ie,ee,null),v(t,X),v(t,fe),v(t,G),ce=!0,ge||(Me=[J(t,"click",He),J(t,"keydown",we)],ge=!0)},p(Ze,We){var Fe,Qe,Gt;e=Ze,(!ce||We&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!ce||We&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&h(s,"class",r),(!ce||We&8)&&d!==(d=e[23].url+"")&&le(p,d),(!ce||We&8&&m!==(m=e[23].url))&&h(f,"title",m),(Qe=e[23].meta)!=null&&Qe.errorMessage||(Gt=e[23].meta)!=null&&Gt.errorData?qe||(qe=of(),qe.c(),qe.m(u,null)):qe&&(qe.d(1),qe=null),(!ce||We&8)&&$!==($=(e[23].referer||"N/A")+"")&&le(T,$),(!ce||We&8&&C!==(C=e[23].referer))&&h(k,"title",C),(!ce||We&8)&&x(k,"txt-hint",!e[23].referer),(!ce||We&8)&&I!==(I=(e[23].userIp||"N/A")+"")&&le(L,I),(!ce||We&8&&F!==(F=e[23].userIp))&&h(O,"title",F),(!ce||We&8)&&x(O,"txt-hint",!e[23].userIp),(!ce||We&8)&&Y!==(Y=e[23].status+"")&&le(B,Y),(!ce||We&8)&&x(q,"label-danger",e[23].status>=400);const te={};We&8&&(te.date=e[23].created),ie.$set(te)},i(Ze){ce||(A(ie.$$.fragment,Ze),ce=!0)},o(Ze){P(ie.$$.fragment,Ze),ce=!1},d(Ze){Ze&&w(t),qe&&qe.d(),H(ie),ge=!1,De(Me)}}}function n2(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L=[],F=new Map,R;function N(we){n[11](we)}let q={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Jy]},$$scope:{ctx:n}};n[1]!==void 0&&(q.sort=n[1]),s=new tn({props:q}),se.push(()=>he(s,"sort",N));function Y(we){n[12](we)}let B={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Zy]},$$scope:{ctx:n}};n[1]!==void 0&&(B.sort=n[1]),r=new tn({props:B}),se.push(()=>he(r,"sort",Y));function Z(we){n[13](we)}let ee={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Gy]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),f=new tn({props:ee}),se.push(()=>he(f,"sort",Z));function ie(we){n[14](we)}let X={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Xy]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),m=new tn({props:X}),se.push(()=>he(m,"sort",ie));function fe(we){n[15](we)}let G={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Qy]},$$scope:{ctx:n}};n[1]!==void 0&&(G.sort=n[1]),b=new tn({props:G}),se.push(()=>he(b,"sort",fe));function ce(we){n[16](we)}let ge={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[xy]},$$scope:{ctx:n}};n[1]!==void 0&&(ge.sort=n[1]),T=new tn({props:ge}),se.push(()=>he(T,"sort",ce));let Me=n[3];const qe=we=>we[23].id;for(let we=0;wel=!1)),s.$set(Je);const mt={};Ce&67108864&&(mt.$$scope={dirty:Ce,ctx:we}),!a&&Ce&2&&(a=!0,mt.sort=we[1],ke(()=>a=!1)),r.$set(mt);const Ze={};Ce&67108864&&(Ze.$$scope={dirty:Ce,ctx:we}),!d&&Ce&2&&(d=!0,Ze.sort=we[1],ke(()=>d=!1)),f.$set(Ze);const We={};Ce&67108864&&(We.$$scope={dirty:Ce,ctx:we}),!_&&Ce&2&&(_=!0,We.sort=we[1],ke(()=>_=!1)),m.$set(We);const te={};Ce&67108864&&(te.$$scope={dirty:Ce,ctx:we}),!k&&Ce&2&&(k=!0,te.sort=we[1],ke(()=>k=!1)),b.$set(te);const Fe={};Ce&67108864&&(Fe.$$scope={dirty:Ce,ctx:we}),!C&&Ce&2&&(C=!0,Fe.sort=we[1],ke(()=>C=!1)),T.$set(Fe),Ce&841&&(Me=we[3],re(),L=yt(L,Ce,qe,1,we,Me,F,I,Zt,rf,null,nf),ae(),!Me.length&&He?He.p(we,Ce):Me.length?He&&(He.d(1),He=null):(He=sf(we),He.c(),He.m(I,null))),(!R||Ce&64)&&x(e,"table-loading",we[6])},i(we){if(!R){A(s.$$.fragment,we),A(r.$$.fragment,we),A(f.$$.fragment,we),A(m.$$.fragment,we),A(b.$$.fragment,we),A(T.$$.fragment,we);for(let Ce=0;Ce{if(F<=1&&g(),t(6,p=!1),t(5,f=N.page),t(4,d=N.totalItems),s("load",u.concat(N.items)),R){const q=++m;for(;N.items.length&&m==q;)t(3,u=u.concat(N.items.splice(0,10))),await j.yieldToMain()}else t(3,u=u.concat(N.items))}).catch(N=>{N!=null&&N.isAbort||(t(6,p=!1),console.warn(N),g(),me.errorResponseHandler(N,!1))})}function g(){t(3,u=[]),t(5,f=1),t(4,d=0)}function b(F){a=F,t(1,a)}function k(F){a=F,t(1,a)}function $(F){a=F,t(1,a)}function T(F){a=F,t(1,a)}function C(F){a=F,t(1,a)}function D(F){a=F,t(1,a)}const M=F=>s("select",F),O=(F,R)=>{R.code==="Enter"&&(R.preventDefault(),s("select",F))},I=()=>t(0,o=""),L=()=>_(f+1);return n.$$set=F=>{"filter"in F&&t(0,o=F.filter),"presets"in F&&t(10,r=F.presets),"sort"in F&&t(1,a=F.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(g(),_(1)),n.$$.dirty&24&&t(7,i=d>u.length)},[o,a,_,u,d,f,p,i,s,l,r,b,k,$,T,C,D,M,O,I,L]}class l2 extends ve{constructor(e){super(),be(this,e,s2,i2,_e,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! +`)})},i(a){l||(a&&nt(()=>{l&&(s||(s=Ve(t,Bt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=Ve(t,Bt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&w(e),a&&s&&s.end(),o=!1,r()}}}function Zu(n){let e,t,i=ko(n[12])+"",s,l,o,r;return{c(){e=y("div"),t=y("pre"),s=U(i),l=E(),h(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),v(e,t),v(t,s),v(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=ko(a[12])+"")&&le(s,i)},i(a){r||(a&&nt(()=>{r&&(o||(o=Ve(e,wt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Ve(e,wt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&w(e),a&&o&&o.end()}}}function ky(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Tt(a,n,n[8],Ju),f=[yy,vy],d=[];function p(m,_){return m[0]&&m[3].length?0:1}return i=p(n),s=d[i]=f[i](n),{c(){e=y("div"),u&&u.c(),t=E(),s.c(),h(e,"class",n[1]),x(e,"error",n[3].length)},m(m,_){S(m,e,_),u&&u.m(e,null),v(e,t),d[i].m(e,null),n[11](e),l=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[_]){u&&u.p&&(!l||_&256)&&Mt(u,a,m,m[8],l?Ct(a,m[8],_,by):Ot(m[8]),Ju);let g=i;i=p(m),i===g?d[i].p(m,_):(re(),P(d[g],1,1,()=>{d[g]=null}),ae(),s=d[i],s?s.p(m,_):(s=d[i]=f[i](m),s.c()),A(s,1),s.m(e,null)),(!l||_&2)&&h(e,"class",m[1]),(!l||_&10)&&x(e,"error",m[3].length)},i(m){l||(A(u,m),A(s),l=!0)},o(m){P(u,m),P(s),l=!1},d(m){m&&w(e),u&&u.d(m),d[i].d(),n[11](null),o=!1,r()}}}const Gu="Invalid value";function ko(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Gu:n||Gu}function wy(n,e,t){let i;Ke(n,gi,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,d=[];function p(){Ai(r)}xt(()=>(f.addEventListener("input",p),f.addEventListener("change",p),()=>{f.removeEventListener("input",p),f.removeEventListener("change",p)}));function m(g){pe.call(this,n,g)}function _(g){se[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,d=j.toArray(j.getNestedVal(i,r)))},[a,u,f,d,o,r,p,i,l,s,m,_]}class de extends ve{constructor(e){super(),be(this,e,wy,ky,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Sy(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=E(),l=y("input"),h(e,"for",i=n[9]),h(l,"type","email"),h(l,"autocomplete","off"),h(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function $y(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Password"),s=E(),l=y("input"),r=E(),a=y("div"),a.textContent="Minimum 10 characters.",h(e,"for",i=n[9]),h(l,"type","password"),h(l,"autocomplete","new-password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0,h(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[1]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[6]),u=!0)},p(d,p){p&512&&i!==(i=d[9])&&h(e,"for",i),p&512&&o!==(o=d[9])&&h(l,"id",o),p&2&&l.value!==d[1]&&ue(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function Ty(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Password confirm"),s=E(),l=y("input"),h(e,"for",i=n[9]),h(l,"type","password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[2]),r||(a=J(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&4&&l.value!==u[2]&&ue(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Cy(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;return s=new de({props:{class:"form-field required",name:"email",$$slots:{default:[Sy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[$y,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Ty,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),t.innerHTML="

Create your first admin account in order to continue

",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=y("button"),f.innerHTML=`Create and login + `,h(t,"class","content txt-center m-b-base"),h(f,"type","submit"),h(f,"class","btn btn-lg btn-block btn-next"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),h(e,"class","block"),h(e,"autocomplete","off")},m(_,g){S(_,e,g),v(e,t),v(e,i),V(s,e,null),v(e,l),V(o,e,null),v(e,r),V(a,e,null),v(e,u),v(e,f),d=!0,p||(m=J(e,"submit",ft(n[4])),p=!0)},p(_,[g]){const b={};g&1537&&(b.$$scope={dirty:g,ctx:_}),s.$set(b);const k={};g&1538&&(k.$$scope={dirty:g,ctx:_}),o.$set(k);const $={};g&1540&&($.$$scope={dirty:g,ctx:_}),a.$set($),(!d||g&8)&&x(f,"btn-disabled",_[3]),(!d||g&8)&&x(f,"btn-loading",_[3])},i(_){d||(A(s.$$.fragment,_),A(o.$$.fragment,_),A(a.$$.fragment,_),d=!0)},o(_){P(s.$$.fragment,_),P(o.$$.fragment,_),P(a.$$.fragment,_),d=!1},d(_){_&&w(e),H(s),H(o),H(a),p=!1,m()}}}function My(n,e,t){const i=kt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await me.admins.create({email:s,password:l,passwordConfirm:o}),await me.admins.authWithPassword(s,l),i("submit")}catch(p){me.errorResponseHandler(p)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function d(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,d]}class Oy extends ve{constructor(e){super(),be(this,e,My,Cy,_e,{})}}function Xu(n){let e,t;return e=new t1({props:{$$slots:{default:[Dy]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Dy(n){let e,t;return e=new Oy({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p:Q,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Ey(n){let e,t,i=n[0]&&Xu(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Xu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),P(i,1,1,()=>{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Ay(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Li("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await ln(),window.location.search=""}]}class Iy extends ve{constructor(e){super(),be(this,e,Ay,Ey,_e,{})}}const Lt=An(""),wo=An(""),Os=An(!1);function Py(n){let e,t,i,s;return{c(){e=y("input"),h(e,"type","text"),h(e,"id",n[8]),h(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),ue(e,n[7]),i||(s=J(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&h(e,"placeholder",t),o&128&&e.value!==l[7]&&ue(e,l[7])},i:Q,o:Q,d(l){l&&w(e),n[13](null),i=!1,s()}}}function Ly(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>he(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ke(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>he(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function Qu(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Search',h(e,"type","submit"),h(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&nt(()=>{i&&(t||(t=Ve(e,ii,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,ii,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function xu(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='Clear',h(e,"type","button"),h(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){S(o,e,r),i=!0,s||(l=J(e,"click",n[15]),s=!0)},p:Q,i(o){i||(o&&nt(()=>{i&&(t||(t=Ve(e,ii,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,ii,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Ny(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[Ly,Py],m=[];function _(k,$){return k[4]&&!k[5]?0:1}l=_(n),o=m[l]=p[l](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&Qu(),b=(n[0].length||n[7].length)&&xu(n);return{c(){e=y("form"),t=y("label"),i=y("i"),s=E(),o.c(),r=E(),g&&g.c(),a=E(),b&&b.c(),h(i,"class","ri-search-line"),h(t,"for",n[8]),h(t,"class","m-l-10 txt-xl"),h(e,"class","searchbar")},m(k,$){S(k,e,$),v(e,t),v(t,i),v(e,s),m[l].m(e,null),v(e,r),g&&g.m(e,null),v(e,a),b&&b.m(e,null),u=!0,f||(d=[J(e,"click",En(n[11])),J(e,"submit",ft(n[10]))],f=!0)},p(k,[$]){let T=l;l=_(k),l===T?m[l].p(k,$):(re(),P(m[T],1,1,()=>{m[T]=null}),ae(),o=m[l],o?o.p(k,$):(o=m[l]=p[l](k),o.c()),A(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?g?$&129&&A(g,1):(g=Qu(),g.c(),A(g,1),g.m(e,a)):g&&(re(),P(g,1,1,()=>{g=null}),ae()),k[0].length||k[7].length?b?(b.p(k,$),$&129&&A(b,1)):(b=xu(k),b.c(),A(b,1),b.m(e,null)):b&&(re(),P(b,1,1,()=>{b=null}),ae())},i(k){u||(A(o),A(g),A(b),u=!0)},o(k){P(o),P(g),P(b),u=!1},d(k){k&&w(e),m[l].d(),g&&g.d(),b&&b.d(),f=!1,De(d)}}}function Fy(n,e,t){const i=kt(),s="search_"+j.randomString(7);let{value:l=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=new kn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,d,p="";function m(D=!0){t(7,p=""),D&&(d==null||d.focus()),i("clear")}function _(){t(0,l=p),i("submit",l)}async function g(){u||f||(t(5,f=!0),t(4,u=(await rt(()=>import("./FilterAutocompleteInput-773533b0.js"),["./FilterAutocompleteInput-773533b0.js","./index-c4d2d831.js"],import.meta.url)).default),t(5,f=!1))}xt(()=>{g()});function b(D){pe.call(this,n,D)}function k(D){p=D,t(7,p),t(0,l)}function $(D){se[D?"unshift":"push"](()=>{d=D,t(6,d)})}function T(){p=this.value,t(7,p),t(0,l)}const C=()=>{m(!1),_()};return n.$$set=D=>{"value"in D&&t(0,l=D.value),"placeholder"in D&&t(1,o=D.placeholder),"autocompleteCollection"in D&&t(2,r=D.autocompleteCollection),"extraAutocompleteKeys"in D&&t(3,a=D.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,p=l)},[l,o,r,a,u,f,d,p,s,m,_,b,k,$,T,C]}class Ko extends ve{constructor(e){super(),be(this,e,Fy,Ny,_e,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Ry(n){let e,t,i,s;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"aria-label","Refresh"),h(e,"class","btn btn-transparent btn-circle svelte-1bvelc2"),x(e,"refreshing",n[1])},m(l,o){S(l,e,o),i||(s=[Ee(t=Ue.call(null,e,n[0])),J(e,"click",n[2])],i=!0)},p(l,[o]){t&&Ut(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&x(e,"refreshing",l[1])},i:Q,o:Q,d(l){l&&w(e),i=!1,De(s)}}}function qy(n,e,t){const i=kt();let{tooltip:s={text:"Refresh",position:"right"}}=e,l=null;function o(){i("refresh");const r=s;t(0,s=null),clearTimeout(l),t(1,l=setTimeout(()=>{t(1,l=null),t(0,s=r)},150))}return xt(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class Pa extends ve{constructor(e){super(),be(this,e,qy,Ry,_e,{tooltip:0})}}function jy(n){let e,t,i,s,l;const o=n[6].default,r=Tt(o,n,n[5],null);return{c(){e=y("th"),r&&r.c(),h(e,"tabindex","0"),h(e,"title",n[2]),h(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){S(a,e,u),r&&r.m(e,null),i=!0,s||(l=[J(e,"click",n[7]),J(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Mt(r,o,a,a[5],i?Ct(o,a[5],u,null):Ot(a[5]),null),(!i||u&4)&&h(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&h(e,"class",t),(!i||u&10)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&w(e),r&&r.d(a),s=!1,De(l)}}}function Vy(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),d=p=>{(p.code==="Enter"||p.code==="Space")&&(p.preventDefault(),u())};return n.$$set=p=>{"class"in p&&t(1,l=p.class),"name"in p&&t(2,o=p.name),"sort"in p&&t(0,r=p.sort),"disable"in p&&t(3,a=p.disable),"$$scope"in p&&t(5,s=p.$$scope)},[r,l,o,a,u,s,i,f,d]}class tn extends ve{constructor(e){super(),be(this,e,Vy,jy,_e,{class:1,name:2,sort:0,disable:3})}}function Hy(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt txt-hint")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function zy(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("div"),i=U(n[2]),s=E(),l=y("div"),o=U(n[1]),r=U(" UTC"),h(t,"class","date"),h(l,"class","time svelte-zdiknu"),h(e,"class","datetime svelte-zdiknu")},m(a,u){S(a,e,u),v(e,t),v(t,i),v(e,s),v(e,l),v(l,o),v(l,r)},p(a,u){u&4&&le(i,a[2]),u&2&&le(o,a[1])},d(a){a&&w(e)}}}function By(n){let e;function t(l,o){return l[0]?zy:Hy}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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:Q,o:Q,d(l){s.d(l),l&&w(e)}}}function Uy(n,e,t){let i,s,{date:l=""}=e;return n.$$set=o=>{"date"in o&&t(0,l=o.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i]}class hi extends ve{constructor(e){super(),be(this,e,Uy,By,_e,{date:0})}}const Wy=n=>({}),ef=n=>({}),Yy=n=>({}),tf=n=>({});function Ky(n){let e,t,i,s,l,o,r,a;const u=n[5].before,f=Tt(u,n,n[4],tf),d=n[5].default,p=Tt(d,n,n[4],null),m=n[5].after,_=Tt(m,n,n[4],ef);return{c(){e=y("div"),f&&f.c(),t=E(),i=y("div"),p&&p.c(),l=E(),_&&_.c(),h(i,"class",s="horizontal-scroller "+n[0]+" "+n[3]+" svelte-wc2j9h"),h(e,"class","horizontal-scroller-wrapper svelte-wc2j9h")},m(g,b){S(g,e,b),f&&f.m(e,null),v(e,t),v(e,i),p&&p.m(i,null),n[6](i),v(e,l),_&&_.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(g,[b]){f&&f.p&&(!o||b&16)&&Mt(f,u,g,g[4],o?Ct(u,g[4],b,Yy):Ot(g[4]),tf),p&&p.p&&(!o||b&16)&&Mt(p,d,g,g[4],o?Ct(d,g[4],b,null):Ot(g[4]),null),(!o||b&9&&s!==(s="horizontal-scroller "+g[0]+" "+g[3]+" svelte-wc2j9h"))&&h(i,"class",s),_&&_.p&&(!o||b&16)&&Mt(_,m,g,g[4],o?Ct(m,g[4],b,Wy):Ot(g[4]),ef)},i(g){o||(A(f,g),A(p,g),A(_,g),o=!0)},o(g){P(f,g),P(p,g),P(_,g),o=!1},d(g){g&&w(e),f&&f.d(g),p&&p.d(g),n[6](null),_&&_.d(g),r=!1,De(a)}}}function Jy(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o=null,r="",a=null,u;function f(){o&&(clearTimeout(a),a=setTimeout(()=>{const p=o.offsetWidth,m=o.scrollWidth;m-p?(t(3,r="scrollable"),o.scrollLeft===0?t(3,r+=" scroll-start"):o.scrollLeft+p==m&&t(3,r+=" scroll-end")):t(3,r="")},100))}xt(()=>(f(),u=new MutationObserver(()=>{f()}),u.observe(o,{attributeFilter:["width"],childList:!0,subtree:!0}),()=>{u==null||u.disconnect(),clearTimeout(a)}));function d(p){se[p?"unshift":"push"](()=>{o=p,t(2,o)})}return n.$$set=p=>{"class"in p&&t(0,l=p.class),"$$scope"in p&&t(4,s=p.$$scope)},[l,f,o,r,s,i,d]}class La extends ve{constructor(e){super(),be(this,e,Jy,Ky,_e,{class:0,refresh:1})}get refresh(){return this.$$.ctx[1]}}function nf(n,e,t){const i=n.slice();return i[23]=e[t],i}function Zy(n){let e;return{c(){e=y("div"),e.innerHTML=` + Method`,h(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Gy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="URL",h(t,"class",j.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Xy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Referer",h(t,"class",j.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Qy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="User IP",h(t,"class",j.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function xy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Status",h(t,"class",j.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function e2(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Created",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function sf(n){let e;function t(l,o){return l[6]?n2:t2}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 t2(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&lf(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=lf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function n2(n){let e;return{c(){e=y("tr"),e.innerHTML=` + `},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function lf(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[19]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function of(n){let e;return{c(){e=y("i"),h(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),h(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function rf(n,e){var Ce,Je,mt;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,d=e[23].url+"",p,m,_,g,b,k,$=(e[23].referer||"N/A")+"",T,C,D,M,O,I=(e[23].userIp||"N/A")+"",L,F,R,N,q,Y=e[23].status+"",B,Z,ee,ie,X,fe,G,ce,ge,Me,qe=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((mt=e[23].meta)==null?void 0:mt.errorData))&&of();ie=new hi({props:{date:e[23].created}});function He(){return e[17](e[23])}function we(...Ze){return e[18](e[23],...Ze)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("span"),o=U(l),a=E(),u=y("td"),f=y("span"),p=U(d),_=E(),qe&&qe.c(),g=E(),b=y("td"),k=y("span"),T=U($),D=E(),M=y("td"),O=y("span"),L=U(I),R=E(),N=y("td"),q=y("span"),B=U(Y),Z=E(),ee=y("td"),z(ie.$$.fragment),X=E(),fe=y("td"),fe.innerHTML='',G=E(),h(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",m=e[23].url),h(u,"class","col-type-text col-field-url"),h(k,"class","txt txt-ellipsis"),h(k,"title",C=e[23].referer),x(k,"txt-hint",!e[23].referer),h(b,"class","col-type-text col-field-referer"),h(O,"class","txt txt-ellipsis"),h(O,"title",F=e[23].userIp),x(O,"txt-hint",!e[23].userIp),h(M,"class","col-type-number col-field-userIp"),h(q,"class","label"),x(q,"label-danger",e[23].status>=400),h(N,"class","col-type-number col-field-status"),h(ee,"class","col-type-date col-field-created"),h(fe,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Ze,We){S(Ze,t,We),v(t,i),v(i,s),v(s,o),v(t,a),v(t,u),v(u,f),v(f,p),v(u,_),qe&&qe.m(u,null),v(t,g),v(t,b),v(b,k),v(k,T),v(t,D),v(t,M),v(M,O),v(O,L),v(t,R),v(t,N),v(N,q),v(q,B),v(t,Z),v(t,ee),V(ie,ee,null),v(t,X),v(t,fe),v(t,G),ce=!0,ge||(Me=[J(t,"click",He),J(t,"keydown",we)],ge=!0)},p(Ze,We){var Fe,Qe,Gt;e=Ze,(!ce||We&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!ce||We&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&h(s,"class",r),(!ce||We&8)&&d!==(d=e[23].url+"")&&le(p,d),(!ce||We&8&&m!==(m=e[23].url))&&h(f,"title",m),(Qe=e[23].meta)!=null&&Qe.errorMessage||(Gt=e[23].meta)!=null&&Gt.errorData?qe||(qe=of(),qe.c(),qe.m(u,null)):qe&&(qe.d(1),qe=null),(!ce||We&8)&&$!==($=(e[23].referer||"N/A")+"")&&le(T,$),(!ce||We&8&&C!==(C=e[23].referer))&&h(k,"title",C),(!ce||We&8)&&x(k,"txt-hint",!e[23].referer),(!ce||We&8)&&I!==(I=(e[23].userIp||"N/A")+"")&&le(L,I),(!ce||We&8&&F!==(F=e[23].userIp))&&h(O,"title",F),(!ce||We&8)&&x(O,"txt-hint",!e[23].userIp),(!ce||We&8)&&Y!==(Y=e[23].status+"")&&le(B,Y),(!ce||We&8)&&x(q,"label-danger",e[23].status>=400);const te={};We&8&&(te.date=e[23].created),ie.$set(te)},i(Ze){ce||(A(ie.$$.fragment,Ze),ce=!0)},o(Ze){P(ie.$$.fragment,Ze),ce=!1},d(Ze){Ze&&w(t),qe&&qe.d(),H(ie),ge=!1,De(Me)}}}function i2(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L=[],F=new Map,R;function N(we){n[11](we)}let q={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Zy]},$$scope:{ctx:n}};n[1]!==void 0&&(q.sort=n[1]),s=new tn({props:q}),se.push(()=>he(s,"sort",N));function Y(we){n[12](we)}let B={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Gy]},$$scope:{ctx:n}};n[1]!==void 0&&(B.sort=n[1]),r=new tn({props:B}),se.push(()=>he(r,"sort",Y));function Z(we){n[13](we)}let ee={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Xy]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),f=new tn({props:ee}),se.push(()=>he(f,"sort",Z));function ie(we){n[14](we)}let X={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Qy]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),m=new tn({props:X}),se.push(()=>he(m,"sort",ie));function fe(we){n[15](we)}let G={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[xy]},$$scope:{ctx:n}};n[1]!==void 0&&(G.sort=n[1]),b=new tn({props:G}),se.push(()=>he(b,"sort",fe));function ce(we){n[16](we)}let ge={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[e2]},$$scope:{ctx:n}};n[1]!==void 0&&(ge.sort=n[1]),T=new tn({props:ge}),se.push(()=>he(T,"sort",ce));let Me=n[3];const qe=we=>we[23].id;for(let we=0;wel=!1)),s.$set(Je);const mt={};Ce&67108864&&(mt.$$scope={dirty:Ce,ctx:we}),!a&&Ce&2&&(a=!0,mt.sort=we[1],ke(()=>a=!1)),r.$set(mt);const Ze={};Ce&67108864&&(Ze.$$scope={dirty:Ce,ctx:we}),!d&&Ce&2&&(d=!0,Ze.sort=we[1],ke(()=>d=!1)),f.$set(Ze);const We={};Ce&67108864&&(We.$$scope={dirty:Ce,ctx:we}),!_&&Ce&2&&(_=!0,We.sort=we[1],ke(()=>_=!1)),m.$set(We);const te={};Ce&67108864&&(te.$$scope={dirty:Ce,ctx:we}),!k&&Ce&2&&(k=!0,te.sort=we[1],ke(()=>k=!1)),b.$set(te);const Fe={};Ce&67108864&&(Fe.$$scope={dirty:Ce,ctx:we}),!C&&Ce&2&&(C=!0,Fe.sort=we[1],ke(()=>C=!1)),T.$set(Fe),Ce&841&&(Me=we[3],re(),L=yt(L,Ce,qe,1,we,Me,F,I,Zt,rf,null,nf),ae(),!Me.length&&He?He.p(we,Ce):Me.length?He&&(He.d(1),He=null):(He=sf(we),He.c(),He.m(I,null))),(!R||Ce&64)&&x(e,"table-loading",we[6])},i(we){if(!R){A(s.$$.fragment,we),A(r.$$.fragment,we),A(f.$$.fragment,we),A(m.$$.fragment,we),A(b.$$.fragment,we),A(T.$$.fragment,we);for(let Ce=0;Ce{if(F<=1&&g(),t(6,p=!1),t(5,f=N.page),t(4,d=N.totalItems),s("load",u.concat(N.items)),R){const q=++m;for(;N.items.length&&m==q;)t(3,u=u.concat(N.items.splice(0,10))),await j.yieldToMain()}else t(3,u=u.concat(N.items))}).catch(N=>{N!=null&&N.isAbort||(t(6,p=!1),console.warn(N),g(),me.errorResponseHandler(N,!1))})}function g(){t(3,u=[]),t(5,f=1),t(4,d=0)}function b(F){a=F,t(1,a)}function k(F){a=F,t(1,a)}function $(F){a=F,t(1,a)}function T(F){a=F,t(1,a)}function C(F){a=F,t(1,a)}function D(F){a=F,t(1,a)}const M=F=>s("select",F),O=(F,R)=>{R.code==="Enter"&&(R.preventDefault(),s("select",F))},I=()=>t(0,o=""),L=()=>_(f+1);return n.$$set=F=>{"filter"in F&&t(0,o=F.filter),"presets"in F&&t(10,r=F.presets),"sort"in F&&t(1,a=F.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(g(),_(1)),n.$$.dirty&24&&t(7,i=d>u.length)},[o,a,_,u,d,f,p,i,s,l,r,b,k,$,T,C,D,M,O,I,L]}class o2 extends ve{constructor(e){super(),be(this,e,l2,s2,_e,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! * Chart.js v3.9.1 * https://www.chartjs.org * (c) 2022 Chart.js Contributors * Released under the MIT License - */function ri(){}const o2=function(){let n=0;return function(){return n++}}();function ct(n){return n===null||typeof n>"u"}function vt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function xe(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const qt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Nn(n,e){return qt(n)?n:e}function st(n,e){return typeof n>"u"?e:n}const r2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,n1=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function At(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function pt(n,e,t,i){let s,l,o;if(vt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function Ii(n,e){return(ff[e]||(ff[e]=f2(e)))(n)}function f2(n){const e=c2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function c2(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Na(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Hn=n=>typeof n<"u",Pi=n=>typeof n=="function",cf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function d2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Nt=Math.PI,ht=2*Nt,p2=ht+Nt,To=Number.POSITIVE_INFINITY,m2=Nt/180,It=Nt/2,Ws=Nt/4,df=Nt*2/3,jn=Math.log10,ti=Math.sign;function pf(n){const e=Math.round(n);n=ll(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(jn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function h2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Ds(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ll(n,e,t){return Math.abs(n-e)=n}function s1(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ra(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Qi=(n,e,t,i)=>Ra(n,t,i?s=>n[s][e]<=t:s=>n[s][e]Ra(n,t,i=>n[i][e]>=t);function y2(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Na(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function hf(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(o1.forEach(l=>{delete n[l]}),delete n._chartjs)}function r1(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function u1(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,a1.call(window,()=>{s=!1,n.apply(e,l)}))}}function w2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const S2=n=>n==="start"?"left":n==="end"?"right":"center",_f=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function f1(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:d,maxDefined:p}=o.getUserBounds();d&&(s=nn(Math.min(Qi(r,o.axis,u).lo,t?i:Qi(e,a,o.getPixelForValue(u)).lo),0,i-1)),p?l=nn(Math.max(Qi(r,o.axis,f,!0).hi+1,t?0:Qi(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function c1(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const Wl=n=>n===0||n===1,gf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ht/t)),bf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ht/t)+1,ol={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*It)+1,easeOutSine:n=>Math.sin(n*It),easeInOutSine:n=>-.5*(Math.cos(Nt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Wl(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Wl(n)?n:gf(n,.075,.3),easeOutElastic:n=>Wl(n)?n:bf(n,.075,.3),easeInOutElastic(n){return Wl(n)?n:n<.5?.5*gf(n*2,.1125,.45):.5+.5*bf(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-ol.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?ol.easeInBounce(n*2)*.5:ol.easeOutBounce(n*2-1)*.5+.5};/*! + */function ri(){}const r2=function(){let n=0;return function(){return n++}}();function ct(n){return n===null||typeof n>"u"}function vt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function xe(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const qt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Nn(n,e){return qt(n)?n:e}function st(n,e){return typeof n>"u"?e:n}const a2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,i1=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function At(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function pt(n,e,t,i){let s,l,o;if(vt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function Ii(n,e){return(ff[e]||(ff[e]=c2(e)))(n)}function c2(n){const e=d2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function d2(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Na(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Hn=n=>typeof n<"u",Pi=n=>typeof n=="function",cf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function p2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Nt=Math.PI,ht=2*Nt,m2=ht+Nt,To=Number.POSITIVE_INFINITY,h2=Nt/180,It=Nt/2,Ws=Nt/4,df=Nt*2/3,jn=Math.log10,ti=Math.sign;function pf(n){const e=Math.round(n);n=ll(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(jn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function _2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Ds(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ll(n,e,t){return Math.abs(n-e)=n}function l1(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ra(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Qi=(n,e,t,i)=>Ra(n,t,i?s=>n[s][e]<=t:s=>n[s][e]Ra(n,t,i=>n[i][e]>=t);function k2(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Na(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function hf(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(r1.forEach(l=>{delete n[l]}),delete n._chartjs)}function a1(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function f1(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,u1.call(window,()=>{s=!1,n.apply(e,l)}))}}function S2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const $2=n=>n==="start"?"left":n==="end"?"right":"center",_f=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function c1(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:d,maxDefined:p}=o.getUserBounds();d&&(s=nn(Math.min(Qi(r,o.axis,u).lo,t?i:Qi(e,a,o.getPixelForValue(u)).lo),0,i-1)),p?l=nn(Math.max(Qi(r,o.axis,f,!0).hi+1,t?0:Qi(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function d1(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const Wl=n=>n===0||n===1,gf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ht/t)),bf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ht/t)+1,ol={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*It)+1,easeOutSine:n=>Math.sin(n*It),easeInOutSine:n=>-.5*(Math.cos(Nt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Wl(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Wl(n)?n:gf(n,.075,.3),easeOutElastic:n=>Wl(n)?n:bf(n,.075,.3),easeInOutElastic(n){return Wl(n)?n:n<.5?.5*gf(n*2,.1125,.45):.5+.5*bf(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-ol.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?ol.easeInBounce(n*2)*.5:ol.easeOutBounce(n*2-1)*.5+.5};/*! * @kurkle/color v0.2.1 * https://github.com/kurkle/color#readme * (c) 2022 Jukka Kurkela * Released under the MIT License - */function Al(n){return n+.5|0}const Ti=(n,e,t)=>Math.max(Math.min(n,t),e);function el(n){return Ti(Al(n*2.55),0,255)}function Di(n){return Ti(Al(n*255),0,255)}function fi(n){return Ti(Al(n/2.55)/100,0,1)}function vf(n){return Ti(Al(n*100),0,100)}const Ln={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},na=[..."0123456789ABCDEF"],$2=n=>na[n&15],T2=n=>na[(n&240)>>4]+na[n&15],Yl=n=>(n&240)>>4===(n&15),C2=n=>Yl(n.r)&&Yl(n.g)&&Yl(n.b)&&Yl(n.a);function M2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Ln[n[1]]*17,g:255&Ln[n[2]]*17,b:255&Ln[n[3]]*17,a:e===5?Ln[n[4]]*17:255}:(e===7||e===9)&&(t={r:Ln[n[1]]<<4|Ln[n[2]],g:Ln[n[3]]<<4|Ln[n[4]],b:Ln[n[5]]<<4|Ln[n[6]],a:e===9?Ln[n[7]]<<4|Ln[n[8]]:255})),t}const O2=(n,e)=>n<255?e(n):"";function D2(n){var e=C2(n)?$2:T2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+O2(n.a,e):void 0}const E2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function d1(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function A2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function I2(n,e,t){const i=d1(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function P2(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=P2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function ja(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Di)}function Va(n,e,t){return ja(d1,n,e,t)}function L2(n,e,t){return ja(I2,n,e,t)}function N2(n,e,t){return ja(A2,n,e,t)}function p1(n){return(n%360+360)%360}function F2(n){const e=E2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?el(+e[5]):Di(+e[5]));const s=p1(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=L2(s,l,o):e[1]==="hsv"?i=N2(s,l,o):i=Va(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function R2(n,e){var t=qa(n);t[0]=p1(t[0]+e),t=Va(t),n.r=t[0],n.g=t[1],n.b=t[2]}function q2(n){if(!n)return;const e=qa(n),t=e[0],i=vf(e[1]),s=vf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${fi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const yf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},kf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function j2(){const n={},e=Object.keys(kf),t=Object.keys(yf);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let Kl;function V2(n){Kl||(Kl=j2(),Kl.transparent=[0,0,0,0]);const e=Kl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const H2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function z2(n){const e=H2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?el(o):Ti(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?el(i):Ti(i,0,255)),s=255&(e[4]?el(s):Ti(s,0,255)),l=255&(e[6]?el(l):Ti(l,0,255)),{r:i,g:s,b:l,a:t}}}function B2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${fi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const pr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,_s=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function U2(n,e,t){const i=_s(fi(n.r)),s=_s(fi(n.g)),l=_s(fi(n.b));return{r:Di(pr(i+t*(_s(fi(e.r))-i))),g:Di(pr(s+t*(_s(fi(e.g))-s))),b:Di(pr(l+t*(_s(fi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Jl(n,e,t){if(n){let i=qa(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Va(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function m1(n,e){return n&&Object.assign(e||{},n)}function wf(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Di(n[3]))):(e=m1(n,{r:0,g:0,b:0,a:1}),e.a=Di(e.a)),e}function W2(n){return n.charAt(0)==="r"?z2(n):F2(n)}class Co{constructor(e){if(e instanceof Co)return e;const t=typeof e;let i;t==="object"?i=wf(e):t==="string"&&(i=M2(e)||V2(e)||W2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=m1(this._rgb);return e&&(e.a=fi(e.a)),e}set rgb(e){this._rgb=wf(e)}rgbString(){return this._valid?B2(this._rgb):void 0}hexString(){return this._valid?D2(this._rgb):void 0}hslString(){return this._valid?q2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=U2(this._rgb,e._rgb,t)),this}clone(){return new Co(this.rgb)}alpha(e){return this._rgb.a=Di(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Al(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Jl(this._rgb,2,e),this}darken(e){return Jl(this._rgb,2,-e),this}saturate(e){return Jl(this._rgb,1,e),this}desaturate(e){return Jl(this._rgb,1,-e),this}rotate(e){return R2(this._rgb,e),this}}function h1(n){return new Co(n)}function _1(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Sf(n){return _1(n)?n:h1(n)}function mr(n){return _1(n)?n:h1(n).saturate(.5).darken(.1).hexString()}const ss=Object.create(null),ia=Object.create(null);function rl(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;it.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>mr(i.backgroundColor),this.hoverBorderColor=(t,i)=>mr(i.borderColor),this.hoverColor=(t,i)=>mr(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return hr(this,e,t)}get(e){return rl(this,e)}describe(e,t){return hr(ia,e,t)}override(e,t){return hr(ss,e,t)}route(e,t,i,s){const l=rl(this,e),o=rl(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return xe(a)?Object.assign({},u,a):st(a,u)},set(a){this[r]=a}}})}}var lt=new Y2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function K2(n){return!n||ct(n.size)||ct(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Mo(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function J2(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,d,p;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function vl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,Q2(n,l),a=0;a+n||0;function Ba(n,e){const t={},i=xe(e),s=i?Object.keys(e):e,l=xe(n)?i?o=>st(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=ik(l(o));return t}function g1(n){return Ba(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ss(n){return Ba(n,["topLeft","topRight","bottomLeft","bottomRight"])}function zn(n){const e=g1(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Mn(n,e){n=n||{},e=e||lt.font;let t=st(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=st(n.style,e.style);i&&!(""+i).match(tk)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:st(n.family,e.family),lineHeight:nk(st(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:st(n.weight,e.weight),string:""};return s.string=K2(s),s}function Zl(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Ni(n,e){return Object.assign(Object.create(n),e)}function Ua(n,e=[""],t=n,i,s=()=>n[0]){Hn(i)||(i=k1("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Ua([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return v1(o,r,()=>dk(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return Cf(o).includes(r)},ownKeys(o){return Cf(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Es(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:b1(n,i),setContext:l=>Es(n,l,t,i),override:l=>Es(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return v1(l,o,()=>ok(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function b1(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Pi(t)?t:()=>t,isIndexable:Pi(i)?i:()=>i}}const lk=(n,e)=>n?n+Na(e):e,Wa=(n,e)=>xe(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function v1(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function ok(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Pi(r)&&o.isScriptable(e)&&(r=rk(e,r,n,t)),vt(r)&&r.length&&(r=ak(e,r,n,o.isIndexable)),Wa(e,r)&&(r=Es(r,s,l&&l[e],o)),r}function rk(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);return r.add(n),e=e(l,o||i),r.delete(n),Wa(n,e)&&(e=Ya(s._scopes,s,n,e)),e}function ak(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Hn(l.index)&&i(n))e=e[l.index%e.length];else if(xe(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const d=Ya(u,s,n,f);e.push(Es(d,l,o&&o[n],r))}}return e}function y1(n,e,t){return Pi(n)?n(e,t):n}const uk=(n,e)=>n===!0?e:typeof n=="string"?Ii(e,n):void 0;function fk(n,e,t,i,s){for(const l of e){const o=uk(t,l);if(o){n.add(o);const r=y1(o._fallback,t,s);if(Hn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Hn(i)&&t!==i)return null}return!1}function Ya(n,e,t,i){const s=e._rootScopes,l=y1(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=Tf(r,o,t,l||t,i);return a===null||Hn(l)&&l!==t&&(a=Tf(r,o,l,a,i),a===null)?!1:Ua(Array.from(r),[""],s,l,()=>ck(e,t,i))}function Tf(n,e,t,i,s){for(;t;)t=fk(n,e,t,i,s);return t}function ck(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return vt(s)&&xe(t)?t:s}function dk(n,e,t,i){let s;for(const l of e)if(s=k1(lk(l,n),t),Hn(s))return Wa(n,s)?Ya(t,i,n,s):s}function k1(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Hn(i))return i}}function Cf(n){let e=n._keys;return e||(e=n._keys=pk(n._scopes)),e}function pk(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function w1(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;ren==="x"?"y":"x";function hk(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=ta(l,s),a=ta(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const d=i*u,p=i*f;return{previous:{x:l.x-d*(o.x-s.x),y:l.y-d*(o.y-s.y)},next:{x:l.x+p*(o.x-s.x),y:l.y+p*(o.y-s.y)}}}function _k(n,e,t){const i=n.length;let s,l,o,r,a,u=As(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")bk(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function kk(n,e){return Jo(n).getPropertyValue(e)}const wk=["top","right","bottom","left"];function ts(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=wk[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Sk=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function $k(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(Sk(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function Zi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Jo(t),l=s.boxSizing==="border-box",o=ts(s,"padding"),r=ts(s,"border","width"),{x:a,y:u,box:f}=$k(n,t),d=o.left+(f&&r.left),p=o.top+(f&&r.top);let{width:m,height:_}=e;return l&&(m-=o.width+r.width,_-=o.height+r.height),{x:Math.round((a-d)/m*t.width/i),y:Math.round((u-p)/_*t.height/i)}}function Tk(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Ka(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Jo(l),a=ts(r,"border","width"),u=ts(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Eo(r.maxWidth,l,"clientWidth"),s=Eo(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||To,maxHeight:s||To}}const _r=n=>Math.round(n*10)/10;function Ck(n,e,t,i){const s=Jo(n),l=ts(s,"margin"),o=Eo(s.maxWidth,n,"clientWidth")||To,r=Eo(s.maxHeight,n,"clientHeight")||To,a=Tk(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const d=ts(s,"border","width"),p=ts(s,"padding");u-=p.width+d.width,f-=p.height+d.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=_r(Math.min(u,o,a.maxWidth)),f=_r(Math.min(f,r,a.maxHeight)),u&&!f&&(f=_r(u/2)),{width:u,height:f}}function Mf(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Mk=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function Of(n,e){const t=kk(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Gi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Ok(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Dk(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Gi(n,s,t),r=Gi(s,l,t),a=Gi(l,e,t),u=Gi(o,r,t),f=Gi(r,a,t);return Gi(u,f,t)}const Df=new Map;function Ek(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Df.get(t);return i||(i=new Intl.NumberFormat(n,e),Df.set(t,i)),i}function Il(n,e,t){return Ek(e,t).format(n)}const Ak=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Ik=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function gr(n,e,t){return n?Ak(e,t):Ik()}function Pk(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Lk(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function T1(n){return n==="angle"?{between:gl,compare:g2,normalize:Cn}:{between:bl,compare:(e,t)=>e-t,normalize:e=>e}}function Ef({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function Nk(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=T1(i),a=e.length;let{start:u,end:f,loop:d}=n,p,m;if(d){for(u+=a,f+=a,p=0,m=a;pa(s,T,k)&&r(s,T)!==0,D=()=>r(l,k)===0||a(l,T,k),M=()=>g||C(),O=()=>!g||D();for(let I=f,L=f;I<=d;++I)$=e[I%o],!$.skip&&(k=u($[i]),k!==T&&(g=a(k,s,l),b===null&&M()&&(b=r(k,s)===0?I:L),b!==null&&O()&&(_.push(Ef({start:b,end:I,loop:p,count:o,style:m})),b=null),L=I,T=k));return b!==null&&_.push(Ef({start:b,end:d,loop:p,count:o,style:m})),_}function M1(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function Rk(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function qk(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=Fk(t,s,l,i);if(i===!0)return Af(n,[{start:o,end:r,loop:l}],t,e);const a=rMath.max(Math.min(n,t),e);function el(n){return Ti(Al(n*2.55),0,255)}function Di(n){return Ti(Al(n*255),0,255)}function fi(n){return Ti(Al(n/2.55)/100,0,1)}function vf(n){return Ti(Al(n*100),0,100)}const Ln={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},na=[..."0123456789ABCDEF"],T2=n=>na[n&15],C2=n=>na[(n&240)>>4]+na[n&15],Yl=n=>(n&240)>>4===(n&15),M2=n=>Yl(n.r)&&Yl(n.g)&&Yl(n.b)&&Yl(n.a);function O2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Ln[n[1]]*17,g:255&Ln[n[2]]*17,b:255&Ln[n[3]]*17,a:e===5?Ln[n[4]]*17:255}:(e===7||e===9)&&(t={r:Ln[n[1]]<<4|Ln[n[2]],g:Ln[n[3]]<<4|Ln[n[4]],b:Ln[n[5]]<<4|Ln[n[6]],a:e===9?Ln[n[7]]<<4|Ln[n[8]]:255})),t}const D2=(n,e)=>n<255?e(n):"";function E2(n){var e=M2(n)?T2:C2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+D2(n.a,e):void 0}const A2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function p1(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function I2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function P2(n,e,t){const i=p1(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function L2(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=L2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function ja(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Di)}function Va(n,e,t){return ja(p1,n,e,t)}function N2(n,e,t){return ja(P2,n,e,t)}function F2(n,e,t){return ja(I2,n,e,t)}function m1(n){return(n%360+360)%360}function R2(n){const e=A2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?el(+e[5]):Di(+e[5]));const s=m1(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=N2(s,l,o):e[1]==="hsv"?i=F2(s,l,o):i=Va(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function q2(n,e){var t=qa(n);t[0]=m1(t[0]+e),t=Va(t),n.r=t[0],n.g=t[1],n.b=t[2]}function j2(n){if(!n)return;const e=qa(n),t=e[0],i=vf(e[1]),s=vf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${fi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const yf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},kf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function V2(){const n={},e=Object.keys(kf),t=Object.keys(yf);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let Kl;function H2(n){Kl||(Kl=V2(),Kl.transparent=[0,0,0,0]);const e=Kl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const z2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function B2(n){const e=z2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?el(o):Ti(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?el(i):Ti(i,0,255)),s=255&(e[4]?el(s):Ti(s,0,255)),l=255&(e[6]?el(l):Ti(l,0,255)),{r:i,g:s,b:l,a:t}}}function U2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${fi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const pr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,_s=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function W2(n,e,t){const i=_s(fi(n.r)),s=_s(fi(n.g)),l=_s(fi(n.b));return{r:Di(pr(i+t*(_s(fi(e.r))-i))),g:Di(pr(s+t*(_s(fi(e.g))-s))),b:Di(pr(l+t*(_s(fi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Jl(n,e,t){if(n){let i=qa(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Va(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function h1(n,e){return n&&Object.assign(e||{},n)}function wf(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Di(n[3]))):(e=h1(n,{r:0,g:0,b:0,a:1}),e.a=Di(e.a)),e}function Y2(n){return n.charAt(0)==="r"?B2(n):R2(n)}class Co{constructor(e){if(e instanceof Co)return e;const t=typeof e;let i;t==="object"?i=wf(e):t==="string"&&(i=O2(e)||H2(e)||Y2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=h1(this._rgb);return e&&(e.a=fi(e.a)),e}set rgb(e){this._rgb=wf(e)}rgbString(){return this._valid?U2(this._rgb):void 0}hexString(){return this._valid?E2(this._rgb):void 0}hslString(){return this._valid?j2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=W2(this._rgb,e._rgb,t)),this}clone(){return new Co(this.rgb)}alpha(e){return this._rgb.a=Di(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Al(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Jl(this._rgb,2,e),this}darken(e){return Jl(this._rgb,2,-e),this}saturate(e){return Jl(this._rgb,1,e),this}desaturate(e){return Jl(this._rgb,1,-e),this}rotate(e){return q2(this._rgb,e),this}}function _1(n){return new Co(n)}function g1(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Sf(n){return g1(n)?n:_1(n)}function mr(n){return g1(n)?n:_1(n).saturate(.5).darken(.1).hexString()}const ss=Object.create(null),ia=Object.create(null);function rl(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;it.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>mr(i.backgroundColor),this.hoverBorderColor=(t,i)=>mr(i.borderColor),this.hoverColor=(t,i)=>mr(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return hr(this,e,t)}get(e){return rl(this,e)}describe(e,t){return hr(ia,e,t)}override(e,t){return hr(ss,e,t)}route(e,t,i,s){const l=rl(this,e),o=rl(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return xe(a)?Object.assign({},u,a):st(a,u)},set(a){this[r]=a}}})}}var lt=new K2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function J2(n){return!n||ct(n.size)||ct(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Mo(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function Z2(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,d,p;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function vl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,x2(n,l),a=0;a+n||0;function Ba(n,e){const t={},i=xe(e),s=i?Object.keys(e):e,l=xe(n)?i?o=>st(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=sk(l(o));return t}function b1(n){return Ba(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ss(n){return Ba(n,["topLeft","topRight","bottomLeft","bottomRight"])}function zn(n){const e=b1(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Mn(n,e){n=n||{},e=e||lt.font;let t=st(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=st(n.style,e.style);i&&!(""+i).match(nk)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:st(n.family,e.family),lineHeight:ik(st(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:st(n.weight,e.weight),string:""};return s.string=J2(s),s}function Zl(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Ni(n,e){return Object.assign(Object.create(n),e)}function Ua(n,e=[""],t=n,i,s=()=>n[0]){Hn(i)||(i=w1("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Ua([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return y1(o,r,()=>pk(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return Cf(o).includes(r)},ownKeys(o){return Cf(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Es(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:v1(n,i),setContext:l=>Es(n,l,t,i),override:l=>Es(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return y1(l,o,()=>rk(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function v1(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Pi(t)?t:()=>t,isIndexable:Pi(i)?i:()=>i}}const ok=(n,e)=>n?n+Na(e):e,Wa=(n,e)=>xe(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function y1(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function rk(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Pi(r)&&o.isScriptable(e)&&(r=ak(e,r,n,t)),vt(r)&&r.length&&(r=uk(e,r,n,o.isIndexable)),Wa(e,r)&&(r=Es(r,s,l&&l[e],o)),r}function ak(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);return r.add(n),e=e(l,o||i),r.delete(n),Wa(n,e)&&(e=Ya(s._scopes,s,n,e)),e}function uk(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Hn(l.index)&&i(n))e=e[l.index%e.length];else if(xe(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const d=Ya(u,s,n,f);e.push(Es(d,l,o&&o[n],r))}}return e}function k1(n,e,t){return Pi(n)?n(e,t):n}const fk=(n,e)=>n===!0?e:typeof n=="string"?Ii(e,n):void 0;function ck(n,e,t,i,s){for(const l of e){const o=fk(t,l);if(o){n.add(o);const r=k1(o._fallback,t,s);if(Hn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Hn(i)&&t!==i)return null}return!1}function Ya(n,e,t,i){const s=e._rootScopes,l=k1(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=Tf(r,o,t,l||t,i);return a===null||Hn(l)&&l!==t&&(a=Tf(r,o,l,a,i),a===null)?!1:Ua(Array.from(r),[""],s,l,()=>dk(e,t,i))}function Tf(n,e,t,i,s){for(;t;)t=ck(n,e,t,i,s);return t}function dk(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return vt(s)&&xe(t)?t:s}function pk(n,e,t,i){let s;for(const l of e)if(s=w1(ok(l,n),t),Hn(s))return Wa(n,s)?Ya(t,i,n,s):s}function w1(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Hn(i))return i}}function Cf(n){let e=n._keys;return e||(e=n._keys=mk(n._scopes)),e}function mk(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function S1(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;ren==="x"?"y":"x";function _k(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=ta(l,s),a=ta(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const d=i*u,p=i*f;return{previous:{x:l.x-d*(o.x-s.x),y:l.y-d*(o.y-s.y)},next:{x:l.x+p*(o.x-s.x),y:l.y+p*(o.y-s.y)}}}function gk(n,e,t){const i=n.length;let s,l,o,r,a,u=As(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")vk(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function wk(n,e){return Jo(n).getPropertyValue(e)}const Sk=["top","right","bottom","left"];function ts(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=Sk[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const $k=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Tk(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if($k(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function Zi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Jo(t),l=s.boxSizing==="border-box",o=ts(s,"padding"),r=ts(s,"border","width"),{x:a,y:u,box:f}=Tk(n,t),d=o.left+(f&&r.left),p=o.top+(f&&r.top);let{width:m,height:_}=e;return l&&(m-=o.width+r.width,_-=o.height+r.height),{x:Math.round((a-d)/m*t.width/i),y:Math.round((u-p)/_*t.height/i)}}function Ck(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Ka(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Jo(l),a=ts(r,"border","width"),u=ts(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Eo(r.maxWidth,l,"clientWidth"),s=Eo(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||To,maxHeight:s||To}}const _r=n=>Math.round(n*10)/10;function Mk(n,e,t,i){const s=Jo(n),l=ts(s,"margin"),o=Eo(s.maxWidth,n,"clientWidth")||To,r=Eo(s.maxHeight,n,"clientHeight")||To,a=Ck(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const d=ts(s,"border","width"),p=ts(s,"padding");u-=p.width+d.width,f-=p.height+d.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=_r(Math.min(u,o,a.maxWidth)),f=_r(Math.min(f,r,a.maxHeight)),u&&!f&&(f=_r(u/2)),{width:u,height:f}}function Mf(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Ok=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function Of(n,e){const t=wk(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Gi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Dk(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Ek(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Gi(n,s,t),r=Gi(s,l,t),a=Gi(l,e,t),u=Gi(o,r,t),f=Gi(r,a,t);return Gi(u,f,t)}const Df=new Map;function Ak(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Df.get(t);return i||(i=new Intl.NumberFormat(n,e),Df.set(t,i)),i}function Il(n,e,t){return Ak(e,t).format(n)}const Ik=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Pk=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function gr(n,e,t){return n?Ik(e,t):Pk()}function Lk(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Nk(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function C1(n){return n==="angle"?{between:gl,compare:b2,normalize:Cn}:{between:bl,compare:(e,t)=>e-t,normalize:e=>e}}function Ef({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function Fk(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=C1(i),a=e.length;let{start:u,end:f,loop:d}=n,p,m;if(d){for(u+=a,f+=a,p=0,m=a;pa(s,T,k)&&r(s,T)!==0,D=()=>r(l,k)===0||a(l,T,k),M=()=>g||C(),O=()=>!g||D();for(let I=f,L=f;I<=d;++I)$=e[I%o],!$.skip&&(k=u($[i]),k!==T&&(g=a(k,s,l),b===null&&M()&&(b=r(k,s)===0?I:L),b!==null&&O()&&(_.push(Ef({start:b,end:I,loop:p,count:o,style:m})),b=null),L=I,T=k));return b!==null&&_.push(Ef({start:b,end:d,loop:p,count:o,style:m})),_}function O1(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function qk(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function jk(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=Rk(t,s,l,i);if(i===!0)return Af(n,[{start:o,end:r,loop:l}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=a1.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new Hk;const Pf="transparent",zk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Sf(n||Pf),s=i.valid&&Sf(e||Pf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Bk{constructor(e,t,i,s){const l=t[i];s=Zl([e.to,s,l,e.from]);const o=Zl([e.from,l,s]);this._active=!0,this._fn=e.fn||zk[e.type||typeof o],this._easing=ol[e.easing]||ol.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Zl([e.to,t,s,e.from]),this._from=Zl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});lt.set("animations",{colors:{type:"color",properties:Wk},numbers:{type:"number",properties:Uk}});lt.describe("animations",{_fallback:"animation"});lt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class O1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!xe(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!xe(s))return;const l={};for(const o of Yk)l[o]=s[o];(vt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Jk(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&Kk(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let d=l[u];const p=i.get(u);if(d)if(p&&d.active()){d.update(p,f,r);continue}else d.cancel();if(!p||!p.duration){e[u]=f;continue}l[u]=d=new Bk(p,e,u,f),s.push(d)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ai.add(this._chart,i),!0}}function Kk(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function qf(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=Qk(l,o,i),d=e.length;let p;for(let m=0;mt[i].axis===e).shift()}function tw(n,e){return Ni(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function nw(n,e,t){return Ni(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Ys(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const vr=n=>n==="reset"||n==="none",jf=(n,e)=>e?n:Object.assign({},n),iw=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:D1(t,!0),values:null};class Gn{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Ff(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Ys(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(d,p,m,_)=>d==="x"?p:d==="r"?_:m,l=t.xAxisID=st(i.xAxisID,br(e,"x")),o=t.yAxisID=st(i.yAxisID,br(e,"y")),r=t.rAxisID=st(i.rAxisID,br(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&hf(this._data,this),e._stacked&&Ys(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(xe(t))this._data=Xk(t);else if(i!==t){if(i){hf(i,this);const s=this._cachedMeta;Ys(s),s._parsed=[]}t&&Object.isExtensible(t)&&k2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const l=t._stacked;t._stacked=Ff(t.vScale,t),t.stack!==i.stack&&(s=!0,Ys(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&qf(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,d,p;if(this._parsing===!1)i._parsed=s,i._sorted=!0,p=s;else{vt(s[e])?p=this.parseArrayData(i,s,e,t):xe(s[e])?p=this.parseObjectData(i,s,e,t):p=this.parsePrimitiveData(i,s,e,t);const m=()=>d[r]===null||u&&d[r]g||d=0;--p)if(!_()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),g=u.resolveNamedOptions(p,m,_,d);return g.$shared&&(g.$shared=a,l[o]=Object.freeze(jf(g,a))),g}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,d=f.datasetAnimationScopeKeys(this._type,t),p=f.getOptionScopes(this.getDataset(),d);a=f.createResolver(p,this.getContext(e,i,t))}const u=new O1(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||vr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){vr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!vr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;rs-l))}return n._cache.$bar}function lw(n){const e=n.iScale,t=sw(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Hn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s0?s[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function E1(n,e,t,i){return vt(n)?aw(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Vf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,d,p;for(u=t,f=t+i;u=t?1:-1)}function fw(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(ct(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,d=r.axis;for(let p=t;pgl(T,r,a,!0)?1:Math.max(C,C*t,D,D*t),_=(T,C,D)=>gl(T,r,a,!0)?-1:Math.min(C,C*t,D,D*t),g=m(0,u,d),b=m(It,f,p),k=_(Nt,u,d),$=_(Nt+It,f,p);i=(g-k)/2,s=(b-$)/2,l=-(g+k)/2,o=-(b+$)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Pl extends Gn{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(xe(i[e])){const{key:a="value"}=this._parsing;l=u=>+Ii(i[u],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?ht*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Il(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};Pl.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return vt(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Zo extends Gn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=f1(t,s,o);this._drawStart=r,this._drawCount=a,c1(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:d}=this._getSharedOptions(t,s),p=o.axis,m=r.axis,{spanGaps:_,segment:g}=this.options,b=Ds(_)?_:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||l||s==="none";let $=t>0&&this.getParsed(t-1);for(let T=t;T0&&Math.abs(D[p]-$[p])>b,g&&(M.parsed=D,M.raw=u.data[T]),d&&(M.options=f||this.resolveDataElementOptions(T,C.active?"active":s)),k||this.updateElement(C,T,M,s),$=D}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Zo.id="line";Zo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Zo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ga extends Gn{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Il(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return w1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(lt.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,d=u.yCenter,p=u.getIndexAngle(0)-.5*Nt;let m=p,_;const g=360/this.countVisibleElements();for(_=0;_{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Jn(this.resolveDataElementOptions(e,t).angle||i):0}}Ga.id="polarArea";Ga.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ga.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class A1 extends Pl{}A1.id="pie";A1.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Xa extends Gn{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return w1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}};bi.defaults={};bi.defaultRoutes=void 0;const I1={values(n){return vt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=hw(n,t)}const o=jn(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Il(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(jn(n)));return i===1||i===2||i===5?I1.numeric.call(this,n,e,t):""}};function hw(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Go={formatters:I1};lt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Go.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});lt.route("scale.ticks","color","","color");lt.route("scale.grid","color","","borderColor");lt.route("scale.grid","borderColor","","borderColor");lt.route("scale.title","color","","color");lt.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});lt.describe("scales",{_fallback:"scale"});lt.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function _w(n,e){const t=n.options.ticks,i=t.maxTicksLimit||gw(n),s=t.major.enabled?vw(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return yw(e,a,s,l/i),a;const u=bw(s,e,i);if(l>0){let f,d;const p=l>1?Math.round((r-o)/(l-1)):null;for(Xl(e,a,u,ct(p)?0:o-p,o),f=0,d=l-1;fs)return a}return Math.max(s,1)}function vw(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Bf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Uf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function $w(n,e){pt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:Nn(t,Nn(i,t)),max:Nn(i,Nn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){At(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=sk(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),d=f.widest.width,p=f.highest.height,m=nn(this.chart.width-d,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),d+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Ks(e.grid)-t.padding-Wf(e.title,this.chart.options.font),u=Math.sqrt(d*d+p*p),o=Fa(Math.min(Math.asin(nn((f.highest.height+6)/r,-1,1)),Math.asin(nn(a/u,-1,1))-Math.asin(nn(p/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){At(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){At(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Wf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ks(l)+a):(e.height=this.maxHeight,e.width=Ks(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:d,highest:p}=this._getLabelSizes(),m=i.padding*2,_=Jn(this.labelRotation),g=Math.cos(_),b=Math.sin(_);if(r){const k=i.mirror?0:b*d.width+g*p.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:g*d.width+b*p.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,b,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,m=0;a?u?(p=s*e.width,m=i*t.height):(p=i*e.height,m=s*t.width):l==="start"?m=t.width:l==="end"?p=e.width:l!=="inner"&&(p=e.width/2,m=t.width/2),this.paddingLeft=Math.max((p-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-d+o)*this.width/(this.width-d),0)}else{let f=t.height/2,d=e.height/2;l==="start"?(f=0,d=e.height):l==="end"&&(f=t.height,d=0),this.paddingTop=f+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){At(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:l[O]||0,height:o[O]||0});return{first:M(0),last:M(t-1),widest:M(C),highest:M(D),widths:l,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return b2(this._alignToPixels?Wi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),d=Ks(l),p=[],m=l.setContext(this.getContext()),_=m.drawBorder?m.borderWidth:0,g=_/2,b=function(B){return Wi(i,B,_)};let k,$,T,C,D,M,O,I,L,F,R,N;if(o==="top")k=b(this.bottom),M=this.bottom-d,I=k-g,F=b(e.top)+g,N=e.bottom;else if(o==="bottom")k=b(this.top),F=e.top,N=b(e.bottom)-g,M=k+g,I=this.top+d;else if(o==="left")k=b(this.right),D=this.right-d,O=k-g,L=b(e.left)+g,R=e.right;else if(o==="right")k=b(this.left),L=e.left,R=b(e.right)-g,D=k+g,O=this.left+d;else if(t==="x"){if(o==="center")k=b((e.top+e.bottom)/2+.5);else if(xe(o)){const B=Object.keys(o)[0],Z=o[B];k=b(this.chart.scales[B].getPixelForValue(Z))}F=e.top,N=e.bottom,M=k+g,I=M+d}else if(t==="y"){if(o==="center")k=b((e.left+e.right)/2);else if(xe(o)){const B=Object.keys(o)[0],Z=o[B];k=b(this.chart.scales[B].getPixelForValue(Z))}D=k-g,O=D-d,L=e.left,R=e.right}const q=st(s.ticks.maxTicksLimit,f),Y=Math.max(1,Math.ceil(f/q));for($=0;$l.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");lt.route(l,s,a,r)})}function Aw(n){return"id"in n&&"defaults"in n}class Iw{constructor(){this.controllers=new Ql(Gn,"datasets",!0),this.elements=new Ql(bi,"elements"),this.plugins=new Ql(Object,"plugins"),this.scales=new Ql(rs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):pt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Na(e);At(i["before"+s],[],i),t[e](i),At(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let C=t;C0&&Math.abs(M[m]-T[m])>k,b&&(O.parsed=M,O.raw=u.data[C]),p&&(O.options=d||this.resolveDataElementOptions(C,D.active?"active":s)),$||this.updateElement(D,C,O,s),T=M}this.updateSharedOptions(d,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}Qa.id="scatter";Qa.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Qa.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Yi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class la{constructor(e){this.options=e||{}}init(e){}formats(){return Yi()}parse(e,t){return Yi()}format(e,t){return Yi()}add(e,t,i){return Yi()}diff(e,t,i){return Yi()}startOf(e,t,i){return Yi()}endOf(e,t){return Yi()}}la.override=function(n){Object.assign(la.prototype,n)};var P1={_date:la};function Pw(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?v2:Qi;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const d=a(l,e,t-f),p=a(l,e,t+f);return{lo:d.lo,hi:p.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Ll(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var Rw={evaluateInteractionItems:Ll,modes:{index(n,e,t,i){const s=Zi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?kr(n,s,l,i,o):wr(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,d=u.data[f];d&&!d.skip&&a.push({element:d,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Zi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?kr(n,s,l,i,o):wr(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function Kf(n,e){return n.filter(t=>L1.indexOf(t.pos)===-1&&t.box.axis===e)}function Zs(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function qw(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Zs(Js(e,"left"),!0),s=Zs(Js(e,"right")),l=Zs(Js(e,"top"),!0),o=Zs(Js(e,"bottom")),r=Kf(e,"x"),a=Kf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Js(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Jf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function N1(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function zw(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!xe(s)){t.size&&(n[s]-=t.size);const d=i[t.stack]||{size:0,count:1};d.size=Math.max(d.size,t.horizontal?l.height:l.width),t.size=d.size/d.count,n[s]+=t.size}l.getPadding&&N1(o,l.getPadding());const r=Math.max(0,e.outerWidth-Jf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Jf(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function Bw(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function Uw(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function tl(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),p=Object.assign({},s);N1(p,zn(i));const m=Object.assign({maxPadding:p,w:l,h:o,x:s.left,y:s.top},s),_=Vw(a.concat(u),d);tl(r.fullSize,m,d,_),tl(a,m,d,_),tl(u,m,d,_)&&tl(a,m,d,_),Bw(m),Zf(r.leftAndTop,m,d,_),m.x+=m.w,m.y+=m.h,Zf(r.rightAndBottom,m,d,_),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},pt(r.chartArea,g=>{const b=g.box;Object.assign(b,n.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class F1{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Ww extends F1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const co="$chartjs",Yw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Gf=n=>n===null||n==="";function Kw(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[co]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Gf(s)){const l=Of(n,"width");l!==void 0&&(n.width=l)}if(Gf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=Of(n,"height");l!==void 0&&(n.height=l)}return n}const R1=Mk?{passive:!0}:!1;function Jw(n,e,t){n.addEventListener(e,t,R1)}function Zw(n,e,t){n.canvas.removeEventListener(e,t,R1)}function Gw(n,e){const t=Yw[n.type]||n.type,{x:i,y:s}=Zi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Ao(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function Xw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Ao(r.addedNodes,i),o=o&&!Ao(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function Qw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Ao(r.removedNodes,i),o=o&&!Ao(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const yl=new Map;let Xf=0;function q1(){const n=window.devicePixelRatio;n!==Xf&&(Xf=n,yl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function xw(n,e){yl.size||window.addEventListener("resize",q1),yl.set(n,e)}function e3(n){yl.delete(n),yl.size||window.removeEventListener("resize",q1)}function t3(n,e,t){const i=n.canvas,s=i&&Ka(i);if(!s)return;const l=u1((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),xw(n,l),o}function Sr(n,e,t){t&&t.disconnect(),e==="resize"&&e3(n)}function n3(n,e,t){const i=n.canvas,s=u1(l=>{n.ctx!==null&&t(Gw(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return Jw(i,e,s),s}class i3 extends F1{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(Kw(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[co])return!1;const i=t[co].initial;["height","width"].forEach(l=>{const o=i[l];ct(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[co],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:Xw,detach:Qw,resize:t3}[t]||n3;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:Sr,detach:Sr,resize:Sr}[t]||Zw)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return Ck(e,t,i,s)}isAttached(e){const t=Ka(e);return!!(t&&t.isConnected)}}function s3(n){return!$1()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Ww:i3}class l3{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(At(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){ct(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=st(i.options&&i.options.plugins,{}),l=o3(i);return s===!1&&!t?[]:a3(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function o3(n){const e={},t=[],i=Object.keys(ei.plugins.items);for(let l=0;l{const a=i[r];if(!xe(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const u=ra(r,a),f=c3(u,s),d=t.scales||{};l[u]=l[u]||r,o[r]=sl(Object.create(null),[{axis:u},a,d[u],d[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||oa(a,e),d=(ss[a]||{}).scales||{};Object.keys(d).forEach(p=>{const m=f3(p,u),_=r[m+"AxisID"]||l[m]||m;o[_]=o[_]||Object.create(null),sl(o[_],[{axis:m},i[_],d[p]])})}),Object.keys(o).forEach(r=>{const a=o[r];sl(a,[lt.scales[a.type],lt.scale])}),o}function j1(n){const e=n.options||(n.options={});e.plugins=st(e.plugins,{}),e.scales=p3(n,e)}function V1(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function m3(n){return n=n||{},n.data=V1(n.data),j1(n),n}const Qf=new Map,H1=new Set;function to(n,e){let t=Qf.get(n);return t||(t=e(),Qf.set(n,t),H1.add(t)),t}const Gs=(n,e,t)=>{const i=Ii(e,t);i!==void 0&&n.add(i)};class h3{constructor(e){this._config=m3(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=V1(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),j1(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return to(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return to(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return to(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return to(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(d=>Gs(a,e,d))),f.forEach(d=>Gs(a,s,d)),f.forEach(d=>Gs(a,ss[l]||{},d)),f.forEach(d=>Gs(a,lt,d)),f.forEach(d=>Gs(a,ia,d))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),H1.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,ss[t]||{},lt.datasets[t]||{},{type:t},lt,ia]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=xf(this._resolverCache,e,s);let a=o;if(g3(o,t)){l.$shared=!1,i=Pi(i)?i():i;const u=this.createResolver(e,i,r);a=Es(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=xf(this._resolverCache,e,i);return xe(t)?Es(l,t,void 0,s):l}}function xf(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:Ua(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const _3=n=>xe(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Pi(n[t]),!1);function g3(n,e){const{isScriptable:t,isIndexable:i}=b1(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Pi(r)||_3(r))||o&&vt(r))return!0}return!1}var b3="3.9.1";const v3=["top","bottom","left","right","chartArea"];function ec(n,e){return n==="top"||n==="bottom"||v3.indexOf(n)===-1&&e==="x"}function tc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function nc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),At(t&&t.onComplete,[n],e)}function y3(n){const e=n.chart,t=e.options.animation;At(t&&t.onProgress,[n],e)}function z1(n){return $1()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Io={},B1=n=>{const e=z1(n);return Object.values(Io).filter(t=>t.canvas===e).pop()};function k3(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function w3(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Po{constructor(e,t){const i=this.config=new h3(t),s=z1(e),l=B1(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||s3(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=o2(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new l3,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=w2(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Io[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ai.listen(this,"complete",nc),ai.listen(this,"progress",y3),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return ct(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Mf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return $f(this.canvas,this.ctx),this}stop(){return ai.stop(this),this}resize(e,t){ai.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Mf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),At(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};pt(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=ra(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),pt(l,o=>{const r=o.options,a=r.id,u=ra(a,r),f=st(r.type,o.dtype);(r.position===void 0||ec(r.position,u)!==ec(o.dposition))&&(r.position=o.dposition),s[a]=!0;let d=null;if(a in i&&i[a].type===f)d=i[a];else{const p=ei.getScale(f);d=new p({id:a,type:f,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(r,e)}),pt(s,(o,r)=>{o||delete i[r]}),pt(i,o=>{eo.configure(this,o,o.options),eo.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(tc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){pt(this.scales,e=>{eo.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!cf(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;k3(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;eo.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],pt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ha(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&za(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return vl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=Rw.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ni(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);Hn(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ai.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};pt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){pt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},pt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!So(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(d=>f.datasetIndex===d.datasetIndex&&f.index===d.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=d2(e),u=w3(e,this._lastEvent,i,a);i&&(this._lastEvent=null,At(l.onHover,[e,r,this],this),a&&At(l.onClick,[e,r,this],this));const f=!So(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const ic=()=>pt(Po.instances,n=>n._plugins.invalidate()),wi=!0;Object.defineProperties(Po,{defaults:{enumerable:wi,value:lt},instances:{enumerable:wi,value:Io},overrides:{enumerable:wi,value:ss},registry:{enumerable:wi,value:ei},version:{enumerable:wi,value:b3},getChart:{enumerable:wi,value:B1},register:{enumerable:wi,value:(...n)=>{ei.add(...n),ic()}},unregister:{enumerable:wi,value:(...n)=>{ei.remove(...n),ic()}}});function U1(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let u=s/r;n.beginPath(),n.arc(l,o,r,i-u,t+u),a>s?(u=s/a,n.arc(l,o,a,t+u,i-u,!0)):n.arc(l,o,s,t+It,i-It),n.closePath(),n.clip()}function S3(n){return Ba(n,["outerStart","outerEnd","innerStart","innerEnd"])}function $3(n,e,t,i){const s=S3(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const u=(t-Math.min(l,a))*i/2;return nn(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:nn(s.innerStart,0,o),innerEnd:nn(s.innerEnd,0,o)}}function gs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function aa(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,d=Math.max(e.outerRadius+i+t-u,0),p=f>0?f+i+t+u:0;let m=0;const _=s-a;if(i){const B=f>0?f-i:0,Z=d>0?d-i:0,ee=(B+Z)/2,ie=ee!==0?_*ee/(ee+i):_;m=(_-ie)/2}const g=Math.max(.001,_*d-t/Nt)/d,b=(_-g)/2,k=a+b+m,$=s-b-m,{outerStart:T,outerEnd:C,innerStart:D,innerEnd:M}=$3(e,p,d,$-k),O=d-T,I=d-C,L=k+T/O,F=$-C/I,R=p+D,N=p+M,q=k+D/R,Y=$-M/N;if(n.beginPath(),l){if(n.arc(o,r,d,L,F),C>0){const ee=gs(I,F,o,r);n.arc(ee.x,ee.y,C,F,$+It)}const B=gs(N,$,o,r);if(n.lineTo(B.x,B.y),M>0){const ee=gs(N,Y,o,r);n.arc(ee.x,ee.y,M,$+It,Y+Math.PI)}if(n.arc(o,r,p,$-M/p,k+D/p,!0),D>0){const ee=gs(R,q,o,r);n.arc(ee.x,ee.y,D,q+Math.PI,k-It)}const Z=gs(O,k,o,r);if(n.lineTo(Z.x,Z.y),T>0){const ee=gs(O,L,o,r);n.arc(ee.x,ee.y,T,k-It,L)}}else{n.moveTo(o,r);const B=Math.cos(L)*d+o,Z=Math.sin(L)*d+r;n.lineTo(B,Z);const ee=Math.cos(F)*d+o,ie=Math.sin(F)*d+r;n.lineTo(ee,ie)}n.closePath()}function T3(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){aa(n,e,t,i,o+ht,s);for(let u=0;u=ht||gl(l,r,a),g=bl(o,u+p,f+p);return _&&g}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,d=(o+r+u+a)/2;return{x:t+Math.cos(f)*d,y:i+Math.sin(f)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>ht?Math.floor(i/ht):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=Nt&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=T3(e,this,r,l,o);M3(e,this,r,l,a,o),e.restore()}}xa.id="arc";xa.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};xa.defaultRoutes={backgroundColor:"backgroundColor"};function W1(n,e,t=e){n.lineCap=st(t.borderCapStyle,e.borderCapStyle),n.setLineDash(st(t.borderDash,e.borderDash)),n.lineDashOffset=st(t.borderDashOffset,e.borderDashOffset),n.lineJoin=st(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=st(t.borderWidth,e.borderWidth),n.strokeStyle=st(t.borderColor,e.borderColor)}function O3(n,e,t){n.lineTo(t.x,t.y)}function D3(n){return n.stepped?G2:n.tension||n.cubicInterpolationMode==="monotone"?X2:O3}function Y1(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-C:C))%l,T=()=>{g!==b&&(n.lineTo(f,b),n.lineTo(f,g),n.lineTo(f,k))};for(a&&(m=s[$(0)],n.moveTo(m.x,m.y)),p=0;p<=r;++p){if(m=s[$(p)],m.skip)continue;const C=m.x,D=m.y,M=C|0;M===_?(Db&&(b=D),f=(d*f+C)/++d):(T(),n.lineTo(C,D),_=M,d=0,g=b=D),k=D}T()}function ua(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?A3:E3}function I3(n){return n.stepped?Ok:n.tension||n.cubicInterpolationMode==="monotone"?Dk:Gi}function P3(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),W1(n,e.options),n.stroke(s)}function L3(n,e,t,i){const{segments:s,options:l}=e,o=ua(e);for(const r of s)W1(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const N3=typeof Path2D=="function";function F3(n,e,t,i){N3&&!e.options.segment?P3(n,e,t,i):L3(n,e,t,i)}class Fi extends bi{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;yk(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=qk(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=M1(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=I3(i);let u,f;for(u=0,f=o.length;un!=="borderDash"&&n!=="fill"};function sc(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=tu(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function tu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function lc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function J1(n,e){let t=[],i=!1;return vt(n)?(i=!0,t=n):t=B3(n,e),t.length?new Fi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function oc(n){return n&&n.fill!==!1}function U3(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!qt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function W3(n,e,t){const i=Z3(n);if(xe(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return qt(s)&&Math.floor(s)===s?Y3(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Y3(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function K3(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:xe(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function J3(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:xe(n)?i=n.value:i=e.getBaseValue(),i}function Z3(n){const e=n.options,t=e.fill;let i=st(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function G3(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=X3(e,t);r.push(J1({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&Cr(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;oc(l)&&Cr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!oc(i)||t.drawTime!=="beforeDatasetDraw"||Cr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const al={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;er({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=u1.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new zk;const Pf="transparent",Bk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Sf(n||Pf),s=i.valid&&Sf(e||Pf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Uk{constructor(e,t,i,s){const l=t[i];s=Zl([e.to,s,l,e.from]);const o=Zl([e.from,l,s]);this._active=!0,this._fn=e.fn||Bk[e.type||typeof o],this._easing=ol[e.easing]||ol.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Zl([e.to,t,s,e.from]),this._from=Zl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});lt.set("animations",{colors:{type:"color",properties:Yk},numbers:{type:"number",properties:Wk}});lt.describe("animations",{_fallback:"animation"});lt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class D1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!xe(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!xe(s))return;const l={};for(const o of Kk)l[o]=s[o];(vt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Zk(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&Jk(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let d=l[u];const p=i.get(u);if(d)if(p&&d.active()){d.update(p,f,r);continue}else d.cancel();if(!p||!p.duration){e[u]=f;continue}l[u]=d=new Uk(p,e,u,f),s.push(d)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ai.add(this._chart,i),!0}}function Jk(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function qf(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=xk(l,o,i),d=e.length;let p;for(let m=0;mt[i].axis===e).shift()}function nw(n,e){return Ni(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function iw(n,e,t){return Ni(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Ys(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const vr=n=>n==="reset"||n==="none",jf=(n,e)=>e?n:Object.assign({},n),sw=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:E1(t,!0),values:null};class Gn{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Ff(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Ys(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(d,p,m,_)=>d==="x"?p:d==="r"?_:m,l=t.xAxisID=st(i.xAxisID,br(e,"x")),o=t.yAxisID=st(i.yAxisID,br(e,"y")),r=t.rAxisID=st(i.rAxisID,br(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&hf(this._data,this),e._stacked&&Ys(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(xe(t))this._data=Qk(t);else if(i!==t){if(i){hf(i,this);const s=this._cachedMeta;Ys(s),s._parsed=[]}t&&Object.isExtensible(t)&&w2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const l=t._stacked;t._stacked=Ff(t.vScale,t),t.stack!==i.stack&&(s=!0,Ys(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&qf(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,d,p;if(this._parsing===!1)i._parsed=s,i._sorted=!0,p=s;else{vt(s[e])?p=this.parseArrayData(i,s,e,t):xe(s[e])?p=this.parseObjectData(i,s,e,t):p=this.parsePrimitiveData(i,s,e,t);const m=()=>d[r]===null||u&&d[r]g||d=0;--p)if(!_()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),g=u.resolveNamedOptions(p,m,_,d);return g.$shared&&(g.$shared=a,l[o]=Object.freeze(jf(g,a))),g}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,d=f.datasetAnimationScopeKeys(this._type,t),p=f.getOptionScopes(this.getDataset(),d);a=f.createResolver(p,this.getContext(e,i,t))}const u=new D1(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||vr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){vr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!vr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;rs-l))}return n._cache.$bar}function ow(n){const e=n.iScale,t=lw(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Hn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s0?s[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function A1(n,e,t,i){return vt(n)?uw(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Vf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,d,p;for(u=t,f=t+i;u=t?1:-1)}function cw(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(ct(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,d=r.axis;for(let p=t;pgl(T,r,a,!0)?1:Math.max(C,C*t,D,D*t),_=(T,C,D)=>gl(T,r,a,!0)?-1:Math.min(C,C*t,D,D*t),g=m(0,u,d),b=m(It,f,p),k=_(Nt,u,d),$=_(Nt+It,f,p);i=(g-k)/2,s=(b-$)/2,l=-(g+k)/2,o=-(b+$)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Pl extends Gn{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(xe(i[e])){const{key:a="value"}=this._parsing;l=u=>+Ii(i[u],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?ht*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Il(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};Pl.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return vt(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Zo extends Gn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=c1(t,s,o);this._drawStart=r,this._drawCount=a,d1(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:d}=this._getSharedOptions(t,s),p=o.axis,m=r.axis,{spanGaps:_,segment:g}=this.options,b=Ds(_)?_:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||l||s==="none";let $=t>0&&this.getParsed(t-1);for(let T=t;T0&&Math.abs(D[p]-$[p])>b,g&&(M.parsed=D,M.raw=u.data[T]),d&&(M.options=f||this.resolveDataElementOptions(T,C.active?"active":s)),k||this.updateElement(C,T,M,s),$=D}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Zo.id="line";Zo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Zo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ga extends Gn{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Il(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return S1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(lt.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,d=u.yCenter,p=u.getIndexAngle(0)-.5*Nt;let m=p,_;const g=360/this.countVisibleElements();for(_=0;_{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Jn(this.resolveDataElementOptions(e,t).angle||i):0}}Ga.id="polarArea";Ga.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ga.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class I1 extends Pl{}I1.id="pie";I1.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Xa extends Gn{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return S1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}};bi.defaults={};bi.defaultRoutes=void 0;const P1={values(n){return vt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=_w(n,t)}const o=jn(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Il(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(jn(n)));return i===1||i===2||i===5?P1.numeric.call(this,n,e,t):""}};function _w(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Go={formatters:P1};lt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Go.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});lt.route("scale.ticks","color","","color");lt.route("scale.grid","color","","borderColor");lt.route("scale.grid","borderColor","","borderColor");lt.route("scale.title","color","","color");lt.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});lt.describe("scales",{_fallback:"scale"});lt.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function gw(n,e){const t=n.options.ticks,i=t.maxTicksLimit||bw(n),s=t.major.enabled?yw(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return kw(e,a,s,l/i),a;const u=vw(s,e,i);if(l>0){let f,d;const p=l>1?Math.round((r-o)/(l-1)):null;for(Xl(e,a,u,ct(p)?0:o-p,o),f=0,d=l-1;fs)return a}return Math.max(s,1)}function yw(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Bf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Uf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function Tw(n,e){pt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:Nn(t,Nn(i,t)),max:Nn(i,Nn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){At(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=lk(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),d=f.widest.width,p=f.highest.height,m=nn(this.chart.width-d,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),d+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Ks(e.grid)-t.padding-Wf(e.title,this.chart.options.font),u=Math.sqrt(d*d+p*p),o=Fa(Math.min(Math.asin(nn((f.highest.height+6)/r,-1,1)),Math.asin(nn(a/u,-1,1))-Math.asin(nn(p/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){At(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){At(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Wf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ks(l)+a):(e.height=this.maxHeight,e.width=Ks(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:d,highest:p}=this._getLabelSizes(),m=i.padding*2,_=Jn(this.labelRotation),g=Math.cos(_),b=Math.sin(_);if(r){const k=i.mirror?0:b*d.width+g*p.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:g*d.width+b*p.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,b,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,m=0;a?u?(p=s*e.width,m=i*t.height):(p=i*e.height,m=s*t.width):l==="start"?m=t.width:l==="end"?p=e.width:l!=="inner"&&(p=e.width/2,m=t.width/2),this.paddingLeft=Math.max((p-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-d+o)*this.width/(this.width-d),0)}else{let f=t.height/2,d=e.height/2;l==="start"?(f=0,d=e.height):l==="end"&&(f=t.height,d=0),this.paddingTop=f+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){At(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:l[O]||0,height:o[O]||0});return{first:M(0),last:M(t-1),widest:M(C),highest:M(D),widths:l,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return v2(this._alignToPixels?Wi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),d=Ks(l),p=[],m=l.setContext(this.getContext()),_=m.drawBorder?m.borderWidth:0,g=_/2,b=function(B){return Wi(i,B,_)};let k,$,T,C,D,M,O,I,L,F,R,N;if(o==="top")k=b(this.bottom),M=this.bottom-d,I=k-g,F=b(e.top)+g,N=e.bottom;else if(o==="bottom")k=b(this.top),F=e.top,N=b(e.bottom)-g,M=k+g,I=this.top+d;else if(o==="left")k=b(this.right),D=this.right-d,O=k-g,L=b(e.left)+g,R=e.right;else if(o==="right")k=b(this.left),L=e.left,R=b(e.right)-g,D=k+g,O=this.left+d;else if(t==="x"){if(o==="center")k=b((e.top+e.bottom)/2+.5);else if(xe(o)){const B=Object.keys(o)[0],Z=o[B];k=b(this.chart.scales[B].getPixelForValue(Z))}F=e.top,N=e.bottom,M=k+g,I=M+d}else if(t==="y"){if(o==="center")k=b((e.left+e.right)/2);else if(xe(o)){const B=Object.keys(o)[0],Z=o[B];k=b(this.chart.scales[B].getPixelForValue(Z))}D=k-g,O=D-d,L=e.left,R=e.right}const q=st(s.ticks.maxTicksLimit,f),Y=Math.max(1,Math.ceil(f/q));for($=0;$l.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");lt.route(l,s,a,r)})}function Iw(n){return"id"in n&&"defaults"in n}class Pw{constructor(){this.controllers=new Ql(Gn,"datasets",!0),this.elements=new Ql(bi,"elements"),this.plugins=new Ql(Object,"plugins"),this.scales=new Ql(rs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):pt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Na(e);At(i["before"+s],[],i),t[e](i),At(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let C=t;C0&&Math.abs(M[m]-T[m])>k,b&&(O.parsed=M,O.raw=u.data[C]),p&&(O.options=d||this.resolveDataElementOptions(C,D.active?"active":s)),$||this.updateElement(D,C,O,s),T=M}this.updateSharedOptions(d,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}Qa.id="scatter";Qa.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Qa.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Yi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class la{constructor(e){this.options=e||{}}init(e){}formats(){return Yi()}parse(e,t){return Yi()}format(e,t){return Yi()}add(e,t,i){return Yi()}diff(e,t,i){return Yi()}startOf(e,t,i){return Yi()}endOf(e,t){return Yi()}}la.override=function(n){Object.assign(la.prototype,n)};var L1={_date:la};function Lw(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?y2:Qi;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const d=a(l,e,t-f),p=a(l,e,t+f);return{lo:d.lo,hi:p.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Ll(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var qw={evaluateInteractionItems:Ll,modes:{index(n,e,t,i){const s=Zi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?kr(n,s,l,i,o):wr(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,d=u.data[f];d&&!d.skip&&a.push({element:d,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Zi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?kr(n,s,l,i,o):wr(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function Kf(n,e){return n.filter(t=>N1.indexOf(t.pos)===-1&&t.box.axis===e)}function Zs(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function jw(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Zs(Js(e,"left"),!0),s=Zs(Js(e,"right")),l=Zs(Js(e,"top"),!0),o=Zs(Js(e,"bottom")),r=Kf(e,"x"),a=Kf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Js(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Jf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function F1(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function Bw(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!xe(s)){t.size&&(n[s]-=t.size);const d=i[t.stack]||{size:0,count:1};d.size=Math.max(d.size,t.horizontal?l.height:l.width),t.size=d.size/d.count,n[s]+=t.size}l.getPadding&&F1(o,l.getPadding());const r=Math.max(0,e.outerWidth-Jf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Jf(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function Uw(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function Ww(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function tl(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),p=Object.assign({},s);F1(p,zn(i));const m=Object.assign({maxPadding:p,w:l,h:o,x:s.left,y:s.top},s),_=Hw(a.concat(u),d);tl(r.fullSize,m,d,_),tl(a,m,d,_),tl(u,m,d,_)&&tl(a,m,d,_),Uw(m),Zf(r.leftAndTop,m,d,_),m.x+=m.w,m.y+=m.h,Zf(r.rightAndBottom,m,d,_),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},pt(r.chartArea,g=>{const b=g.box;Object.assign(b,n.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class R1{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Yw extends R1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const co="$chartjs",Kw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Gf=n=>n===null||n==="";function Jw(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[co]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Gf(s)){const l=Of(n,"width");l!==void 0&&(n.width=l)}if(Gf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=Of(n,"height");l!==void 0&&(n.height=l)}return n}const q1=Ok?{passive:!0}:!1;function Zw(n,e,t){n.addEventListener(e,t,q1)}function Gw(n,e,t){n.canvas.removeEventListener(e,t,q1)}function Xw(n,e){const t=Kw[n.type]||n.type,{x:i,y:s}=Zi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Ao(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function Qw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Ao(r.addedNodes,i),o=o&&!Ao(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function xw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Ao(r.removedNodes,i),o=o&&!Ao(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const yl=new Map;let Xf=0;function j1(){const n=window.devicePixelRatio;n!==Xf&&(Xf=n,yl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function e3(n,e){yl.size||window.addEventListener("resize",j1),yl.set(n,e)}function t3(n){yl.delete(n),yl.size||window.removeEventListener("resize",j1)}function n3(n,e,t){const i=n.canvas,s=i&&Ka(i);if(!s)return;const l=f1((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),e3(n,l),o}function Sr(n,e,t){t&&t.disconnect(),e==="resize"&&t3(n)}function i3(n,e,t){const i=n.canvas,s=f1(l=>{n.ctx!==null&&t(Xw(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return Zw(i,e,s),s}class s3 extends R1{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(Jw(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[co])return!1;const i=t[co].initial;["height","width"].forEach(l=>{const o=i[l];ct(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[co],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:Qw,detach:xw,resize:n3}[t]||i3;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:Sr,detach:Sr,resize:Sr}[t]||Gw)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return Mk(e,t,i,s)}isAttached(e){const t=Ka(e);return!!(t&&t.isConnected)}}function l3(n){return!T1()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Yw:s3}class o3{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(At(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){ct(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=st(i.options&&i.options.plugins,{}),l=r3(i);return s===!1&&!t?[]:u3(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function r3(n){const e={},t=[],i=Object.keys(ei.plugins.items);for(let l=0;l{const a=i[r];if(!xe(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const u=ra(r,a),f=d3(u,s),d=t.scales||{};l[u]=l[u]||r,o[r]=sl(Object.create(null),[{axis:u},a,d[u],d[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||oa(a,e),d=(ss[a]||{}).scales||{};Object.keys(d).forEach(p=>{const m=c3(p,u),_=r[m+"AxisID"]||l[m]||m;o[_]=o[_]||Object.create(null),sl(o[_],[{axis:m},i[_],d[p]])})}),Object.keys(o).forEach(r=>{const a=o[r];sl(a,[lt.scales[a.type],lt.scale])}),o}function V1(n){const e=n.options||(n.options={});e.plugins=st(e.plugins,{}),e.scales=m3(n,e)}function H1(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function h3(n){return n=n||{},n.data=H1(n.data),V1(n),n}const Qf=new Map,z1=new Set;function to(n,e){let t=Qf.get(n);return t||(t=e(),Qf.set(n,t),z1.add(t)),t}const Gs=(n,e,t)=>{const i=Ii(e,t);i!==void 0&&n.add(i)};class _3{constructor(e){this._config=h3(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=H1(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),V1(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return to(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return to(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return to(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return to(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(d=>Gs(a,e,d))),f.forEach(d=>Gs(a,s,d)),f.forEach(d=>Gs(a,ss[l]||{},d)),f.forEach(d=>Gs(a,lt,d)),f.forEach(d=>Gs(a,ia,d))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),z1.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,ss[t]||{},lt.datasets[t]||{},{type:t},lt,ia]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=xf(this._resolverCache,e,s);let a=o;if(b3(o,t)){l.$shared=!1,i=Pi(i)?i():i;const u=this.createResolver(e,i,r);a=Es(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=xf(this._resolverCache,e,i);return xe(t)?Es(l,t,void 0,s):l}}function xf(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:Ua(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const g3=n=>xe(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Pi(n[t]),!1);function b3(n,e){const{isScriptable:t,isIndexable:i}=v1(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Pi(r)||g3(r))||o&&vt(r))return!0}return!1}var v3="3.9.1";const y3=["top","bottom","left","right","chartArea"];function ec(n,e){return n==="top"||n==="bottom"||y3.indexOf(n)===-1&&e==="x"}function tc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function nc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),At(t&&t.onComplete,[n],e)}function k3(n){const e=n.chart,t=e.options.animation;At(t&&t.onProgress,[n],e)}function B1(n){return T1()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Io={},U1=n=>{const e=B1(n);return Object.values(Io).filter(t=>t.canvas===e).pop()};function w3(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function S3(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Po{constructor(e,t){const i=this.config=new _3(t),s=B1(e),l=U1(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||l3(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=r2(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new o3,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=S2(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Io[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ai.listen(this,"complete",nc),ai.listen(this,"progress",k3),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return ct(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Mf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return $f(this.canvas,this.ctx),this}stop(){return ai.stop(this),this}resize(e,t){ai.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Mf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),At(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};pt(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=ra(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),pt(l,o=>{const r=o.options,a=r.id,u=ra(a,r),f=st(r.type,o.dtype);(r.position===void 0||ec(r.position,u)!==ec(o.dposition))&&(r.position=o.dposition),s[a]=!0;let d=null;if(a in i&&i[a].type===f)d=i[a];else{const p=ei.getScale(f);d=new p({id:a,type:f,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(r,e)}),pt(s,(o,r)=>{o||delete i[r]}),pt(i,o=>{eo.configure(this,o,o.options),eo.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(tc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){pt(this.scales,e=>{eo.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!cf(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;w3(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;eo.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],pt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ha(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&za(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return vl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=qw.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ni(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);Hn(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ai.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};pt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){pt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},pt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!So(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(d=>f.datasetIndex===d.datasetIndex&&f.index===d.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=p2(e),u=S3(e,this._lastEvent,i,a);i&&(this._lastEvent=null,At(l.onHover,[e,r,this],this),a&&At(l.onClick,[e,r,this],this));const f=!So(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const ic=()=>pt(Po.instances,n=>n._plugins.invalidate()),wi=!0;Object.defineProperties(Po,{defaults:{enumerable:wi,value:lt},instances:{enumerable:wi,value:Io},overrides:{enumerable:wi,value:ss},registry:{enumerable:wi,value:ei},version:{enumerable:wi,value:v3},getChart:{enumerable:wi,value:U1},register:{enumerable:wi,value:(...n)=>{ei.add(...n),ic()}},unregister:{enumerable:wi,value:(...n)=>{ei.remove(...n),ic()}}});function W1(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let u=s/r;n.beginPath(),n.arc(l,o,r,i-u,t+u),a>s?(u=s/a,n.arc(l,o,a,t+u,i-u,!0)):n.arc(l,o,s,t+It,i-It),n.closePath(),n.clip()}function $3(n){return Ba(n,["outerStart","outerEnd","innerStart","innerEnd"])}function T3(n,e,t,i){const s=$3(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const u=(t-Math.min(l,a))*i/2;return nn(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:nn(s.innerStart,0,o),innerEnd:nn(s.innerEnd,0,o)}}function gs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function aa(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,d=Math.max(e.outerRadius+i+t-u,0),p=f>0?f+i+t+u:0;let m=0;const _=s-a;if(i){const B=f>0?f-i:0,Z=d>0?d-i:0,ee=(B+Z)/2,ie=ee!==0?_*ee/(ee+i):_;m=(_-ie)/2}const g=Math.max(.001,_*d-t/Nt)/d,b=(_-g)/2,k=a+b+m,$=s-b-m,{outerStart:T,outerEnd:C,innerStart:D,innerEnd:M}=T3(e,p,d,$-k),O=d-T,I=d-C,L=k+T/O,F=$-C/I,R=p+D,N=p+M,q=k+D/R,Y=$-M/N;if(n.beginPath(),l){if(n.arc(o,r,d,L,F),C>0){const ee=gs(I,F,o,r);n.arc(ee.x,ee.y,C,F,$+It)}const B=gs(N,$,o,r);if(n.lineTo(B.x,B.y),M>0){const ee=gs(N,Y,o,r);n.arc(ee.x,ee.y,M,$+It,Y+Math.PI)}if(n.arc(o,r,p,$-M/p,k+D/p,!0),D>0){const ee=gs(R,q,o,r);n.arc(ee.x,ee.y,D,q+Math.PI,k-It)}const Z=gs(O,k,o,r);if(n.lineTo(Z.x,Z.y),T>0){const ee=gs(O,L,o,r);n.arc(ee.x,ee.y,T,k-It,L)}}else{n.moveTo(o,r);const B=Math.cos(L)*d+o,Z=Math.sin(L)*d+r;n.lineTo(B,Z);const ee=Math.cos(F)*d+o,ie=Math.sin(F)*d+r;n.lineTo(ee,ie)}n.closePath()}function C3(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){aa(n,e,t,i,o+ht,s);for(let u=0;u=ht||gl(l,r,a),g=bl(o,u+p,f+p);return _&&g}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,d=(o+r+u+a)/2;return{x:t+Math.cos(f)*d,y:i+Math.sin(f)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>ht?Math.floor(i/ht):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=Nt&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=C3(e,this,r,l,o);O3(e,this,r,l,a,o),e.restore()}}xa.id="arc";xa.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};xa.defaultRoutes={backgroundColor:"backgroundColor"};function Y1(n,e,t=e){n.lineCap=st(t.borderCapStyle,e.borderCapStyle),n.setLineDash(st(t.borderDash,e.borderDash)),n.lineDashOffset=st(t.borderDashOffset,e.borderDashOffset),n.lineJoin=st(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=st(t.borderWidth,e.borderWidth),n.strokeStyle=st(t.borderColor,e.borderColor)}function D3(n,e,t){n.lineTo(t.x,t.y)}function E3(n){return n.stepped?X2:n.tension||n.cubicInterpolationMode==="monotone"?Q2:D3}function K1(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-C:C))%l,T=()=>{g!==b&&(n.lineTo(f,b),n.lineTo(f,g),n.lineTo(f,k))};for(a&&(m=s[$(0)],n.moveTo(m.x,m.y)),p=0;p<=r;++p){if(m=s[$(p)],m.skip)continue;const C=m.x,D=m.y,M=C|0;M===_?(Db&&(b=D),f=(d*f+C)/++d):(T(),n.lineTo(C,D),_=M,d=0,g=b=D),k=D}T()}function ua(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?I3:A3}function P3(n){return n.stepped?Dk:n.tension||n.cubicInterpolationMode==="monotone"?Ek:Gi}function L3(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),Y1(n,e.options),n.stroke(s)}function N3(n,e,t,i){const{segments:s,options:l}=e,o=ua(e);for(const r of s)Y1(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const F3=typeof Path2D=="function";function R3(n,e,t,i){F3&&!e.options.segment?L3(n,e,t,i):N3(n,e,t,i)}class Fi extends bi{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;kk(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=jk(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=O1(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=P3(i);let u,f;for(u=0,f=o.length;un!=="borderDash"&&n!=="fill"};function sc(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=tu(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function tu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function lc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Z1(n,e){let t=[],i=!1;return vt(n)?(i=!0,t=n):t=U3(n,e),t.length?new Fi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function oc(n){return n&&n.fill!==!1}function W3(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!qt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function Y3(n,e,t){const i=G3(n);if(xe(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return qt(s)&&Math.floor(s)===s?K3(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function K3(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function J3(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:xe(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function Z3(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:xe(n)?i=n.value:i=e.getBaseValue(),i}function G3(n){const e=n.options,t=e.fill;let i=st(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function X3(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=Q3(e,t);r.push(Z1({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&Cr(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;oc(l)&&Cr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!oc(i)||t.drawTime!=="beforeDatasetDraw"||Cr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const al={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e-1?n.split(` -`):n}function aS(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function fc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Mn(e.bodyFont),u=Mn(e.titleFont),f=Mn(e.footerFont),d=l.length,p=s.length,m=i.length,_=zn(e.padding);let g=_.height,b=0,k=i.reduce((C,D)=>C+D.before.length+D.lines.length+D.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,d&&(g+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),k){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*C+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}p&&(g+=e.footerMarginTop+p*f.lineHeight+(p-1)*e.footerSpacing);let $=0;const T=function(C){b=Math.max(b,t.measureText(C).width+$)};return t.save(),t.font=u.string,pt(n.title,T),t.font=a.string,pt(n.beforeBody.concat(n.afterBody),T),$=e.displayColors?o+2+e.boxPadding:0,pt(i,C=>{pt(C.before,T),pt(C.lines,T),pt(C.after,T)}),$=0,t.font=f.string,pt(n.footer,T),t.restore(),b+=_.width,{width:b,height:g}}function uS(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function fS(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function cS(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),fS(u,n,e,t)&&(u="center"),u}function cc(n,e,t){const i=t.yAlign||e.yAlign||uS(n,t);return{xAlign:t.xAlign||e.xAlign||cS(n,e,t,i),yAlign:i}}function dS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function pS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function dc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:d,bottomLeft:p,bottomRight:m}=Ss(o);let _=dS(e,r);const g=pS(e,a,u);return a==="center"?r==="left"?_+=u:r==="right"&&(_-=u):r==="left"?_-=Math.max(f,p)+s:r==="right"&&(_+=Math.max(d,m)+s),{x:nn(_,0,i.width-e.width),y:nn(g,0,i.height-e.height)}}function no(n,e,t){const i=zn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function pc(n){return Qn([],ui(n))}function mS(n,e,t){return Ni(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function mc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ca extends bi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new O1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=mS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=Qn(r,ui(s)),r=Qn(r,ui(l)),r=Qn(r,ui(o)),r}getBeforeBody(e,t){return pc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return pt(e,l=>{const o={before:[],lines:[],after:[]},r=mc(i,l);Qn(o.before,ui(r.beforeLabel.call(this,l))),Qn(o.lines,r.label.call(this,l)),Qn(o.after,ui(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return pc(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=Qn(r,ui(s)),r=Qn(r,ui(l)),r=Qn(r,ui(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,d,p,i))),e.itemSort&&(r=r.sort((f,d)=>e.itemSort(f,d,i))),pt(r,f=>{const d=mc(e.callbacks,f);s.push(d.labelColor.call(this,f)),l.push(d.labelPointStyle.call(this,f)),o.push(d.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=al[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=fc(this,i),u=Object.assign({},r,a),f=cc(this.chart,i,u),d=dc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:d.x,y:d.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:d}=Ss(r),{x:p,y:m}=e,{width:_,height:g}=t;let b,k,$,T,C,D;return l==="center"?(C=m+g/2,s==="left"?(b=p,k=b-o,T=C+o,D=C-o):(b=p+_,k=b+o,T=C-o,D=C+o),$=b):(s==="left"?k=p+Math.max(a,f)+o:s==="right"?k=p+_-Math.max(u,d)-o:k=this.caretX,l==="top"?(T=m,C=T-o,b=k-o,$=k+o):(T=m+g,C=T+o,b=k+o,$=k-o),D=T),{x1:b,x2:k,x3:$,y1:T,y2:C,y3:D}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=gr(i.rtl,this.x,this.width);for(e.x=no(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Mn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aT!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Do(e,{x:b,y:g,w:u,h:a,radius:$}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Do(e,{x:k,y:g+1,w:u-2,h:a-2,radius:$}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,g,u,a),e.strokeRect(b,g,u,a),e.fillStyle=o.backgroundColor,e.fillRect(k,g+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,d=Mn(i.bodyFont);let p=d.lineHeight,m=0;const _=gr(i.rtl,this.x,this.width),g=function(I){t.fillText(I,_.x(e.x+m),e.y+p/2),e.y+=p+l},b=_.textAlign(o);let k,$,T,C,D,M,O;for(t.textAlign=o,t.textBaseline="middle",t.font=d.string,e.x=no(this,b,i),t.fillStyle=i.bodyColor,pt(this.beforeBody,g),m=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,C=0,M=s.length;C0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=al[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=fc(this,e),a=Object.assign({},o,this._size),u=cc(t,e,a),f=dc(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=zn(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(l,e,s,t),Pk(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),Lk(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!So(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!So(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=al[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ca.positioners=al;var hS={id:"tooltip",_element:ca,positioners:al,afterInit(n,e,t){t&&(n.tooltip=new ca({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",t)===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:ri,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const _S=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function gS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return _S(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const bS=(n,e)=>n===null?null:nn(Math.round(n),0,e);class da extends rs{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(ct(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:gS(i,e,st(t,e),this._addedLabels),bS(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}da.id="category";da.defaults={ticks:{callback:da.prototype.getLabelForValue}};function vS(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:d,includeBounds:p}=n,m=l||1,_=f-1,{min:g,max:b}=e,k=!ct(o),$=!ct(r),T=!ct(u),C=(b-g)/(d+1);let D=pf((b-g)/_/m)*m,M,O,I,L;if(D<1e-14&&!k&&!$)return[{value:g},{value:b}];L=Math.ceil(b/D)-Math.floor(g/D),L>_&&(D=pf(L*D/_/m)*m),ct(a)||(M=Math.pow(10,a),D=Math.ceil(D*M)/M),s==="ticks"?(O=Math.floor(g/D)*D,I=Math.ceil(b/D)*D):(O=g,I=b),k&&$&&l&&_2((r-o)/l,D/1e3)?(L=Math.round(Math.min((r-o)/D,f)),D=(r-o)/L,O=o,I=r):T?(O=k?o:O,I=$?r:I,L=u-1,D=(I-O)/L):(L=(I-O)/D,ll(L,Math.round(L),D/1e3)?L=Math.round(L):L=Math.ceil(L));const F=Math.max(mf(D),mf(O));M=Math.pow(10,ct(a)?F:a),O=Math.round(O*M)/M,I=Math.round(I*M)/M;let R=0;for(k&&(p&&O!==o?(t.push({value:o}),Os=t?s:a,r=a=>l=i?l:a;if(e){const a=ti(s),u=ti(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(l*.05)),r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=vS(s,l);return e.bounds==="ticks"&&s1(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Il(e,this.chart.options.locale,this.options.ticks.format)}}class nu extends Lo{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=qt(e)?e:0,this.max=qt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Jn(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}nu.id="linear";nu.defaults={ticks:{callback:Go.formatters.numeric}};function _c(n){return n/Math.pow(10,Math.floor(jn(n)))===1}function yS(n,e){const t=Math.floor(jn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Nn(n.min,Math.pow(10,Math.floor(jn(e.min)))),o=Math.floor(jn(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:_c(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=qt(e)?Math.max(0,e):null,this.max=qt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,u)=>Math.pow(10,Math.floor(jn(a))+u);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=yS(t,this);return e.bounds==="ticks"&&s1(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Il(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=jn(e),this._valueRange=jn(this.max)-jn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(jn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}G1.id="logarithmic";G1.defaults={ticks:{callback:Go.formatters.logarithmic,major:{enabled:!0}}};function pa(n){const e=n.ticks;if(e.display&&n.display){const t=zn(e.backdropPadding);return st(e.font&&e.font.size,lt.font.size)+t.height}return 0}function kS(n,e,t){return t=vt(t)?t:[t],{w:J2(n,e.string,t),h:t.length*e.lineHeight}}function gc(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:ns?{start:e-t,end:e}:{start:e,end:e+t}}function wS(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?Nt/l:0;for(let a=0;ae.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.starte.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function $S(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=pa(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Nt/s:0;for(let u=0;u270||t<90)&&(n-=e),n}function OS(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=Mn(l.font),{x:r,y:a,textAlign:u,left:f,top:d,right:p,bottom:m}=n._pointLabelItems[s],{backdropColor:_}=l;if(!ct(_)){const g=Ss(l.borderRadius),b=zn(l.backdropPadding);t.fillStyle=_;const k=f-b.left,$=d-b.top,T=p-f+b.width,C=m-d+b.height;Object.values(g).some(D=>D!==0)?(t.beginPath(),Do(t,{x:k,y:$,w:T,h:C,radius:g}),t.fill()):t.fillRect(k,$,T,C)}Oo(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function X1(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,ht);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=At(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?wS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=ht/(this._pointLabels.length||1),i=this.options.startAngle||0;return Cn(e*t+Jn(i))}getDistanceFromCenterForValue(e){if(ct(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(ct(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const d=s.setContext(this.getContext(f-1));DS(this,d,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:d}=u;!d||!f||(e.lineWidth=d,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=Mn(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const d=zn(u.backdropPadding);e.fillRect(-o/2-d.left,-l-f.size/2-d.top,o+d.width,f.size+d.height)}Oo(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Qo.id="radialLinear";Qo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Go.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Qo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Qo.descriptors={angleLines:{_fallback:"grid"}};const xo={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},bn=Object.keys(xo);function AS(n,e){return n-e}function bc(n,e){if(ct(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),qt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ds(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function vc(n,e,t,i){const s=bn.length;for(let l=bn.indexOf(n);l=bn.indexOf(t);l--){const o=bn[l];if(xo[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return bn[t?bn.indexOf(t):0]}function PS(n){for(let e=bn.indexOf(n)+1,t=bn.length;e=e?t[i]:t[s];n[l]=!0}}function LS(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function kc(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=nn(t,0,o),i=nn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||vc(l.minUnit,t,i,this._getLabelCapacity(t)),r=st(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Ds(a)||a===!0,f={};let d=t,p,m;if(u&&(d=+e.startOf(d,"isoWeek",a)),d=+e.startOf(d,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const _=s.ticks.source==="data"&&this.getDataTimestamps();for(p=d,m=0;pg-b).map(g=>+g)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],d=i[t],p=a&&f&&d&&d.major,m=this._adapter.format(e,s||(p?f:u)),_=l.ticks.callback;return _?At(_,[m,t,i],this):m}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Qi(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=Qi(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class Q1 extends Nl{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=io(t,this.min),this._tableRange=io(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;oC+D.before.length+D.lines.length+D.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,d&&(g+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),k){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*C+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}p&&(g+=e.footerMarginTop+p*f.lineHeight+(p-1)*e.footerSpacing);let $=0;const T=function(C){b=Math.max(b,t.measureText(C).width+$)};return t.save(),t.font=u.string,pt(n.title,T),t.font=a.string,pt(n.beforeBody.concat(n.afterBody),T),$=e.displayColors?o+2+e.boxPadding:0,pt(i,C=>{pt(C.before,T),pt(C.lines,T),pt(C.after,T)}),$=0,t.font=f.string,pt(n.footer,T),t.restore(),b+=_.width,{width:b,height:g}}function fS(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function cS(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function dS(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),cS(u,n,e,t)&&(u="center"),u}function cc(n,e,t){const i=t.yAlign||e.yAlign||fS(n,t);return{xAlign:t.xAlign||e.xAlign||dS(n,e,t,i),yAlign:i}}function pS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function mS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function dc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:d,bottomLeft:p,bottomRight:m}=Ss(o);let _=pS(e,r);const g=mS(e,a,u);return a==="center"?r==="left"?_+=u:r==="right"&&(_-=u):r==="left"?_-=Math.max(f,p)+s:r==="right"&&(_+=Math.max(d,m)+s),{x:nn(_,0,i.width-e.width),y:nn(g,0,i.height-e.height)}}function no(n,e,t){const i=zn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function pc(n){return Qn([],ui(n))}function hS(n,e,t){return Ni(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function mc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ca extends bi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new D1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=hS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=Qn(r,ui(s)),r=Qn(r,ui(l)),r=Qn(r,ui(o)),r}getBeforeBody(e,t){return pc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return pt(e,l=>{const o={before:[],lines:[],after:[]},r=mc(i,l);Qn(o.before,ui(r.beforeLabel.call(this,l))),Qn(o.lines,r.label.call(this,l)),Qn(o.after,ui(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return pc(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=Qn(r,ui(s)),r=Qn(r,ui(l)),r=Qn(r,ui(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,d,p,i))),e.itemSort&&(r=r.sort((f,d)=>e.itemSort(f,d,i))),pt(r,f=>{const d=mc(e.callbacks,f);s.push(d.labelColor.call(this,f)),l.push(d.labelPointStyle.call(this,f)),o.push(d.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=al[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=fc(this,i),u=Object.assign({},r,a),f=cc(this.chart,i,u),d=dc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:d.x,y:d.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:d}=Ss(r),{x:p,y:m}=e,{width:_,height:g}=t;let b,k,$,T,C,D;return l==="center"?(C=m+g/2,s==="left"?(b=p,k=b-o,T=C+o,D=C-o):(b=p+_,k=b+o,T=C-o,D=C+o),$=b):(s==="left"?k=p+Math.max(a,f)+o:s==="right"?k=p+_-Math.max(u,d)-o:k=this.caretX,l==="top"?(T=m,C=T-o,b=k-o,$=k+o):(T=m+g,C=T+o,b=k+o,$=k-o),D=T),{x1:b,x2:k,x3:$,y1:T,y2:C,y3:D}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=gr(i.rtl,this.x,this.width);for(e.x=no(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Mn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aT!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Do(e,{x:b,y:g,w:u,h:a,radius:$}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Do(e,{x:k,y:g+1,w:u-2,h:a-2,radius:$}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,g,u,a),e.strokeRect(b,g,u,a),e.fillStyle=o.backgroundColor,e.fillRect(k,g+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,d=Mn(i.bodyFont);let p=d.lineHeight,m=0;const _=gr(i.rtl,this.x,this.width),g=function(I){t.fillText(I,_.x(e.x+m),e.y+p/2),e.y+=p+l},b=_.textAlign(o);let k,$,T,C,D,M,O;for(t.textAlign=o,t.textBaseline="middle",t.font=d.string,e.x=no(this,b,i),t.fillStyle=i.bodyColor,pt(this.beforeBody,g),m=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,C=0,M=s.length;C0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=al[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=fc(this,e),a=Object.assign({},o,this._size),u=cc(t,e,a),f=dc(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=zn(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(l,e,s,t),Lk(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),Nk(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!So(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!So(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=al[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ca.positioners=al;var _S={id:"tooltip",_element:ca,positioners:al,afterInit(n,e,t){t&&(n.tooltip=new ca({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",t)===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:ri,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const gS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function bS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return gS(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const vS=(n,e)=>n===null?null:nn(Math.round(n),0,e);class da extends rs{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(ct(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:bS(i,e,st(t,e),this._addedLabels),vS(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}da.id="category";da.defaults={ticks:{callback:da.prototype.getLabelForValue}};function yS(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:d,includeBounds:p}=n,m=l||1,_=f-1,{min:g,max:b}=e,k=!ct(o),$=!ct(r),T=!ct(u),C=(b-g)/(d+1);let D=pf((b-g)/_/m)*m,M,O,I,L;if(D<1e-14&&!k&&!$)return[{value:g},{value:b}];L=Math.ceil(b/D)-Math.floor(g/D),L>_&&(D=pf(L*D/_/m)*m),ct(a)||(M=Math.pow(10,a),D=Math.ceil(D*M)/M),s==="ticks"?(O=Math.floor(g/D)*D,I=Math.ceil(b/D)*D):(O=g,I=b),k&&$&&l&&g2((r-o)/l,D/1e3)?(L=Math.round(Math.min((r-o)/D,f)),D=(r-o)/L,O=o,I=r):T?(O=k?o:O,I=$?r:I,L=u-1,D=(I-O)/L):(L=(I-O)/D,ll(L,Math.round(L),D/1e3)?L=Math.round(L):L=Math.ceil(L));const F=Math.max(mf(D),mf(O));M=Math.pow(10,ct(a)?F:a),O=Math.round(O*M)/M,I=Math.round(I*M)/M;let R=0;for(k&&(p&&O!==o?(t.push({value:o}),Os=t?s:a,r=a=>l=i?l:a;if(e){const a=ti(s),u=ti(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(l*.05)),r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=yS(s,l);return e.bounds==="ticks"&&l1(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Il(e,this.chart.options.locale,this.options.ticks.format)}}class nu extends Lo{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=qt(e)?e:0,this.max=qt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Jn(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}nu.id="linear";nu.defaults={ticks:{callback:Go.formatters.numeric}};function _c(n){return n/Math.pow(10,Math.floor(jn(n)))===1}function kS(n,e){const t=Math.floor(jn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Nn(n.min,Math.pow(10,Math.floor(jn(e.min)))),o=Math.floor(jn(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:_c(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=qt(e)?Math.max(0,e):null,this.max=qt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,u)=>Math.pow(10,Math.floor(jn(a))+u);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=kS(t,this);return e.bounds==="ticks"&&l1(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Il(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=jn(e),this._valueRange=jn(this.max)-jn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(jn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}X1.id="logarithmic";X1.defaults={ticks:{callback:Go.formatters.logarithmic,major:{enabled:!0}}};function pa(n){const e=n.ticks;if(e.display&&n.display){const t=zn(e.backdropPadding);return st(e.font&&e.font.size,lt.font.size)+t.height}return 0}function wS(n,e,t){return t=vt(t)?t:[t],{w:Z2(n,e.string,t),h:t.length*e.lineHeight}}function gc(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:ns?{start:e-t,end:e}:{start:e,end:e+t}}function SS(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?Nt/l:0;for(let a=0;ae.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.starte.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function TS(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=pa(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Nt/s:0;for(let u=0;u270||t<90)&&(n-=e),n}function DS(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=Mn(l.font),{x:r,y:a,textAlign:u,left:f,top:d,right:p,bottom:m}=n._pointLabelItems[s],{backdropColor:_}=l;if(!ct(_)){const g=Ss(l.borderRadius),b=zn(l.backdropPadding);t.fillStyle=_;const k=f-b.left,$=d-b.top,T=p-f+b.width,C=m-d+b.height;Object.values(g).some(D=>D!==0)?(t.beginPath(),Do(t,{x:k,y:$,w:T,h:C,radius:g}),t.fill()):t.fillRect(k,$,T,C)}Oo(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function Q1(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,ht);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=At(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?SS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=ht/(this._pointLabels.length||1),i=this.options.startAngle||0;return Cn(e*t+Jn(i))}getDistanceFromCenterForValue(e){if(ct(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(ct(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const d=s.setContext(this.getContext(f-1));ES(this,d,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:d}=u;!d||!f||(e.lineWidth=d,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=Mn(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const d=zn(u.backdropPadding);e.fillRect(-o/2-d.left,-l-f.size/2-d.top,o+d.width,f.size+d.height)}Oo(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Qo.id="radialLinear";Qo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Go.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Qo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Qo.descriptors={angleLines:{_fallback:"grid"}};const xo={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},bn=Object.keys(xo);function IS(n,e){return n-e}function bc(n,e){if(ct(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),qt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ds(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function vc(n,e,t,i){const s=bn.length;for(let l=bn.indexOf(n);l=bn.indexOf(t);l--){const o=bn[l];if(xo[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return bn[t?bn.indexOf(t):0]}function LS(n){for(let e=bn.indexOf(n)+1,t=bn.length;e=e?t[i]:t[s];n[l]=!0}}function NS(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function kc(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=nn(t,0,o),i=nn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||vc(l.minUnit,t,i,this._getLabelCapacity(t)),r=st(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Ds(a)||a===!0,f={};let d=t,p,m;if(u&&(d=+e.startOf(d,"isoWeek",a)),d=+e.startOf(d,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const _=s.ticks.source==="data"&&this.getDataTimestamps();for(p=d,m=0;pg-b).map(g=>+g)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],d=i[t],p=a&&f&&d&&d.major,m=this._adapter.format(e,s||(p?f:u)),_=l.ticks.callback;return _?At(_,[m,t,i],this):m}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Qi(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=Qi(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class x1 extends Nl{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=io(t,this.min),this._tableRange=io(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o{i&&(t||(t=Ve(e,Bt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,Bt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function FS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=E(),s=U(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function RS(n){let e;return{c(){e=U("Loading...")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function qS(n){let e,t,i,s,l,o=n[2]&&wc();function r(f,d){return f[2]?RS:FS}let a=r(n),u=a(n);return{c(){e=y("div"),o&&o.c(),t=E(),i=y("canvas"),s=E(),l=y("div"),u.c(),h(i,"class","chart-canvas svelte-vh4sl8"),qr(i,"height","250px"),qr(i,"width","100%"),h(e,"class","chart-wrapper svelte-vh4sl8"),x(e,"loading",n[2]),h(l,"class","txt-hint m-t-xs txt-right")},m(f,d){S(f,e,d),o&&o.m(e,null),v(e,t),v(e,i),n[8](i),S(f,s,d),S(f,l,d),u.m(l,null)},p(f,[d]){f[2]?o?d&4&&A(o,1):(o=wc(),o.c(),A(o,1),o.m(e,t)):o&&(re(),P(o,1,1,()=>{o=null}),ae()),d&4&&x(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,d):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function jS(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),me.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{d();for(let _ of m)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(d(),console.warn(m),me.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function d(){t(1,a=0),t(7,r=[])}xt(()=>(Po.register(Fi,Xo,Zo,nu,Nl,rS,hS),t(6,o=new Po(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function p(m){se[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,p]}class VS extends ve{constructor(e){super(),be(this,e,jS,qS,_e,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Sc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ma={},HS={get exports(){return ma},set exports(n){ma=n}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** + */const FS={datetime:ze.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:ze.TIME_WITH_SECONDS,minute:ze.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};L1._date.override({_id:"luxon",_create:function(n){return ze.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return FS},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=ze.fromFormat(n,e,t):n=ze.fromISO(n,t):n instanceof Date?n=ze.fromJSDate(n,t):i==="object"&&!(n instanceof ze)&&(n=ze.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function wc(n){let e,t,i;return{c(){e=y("div"),h(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,Bt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function RS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=E(),s=U(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function qS(n){let e;return{c(){e=U("Loading...")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function jS(n){let e,t,i,s,l,o=n[2]&&wc();function r(f,d){return f[2]?qS:RS}let a=r(n),u=a(n);return{c(){e=y("div"),o&&o.c(),t=E(),i=y("canvas"),s=E(),l=y("div"),u.c(),h(i,"class","chart-canvas svelte-vh4sl8"),qr(i,"height","250px"),qr(i,"width","100%"),h(e,"class","chart-wrapper svelte-vh4sl8"),x(e,"loading",n[2]),h(l,"class","txt-hint m-t-xs txt-right")},m(f,d){S(f,e,d),o&&o.m(e,null),v(e,t),v(e,i),n[8](i),S(f,s,d),S(f,l,d),u.m(l,null)},p(f,[d]){f[2]?o?d&4&&A(o,1):(o=wc(),o.c(),A(o,1),o.m(e,t)):o&&(re(),P(o,1,1,()=>{o=null}),ae()),d&4&&x(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,d):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function VS(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),me.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{d();for(let _ of m)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(d(),console.warn(m),me.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function d(){t(1,a=0),t(7,r=[])}xt(()=>(Po.register(Fi,Xo,Zo,nu,Nl,aS,_S),t(6,o=new Po(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function p(m){se[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,p]}class HS extends ve{constructor(e){super(),be(this,e,VS,jS,_e,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Sc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ma={},zS={get exports(){return ma},set exports(n){ma=n}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** * Prism: Lightweight, robust, elegant syntax highlighting * * @license MIT @@ -46,25 +46,25 @@ * @namespace * @public */var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function $(T){return T instanceof a?new a(T.type,$(T.content),T.alias):Array.isArray(T)?T.map($):T.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(D){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(D.stack)||[])[1];if($){var T=document.getElementsByTagName("script");for(var C in T)if(T[C].src==$)return T[C]}return null}},isActive:function($,T,C){for(var D="no-"+T;$;){var M=$.classList;if(M.contains(T))return!0;if(M.contains(D))return!1;$=$.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,T){var C=r.util.clone(r.languages[$]);for(var D in T)C[D]=T[D];return C},insertBefore:function($,T,C,D){D=D||r.languages;var M=D[$],O={};for(var I in M)if(M.hasOwnProperty(I)){if(I==T)for(var L in C)C.hasOwnProperty(L)&&(O[L]=C[L]);C.hasOwnProperty(I)||(O[I]=M[I])}var F=D[$];return D[$]=O,r.languages.DFS(r.languages,function(R,N){N===F&&R!=$&&(this[R]=O)}),O},DFS:function $(T,C,D,M){M=M||{};var O=r.util.objId;for(var I in T)if(T.hasOwnProperty(I)){C.call(T,I,T[I],D||I);var L=T[I],F=r.util.type(L);F==="Object"&&!M[O(L)]?(M[O(L)]=!0,$(L,C,null,M)):F==="Array"&&!M[O(L)]&&(M[O(L)]=!0,$(L,C,I,M))}}},plugins:{},highlightAll:function($,T){r.highlightAllUnder(document,$,T)},highlightAllUnder:function($,T,C){var D={callback:C,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",D),D.elements=Array.prototype.slice.apply(D.container.querySelectorAll(D.selector)),r.hooks.run("before-all-elements-highlight",D);for(var M=0,O;O=D.elements[M++];)r.highlightElement(O,T===!0,D.callback)},highlightElement:function($,T,C){var D=r.util.getLanguage($),M=r.languages[D];r.util.setLanguage($,D);var O=$.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,D);var I=$.textContent,L={element:$,language:D,grammar:M,code:I};function F(N){L.highlightedCode=N,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),C&&C.call(L.element)}if(r.hooks.run("before-sanity-check",L),O=L.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),C&&C.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){F(r.util.encode(L.code));return}if(T&&i.Worker){var R=new Worker(r.filename);R.onmessage=function(N){F(N.data)},R.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else F(r.highlight(L.code,L.grammar,L.language))},highlight:function($,T,C){var D={code:$,grammar:T,language:C};if(r.hooks.run("before-tokenize",D),!D.grammar)throw new Error('The language "'+D.language+'" has no grammar.');return D.tokens=r.tokenize(D.code,D.grammar),r.hooks.run("after-tokenize",D),a.stringify(r.util.encode(D.tokens),D.language)},tokenize:function($,T){var C=T.rest;if(C){for(var D in C)T[D]=C[D];delete T.rest}var M=new d;return p(M,M.head,$),f($,M,T,M.head,0),_(M)},hooks:{all:{},add:function($,T){var C=r.hooks.all;C[$]=C[$]||[],C[$].push(T)},run:function($,T){var C=r.hooks.all[$];if(!(!C||!C.length))for(var D=0,M;M=C[D++];)M(T)}},Token:a};i.Prism=r;function a($,T,C,D){this.type=$,this.content=T,this.alias=C,this.length=(D||"").length|0}a.stringify=function $(T,C){if(typeof T=="string")return T;if(Array.isArray(T)){var D="";return T.forEach(function(F){D+=$(F,C)}),D}var M={type:T.type,content:$(T.content,C),tag:"span",classes:["token",T.type],attributes:{},language:C},O=T.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(M.classes,O):M.classes.push(O)),r.hooks.run("wrap",M);var I="";for(var L in M.attributes)I+=" "+L+'="'+(M.attributes[L]||"").replace(/"/g,""")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+I+">"+M.content+""};function u($,T,C,D){$.lastIndex=T;var M=$.exec(C);if(M&&D&&M[1]){var O=M[1].length;M.index+=O,M[0]=M[0].slice(O)}return M}function f($,T,C,D,M,O){for(var I in C)if(!(!C.hasOwnProperty(I)||!C[I])){var L=C[I];L=Array.isArray(L)?L:[L];for(var F=0;F=O.reach);X+=ie.value.length,ie=ie.next){var fe=ie.value;if(T.length>$.length)return;if(!(fe instanceof a)){var G=1,ce;if(Y){if(ce=u(ee,X,$,q),!ce||ce.index>=$.length)break;var He=ce.index,ge=ce.index+ce[0].length,Me=X;for(Me+=ie.value.length;He>=Me;)ie=ie.next,Me+=ie.value.length;if(Me-=ie.value.length,X=Me,ie.value instanceof a)continue;for(var qe=ie;qe!==T.tail&&(MeO.reach&&(O.reach=mt);var Ze=ie.prev;Ce&&(Ze=p(T,Ze,Ce),X+=Ce.length),m(T,Ze,G);var We=new a(I,N?r.tokenize(we,N):we,B,we);if(ie=p(T,Ze,We),Je&&p(T,ie,Je),G>1){var te={cause:I+","+F,reach:mt};f($,T,C,ie.prev,X,te),O&&te.reach>O.reach&&(O.reach=te.reach)}}}}}}function d(){var $={value:null,prev:null,next:null},T={value:null,prev:$,next:null};$.next=T,this.head=$,this.tail=T,this.length=0}function p($,T,C){var D=T.next,M={value:C,prev:T,next:D};return T.next=M,D.prev=M,$.length++,M}function m($,T,C){for(var D=T.next,M=0;M/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading…",s=function(g,b){return"✖ Error "+g+" while fetching file: "+b},l="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",d="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function p(g,b,k){var $=new XMLHttpRequest;$.open("GET",g,!0),$.onreadystatechange=function(){$.readyState==4&&($.status<400&&$.responseText?b($.responseText):$.status>=400?k(s($.status,$.statusText)):k(l))},$.send(null)}function m(g){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g||"");if(b){var k=Number(b[1]),$=b[2],T=b[3];return $?T?[k,Number(T)]:[k,void 0]:[k,k]}}t.hooks.add("before-highlightall",function(g){g.selector+=", "+d}),t.hooks.add("before-sanity-check",function(g){var b=g.element;if(b.matches(d)){g.code="",b.setAttribute(r,a);var k=b.appendChild(document.createElement("CODE"));k.textContent=i;var $=b.getAttribute("data-src"),T=g.language;if(T==="none"){var C=(/\.(\w+)$/.exec($)||[,"none"])[1];T=o[C]||C}t.util.setLanguage(k,T),t.util.setLanguage(b,T);var D=t.plugins.autoloader;D&&D.loadLanguages(T),p($,function(M){b.setAttribute(r,u);var O=m(b.getAttribute("data-range"));if(O){var I=M.split(/\r\n?|\n/g),L=O[0],F=O[1]==null?I.length:O[1];L<0&&(L+=I.length),L=Math.max(0,Math.min(L-1,I.length)),F<0&&(F+=I.length),F=Math.max(0,Math.min(F,I.length)),M=I.slice(L,F).join(` -`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(L+1))}k.textContent=M,t.highlightElement(k)},function(M){b.setAttribute(r,f),k.textContent=M})}}),t.plugins.fileHighlight={highlight:function(b){for(var k=(b||document).querySelectorAll(d),$=0,T;T=k[$++];)t.highlightElement(T)}};var _=!1;t.fileHighlight=function(){_||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),_=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(HS);const Xs=ma;var $c={},zS={get exports(){return $c},set exports(n){$c=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;ar&&(f[p]=` `+f[p],d=m)}a[u]=f.join("")}return a.join(` -`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var d=JSON.parse(a.getAttribute("data-"+u)||"true");typeof d===f&&(o.settings[u]=d)}catch{}}for(var p=a.childNodes,m="",_="",g=!1,b=0;b>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function BS(n){let e,t,i;return{c(){e=y("div"),t=y("code"),h(t,"class","svelte-10s5tkd"),h(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),v(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&h(e,"class",i)},i:Q,o:Q,d(s){s&&w(e)}}}function US(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Xs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Xs.highlight(a,Xs.languages[l]||Xs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Xs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class x1 extends ve{constructor(e){super(),be(this,e,US,BS,_e,{class:0,content:2,language:3})}}const WS=n=>({}),Tc=n=>({}),YS=n=>({}),Cc=n=>({});function Mc(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T=n[4]&&!n[2]&&Oc(n);const C=n[19].header,D=Tt(C,n,n[18],Cc);let M=n[4]&&n[2]&&Dc(n);const O=n[19].default,I=Tt(O,n,n[18],null),L=n[19].footer,F=Tt(L,n,n[18],Tc);return{c(){e=y("div"),t=y("div"),s=E(),l=y("div"),o=y("div"),T&&T.c(),r=E(),D&&D.c(),a=E(),M&&M.c(),u=E(),f=y("div"),I&&I.c(),d=E(),p=y("div"),F&&F.c(),h(t,"class","overlay"),h(o,"class","overlay-panel-section panel-header"),h(f,"class","overlay-panel-section panel-content"),h(p,"class","overlay-panel-section panel-footer"),h(l,"class",m="overlay-panel "+n[1]+" "+n[8]),x(l,"popup",n[2]),h(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(R,N){S(R,e,N),v(e,t),v(e,s),v(e,l),v(l,o),T&&T.m(o,null),v(o,r),D&&D.m(o,null),v(o,a),M&&M.m(o,null),v(l,u),v(l,f),I&&I.m(f,null),n[21](f),v(l,d),v(l,p),F&&F.m(p,null),b=!0,k||($=[J(t,"click",ft(n[20])),J(f,"scroll",n[22])],k=!0)},p(R,N){n=R,n[4]&&!n[2]?T?T.p(n,N):(T=Oc(n),T.c(),T.m(o,r)):T&&(T.d(1),T=null),D&&D.p&&(!b||N[0]&262144)&&Mt(D,C,n,n[18],b?Ct(C,n[18],N,YS):Ot(n[18]),Cc),n[4]&&n[2]?M?M.p(n,N):(M=Dc(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),I&&I.p&&(!b||N[0]&262144)&&Mt(I,O,n,n[18],b?Ct(O,n[18],N,null):Ot(n[18]),null),F&&F.p&&(!b||N[0]&262144)&&Mt(F,L,n,n[18],b?Ct(L,n[18],N,WS):Ot(n[18]),Tc),(!b||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&h(l,"class",m),(!b||N[0]&262)&&x(l,"popup",n[2]),(!b||N[0]&4)&&x(e,"padded",n[2]),(!b||N[0]&1)&&x(e,"active",n[0])},i(R){b||(R&&nt(()=>{b&&(i||(i=Ve(t,yo,{duration:bs,opacity:0},!0)),i.run(1))}),A(D,R),A(I,R),A(F,R),nt(()=>{b&&(g&&g.end(1),_=Lb(l,ii,n[2]?{duration:bs,y:-10}:{duration:bs,x:50}),_.start())}),b=!0)},o(R){R&&(i||(i=Ve(t,yo,{duration:bs,opacity:0},!1)),i.run(0)),P(D,R),P(I,R),P(F,R),_&&_.invalidate(),g=Nb(l,ii,n[2]?{duration:bs,y:10}:{duration:bs,x:50}),b=!1},d(R){R&&w(e),R&&i&&i.end(),T&&T.d(),D&&D.d(R),M&&M.d(),I&&I.d(R),n[21](null),F&&F.d(R),R&&g&&g.end(),k=!1,De($)}}}function Oc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=J(e,"click",ft(n[5])),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Dc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){S(s,e,l),t||(i=J(e,"click",ft(n[5])),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function KS(n){let e,t,i,s,l=n[0]&&Mc(n);return{c(){e=y("div"),l&&l.c(),h(e,"class","overlay-panel-wrapper"),h(e,"tabindex","-1")},m(o,r){S(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[J(window,"resize",n[10]),J(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&A(l,1)):(l=Mc(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[23](null),i=!1,De(s)}}}let Ki,Mr=[];function eb(){return Ki=Ki||document.querySelector(".overlays"),Ki||(Ki=document.createElement("div"),Ki.classList.add("overlays"),document.body.appendChild(Ki)),Ki}let bs=150;function Ec(){return 1e3+eb().querySelectorAll(".overlay-panel-container.active").length}function JS(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:d=void 0}=e,{beforeHide:p=void 0}=e;const m=kt(),_="op_"+j.randomString(10);let g,b,k,$,T="",C=o;function D(){typeof d=="function"&&d()===!1||t(0,o=!0)}function M(){typeof p=="function"&&p()===!1||t(0,o=!1)}function O(){return o}async function I(X){t(17,C=X),X?(k=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout($),m("hide"),k==null||k.focus()),await ln(),L()}function L(){g&&(o?t(6,g.style.zIndex=Ec(),g):t(6,g.style="",g))}function F(){j.pushUnique(Mr,_),document.body.classList.add("overlay-active")}function R(){j.removeByValue(Mr,_),Mr.length||document.body.classList.remove("overlay-active")}function N(X){o&&f&&X.code=="Escape"&&!j.isInput(X.target)&&g&&g.style.zIndex==Ec()&&(X.preventDefault(),M())}function q(X){o&&Y(b)}function Y(X,fe){fe&&t(8,T=""),X&&($||($=setTimeout(()=>{if(clearTimeout($),$=null,!X)return;if(X.scrollHeight-X.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}X.scrollTop==0?t(8,T+=" scroll-top-reached"):X.scrollTop+X.offsetHeight==X.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100)))}xt(()=>(eb().appendChild(g),()=>{var X;clearTimeout($),R(),(X=g==null?void 0:g.classList)==null||X.add("hidden"),setTimeout(()=>{g==null||g.remove()},0)}));const B=()=>a?M():!0;function Z(X){se[X?"unshift":"push"](()=>{b=X,t(7,b)})}const ee=X=>Y(X.target);function ie(X){se[X?"unshift":"push"](()=>{g=X,t(6,g)})}return n.$$set=X=>{"class"in X&&t(1,l=X.class),"active"in X&&t(0,o=X.active),"popup"in X&&t(2,r=X.popup),"overlayClose"in X&&t(3,a=X.overlayClose),"btnClose"in X&&t(4,u=X.btnClose),"escClose"in X&&t(12,f=X.escClose),"beforeOpen"in X&&t(13,d=X.beforeOpen),"beforeHide"in X&&t(14,p=X.beforeHide),"$$scope"in X&&t(18,s=X.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&C!=o&&I(o),n.$$.dirty[0]&128&&Y(b,!0),n.$$.dirty[0]&64&&g&&L(),n.$$.dirty[0]&1&&(o?F():R())},[o,l,r,a,u,M,g,b,T,N,q,Y,f,d,p,D,O,C,s,i,B,Z,ee,ie]}class pn extends ve{constructor(e){super(),be(this,e,JS,KS,_e,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function ZS(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function GS(n){let e,t=n[2].referer+"",i,s;return{c(){e=y("a"),i=U(t),h(e,"href",s=n[2].referer),h(e,"target","_blank"),h(e,"rel","noopener noreferrer")},m(l,o){S(l,e,o),v(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&le(i,t),o&4&&s!==(s=l[2].referer)&&h(e,"href",s)},d(l){l&&w(e)}}}function XS(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function QS(n){let e,t,i;return t=new x1({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","block")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&4&&(o.content=JSON.stringify(s[2].meta,null,2)),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function xS(n){var Ie;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,d,p,m,_,g=n[2].status+"",b,k,$,T,C,D,M=((Ie=n[2].method)==null?void 0:Ie.toUpperCase())+"",O,I,L,F,R,N,q=n[2].auth+"",Y,B,Z,ee,ie,X,fe=n[2].url+"",G,ce,ge,Me,qe,He,we,Ce,Je,mt,Ze,We=n[2].remoteIp+"",te,Fe,Qe,Gt,Le,$e,et=n[2].userIp+"",Dt,Ft,jt,ye,je,gt,Ge=n[2].userAgent+"",mn,vi,yi,as,Fl,ji,us,hn,tt,fs,oi,cs,Vi,Hi,Xt,on;function Rl(Pe,Oe){return Pe[2].referer?GS:ZS}let W=Rl(n),K=W(n);const ne=[QS,XS],oe=[];function Te(Pe,Oe){return Oe&4&&(us=null),us==null&&(us=!j.isEmpty(Pe[2].meta)),us?0:1}return hn=Te(n,-1),tt=oe[hn]=ne[hn](n),Xt=new hi({props:{date:n[2].created}}),{c(){e=y("table"),t=y("tbody"),i=y("tr"),s=y("td"),s.textContent="ID",l=E(),o=y("td"),a=U(r),u=E(),f=y("tr"),d=y("td"),d.textContent="Status",p=E(),m=y("td"),_=y("span"),b=U(g),k=E(),$=y("tr"),T=y("td"),T.textContent="Method",C=E(),D=y("td"),O=U(M),I=E(),L=y("tr"),F=y("td"),F.textContent="Auth",R=E(),N=y("td"),Y=U(q),B=E(),Z=y("tr"),ee=y("td"),ee.textContent="URL",ie=E(),X=y("td"),G=U(fe),ce=E(),ge=y("tr"),Me=y("td"),Me.textContent="Referer",qe=E(),He=y("td"),K.c(),we=E(),Ce=y("tr"),Je=y("td"),Je.textContent="Remote IP",mt=E(),Ze=y("td"),te=U(We),Fe=E(),Qe=y("tr"),Gt=y("td"),Gt.textContent="User IP",Le=E(),$e=y("td"),Dt=U(et),Ft=E(),jt=y("tr"),ye=y("td"),ye.textContent="UserAgent",je=E(),gt=y("td"),mn=U(Ge),vi=E(),yi=y("tr"),as=y("td"),as.textContent="Meta",Fl=E(),ji=y("td"),tt.c(),fs=E(),oi=y("tr"),cs=y("td"),cs.textContent="Created",Vi=E(),Hi=y("td"),z(Xt.$$.fragment),h(s,"class","min-width txt-hint txt-bold"),h(d,"class","min-width txt-hint txt-bold"),h(_,"class","label"),x(_,"label-danger",n[2].status>=400),h(T,"class","min-width txt-hint txt-bold"),h(F,"class","min-width txt-hint txt-bold"),h(ee,"class","min-width txt-hint txt-bold"),h(Me,"class","min-width txt-hint txt-bold"),h(Je,"class","min-width txt-hint txt-bold"),h(Gt,"class","min-width txt-hint txt-bold"),h(ye,"class","min-width txt-hint txt-bold"),h(as,"class","min-width txt-hint txt-bold"),h(cs,"class","min-width txt-hint txt-bold"),h(e,"class","table-border")},m(Pe,Oe){S(Pe,e,Oe),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(o,a),v(t,u),v(t,f),v(f,d),v(f,p),v(f,m),v(m,_),v(_,b),v(t,k),v(t,$),v($,T),v($,C),v($,D),v(D,O),v(t,I),v(t,L),v(L,F),v(L,R),v(L,N),v(N,Y),v(t,B),v(t,Z),v(Z,ee),v(Z,ie),v(Z,X),v(X,G),v(t,ce),v(t,ge),v(ge,Me),v(ge,qe),v(ge,He),K.m(He,null),v(t,we),v(t,Ce),v(Ce,Je),v(Ce,mt),v(Ce,Ze),v(Ze,te),v(t,Fe),v(t,Qe),v(Qe,Gt),v(Qe,Le),v(Qe,$e),v($e,Dt),v(t,Ft),v(t,jt),v(jt,ye),v(jt,je),v(jt,gt),v(gt,mn),v(t,vi),v(t,yi),v(yi,as),v(yi,Fl),v(yi,ji),oe[hn].m(ji,null),v(t,fs),v(t,oi),v(oi,cs),v(oi,Vi),v(oi,Hi),V(Xt,Hi,null),on=!0},p(Pe,Oe){var Be;(!on||Oe&4)&&r!==(r=Pe[2].id+"")&&le(a,r),(!on||Oe&4)&&g!==(g=Pe[2].status+"")&&le(b,g),(!on||Oe&4)&&x(_,"label-danger",Pe[2].status>=400),(!on||Oe&4)&&M!==(M=((Be=Pe[2].method)==null?void 0:Be.toUpperCase())+"")&&le(O,M),(!on||Oe&4)&&q!==(q=Pe[2].auth+"")&&le(Y,q),(!on||Oe&4)&&fe!==(fe=Pe[2].url+"")&&le(G,fe),W===(W=Rl(Pe))&&K?K.p(Pe,Oe):(K.d(1),K=W(Pe),K&&(K.c(),K.m(He,null))),(!on||Oe&4)&&We!==(We=Pe[2].remoteIp+"")&&le(te,We),(!on||Oe&4)&&et!==(et=Pe[2].userIp+"")&&le(Dt,et),(!on||Oe&4)&&Ge!==(Ge=Pe[2].userAgent+"")&&le(mn,Ge);let Ye=hn;hn=Te(Pe,Oe),hn===Ye?oe[hn].p(Pe,Oe):(re(),P(oe[Ye],1,1,()=>{oe[Ye]=null}),ae(),tt=oe[hn],tt?tt.p(Pe,Oe):(tt=oe[hn]=ne[hn](Pe),tt.c()),A(tt,1),tt.m(ji,null));const Ne={};Oe&4&&(Ne.date=Pe[2].created),Xt.$set(Ne)},i(Pe){on||(A(tt),A(Xt.$$.fragment,Pe),on=!0)},o(Pe){P(tt),P(Xt.$$.fragment,Pe),on=!1},d(Pe){Pe&&w(e),K.d(),oe[hn].d(),H(Xt)}}}function e$(n){let e;return{c(){e=y("h4"),e.textContent="Request log"},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function t$(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Close',h(e,"type","button"),h(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[4]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function n$(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[t$],header:[e$],default:[xS]},$$scope:{ctx:n}};return e=new pn({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),H(e,s)}}}function i$(n,e,t){let i,s=new Br;function l(d){return t(2,s=d),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(d){se[d?"unshift":"push"](()=>{i=d,t(1,i)})}function u(d){pe.call(this,n,d)}function f(d){pe.call(this,n,d)}return[o,i,s,l,r,a,u,f]}class s$ extends ve{constructor(e){super(),be(this,e,i$,n$,_e,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function l$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Include requests by admins"),h(e,"type","checkbox"),h(e,"id",t=n[14]),h(s,"for",o=n[14])},m(u,f){S(u,e,f),e.checked=n[1],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[10]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&h(e,"id",t),f&2&&(e.checked=u[1]),f&16384&&o!==(o=u[14])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Ac(n){let e,t;return e=new VS({props:{filter:n[4],presets:n[5]}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Ic(n){let e,t;return e=new l2({props:{filter:n[4],presets:n[5]}}),e.$on("select",n[12]),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function o$(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$=n[3],T,C=n[3],D,M;r=new Pa({}),r.$on("refresh",n[9]),p=new de({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[l$,({uniqueId:L})=>({14:L}),({uniqueId:L})=>L?16384:0]},$$scope:{ctx:n}}}),_=new Ko({props:{value:n[0],placeholder:"Search term or filter like status >= 400",extraAutocompleteKeys:n[7]}}),_.$on("submit",n[11]);let O=Ac(n),I=Ic(n);return{c(){e=y("div"),t=y("header"),i=y("nav"),s=y("div"),l=U(n[6]),o=E(),z(r.$$.fragment),a=E(),u=y("div"),f=E(),d=y("div"),z(p.$$.fragment),m=E(),z(_.$$.fragment),g=E(),b=y("div"),k=E(),O.c(),T=E(),I.c(),D=Se(),h(s,"class","breadcrumb-item"),h(i,"class","breadcrumbs"),h(u,"class","flex-fill"),h(d,"class","inline-flex"),h(t,"class","page-header"),h(b,"class","clearfix m-b-base"),h(e,"class","page-header-wrapper m-b-0")},m(L,F){S(L,e,F),v(e,t),v(t,i),v(i,s),v(s,l),v(t,o),V(r,t,null),v(t,a),v(t,u),v(t,f),v(t,d),V(p,d,null),v(e,m),V(_,e,null),v(e,g),v(e,b),v(e,k),O.m(e,null),S(L,T,F),I.m(L,F),S(L,D,F),M=!0},p(L,F){(!M||F&64)&&le(l,L[6]);const R={};F&49154&&(R.$$scope={dirty:F,ctx:L}),p.$set(R);const N={};F&1&&(N.value=L[0]),_.$set(N),F&8&&_e($,$=L[3])?(re(),P(O,1,1,Q),ae(),O=Ac(L),O.c(),A(O,1),O.m(e,null)):O.p(L,F),F&8&&_e(C,C=L[3])?(re(),P(I,1,1,Q),ae(),I=Ic(L),I.c(),A(I,1),I.m(D.parentNode,D)):I.p(L,F)},i(L){M||(A(r.$$.fragment,L),A(p.$$.fragment,L),A(_.$$.fragment,L),A(O),A(I),M=!0)},o(L){P(r.$$.fragment,L),P(p.$$.fragment,L),P(_.$$.fragment,L),P(O),P(I),M=!1},d(L){L&&w(e),H(r),H(p),H(_),O.d(L),L&&w(T),L&&w(D),I.d(L)}}}function r$(n){let e,t,i,s;e=new In({props:{$$slots:{default:[o$]},$$scope:{ctx:n}}});let l={};return i=new s$({props:l}),n[13](i),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){V(e,o,r),S(o,t,r),V(i,o,r),s=!0},p(o,[r]){const a={};r&32895&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){H(e,o),o&&w(t),n[13](null),H(i,o)}}}const Pc="includeAdminLogs";function a$(n,e,t){var k;let i,s,l;Ke(n,Lt,$=>t(6,l=$));const o=["method","url","remoteIp","userIp","referer","status","auth","userAgent","created"];sn(Lt,l="Request logs",l);let r,a="",u=((k=window.localStorage)==null?void 0:k.getItem(Pc))<<0,f=1;function d(){t(3,f++,f)}const p=()=>d();function m(){u=this.checked,t(1,u)}const _=$=>t(0,a=$.detail),g=$=>r==null?void 0:r.show($==null?void 0:$.detail);function b($){se[$?"unshift":"push"](()=>{r=$,t(2,r)})}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=u?"":'auth!="admin"'),n.$$.dirty&2&&typeof u<"u"&&window.localStorage&&window.localStorage.setItem(Pc,u<<0),n.$$.dirty&1&&t(4,s=j.normalizeSearchFilter(a,o))},[a,u,r,f,s,i,l,o,d,p,m,_,g,b]}class u$ extends ve{constructor(e){super(),be(this,e,a$,r$,_e,{})}}const si=An([]),_i=An({}),No=An(!1),tb=An({});function f$(n){si.update(e=>{const t=j.findByKey(e,"id",n);return t?_i.set(t):e.length&&_i.set(e[0]),e})}function c$(n){_i.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),si.update(e=>(j.pushOrReplaceByKey(e,n,"id"),iu(),j.sortCollections(e)))}function d$(n){si.update(e=>(j.removeByKey(e,"id",n.id),_i.update(t=>t.id===n.id?e[0]:t),iu(),e))}async function p$(n=null){No.set(!0);try{let e=await me.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),si.set(e);const t=n&&j.findByKey(e,"id",n);t?_i.set(t):e.length&&_i.set(e[0]),iu()}catch(e){me.errorResponseHandler(e)}No.set(!1)}function iu(){tb.update(n=>(si.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.private)}));return e}),n))}const su=An({});function vn(n,e,t){su.set({text:n,yesCallback:e,noCallback:t})}function nb(){su.set({})}function Lc(n){let e,t,i;const s=n[17].default,l=Tt(s,n,n[16],null);return{c(){e=y("div"),l&&l.c(),h(e,"class",n[1]),x(e,"active",n[0])},m(o,r){S(o,e,r),l&&l.m(e,null),n[18](e),i=!0},p(o,r){l&&l.p&&(!i||r&65536)&&Mt(l,s,o,o[16],i?Ct(s,o[16],r,null):Ot(o[16]),null),(!i||r&2)&&h(e,"class",o[1]),(!i||r&3)&&x(e,"active",o[0])},i(o){i||(A(l,o),o&&nt(()=>{i&&(t||(t=Ve(e,ii,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=Ve(e,ii,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),n[18](null),o&&t&&t.end()}}}function m$(n){let e,t,i,s,l=n[0]&&Lc(n);return{c(){e=y("div"),l&&l.c(),h(e,"class","toggler-container")},m(o,r){S(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[J(window,"mousedown",n[5]),J(window,"click",n[6]),J(window,"keydown",n[4]),J(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=Lc(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[19](null),i=!1,De(s)}}}function h$(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,d,p,m,_,g=!1;const b=kt();function k(){t(0,o=!1),g=!1,clearTimeout(_)}function $(){t(0,o=!0),clearTimeout(_),_=setTimeout(()=>{a&&(p!=null&&p.scrollIntoViewIfNeeded?p==null||p.scrollIntoViewIfNeeded():p!=null&&p.scrollIntoView&&(p==null||p.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function T(){o?k():$()}function C(B){return!d||B.classList.contains(u)||(m==null?void 0:m.contains(B))&&!d.contains(B)||d.contains(B)&&B.closest&&B.closest("."+u)}function D(B){(!o||C(B.target))&&(B.preventDefault(),B.stopPropagation(),T())}function M(B){(B.code==="Enter"||B.code==="Space")&&(!o||C(B.target))&&(B.preventDefault(),B.stopPropagation(),T())}function O(B){o&&r&&B.code==="Escape"&&(B.preventDefault(),k())}function I(B){o&&!(d!=null&&d.contains(B.target))?g=!0:g&&(g=!1)}function L(B){var Z;o&&g&&!(d!=null&&d.contains(B.target))&&!(m!=null&&m.contains(B.target))&&!((Z=B.target)!=null&&Z.closest(".flatpickr-calendar"))&&k()}function F(B){I(B),L(B)}function R(B){N(),t(15,m=B||(d==null?void 0:d.parentNode)),m&&(d==null||d.addEventListener("click",D),m.addEventListener("click",D),m.addEventListener("keydown",M))}function N(){clearTimeout(_),m&&(d==null||d.removeEventListener("click",D),m.removeEventListener("click",D),m.removeEventListener("keydown",M))}xt(()=>(R(),()=>N()));function q(B){se[B?"unshift":"push"](()=>{p=B,t(3,p)})}function Y(B){se[B?"unshift":"push"](()=>{d=B,t(2,d)})}return n.$$set=B=>{"trigger"in B&&t(8,l=B.trigger),"active"in B&&t(0,o=B.active),"escClose"in B&&t(9,r=B.escClose),"autoScroll"in B&&t(10,a=B.autoScroll),"closableClass"in B&&t(11,u=B.closableClass),"class"in B&&t(1,f=B.class),"$$scope"in B&&t(16,s=B.$$scope)},n.$$.update=()=>{var B,Z;n.$$.dirty&260&&d&&R(l),n.$$.dirty&32769&&(o?((B=m==null?void 0:m.classList)==null||B.add("active"),b("show")):((Z=m==null?void 0:m.classList)==null||Z.remove("active"),b("hide")))},[o,f,d,p,O,I,L,F,l,r,a,u,k,$,T,m,s,i,q,Y]}class Bn extends ve{constructor(e){super(),be(this,e,h$,m$,_e,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function Nc(n,e,t){const i=n.slice();return i[27]=e[t],i}function _$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("input"),s=E(),l=y("label"),o=U("Unique"),h(e,"type","checkbox"),h(e,"id",t=n[30]),e.checked=i=n[3].unique,h(l,"for",r=n[30])},m(f,d){S(f,e,d),S(f,s,d),S(f,l,d),v(l,o),a||(u=J(e,"change",n[19]),a=!0)},p(f,d){d[0]&1073741824&&t!==(t=f[30])&&h(e,"id",t),d[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),d[0]&1073741824&&r!==(r=f[30])&&h(l,"for",r)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function g$(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a){var f;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){var d;const f={};if(u[0]&1073741824&&(f.id=a[30]),u[0]&1&&(f.placeholder=`eg. CREATE INDEX idx_test on ${(d=a[0])==null?void 0:d.name} (created)`),!t&&u[0]&4&&(t=!0,f.value=a[2],ke(()=>t=!1)),u[0]&128&&o!==(o=a[7])){if(e){re();const p=e;P(p.$$.fragment,1,0,()=>{H(p,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function b$(n){let e;return{c(){e=y("textarea"),e.disabled=!0,h(e,"rows","7"),h(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function v$(n){let e,t,i,s;const l=[b$,g$],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},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()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function Fc(n){let e,t,i,s=n[10],l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[v$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Fc(n);return{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),r&&r.c(),l=Se()},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),r&&r.m(a,u),S(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const d={};u[0]&64&&(d.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(d.$$scope={dirty:u,ctx:a}),i.$set(d),a[10].length>0?r?r.p(a,u):(r=Fc(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),r&&r.d(a),a&&w(l)}}}function k$(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=y("h4"),i=U(t),s=U(" index")},m(l,o){S(l,e,o),v(e,i),v(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&le(i,t)},d(l){l&&w(e)}}}function qc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){S(s,e,l),t||(i=[Ee(Ue.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:Q,d(s){s&&w(e),t=!1,De(i)}}}function w$(n){let e,t,i,s,l,o,r=n[5]!=""&&qc(n);return{c(){r&&r.c(),e=E(),t=y("button"),t.innerHTML='Cancel',i=E(),s=y("button"),s.innerHTML='Set index',h(t,"type","button"),h(t,"class","btn btn-transparent"),h(s,"type","button"),h(s,"class","btn"),x(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),l||(o=[J(t,"click",n[17]),J(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=qc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&x(s,"btn-disabled",a[9].length<=0)},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&w(i),a&&w(s),l=!1,De(o)}}}function S$(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[w$],header:[k$],default:[y$]},$$scope:{ctx:n}};for(let l=0;lie.name==B);ee?j.removeByValue(Z.columns,ee):j.pushUnique(Z.columns,{name:B}),t(2,p=j.buildIndex(Z))}xt(async()=>{t(8,g=!0);try{t(7,_=(await rt(()=>import("./CodeEditor-55647829.js"),["./CodeEditor-55647829.js","./index-6f704b4c.js"],import.meta.url)).default)}catch(B){console.warn(B)}t(8,g=!1)});const M=()=>T(),O=()=>k(),I=()=>C(),L=B=>{t(3,s.unique=B.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,p=j.buildIndex(s))};function F(B){p=B,t(2,p)}const R=B=>D(B);function N(B){se[B?"unshift":"push"](()=>{f=B,t(4,f)})}function q(B){pe.call(this,n,B)}function Y(B){pe.call(this,n,B)}return n.$$set=B=>{e=Re(Re({},e),Yt(B)),t(14,r=Xe(e,o)),"collection"in B&&t(0,u=B.collection)},n.$$.update=()=>{var B,Z,ee;n.$$.dirty[0]&1&&t(10,i=(((Z=(B=u==null?void 0:u.schema)==null?void 0:B.filter(ie=>!ie.toDelete))==null?void 0:Z.map(ie=>ie.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,s=j.parseIndex(p)),n.$$.dirty[0]&8&&t(9,l=((ee=s.columns)==null?void 0:ee.map(ie=>ie.name))||[])},[u,k,p,s,f,d,m,_,g,l,i,T,C,D,r,b,M,O,I,L,F,R,N,q,Y]}class T$ extends ve{constructor(e){super(),be(this,e,$$,S$,_e,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function jc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=j.parseIndex(i[10]);return i[11]=s,i}function Vc(n){let e;return{c(){e=y("strong"),e.textContent="Unique:"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Hc(n){var p;let e,t,i,s=((p=n[11].columns)==null?void 0:p.map(zc).join(", "))+"",l,o,r,a,u,f=n[11].unique&&Vc();function d(){return n[4](n[10],n[13])}return{c(){var m,_;e=y("button"),f&&f.c(),t=E(),i=y("span"),l=U(s),h(i,"class","txt"),h(e,"type","button"),h(e,"class",o="label link-primary "+((_=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&_.message?"label-danger":"")+" svelte-167lbwu")},m(m,_){var g,b;S(m,e,_),f&&f.m(e,null),v(e,t),v(e,i),v(i,l),a||(u=[Ee(r=Ue.call(null,e,((b=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:b.message)||"")),J(e,"click",d)],a=!0)},p(m,_){var g,b,k,$,T;n=m,n[11].unique?f||(f=Vc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),_&1&&s!==(s=((g=n[11].columns)==null?void 0:g.map(zc).join(", "))+"")&&le(l,s),_&4&&o!==(o="label link-primary "+((k=(b=n[2].indexes)==null?void 0:b[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&h(e,"class",o),r&&Ut(r.update)&&_&4&&r.update.call(null,((T=($=n[2].indexes)==null?void 0:$[n[13]])==null?void 0:T.message)||"")},d(m){m&&w(e),f&&f.d(),a=!1,De(u)}}}function C$(n){var C,D,M;let e,t,i=(((D=(C=n[0])==null?void 0:C.indexes)==null?void 0:D.length)||0)+"",s,l,o,r,a,u,f,d,p,m,_,g,b=((M=n[0])==null?void 0:M.indexes)||[],k=[];for(let O=0;Ohe(d,"collection",$)),d.$on("remove",n[8]),d.$on("submit",n[9]),{c(){e=y("div"),t=U("Unique constraints and indexes ("),s=U(i),l=U(")"),o=E(),r=y("div");for(let O=0;O+ - New index`,f=E(),z(d.$$.fragment),h(e,"class","section-title"),h(u,"type","button"),h(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),h(r,"class","indexes-list svelte-167lbwu")},m(O,I){S(O,e,I),v(e,t),v(e,s),v(e,l),S(O,o,I),S(O,r,I);for(let L=0;Lp=!1)),d.$set(L)},i(O){m||(A(d.$$.fragment,O),m=!0)},o(O){P(d.$$.fragment,O),m=!1},d(O){O&&w(e),O&&w(o),O&&w(r),dt(k,O),O&&w(f),n[6](null),H(d,O),_=!1,g()}}}const zc=n=>n.name;function M$(n,e,t){let i;Ke(n,gi,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let g=0;gl==null?void 0:l.show(m,_),a=()=>l==null?void 0:l.show();function u(m){se[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const d=m=>{for(let _=0;_{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,u,f,d,p]}class O$ extends ve{constructor(e){super(),be(this,e,M$,C$,_e,{collection:0})}}function Bc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Uc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function d(...p){return n[5](n[6],...p)}return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),o=U(l),r=E(),h(t,"class","icon "+n[6].icon+" svelte-1p626x7"),h(s,"class","txt"),h(e,"tabindex","0"),h(e,"class","dropdown-item closable svelte-1p626x7")},m(p,m){S(p,e,m),v(e,t),v(e,i),v(e,s),v(s,o),v(e,r),a||(u=[J(e,"click",En(f)),J(e,"keydown",En(d))],a=!0)},p(p,m){n=p},d(p){p&&w(e),a=!1,De(u)}}}function D$(n){let e,t=n[2],i=[];for(let s=0;s{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$set=u=>{"class"in u&&t(0,i=u.class)},[i,s,l,o,r,a]}class I$ extends ve{constructor(e){super(),be(this,e,A$,E$,_e,{class:0})}}const P$=n=>({interactive:n&128,hasErrors:n&64}),Wc=n=>({interactive:n[7],hasErrors:n[6]}),L$=n=>({interactive:n&128,hasErrors:n&64}),Yc=n=>({interactive:n[7],hasErrors:n[6]}),N$=n=>({interactive:n&128,hasErrors:n&64}),Kc=n=>({interactive:n[7],hasErrors:n[6]}),F$=n=>({interactive:n&128,hasErrors:n&64}),Jc=n=>({interactive:n[7],hasErrors:n[6]});function Zc(n){let e;return{c(){e=y("div"),e.innerHTML='',h(e,"class","drag-handle-wrapper"),h(e,"draggable","true"),h(e,"aria-label","Sort")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Gc(n){let e,t,i,s;return{c(){e=y("span"),h(e,"class","marker marker-required")},m(l,o){S(l,e,o),i||(s=Ee(t=Ue.call(null,e,n[5])),i=!0)},p(l,o){t&&Ut(t.update)&&o&32&&t.update.call(null,l[5])},d(l){l&&w(e),i=!1,s()}}}function R$(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_=n[0].required&&Gc(n);return{c(){e=y("div"),_&&_.c(),t=E(),i=y("div"),s=y("i"),o=E(),r=y("input"),h(e,"class","markers"),h(s,"class",l=j.getFieldTypeIcon(n[0].type)),h(i,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(i,"txt-disabled",!n[7]),h(r,"type","text"),r.required=!0,r.disabled=a=!n[7],r.readOnly=u=n[0].id&&n[0].system,h(r,"spellcheck","false"),r.autofocus=f=!n[0].id,h(r,"placeholder","Field name"),r.value=d=n[0].name},m(g,b){S(g,e,b),_&&_.m(e,null),S(g,t,b),S(g,i,b),v(i,s),S(g,o,b),S(g,r,b),n[15](r),n[0].id||r.focus(),p||(m=J(r,"input",n[16]),p=!0)},p(g,b){g[0].required?_?_.p(g,b):(_=Gc(g),_.c(),_.m(e,null)):_&&(_.d(1),_=null),b&1&&l!==(l=j.getFieldTypeIcon(g[0].type))&&h(s,"class",l),b&128&&x(i,"txt-disabled",!g[7]),b&128&&a!==(a=!g[7])&&(r.disabled=a),b&1&&u!==(u=g[0].id&&g[0].system)&&(r.readOnly=u),b&1&&f!==(f=!g[0].id)&&(r.autofocus=f),b&1&&d!==(d=g[0].name)&&r.value!==d&&(r.value=d)},d(g){g&&w(e),_&&_.d(),g&&w(t),g&&w(i),g&&w(o),g&&w(r),n[15](null),p=!1,m()}}}function q$(n){let e,t,i;return{c(){e=y("button"),t=y("i"),h(t,"class","ri-settings-3-line"),h(e,"type","button"),h(e,"aria-label","Field options"),h(e,"class",i="btn btn-sm btn-circle btn-transparent options-trigger "+(n[6]?"btn-danger":"btn-hint"))},m(s,l){S(s,e,l),v(e,t),n[17](e)},p(s,l){l&64&&i!==(i="btn btn-sm btn-circle btn-transparent options-trigger "+(s[6]?"btn-danger":"btn-hint"))&&h(e,"class",i)},d(s){s&&w(e),n[17](null)}}}function j$(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),h(e,"aria-label","Restore")},m(s,l){S(s,e,l),t||(i=[Ee(Ue.call(null,e,"Restore")),J(e,"click",n[10])],t=!0)},p:Q,d(s){s&&w(e),t=!1,De(i)}}}function Xc(n){let e,t;return e=new Bn({props:{class:"dropdown dropdown-block schema-field-dropdown",trigger:n[3],$$slots:{default:[z$]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.trigger=i[3]),s&8388833&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function V$(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),o=U(n[5]),r=E(),a=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[25]),h(l,"class","txt"),h(a,"class","ri-information-line link-hint"),h(s,"for",f=n[25])},m(m,_){S(m,e,_),e.checked=n[0].required,S(m,i,_),S(m,s,_),v(s,l),v(l,o),v(s,r),v(s,a),d||(p=[J(e,"change",n[18]),Ee(u=Ue.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`,position:"right"}))],d=!0)},p(m,_){_&33554432&&t!==(t=m[25])&&h(e,"id",t),_&1&&(e.checked=m[0].required),_&32&&le(o,m[5]),u&&Ut(u.update)&&_&1&&u.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`,position:"right"}),_&33554432&&f!==(f=m[25])&&h(s,"for",f)},d(m){m&&w(e),m&&w(i),m&&w(s),d=!1,De(p)}}}function Qc(n){let e,t,i,s,l,o,r,a,u;return a=new Bn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[H$]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=E(),s=y("div"),l=y("button"),o=y("i"),r=E(),z(a.$$.fragment),h(t,"class","flex-fill"),h(o,"class","ri-more-line"),h(l,"type","button"),h(l,"aria-label","More"),h(l,"class","btn btn-circle btn-sm btn-transparent"),h(s,"class","inline-flex flex-gap-sm flex-nowrap"),h(e,"class","col-sm-4 m-l-auto txt-right")},m(f,d){S(f,e,d),v(e,t),v(e,i),v(e,s),v(s,l),v(l,o),v(l,r),V(a,l,null),u=!0},p(f,d){const p={};d&8388608&&(p.$$scope={dirty:d,ctx:f}),a.$set(p)},i(f){u||(A(a.$$.fragment,f),u=!0)},o(f){P(a.$$.fragment,f),u=!1},d(f){f&&w(e),H(a)}}}function H$(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Remove',h(e,"type","button"),h(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[9]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function z$(n){let e,t,i,s,l,o,r,a,u;const f=n[13].options,d=Tt(f,n,n[23],Kc),p=n[13].beforeNonempty,m=Tt(p,n,n[23],Yc);o=new de({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[V$,({uniqueId:k})=>({25:k}),({uniqueId:k})=>k?33554432:0]},$$scope:{ctx:n}}});const _=n[13].afterNonempty,g=Tt(_,n,n[23],Wc);let b=!n[0].toDelete&&Qc(n);return{c(){e=y("div"),t=y("div"),d&&d.c(),i=E(),m&&m.c(),s=E(),l=y("div"),z(o.$$.fragment),r=E(),g&&g.c(),a=E(),b&&b.c(),h(t,"class","col-sm-12 hidden-empty"),h(l,"class","col-sm-4"),h(e,"class","grid grid-sm")},m(k,$){S(k,e,$),v(e,t),d&&d.m(t,null),v(e,i),m&&m.m(e,null),v(e,s),v(e,l),V(o,l,null),v(e,r),g&&g.m(e,null),v(e,a),b&&b.m(e,null),u=!0},p(k,$){d&&d.p&&(!u||$&8388800)&&Mt(d,f,k,k[23],u?Ct(f,k[23],$,N$):Ot(k[23]),Kc),m&&m.p&&(!u||$&8388800)&&Mt(m,p,k,k[23],u?Ct(p,k[23],$,L$):Ot(k[23]),Yc);const T={};$&41943073&&(T.$$scope={dirty:$,ctx:k}),o.$set(T),g&&g.p&&(!u||$&8388800)&&Mt(g,_,k,k[23],u?Ct(_,k[23],$,P$):Ot(k[23]),Wc),k[0].toDelete?b&&(re(),P(b,1,1,()=>{b=null}),ae()):b?(b.p(k,$),$&1&&A(b,1)):(b=Qc(k),b.c(),A(b,1),b.m(e,null))},i(k){u||(A(d,k),A(m,k),A(o.$$.fragment,k),A(g,k),A(b),u=!0)},o(k){P(d,k),P(m,k),P(o.$$.fragment,k),P(g,k),P(b),u=!1},d(k){k&&w(e),d&&d.d(k),m&&m.d(k),H(o),g&&g.d(k),b&&b.d()}}}function B$(n){let e,t,i,s,l,o,r,a,u,f,d,p=n[7]&&Zc();s=new de({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[R$]},$$scope:{ctx:n}}});const m=n[13].default,_=Tt(m,n,n[23],Jc);function g(T,C){if(T[0].toDelete)return j$;if(T[7])return q$}let b=g(n),k=b&&b(n),$=n[7]&&Xc(n);return{c(){e=y("div"),t=y("div"),p&&p.c(),i=E(),z(s.$$.fragment),l=E(),_&&_.c(),o=E(),k&&k.c(),r=E(),$&&$.c(),h(t,"class","schema-field-header"),h(e,"draggable",!0),h(e,"class","schema-field"),x(e,"drag-over",n[4])},m(T,C){S(T,e,C),v(e,t),p&&p.m(t,null),v(t,i),V(s,t,null),v(t,l),_&&_.m(t,null),v(t,o),k&&k.m(t,null),v(e,r),$&&$.m(e,null),u=!0,f||(d=[J(e,"dragstart",n[19]),J(e,"dragenter",n[20]),J(e,"drop",ft(n[21])),J(e,"dragleave",n[22]),J(e,"dragover",ft(n[14]))],f=!0)},p(T,[C]){T[7]?p||(p=Zc(),p.c(),p.m(t,i)):p&&(p.d(1),p=null);const D={};C&128&&(D.class="form-field required m-0 "+(T[7]?"":"disabled")),C&2&&(D.name="schema."+T[1]+".name"),C&8388773&&(D.$$scope={dirty:C,ctx:T}),s.$set(D),_&&_.p&&(!u||C&8388800)&&Mt(_,m,T,T[23],u?Ct(m,T[23],C,F$):Ot(T[23]),Jc),b===(b=g(T))&&k?k.p(T,C):(k&&k.d(1),k=b&&b(T),k&&(k.c(),k.m(t,null))),T[7]?$?($.p(T,C),C&128&&A($,1)):($=Xc(T),$.c(),A($,1),$.m(e,null)):$&&(re(),P($,1,1,()=>{$=null}),ae()),(!u||C&16)&&x(e,"drag-over",T[4])},i(T){u||(A(s.$$.fragment,T),A(_,T),A($),T&&nt(()=>{u&&(a||(a=Ve(e,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(T){P(s.$$.fragment,T),P(_,T),P($),T&&(a||(a=Ve(e,wt,{duration:150},!1)),a.run(0)),u=!1},d(T){T&&w(e),p&&p.d(),H(s),_&&_.d(T),k&&k.d(),$&&$.d(),T&&a&&a.end(),f=!1,De(d)}}}function U$(n,e,t){let i,s,l,o;Ke(n,gi,N=>t(12,o=N));let{$$slots:r={},$$scope:a}=e,{key:u=""}=e,{field:f=new wn}=e,d,p,m=!1;const _=kt(),g={bool:"Nonfalsey",number:"Nonzero"};function b(){f.id?t(0,f.toDelete=!0,f):_("remove")}function k(){t(0,f.toDelete=!1,f),dn({})}function $(N){return j.slugify(N)}xt(()=>{f.onMountSelect&&(t(0,f.onMountSelect=!1,f),d==null||d.select())});function T(N){pe.call(this,n,N)}function C(N){se[N?"unshift":"push"](()=>{d=N,t(2,d)})}const D=N=>{const q=f.name;t(0,f.name=$(N.target.value),f),N.target.value=f.name,_("rename",{oldName:q,newName:f.name})};function M(N){se[N?"unshift":"push"](()=>{p=N,t(3,p)})}function O(){f.required=this.checked,t(0,f)}const I=N=>{if(!N.target.classList.contains("drag-handle-wrapper")){N.preventDefault();return}const q=document.createElement("div");N.dataTransfer.setDragImage(q,0,0),i&&_("dragstart",N)},L=N=>{i&&(t(4,m=!0),_("dragenter",N))},F=N=>{i&&(t(4,m=!1),_("drop",N))},R=N=>{i&&(t(4,m=!1),_("dragleave",N))};return n.$$set=N=>{"key"in N&&t(1,u=N.key),"field"in N&&t(0,f=N.field),"$$scope"in N&&t(23,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&f.toDelete&&f.originalName&&f.name!==f.originalName&&t(0,f.name=f.originalName,f),n.$$.dirty&1&&!f.originalName&&f.name&&t(0,f.originalName=f.name,f),n.$$.dirty&1&&typeof f.toDelete>"u"&&t(0,f.toDelete=!1,f),n.$$.dirty&1&&f.required&&t(0,f.nullable=!1,f),n.$$.dirty&1&&t(7,i=!f.toDelete&&!(f.id&&f.system)),n.$$.dirty&4098&&t(6,s=!j.isEmpty(j.getNestedVal(o,`schema.${u}`))),n.$$.dirty&1&&t(5,l=g[f==null?void 0:f.type]||"Nonempty")},[f,u,d,p,m,l,s,i,_,b,k,$,o,r,T,C,D,M,O,I,L,F,R,a]}class li extends ve{constructor(e){super(),be(this,e,U$,B$,_e,{key:1,field:0})}}function W$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min length"),s=E(),l=y("input"),h(e,"for",i=n[13]),h(l,"type","number"),h(l,"id",o=n[13]),h(l,"step","1"),h(l,"min","0")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.min),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&h(e,"for",i),f&8192&&o!==(o=u[13])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].options.min&&ue(l,u[0].options.min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Y$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max length"),s=E(),l=y("input"),h(e,"for",i=n[13]),h(l,"type","number"),h(l,"id",o=n[13]),h(l,"step","1"),h(l,"min",r=n[0].options.min||0)},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ue(l,n[0].options.max),a||(u=J(l,"input",n[4]),a=!0)},p(f,d){d&8192&&i!==(i=f[13])&&h(e,"for",i),d&8192&&o!==(o=f[13])&&h(l,"id",o),d&1&&r!==(r=f[0].options.min||0)&&h(l,"min",r),d&1&&_t(l.value)!==f[0].options.max&&ue(l,f[0].options.max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function K$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Regex pattern"),s=E(),l=y("input"),h(e,"for",i=n[13]),h(l,"type","text"),h(l,"id",o=n[13]),h(l,"placeholder","Valid Go regular expression, eg. ^w+$")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.pattern),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&h(e,"for",i),f&8192&&o!==(o=u[13])&&h(l,"id",o),f&1&&l.value!==u[0].options.pattern&&ue(l,u[0].options.pattern)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function J$(n){let e,t,i,s,l,o,r,a,u,f;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[W$,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[Y$,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[K$,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),h(t,"class","col-sm-3"),h(l,"class","col-sm-3"),h(a,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(d,p){S(d,e,p),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),V(u,a,null),f=!0},p(d,p){const m={};p&2&&(m.name="schema."+d[1]+".options.min"),p&24577&&(m.$$scope={dirty:p,ctx:d}),i.$set(m);const _={};p&2&&(_.name="schema."+d[1]+".options.max"),p&24577&&(_.$$scope={dirty:p,ctx:d}),o.$set(_);const g={};p&2&&(g.name="schema."+d[1]+".options.pattern"),p&24577&&(g.$$scope={dirty:p,ctx:d}),u.$set(g)},i(d){f||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),f=!0)},o(d){P(i.$$.fragment,d),P(o.$$.fragment,d),P(u.$$.fragment,d),f=!1},d(d){d&&w(e),H(i),H(o),H(u)}}}function Z$(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[J$]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("drop",n[9]),e.$on("dragstart",n[10]),e.$on("dragenter",n[11]),e.$on("dragleave",n[12]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};a&16387&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function G$(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=_t(this.value),t(0,l)}function a(){l.options.max=_t(this.value),t(0,l)}function u(){l.options.pattern=this.value,t(0,l)}function f(k){l=k,t(0,l)}function d(k){pe.call(this,n,k)}function p(k){pe.call(this,n,k)}function m(k){pe.call(this,n,k)}function _(k){pe.call(this,n,k)}function g(k){pe.call(this,n,k)}function b(k){pe.call(this,n,k)}return n.$$set=k=>{e=Re(Re({},e),Yt(k)),t(2,s=Xe(e,i)),"field"in k&&t(0,l=k.field),"key"in k&&t(1,o=k.key)},[l,o,s,r,a,u,f,d,p,m,_,g,b]}class X$ extends ve{constructor(e){super(),be(this,e,G$,Z$,_e,{field:0,key:1})}}function Q$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min"),s=E(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.min),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].options.min&&ue(l,u[0].options.min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function x$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max"),s=E(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12]),h(l,"min",r=n[0].options.min)},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ue(l,n[0].options.max),a||(u=J(l,"input",n[4]),a=!0)},p(f,d){d&4096&&i!==(i=f[12])&&h(e,"for",i),d&4096&&o!==(o=f[12])&&h(l,"id",o),d&1&&r!==(r=f[0].options.min)&&h(l,"min",r),d&1&&_t(l.value)!==f[0].options.max&&ue(l,f[0].options.max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function eT(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[Q$,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[x$,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){S(a,e,u),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.max"),u&12289&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),H(i),H(o)}}}function tT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[eT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function nT(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=_t(this.value),t(0,l)}function a(){l.options.max=_t(this.value),t(0,l)}function u(b){l=b,t(0,l)}function f(b){pe.call(this,n,b)}function d(b){pe.call(this,n,b)}function p(b){pe.call(this,n,b)}function m(b){pe.call(this,n,b)}function _(b){pe.call(this,n,b)}function g(b){pe.call(this,n,b)}return n.$$set=b=>{e=Re(Re({},e),Yt(b)),t(2,s=Xe(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,s,r,a,u,f,d,p,m,_,g]}class iT extends ve{constructor(e){super(),be(this,e,nT,tT,_e,{field:0,key:1})}}function sT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function lT(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){pe.call(this,n,_)}function u(_){pe.call(this,n,_)}function f(_){pe.call(this,n,_)}function d(_){pe.call(this,n,_)}function p(_){pe.call(this,n,_)}function m(_){pe.call(this,n,_)}return n.$$set=_=>{e=Re(Re({},e),Yt(_)),t(2,s=Xe(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class oT extends ve{constructor(e){super(),be(this,e,lT,sT,_e,{field:0,key:1})}}function rT(n){let e,t,i,s,l=[{type:t=n[3].type||"text"},{value:n[2]},n[3]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=Re(Re({},e),Yt(u)),t(3,l=Xe(e,s)),"value"in u&&t(0,o=u.value),"separator"in u&&t(1,r=u.separator)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=(o||[]).join(", "))},[o,r,i,l,a]}class qs extends ve{constructor(e){super(),be(this,e,aT,rT,_e,{value:0,separator:1})}}function uT(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[3](b)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(g.value=n[0].options.exceptDomains),r=new qs({props:g}),se.push(()=>he(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),V(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!j.isEmpty(b[0].options.onlyDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function fT(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[4](b)}let g={id:n[12]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(g.value=n[0].options.onlyDomains),r=new qs({props:g}),se.push(()=>he(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]+".options.onlyDomains"),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),V(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]+".options.onlyDomains"))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]+".options.onlyDomains"),k&1&&($.disabled=!j.isEmpty(b[0].options.exceptDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function cT(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[uT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[fT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){S(a,e,u),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.onlyDomains"),u&12289&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),H(i),H(o)}}}function dT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[cT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function pT(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(b){n.$$.not_equal(l.options.exceptDomains,b)&&(l.options.exceptDomains=b,t(0,l))}function a(b){n.$$.not_equal(l.options.onlyDomains,b)&&(l.options.onlyDomains=b,t(0,l))}function u(b){l=b,t(0,l)}function f(b){pe.call(this,n,b)}function d(b){pe.call(this,n,b)}function p(b){pe.call(this,n,b)}function m(b){pe.call(this,n,b)}function _(b){pe.call(this,n,b)}function g(b){pe.call(this,n,b)}return n.$$set=b=>{e=Re(Re({},e),Yt(b)),t(2,s=Xe(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,s,r,a,u,f,d,p,m,_,g]}class ib extends ve{constructor(e){super(),be(this,e,pT,dT,_e,{field:0,key:1})}}function mT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function hT(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){pe.call(this,n,_)}function u(_){pe.call(this,n,_)}function f(_){pe.call(this,n,_)}function d(_){pe.call(this,n,_)}function p(_){pe.call(this,n,_)}function m(_){pe.call(this,n,_)}return n.$$set=_=>{e=Re(Re({},e),Yt(_)),t(2,s=Xe(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class _T extends ve{constructor(e){super(),be(this,e,hT,mT,_e,{field:0,key:1})}}function gT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function bT(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){pe.call(this,n,_)}function u(_){pe.call(this,n,_)}function f(_){pe.call(this,n,_)}function d(_){pe.call(this,n,_)}function p(_){pe.call(this,n,_)}function m(_){pe.call(this,n,_)}return n.$$set=_=>{e=Re(Re({},e),Yt(_)),t(2,s=Xe(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class vT extends ve{constructor(e){super(),be(this,e,bT,gT,_e,{field:0,key:1})}}var Or=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],$s={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},kl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},_n=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Fn=function(n){return n===!0?1:0};function xc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Dr=function(n){return n instanceof Array?n:[n]};function rn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ut(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function so(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function sb(n,e){if(e(n))return n;if(n.parentNode)return sb(n.parentNode,e)}function lo(n,e){var t=ut("div","numInputWrapper"),i=ut("input","numInput "+n),s=ut("span","arrowUp"),l=ut("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function $n(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Er=function(){},Fo=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},yT={D:Er,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Fn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Er,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Er,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Xi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ul={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ul.w(n,e,t)]},F:function(n,e,t){return Fo(ul.n(n,e,t)-1,!1,e)},G:function(n,e,t){return _n(ul.h(n,e,t))},H:function(n){return _n(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Fn(n.getHours()>11)]},M:function(n,e){return Fo(n.getMonth(),!0,e)},S:function(n){return _n(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return _n(n.getFullYear(),4)},d:function(n){return _n(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return _n(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return _n(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},lb=function(n){var e=n.config,t=e===void 0?$s:e,i=n.l10n,s=i===void 0?kl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(d,p,m){return ul[d]&&m[p-1]!=="\\"?ul[d](r,f,t):d!=="\\"?d:""}).join("")}},ha=function(n){var e=n.config,t=e===void 0?$s:e,i=n.l10n,s=i===void 0?kl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,d=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var p=o||(t||$s).dateFormat,m=String(l).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,p);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(l);else{for(var _=void 0,g=[],b=0,k=0,$="";bMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Ir(t.config);K.setHours(ne.hours,ne.minutes,ne.seconds,K.getMilliseconds()),t.selectedDates=[K],t.latestSelectedDateObj=K}W!==void 0&&W.type!=="blur"&&Rl(W);var oe=t._input.value;d(),Xt(),t._input.value!==oe&&t._debouncedChange()}function u(W,K){return W%12+12*Fn(K===t.l10n.amPM[1])}function f(W){switch(W%24){case 0:case 12:return 12;default:return W%12}}function d(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var W=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,K=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(W=u(W,t.amPM.textContent));var oe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Tn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Tn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Ie=Ar(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Pe=Ar(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Oe=Ar(W,K,ne);if(Oe>Pe&&Oe=12)]),t.secondElement!==void 0&&(t.secondElement.value=_n(ne)))}function _(W){var K=$n(W),ne=parseInt(K.value)+(W.delta||0);(ne/1e3>1||W.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&we(ne)}function g(W,K,ne,oe){if(K instanceof Array)return K.forEach(function(Te){return g(W,Te,ne,oe)});if(W instanceof Array)return W.forEach(function(Te){return g(Te,K,ne,oe)});W.addEventListener(K,ne,oe),t._handlers.push({remove:function(){return W.removeEventListener(K,ne,oe)}})}function b(){tt("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(oe){return g(oe,"click",t[ne])})}),t.isMobile){us();return}var W=xc(te,50);if(t._debouncedChange=xc(b,$T),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&We($n(ne))}),g(t._input,"keydown",Ze),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",Ze),!t.config.inline&&!t.config.static&&g(window,"resize",W),window.ontouchstart!==void 0?g(window.document,"touchstart",He):g(window.document,"mousedown",He),g(window.document,"focus",He,{capture:!0}),t.config.clickOpens===!0&&(g(t._input,"focus",t.open),g(t._input,"click",t.open)),t.daysContainer!==void 0&&(g(t.monthNav,"click",on),g(t.monthNav,["keyup","increment"],_),g(t.daysContainer,"click",je)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var K=function(ne){return $n(ne).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",T),g([t.hourElement,t.minuteElement],["focus","click"],K),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&g(t._input,"blur",mt)}function $(W,K){var ne=W!==void 0?t.parseDate(W):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(W);var Te=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Te&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ie=ut("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ie,t.element),Ie.appendChild(t.element),t.altInput&&Ie.appendChild(t.altInput),Ie.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function M(W,K,ne,oe){var Te=Ce(K,!0),Ie=ut("span",W,K.getDate().toString());return Ie.dateObj=K,Ie.$i=oe,Ie.setAttribute("aria-label",t.formatDate(K,t.config.ariaDateFormat)),W.indexOf("hidden")===-1&&Tn(K,t.now)===0&&(t.todayDateElem=Ie,Ie.classList.add("today"),Ie.setAttribute("aria-current","date")),Te?(Ie.tabIndex=-1,oi(K)&&(Ie.classList.add("selected"),t.selectedDateElem=Ie,t.config.mode==="range"&&(rn(Ie,"startRange",t.selectedDates[0]&&Tn(K,t.selectedDates[0],!0)===0),rn(Ie,"endRange",t.selectedDates[1]&&Tn(K,t.selectedDates[1],!0)===0),W==="nextMonthDay"&&Ie.classList.add("inRange")))):Ie.classList.add("flatpickr-disabled"),t.config.mode==="range"&&cs(K)&&!oi(K)&&Ie.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&W!=="prevMonthDay"&&oe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(K)+""),tt("onDayCreate",Ie),Ie}function O(W){W.focus(),t.config.mode==="range"&&We(W)}function I(W){for(var K=W>0?0:t.config.showMonths-1,ne=W>0?t.config.showMonths:-1,oe=K;oe!=ne;oe+=W)for(var Te=t.daysContainer.children[oe],Ie=W>0?0:Te.children.length-1,Pe=W>0?Te.children.length:-1,Oe=Ie;Oe!=Pe;Oe+=W){var Ye=Te.children[Oe];if(Ye.className.indexOf("hidden")===-1&&Ce(Ye.dateObj))return Ye}}function L(W,K){for(var ne=W.className.indexOf("Month")===-1?W.dateObj.getMonth():t.currentMonth,oe=K>0?t.config.showMonths:-1,Te=K>0?1:-1,Ie=ne-t.currentMonth;Ie!=oe;Ie+=Te)for(var Pe=t.daysContainer.children[Ie],Oe=ne-t.currentMonth===Ie?W.$i+K:K<0?Pe.children.length-1:0,Ye=Pe.children.length,Ne=Oe;Ne>=0&&Ne0?Ye:-1);Ne+=Te){var Be=Pe.children[Ne];if(Be.className.indexOf("hidden")===-1&&Ce(Be.dateObj)&&Math.abs(W.$i-Ne)>=Math.abs(K))return O(Be)}t.changeMonth(Te),F(I(Te),0)}function F(W,K){var ne=l(),oe=Je(ne||document.body),Te=W!==void 0?W:oe?ne:t.selectedDateElem!==void 0&&Je(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Je(t.todayDateElem)?t.todayDateElem:I(K>0?1:-1);Te===void 0?t._input.focus():oe?L(Te,K):O(Te)}function R(W,K){for(var ne=(new Date(W,K,1).getDay()-t.l10n.firstDayOfWeek+7)%7,oe=t.utils.getDaysInMonth((K-1+12)%12,W),Te=t.utils.getDaysInMonth(K,W),Ie=window.document.createDocumentFragment(),Pe=t.config.showMonths>1,Oe=Pe?"prevMonthDay hidden":"prevMonthDay",Ye=Pe?"nextMonthDay hidden":"nextMonthDay",Ne=oe+1-ne,Be=0;Ne<=oe;Ne++,Be++)Ie.appendChild(M("flatpickr-day "+Oe,new Date(W,K-1,Ne),Ne,Be));for(Ne=1;Ne<=Te;Ne++,Be++)Ie.appendChild(M("flatpickr-day",new Date(W,K,Ne),Ne,Be));for(var bt=Te+1;bt<=42-ne&&(t.config.showMonths===1||Be%7!==0);bt++,Be++)Ie.appendChild(M("flatpickr-day "+Ye,new Date(W,K+1,bt%Te),bt,Be));var Xn=ut("div","dayContainer");return Xn.appendChild(Ie),Xn}function N(){if(t.daysContainer!==void 0){so(t.daysContainer),t.weekNumbers&&so(t.weekNumbers);for(var W=document.createDocumentFragment(),K=0;K1||t.config.monthSelectorType!=="dropdown")){var W=function(oe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&oet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var K=0;K<12;K++)if(W(K)){var ne=ut("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,K).getMonth().toString(),ne.textContent=Fo(K,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===K&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function Y(){var W=ut("div","flatpickr-month"),K=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=ut("span","cur-month"):(t.monthsDropdownContainer=ut("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(Pe){var Oe=$n(Pe),Ye=parseInt(Oe.value,10);t.changeMonth(Ye-t.currentMonth),tt("onMonthChange")}),q(),ne=t.monthsDropdownContainer);var oe=lo("cur-year",{tabindex:"-1"}),Te=oe.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ie=ut("div","flatpickr-current-month");return Ie.appendChild(ne),Ie.appendChild(oe),K.appendChild(Ie),W.appendChild(K),{container:W,yearElement:Te,monthElement:ne}}function B(){so(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var W=t.config.showMonths;W--;){var K=Y();t.yearElements.push(K.yearElement),t.monthElements.push(K.monthElement),t.monthNav.appendChild(K.container)}t.monthNav.appendChild(t.nextMonthNav)}function Z(){return t.monthNav=ut("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ut("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ut("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,B(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(W){t.__hidePrevMonthArrow!==W&&(rn(t.prevMonthNav,"flatpickr-disabled",W),t.__hidePrevMonthArrow=W)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(W){t.__hideNextMonthArrow!==W&&(rn(t.nextMonthNav,"flatpickr-disabled",W),t.__hideNextMonthArrow=W)}}),t.currentYearElement=t.yearElements[0],Vi(),t.monthNav}function ee(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var W=Ir(t.config);t.timeContainer=ut("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var K=ut("span","flatpickr-time-separator",":"),ne=lo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var oe=lo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=oe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=_n(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?W.hours:f(W.hours)),t.minuteElement.value=_n(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():W.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(K),t.timeContainer.appendChild(oe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=lo("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=_n(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():W.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ut("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=ut("span","flatpickr-am-pm",t.l10n.amPM[Fn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function ie(){t.weekdayContainer?so(t.weekdayContainer):t.weekdayContainer=ut("div","flatpickr-weekdays");for(var W=t.config.showMonths;W--;){var K=ut("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(K)}return X(),t.weekdayContainer}function X(){if(t.weekdayContainer){var W=t.l10n.firstDayOfWeek,K=ed(t.l10n.weekdays.shorthand);W>0&&W>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function US(n){let e,t,i;return{c(){e=y("div"),t=y("code"),h(t,"class","svelte-10s5tkd"),h(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),v(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&h(e,"class",i)},i:Q,o:Q,d(s){s&&w(e)}}}function WS(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Xs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Xs.highlight(a,Xs.languages[l]||Xs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Xs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class eb extends ve{constructor(e){super(),be(this,e,WS,US,_e,{class:0,content:2,language:3})}}const YS=n=>({}),Tc=n=>({}),KS=n=>({}),Cc=n=>({});function Mc(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T=n[4]&&!n[2]&&Oc(n);const C=n[19].header,D=Tt(C,n,n[18],Cc);let M=n[4]&&n[2]&&Dc(n);const O=n[19].default,I=Tt(O,n,n[18],null),L=n[19].footer,F=Tt(L,n,n[18],Tc);return{c(){e=y("div"),t=y("div"),s=E(),l=y("div"),o=y("div"),T&&T.c(),r=E(),D&&D.c(),a=E(),M&&M.c(),u=E(),f=y("div"),I&&I.c(),d=E(),p=y("div"),F&&F.c(),h(t,"class","overlay"),h(o,"class","overlay-panel-section panel-header"),h(f,"class","overlay-panel-section panel-content"),h(p,"class","overlay-panel-section panel-footer"),h(l,"class",m="overlay-panel "+n[1]+" "+n[8]),x(l,"popup",n[2]),h(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(R,N){S(R,e,N),v(e,t),v(e,s),v(e,l),v(l,o),T&&T.m(o,null),v(o,r),D&&D.m(o,null),v(o,a),M&&M.m(o,null),v(l,u),v(l,f),I&&I.m(f,null),n[21](f),v(l,d),v(l,p),F&&F.m(p,null),b=!0,k||($=[J(t,"click",ft(n[20])),J(f,"scroll",n[22])],k=!0)},p(R,N){n=R,n[4]&&!n[2]?T?T.p(n,N):(T=Oc(n),T.c(),T.m(o,r)):T&&(T.d(1),T=null),D&&D.p&&(!b||N[0]&262144)&&Mt(D,C,n,n[18],b?Ct(C,n[18],N,KS):Ot(n[18]),Cc),n[4]&&n[2]?M?M.p(n,N):(M=Dc(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),I&&I.p&&(!b||N[0]&262144)&&Mt(I,O,n,n[18],b?Ct(O,n[18],N,null):Ot(n[18]),null),F&&F.p&&(!b||N[0]&262144)&&Mt(F,L,n,n[18],b?Ct(L,n[18],N,YS):Ot(n[18]),Tc),(!b||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&h(l,"class",m),(!b||N[0]&262)&&x(l,"popup",n[2]),(!b||N[0]&4)&&x(e,"padded",n[2]),(!b||N[0]&1)&&x(e,"active",n[0])},i(R){b||(R&&nt(()=>{b&&(i||(i=Ve(t,yo,{duration:bs,opacity:0},!0)),i.run(1))}),A(D,R),A(I,R),A(F,R),nt(()=>{b&&(g&&g.end(1),_=Nb(l,ii,n[2]?{duration:bs,y:-10}:{duration:bs,x:50}),_.start())}),b=!0)},o(R){R&&(i||(i=Ve(t,yo,{duration:bs,opacity:0},!1)),i.run(0)),P(D,R),P(I,R),P(F,R),_&&_.invalidate(),g=Fb(l,ii,n[2]?{duration:bs,y:10}:{duration:bs,x:50}),b=!1},d(R){R&&w(e),R&&i&&i.end(),T&&T.d(),D&&D.d(R),M&&M.d(),I&&I.d(R),n[21](null),F&&F.d(R),R&&g&&g.end(),k=!1,De($)}}}function Oc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=J(e,"click",ft(n[5])),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Dc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){S(s,e,l),t||(i=J(e,"click",ft(n[5])),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function JS(n){let e,t,i,s,l=n[0]&&Mc(n);return{c(){e=y("div"),l&&l.c(),h(e,"class","overlay-panel-wrapper"),h(e,"tabindex","-1")},m(o,r){S(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[J(window,"resize",n[10]),J(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&A(l,1)):(l=Mc(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[23](null),i=!1,De(s)}}}let Ki,Mr=[];function tb(){return Ki=Ki||document.querySelector(".overlays"),Ki||(Ki=document.createElement("div"),Ki.classList.add("overlays"),document.body.appendChild(Ki)),Ki}let bs=150;function Ec(){return 1e3+tb().querySelectorAll(".overlay-panel-container.active").length}function ZS(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:d=void 0}=e,{beforeHide:p=void 0}=e;const m=kt(),_="op_"+j.randomString(10);let g,b,k,$,T="",C=o;function D(){typeof d=="function"&&d()===!1||t(0,o=!0)}function M(){typeof p=="function"&&p()===!1||t(0,o=!1)}function O(){return o}async function I(X){t(17,C=X),X?(k=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout($),m("hide"),k==null||k.focus()),await ln(),L()}function L(){g&&(o?t(6,g.style.zIndex=Ec(),g):t(6,g.style="",g))}function F(){j.pushUnique(Mr,_),document.body.classList.add("overlay-active")}function R(){j.removeByValue(Mr,_),Mr.length||document.body.classList.remove("overlay-active")}function N(X){o&&f&&X.code=="Escape"&&!j.isInput(X.target)&&g&&g.style.zIndex==Ec()&&(X.preventDefault(),M())}function q(X){o&&Y(b)}function Y(X,fe){fe&&t(8,T=""),X&&($||($=setTimeout(()=>{if(clearTimeout($),$=null,!X)return;if(X.scrollHeight-X.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}X.scrollTop==0?t(8,T+=" scroll-top-reached"):X.scrollTop+X.offsetHeight==X.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100)))}xt(()=>(tb().appendChild(g),()=>{var X;clearTimeout($),R(),(X=g==null?void 0:g.classList)==null||X.add("hidden"),setTimeout(()=>{g==null||g.remove()},0)}));const B=()=>a?M():!0;function Z(X){se[X?"unshift":"push"](()=>{b=X,t(7,b)})}const ee=X=>Y(X.target);function ie(X){se[X?"unshift":"push"](()=>{g=X,t(6,g)})}return n.$$set=X=>{"class"in X&&t(1,l=X.class),"active"in X&&t(0,o=X.active),"popup"in X&&t(2,r=X.popup),"overlayClose"in X&&t(3,a=X.overlayClose),"btnClose"in X&&t(4,u=X.btnClose),"escClose"in X&&t(12,f=X.escClose),"beforeOpen"in X&&t(13,d=X.beforeOpen),"beforeHide"in X&&t(14,p=X.beforeHide),"$$scope"in X&&t(18,s=X.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&C!=o&&I(o),n.$$.dirty[0]&128&&Y(b,!0),n.$$.dirty[0]&64&&g&&L(),n.$$.dirty[0]&1&&(o?F():R())},[o,l,r,a,u,M,g,b,T,N,q,Y,f,d,p,D,O,C,s,i,B,Z,ee,ie]}class pn extends ve{constructor(e){super(),be(this,e,ZS,JS,_e,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function GS(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function XS(n){let e,t=n[2].referer+"",i,s;return{c(){e=y("a"),i=U(t),h(e,"href",s=n[2].referer),h(e,"target","_blank"),h(e,"rel","noopener noreferrer")},m(l,o){S(l,e,o),v(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&le(i,t),o&4&&s!==(s=l[2].referer)&&h(e,"href",s)},d(l){l&&w(e)}}}function QS(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function xS(n){let e,t,i;return t=new eb({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","block")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&4&&(o.content=JSON.stringify(s[2].meta,null,2)),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function e$(n){var Ie;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,d,p,m,_,g=n[2].status+"",b,k,$,T,C,D,M=((Ie=n[2].method)==null?void 0:Ie.toUpperCase())+"",O,I,L,F,R,N,q=n[2].auth+"",Y,B,Z,ee,ie,X,fe=n[2].url+"",G,ce,ge,Me,qe,He,we,Ce,Je,mt,Ze,We=n[2].remoteIp+"",te,Fe,Qe,Gt,Le,$e,et=n[2].userIp+"",Dt,Ft,jt,ye,je,gt,Ge=n[2].userAgent+"",mn,vi,yi,as,Fl,ji,us,hn,tt,fs,oi,cs,Vi,Hi,Xt,on;function Rl(Pe,Oe){return Pe[2].referer?XS:GS}let W=Rl(n),K=W(n);const ne=[xS,QS],oe=[];function Te(Pe,Oe){return Oe&4&&(us=null),us==null&&(us=!j.isEmpty(Pe[2].meta)),us?0:1}return hn=Te(n,-1),tt=oe[hn]=ne[hn](n),Xt=new hi({props:{date:n[2].created}}),{c(){e=y("table"),t=y("tbody"),i=y("tr"),s=y("td"),s.textContent="ID",l=E(),o=y("td"),a=U(r),u=E(),f=y("tr"),d=y("td"),d.textContent="Status",p=E(),m=y("td"),_=y("span"),b=U(g),k=E(),$=y("tr"),T=y("td"),T.textContent="Method",C=E(),D=y("td"),O=U(M),I=E(),L=y("tr"),F=y("td"),F.textContent="Auth",R=E(),N=y("td"),Y=U(q),B=E(),Z=y("tr"),ee=y("td"),ee.textContent="URL",ie=E(),X=y("td"),G=U(fe),ce=E(),ge=y("tr"),Me=y("td"),Me.textContent="Referer",qe=E(),He=y("td"),K.c(),we=E(),Ce=y("tr"),Je=y("td"),Je.textContent="Remote IP",mt=E(),Ze=y("td"),te=U(We),Fe=E(),Qe=y("tr"),Gt=y("td"),Gt.textContent="User IP",Le=E(),$e=y("td"),Dt=U(et),Ft=E(),jt=y("tr"),ye=y("td"),ye.textContent="UserAgent",je=E(),gt=y("td"),mn=U(Ge),vi=E(),yi=y("tr"),as=y("td"),as.textContent="Meta",Fl=E(),ji=y("td"),tt.c(),fs=E(),oi=y("tr"),cs=y("td"),cs.textContent="Created",Vi=E(),Hi=y("td"),z(Xt.$$.fragment),h(s,"class","min-width txt-hint txt-bold"),h(d,"class","min-width txt-hint txt-bold"),h(_,"class","label"),x(_,"label-danger",n[2].status>=400),h(T,"class","min-width txt-hint txt-bold"),h(F,"class","min-width txt-hint txt-bold"),h(ee,"class","min-width txt-hint txt-bold"),h(Me,"class","min-width txt-hint txt-bold"),h(Je,"class","min-width txt-hint txt-bold"),h(Gt,"class","min-width txt-hint txt-bold"),h(ye,"class","min-width txt-hint txt-bold"),h(as,"class","min-width txt-hint txt-bold"),h(cs,"class","min-width txt-hint txt-bold"),h(e,"class","table-border")},m(Pe,Oe){S(Pe,e,Oe),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(o,a),v(t,u),v(t,f),v(f,d),v(f,p),v(f,m),v(m,_),v(_,b),v(t,k),v(t,$),v($,T),v($,C),v($,D),v(D,O),v(t,I),v(t,L),v(L,F),v(L,R),v(L,N),v(N,Y),v(t,B),v(t,Z),v(Z,ee),v(Z,ie),v(Z,X),v(X,G),v(t,ce),v(t,ge),v(ge,Me),v(ge,qe),v(ge,He),K.m(He,null),v(t,we),v(t,Ce),v(Ce,Je),v(Ce,mt),v(Ce,Ze),v(Ze,te),v(t,Fe),v(t,Qe),v(Qe,Gt),v(Qe,Le),v(Qe,$e),v($e,Dt),v(t,Ft),v(t,jt),v(jt,ye),v(jt,je),v(jt,gt),v(gt,mn),v(t,vi),v(t,yi),v(yi,as),v(yi,Fl),v(yi,ji),oe[hn].m(ji,null),v(t,fs),v(t,oi),v(oi,cs),v(oi,Vi),v(oi,Hi),V(Xt,Hi,null),on=!0},p(Pe,Oe){var Be;(!on||Oe&4)&&r!==(r=Pe[2].id+"")&&le(a,r),(!on||Oe&4)&&g!==(g=Pe[2].status+"")&&le(b,g),(!on||Oe&4)&&x(_,"label-danger",Pe[2].status>=400),(!on||Oe&4)&&M!==(M=((Be=Pe[2].method)==null?void 0:Be.toUpperCase())+"")&&le(O,M),(!on||Oe&4)&&q!==(q=Pe[2].auth+"")&&le(Y,q),(!on||Oe&4)&&fe!==(fe=Pe[2].url+"")&&le(G,fe),W===(W=Rl(Pe))&&K?K.p(Pe,Oe):(K.d(1),K=W(Pe),K&&(K.c(),K.m(He,null))),(!on||Oe&4)&&We!==(We=Pe[2].remoteIp+"")&&le(te,We),(!on||Oe&4)&&et!==(et=Pe[2].userIp+"")&&le(Dt,et),(!on||Oe&4)&&Ge!==(Ge=Pe[2].userAgent+"")&&le(mn,Ge);let Ye=hn;hn=Te(Pe,Oe),hn===Ye?oe[hn].p(Pe,Oe):(re(),P(oe[Ye],1,1,()=>{oe[Ye]=null}),ae(),tt=oe[hn],tt?tt.p(Pe,Oe):(tt=oe[hn]=ne[hn](Pe),tt.c()),A(tt,1),tt.m(ji,null));const Ne={};Oe&4&&(Ne.date=Pe[2].created),Xt.$set(Ne)},i(Pe){on||(A(tt),A(Xt.$$.fragment,Pe),on=!0)},o(Pe){P(tt),P(Xt.$$.fragment,Pe),on=!1},d(Pe){Pe&&w(e),K.d(),oe[hn].d(),H(Xt)}}}function t$(n){let e;return{c(){e=y("h4"),e.textContent="Request log"},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function n$(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Close',h(e,"type","button"),h(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[4]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function i$(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[n$],header:[t$],default:[e$]},$$scope:{ctx:n}};return e=new pn({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),H(e,s)}}}function s$(n,e,t){let i,s=new Br;function l(d){return t(2,s=d),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(d){se[d?"unshift":"push"](()=>{i=d,t(1,i)})}function u(d){pe.call(this,n,d)}function f(d){pe.call(this,n,d)}return[o,i,s,l,r,a,u,f]}class l$ extends ve{constructor(e){super(),be(this,e,s$,i$,_e,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function o$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Include requests by admins"),h(e,"type","checkbox"),h(e,"id",t=n[14]),h(s,"for",o=n[14])},m(u,f){S(u,e,f),e.checked=n[1],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[10]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&h(e,"id",t),f&2&&(e.checked=u[1]),f&16384&&o!==(o=u[14])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Ac(n){let e,t;return e=new HS({props:{filter:n[4],presets:n[5]}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Ic(n){let e,t;return e=new o2({props:{filter:n[4],presets:n[5]}}),e.$on("select",n[12]),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function r$(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$=n[3],T,C=n[3],D,M;r=new Pa({}),r.$on("refresh",n[9]),p=new de({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[o$,({uniqueId:L})=>({14:L}),({uniqueId:L})=>L?16384:0]},$$scope:{ctx:n}}}),_=new Ko({props:{value:n[0],placeholder:"Search term or filter like status >= 400",extraAutocompleteKeys:n[7]}}),_.$on("submit",n[11]);let O=Ac(n),I=Ic(n);return{c(){e=y("div"),t=y("header"),i=y("nav"),s=y("div"),l=U(n[6]),o=E(),z(r.$$.fragment),a=E(),u=y("div"),f=E(),d=y("div"),z(p.$$.fragment),m=E(),z(_.$$.fragment),g=E(),b=y("div"),k=E(),O.c(),T=E(),I.c(),D=Se(),h(s,"class","breadcrumb-item"),h(i,"class","breadcrumbs"),h(u,"class","flex-fill"),h(d,"class","inline-flex"),h(t,"class","page-header"),h(b,"class","clearfix m-b-base"),h(e,"class","page-header-wrapper m-b-0")},m(L,F){S(L,e,F),v(e,t),v(t,i),v(i,s),v(s,l),v(t,o),V(r,t,null),v(t,a),v(t,u),v(t,f),v(t,d),V(p,d,null),v(e,m),V(_,e,null),v(e,g),v(e,b),v(e,k),O.m(e,null),S(L,T,F),I.m(L,F),S(L,D,F),M=!0},p(L,F){(!M||F&64)&&le(l,L[6]);const R={};F&49154&&(R.$$scope={dirty:F,ctx:L}),p.$set(R);const N={};F&1&&(N.value=L[0]),_.$set(N),F&8&&_e($,$=L[3])?(re(),P(O,1,1,Q),ae(),O=Ac(L),O.c(),A(O,1),O.m(e,null)):O.p(L,F),F&8&&_e(C,C=L[3])?(re(),P(I,1,1,Q),ae(),I=Ic(L),I.c(),A(I,1),I.m(D.parentNode,D)):I.p(L,F)},i(L){M||(A(r.$$.fragment,L),A(p.$$.fragment,L),A(_.$$.fragment,L),A(O),A(I),M=!0)},o(L){P(r.$$.fragment,L),P(p.$$.fragment,L),P(_.$$.fragment,L),P(O),P(I),M=!1},d(L){L&&w(e),H(r),H(p),H(_),O.d(L),L&&w(T),L&&w(D),I.d(L)}}}function a$(n){let e,t,i,s;e=new In({props:{$$slots:{default:[r$]},$$scope:{ctx:n}}});let l={};return i=new l$({props:l}),n[13](i),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){V(e,o,r),S(o,t,r),V(i,o,r),s=!0},p(o,[r]){const a={};r&32895&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){H(e,o),o&&w(t),n[13](null),H(i,o)}}}const Pc="includeAdminLogs";function u$(n,e,t){var k;let i,s,l;Ke(n,Lt,$=>t(6,l=$));const o=["method","url","remoteIp","userIp","referer","status","auth","userAgent","created"];sn(Lt,l="Request logs",l);let r,a="",u=((k=window.localStorage)==null?void 0:k.getItem(Pc))<<0,f=1;function d(){t(3,f++,f)}const p=()=>d();function m(){u=this.checked,t(1,u)}const _=$=>t(0,a=$.detail),g=$=>r==null?void 0:r.show($==null?void 0:$.detail);function b($){se[$?"unshift":"push"](()=>{r=$,t(2,r)})}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=u?"":'auth!="admin"'),n.$$.dirty&2&&typeof u<"u"&&window.localStorage&&window.localStorage.setItem(Pc,u<<0),n.$$.dirty&1&&t(4,s=j.normalizeSearchFilter(a,o))},[a,u,r,f,s,i,l,o,d,p,m,_,g,b]}class f$ extends ve{constructor(e){super(),be(this,e,u$,a$,_e,{})}}const si=An([]),_i=An({}),No=An(!1),nb=An({});function c$(n){si.update(e=>{const t=j.findByKey(e,"id",n);return t?_i.set(t):e.length&&_i.set(e[0]),e})}function d$(n){_i.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),si.update(e=>(j.pushOrReplaceByKey(e,n,"id"),iu(),j.sortCollections(e)))}function p$(n){si.update(e=>(j.removeByKey(e,"id",n.id),_i.update(t=>t.id===n.id?e[0]:t),iu(),e))}async function m$(n=null){No.set(!0);try{let e=await me.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),si.set(e);const t=n&&j.findByKey(e,"id",n);t?_i.set(t):e.length&&_i.set(e[0]),iu()}catch(e){me.errorResponseHandler(e)}No.set(!1)}function iu(){nb.update(n=>(si.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.private)}));return e}),n))}const su=An({});function vn(n,e,t){su.set({text:n,yesCallback:e,noCallback:t})}function ib(){su.set({})}function Lc(n){let e,t,i;const s=n[17].default,l=Tt(s,n,n[16],null);return{c(){e=y("div"),l&&l.c(),h(e,"class",n[1]),x(e,"active",n[0])},m(o,r){S(o,e,r),l&&l.m(e,null),n[18](e),i=!0},p(o,r){l&&l.p&&(!i||r&65536)&&Mt(l,s,o,o[16],i?Ct(s,o[16],r,null):Ot(o[16]),null),(!i||r&2)&&h(e,"class",o[1]),(!i||r&3)&&x(e,"active",o[0])},i(o){i||(A(l,o),o&&nt(()=>{i&&(t||(t=Ve(e,ii,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=Ve(e,ii,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),n[18](null),o&&t&&t.end()}}}function h$(n){let e,t,i,s,l=n[0]&&Lc(n);return{c(){e=y("div"),l&&l.c(),h(e,"class","toggler-container")},m(o,r){S(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[J(window,"mousedown",n[5]),J(window,"click",n[6]),J(window,"keydown",n[4]),J(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=Lc(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[19](null),i=!1,De(s)}}}function _$(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,d,p,m,_,g=!1;const b=kt();function k(){t(0,o=!1),g=!1,clearTimeout(_)}function $(){t(0,o=!0),clearTimeout(_),_=setTimeout(()=>{a&&(p!=null&&p.scrollIntoViewIfNeeded?p==null||p.scrollIntoViewIfNeeded():p!=null&&p.scrollIntoView&&(p==null||p.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function T(){o?k():$()}function C(B){return!d||B.classList.contains(u)||(m==null?void 0:m.contains(B))&&!d.contains(B)||d.contains(B)&&B.closest&&B.closest("."+u)}function D(B){(!o||C(B.target))&&(B.preventDefault(),B.stopPropagation(),T())}function M(B){(B.code==="Enter"||B.code==="Space")&&(!o||C(B.target))&&(B.preventDefault(),B.stopPropagation(),T())}function O(B){o&&r&&B.code==="Escape"&&(B.preventDefault(),k())}function I(B){o&&!(d!=null&&d.contains(B.target))?g=!0:g&&(g=!1)}function L(B){var Z;o&&g&&!(d!=null&&d.contains(B.target))&&!(m!=null&&m.contains(B.target))&&!((Z=B.target)!=null&&Z.closest(".flatpickr-calendar"))&&k()}function F(B){I(B),L(B)}function R(B){N(),t(15,m=B||(d==null?void 0:d.parentNode)),m&&(d==null||d.addEventListener("click",D),m.addEventListener("click",D),m.addEventListener("keydown",M))}function N(){clearTimeout(_),m&&(d==null||d.removeEventListener("click",D),m.removeEventListener("click",D),m.removeEventListener("keydown",M))}xt(()=>(R(),()=>N()));function q(B){se[B?"unshift":"push"](()=>{p=B,t(3,p)})}function Y(B){se[B?"unshift":"push"](()=>{d=B,t(2,d)})}return n.$$set=B=>{"trigger"in B&&t(8,l=B.trigger),"active"in B&&t(0,o=B.active),"escClose"in B&&t(9,r=B.escClose),"autoScroll"in B&&t(10,a=B.autoScroll),"closableClass"in B&&t(11,u=B.closableClass),"class"in B&&t(1,f=B.class),"$$scope"in B&&t(16,s=B.$$scope)},n.$$.update=()=>{var B,Z;n.$$.dirty&260&&d&&R(l),n.$$.dirty&32769&&(o?((B=m==null?void 0:m.classList)==null||B.add("active"),b("show")):((Z=m==null?void 0:m.classList)==null||Z.remove("active"),b("hide")))},[o,f,d,p,O,I,L,F,l,r,a,u,k,$,T,m,s,i,q,Y]}class Bn extends ve{constructor(e){super(),be(this,e,_$,h$,_e,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function Nc(n,e,t){const i=n.slice();return i[27]=e[t],i}function g$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("input"),s=E(),l=y("label"),o=U("Unique"),h(e,"type","checkbox"),h(e,"id",t=n[30]),e.checked=i=n[3].unique,h(l,"for",r=n[30])},m(f,d){S(f,e,d),S(f,s,d),S(f,l,d),v(l,o),a||(u=J(e,"change",n[19]),a=!0)},p(f,d){d[0]&1073741824&&t!==(t=f[30])&&h(e,"id",t),d[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),d[0]&1073741824&&r!==(r=f[30])&&h(l,"for",r)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function b$(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a){var f;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){var d;const f={};if(u[0]&1073741824&&(f.id=a[30]),u[0]&1&&(f.placeholder=`eg. CREATE INDEX idx_test on ${(d=a[0])==null?void 0:d.name} (created)`),!t&&u[0]&4&&(t=!0,f.value=a[2],ke(()=>t=!1)),u[0]&128&&o!==(o=a[7])){if(e){re();const p=e;P(p.$$.fragment,1,0,()=>{H(p,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function v$(n){let e;return{c(){e=y("textarea"),e.disabled=!0,h(e,"rows","7"),h(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function y$(n){let e,t,i,s;const l=[v$,b$],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},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()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function Fc(n){let e,t,i,s=n[10],l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[y$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Fc(n);return{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),r&&r.c(),l=Se()},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),r&&r.m(a,u),S(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const d={};u[0]&64&&(d.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(d.$$scope={dirty:u,ctx:a}),i.$set(d),a[10].length>0?r?r.p(a,u):(r=Fc(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),r&&r.d(a),a&&w(l)}}}function w$(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=y("h4"),i=U(t),s=U(" index")},m(l,o){S(l,e,o),v(e,i),v(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&le(i,t)},d(l){l&&w(e)}}}function qc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){S(s,e,l),t||(i=[Ee(Ue.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:Q,d(s){s&&w(e),t=!1,De(i)}}}function S$(n){let e,t,i,s,l,o,r=n[5]!=""&&qc(n);return{c(){r&&r.c(),e=E(),t=y("button"),t.innerHTML='Cancel',i=E(),s=y("button"),s.innerHTML='Set index',h(t,"type","button"),h(t,"class","btn btn-transparent"),h(s,"type","button"),h(s,"class","btn"),x(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),l||(o=[J(t,"click",n[17]),J(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=qc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&x(s,"btn-disabled",a[9].length<=0)},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&w(i),a&&w(s),l=!1,De(o)}}}function $$(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[S$],header:[w$],default:[k$]},$$scope:{ctx:n}};for(let l=0;lie.name==B);ee?j.removeByValue(Z.columns,ee):j.pushUnique(Z.columns,{name:B}),t(2,p=j.buildIndex(Z))}xt(async()=>{t(8,g=!0);try{t(7,_=(await rt(()=>import("./CodeEditor-c5150b8e.js"),["./CodeEditor-c5150b8e.js","./index-c4d2d831.js"],import.meta.url)).default)}catch(B){console.warn(B)}t(8,g=!1)});const M=()=>T(),O=()=>k(),I=()=>C(),L=B=>{t(3,s.unique=B.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,p=j.buildIndex(s))};function F(B){p=B,t(2,p)}const R=B=>D(B);function N(B){se[B?"unshift":"push"](()=>{f=B,t(4,f)})}function q(B){pe.call(this,n,B)}function Y(B){pe.call(this,n,B)}return n.$$set=B=>{e=Re(Re({},e),Yt(B)),t(14,r=Xe(e,o)),"collection"in B&&t(0,u=B.collection)},n.$$.update=()=>{var B,Z,ee;n.$$.dirty[0]&1&&t(10,i=(((Z=(B=u==null?void 0:u.schema)==null?void 0:B.filter(ie=>!ie.toDelete))==null?void 0:Z.map(ie=>ie.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,s=j.parseIndex(p)),n.$$.dirty[0]&8&&t(9,l=((ee=s.columns)==null?void 0:ee.map(ie=>ie.name))||[])},[u,k,p,s,f,d,m,_,g,l,i,T,C,D,r,b,M,O,I,L,F,R,N,q,Y]}class C$ extends ve{constructor(e){super(),be(this,e,T$,$$,_e,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function jc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=j.parseIndex(i[10]);return i[11]=s,i}function Vc(n){let e;return{c(){e=y("strong"),e.textContent="Unique:"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Hc(n){var p;let e,t,i,s=((p=n[11].columns)==null?void 0:p.map(zc).join(", "))+"",l,o,r,a,u,f=n[11].unique&&Vc();function d(){return n[4](n[10],n[13])}return{c(){var m,_;e=y("button"),f&&f.c(),t=E(),i=y("span"),l=U(s),h(i,"class","txt"),h(e,"type","button"),h(e,"class",o="label link-primary "+((_=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&_.message?"label-danger":"")+" svelte-167lbwu")},m(m,_){var g,b;S(m,e,_),f&&f.m(e,null),v(e,t),v(e,i),v(i,l),a||(u=[Ee(r=Ue.call(null,e,((b=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:b.message)||"")),J(e,"click",d)],a=!0)},p(m,_){var g,b,k,$,T;n=m,n[11].unique?f||(f=Vc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),_&1&&s!==(s=((g=n[11].columns)==null?void 0:g.map(zc).join(", "))+"")&&le(l,s),_&4&&o!==(o="label link-primary "+((k=(b=n[2].indexes)==null?void 0:b[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&h(e,"class",o),r&&Ut(r.update)&&_&4&&r.update.call(null,((T=($=n[2].indexes)==null?void 0:$[n[13]])==null?void 0:T.message)||"")},d(m){m&&w(e),f&&f.d(),a=!1,De(u)}}}function M$(n){var C,D,M;let e,t,i=(((D=(C=n[0])==null?void 0:C.indexes)==null?void 0:D.length)||0)+"",s,l,o,r,a,u,f,d,p,m,_,g,b=((M=n[0])==null?void 0:M.indexes)||[],k=[];for(let O=0;Ohe(d,"collection",$)),d.$on("remove",n[8]),d.$on("submit",n[9]),{c(){e=y("div"),t=U("Unique constraints and indexes ("),s=U(i),l=U(")"),o=E(),r=y("div");for(let O=0;O+ + New index`,f=E(),z(d.$$.fragment),h(e,"class","section-title"),h(u,"type","button"),h(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),h(r,"class","indexes-list svelte-167lbwu")},m(O,I){S(O,e,I),v(e,t),v(e,s),v(e,l),S(O,o,I),S(O,r,I);for(let L=0;Lp=!1)),d.$set(L)},i(O){m||(A(d.$$.fragment,O),m=!0)},o(O){P(d.$$.fragment,O),m=!1},d(O){O&&w(e),O&&w(o),O&&w(r),dt(k,O),O&&w(f),n[6](null),H(d,O),_=!1,g()}}}const zc=n=>n.name;function O$(n,e,t){let i;Ke(n,gi,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let g=0;gl==null?void 0:l.show(m,_),a=()=>l==null?void 0:l.show();function u(m){se[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const d=m=>{for(let _=0;_{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,u,f,d,p]}class D$ extends ve{constructor(e){super(),be(this,e,O$,M$,_e,{collection:0})}}function Bc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Uc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function d(...p){return n[5](n[6],...p)}return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),o=U(l),r=E(),h(t,"class","icon "+n[6].icon+" svelte-1p626x7"),h(s,"class","txt"),h(e,"tabindex","0"),h(e,"class","dropdown-item closable svelte-1p626x7")},m(p,m){S(p,e,m),v(e,t),v(e,i),v(e,s),v(s,o),v(e,r),a||(u=[J(e,"click",En(f)),J(e,"keydown",En(d))],a=!0)},p(p,m){n=p},d(p){p&&w(e),a=!1,De(u)}}}function E$(n){let e,t=n[2],i=[];for(let s=0;s{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$set=u=>{"class"in u&&t(0,i=u.class)},[i,s,l,o,r,a]}class P$ extends ve{constructor(e){super(),be(this,e,I$,A$,_e,{class:0})}}const L$=n=>({interactive:n&128,hasErrors:n&64}),Wc=n=>({interactive:n[7],hasErrors:n[6]}),N$=n=>({interactive:n&128,hasErrors:n&64}),Yc=n=>({interactive:n[7],hasErrors:n[6]}),F$=n=>({interactive:n&128,hasErrors:n&64}),Kc=n=>({interactive:n[7],hasErrors:n[6]}),R$=n=>({interactive:n&128,hasErrors:n&64}),Jc=n=>({interactive:n[7],hasErrors:n[6]});function Zc(n){let e;return{c(){e=y("div"),e.innerHTML='',h(e,"class","drag-handle-wrapper"),h(e,"draggable","true"),h(e,"aria-label","Sort")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Gc(n){let e,t,i,s;return{c(){e=y("span"),h(e,"class","marker marker-required")},m(l,o){S(l,e,o),i||(s=Ee(t=Ue.call(null,e,n[5])),i=!0)},p(l,o){t&&Ut(t.update)&&o&32&&t.update.call(null,l[5])},d(l){l&&w(e),i=!1,s()}}}function q$(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_=n[0].required&&Gc(n);return{c(){e=y("div"),_&&_.c(),t=E(),i=y("div"),s=y("i"),o=E(),r=y("input"),h(e,"class","markers"),h(s,"class",l=j.getFieldTypeIcon(n[0].type)),h(i,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(i,"txt-disabled",!n[7]),h(r,"type","text"),r.required=!0,r.disabled=a=!n[7],r.readOnly=u=n[0].id&&n[0].system,h(r,"spellcheck","false"),r.autofocus=f=!n[0].id,h(r,"placeholder","Field name"),r.value=d=n[0].name},m(g,b){S(g,e,b),_&&_.m(e,null),S(g,t,b),S(g,i,b),v(i,s),S(g,o,b),S(g,r,b),n[15](r),n[0].id||r.focus(),p||(m=J(r,"input",n[16]),p=!0)},p(g,b){g[0].required?_?_.p(g,b):(_=Gc(g),_.c(),_.m(e,null)):_&&(_.d(1),_=null),b&1&&l!==(l=j.getFieldTypeIcon(g[0].type))&&h(s,"class",l),b&128&&x(i,"txt-disabled",!g[7]),b&128&&a!==(a=!g[7])&&(r.disabled=a),b&1&&u!==(u=g[0].id&&g[0].system)&&(r.readOnly=u),b&1&&f!==(f=!g[0].id)&&(r.autofocus=f),b&1&&d!==(d=g[0].name)&&r.value!==d&&(r.value=d)},d(g){g&&w(e),_&&_.d(),g&&w(t),g&&w(i),g&&w(o),g&&w(r),n[15](null),p=!1,m()}}}function j$(n){let e,t,i;return{c(){e=y("button"),t=y("i"),h(t,"class","ri-settings-3-line"),h(e,"type","button"),h(e,"aria-label","Field options"),h(e,"class",i="btn btn-sm btn-circle btn-transparent options-trigger "+(n[6]?"btn-danger":"btn-hint"))},m(s,l){S(s,e,l),v(e,t),n[17](e)},p(s,l){l&64&&i!==(i="btn btn-sm btn-circle btn-transparent options-trigger "+(s[6]?"btn-danger":"btn-hint"))&&h(e,"class",i)},d(s){s&&w(e),n[17](null)}}}function V$(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),h(e,"aria-label","Restore")},m(s,l){S(s,e,l),t||(i=[Ee(Ue.call(null,e,"Restore")),J(e,"click",n[10])],t=!0)},p:Q,d(s){s&&w(e),t=!1,De(i)}}}function Xc(n){let e,t;return e=new Bn({props:{class:"dropdown dropdown-block schema-field-dropdown",trigger:n[3],$$slots:{default:[B$]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.trigger=i[3]),s&8388833&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function H$(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),o=U(n[5]),r=E(),a=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[25]),h(l,"class","txt"),h(a,"class","ri-information-line link-hint"),h(s,"for",f=n[25])},m(m,_){S(m,e,_),e.checked=n[0].required,S(m,i,_),S(m,s,_),v(s,l),v(l,o),v(s,r),v(s,a),d||(p=[J(e,"change",n[18]),Ee(u=Ue.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`,position:"right"}))],d=!0)},p(m,_){_&33554432&&t!==(t=m[25])&&h(e,"id",t),_&1&&(e.checked=m[0].required),_&32&&le(o,m[5]),u&&Ut(u.update)&&_&1&&u.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`,position:"right"}),_&33554432&&f!==(f=m[25])&&h(s,"for",f)},d(m){m&&w(e),m&&w(i),m&&w(s),d=!1,De(p)}}}function Qc(n){let e,t,i,s,l,o,r,a,u;return a=new Bn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[z$]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=E(),s=y("div"),l=y("button"),o=y("i"),r=E(),z(a.$$.fragment),h(t,"class","flex-fill"),h(o,"class","ri-more-line"),h(l,"type","button"),h(l,"aria-label","More"),h(l,"class","btn btn-circle btn-sm btn-transparent"),h(s,"class","inline-flex flex-gap-sm flex-nowrap"),h(e,"class","col-sm-4 m-l-auto txt-right")},m(f,d){S(f,e,d),v(e,t),v(e,i),v(e,s),v(s,l),v(l,o),v(l,r),V(a,l,null),u=!0},p(f,d){const p={};d&8388608&&(p.$$scope={dirty:d,ctx:f}),a.$set(p)},i(f){u||(A(a.$$.fragment,f),u=!0)},o(f){P(a.$$.fragment,f),u=!1},d(f){f&&w(e),H(a)}}}function z$(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Remove',h(e,"type","button"),h(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[9]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function B$(n){let e,t,i,s,l,o,r,a,u;const f=n[13].options,d=Tt(f,n,n[23],Kc),p=n[13].beforeNonempty,m=Tt(p,n,n[23],Yc);o=new de({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[H$,({uniqueId:k})=>({25:k}),({uniqueId:k})=>k?33554432:0]},$$scope:{ctx:n}}});const _=n[13].afterNonempty,g=Tt(_,n,n[23],Wc);let b=!n[0].toDelete&&Qc(n);return{c(){e=y("div"),t=y("div"),d&&d.c(),i=E(),m&&m.c(),s=E(),l=y("div"),z(o.$$.fragment),r=E(),g&&g.c(),a=E(),b&&b.c(),h(t,"class","col-sm-12 hidden-empty"),h(l,"class","col-sm-4"),h(e,"class","grid grid-sm")},m(k,$){S(k,e,$),v(e,t),d&&d.m(t,null),v(e,i),m&&m.m(e,null),v(e,s),v(e,l),V(o,l,null),v(e,r),g&&g.m(e,null),v(e,a),b&&b.m(e,null),u=!0},p(k,$){d&&d.p&&(!u||$&8388800)&&Mt(d,f,k,k[23],u?Ct(f,k[23],$,F$):Ot(k[23]),Kc),m&&m.p&&(!u||$&8388800)&&Mt(m,p,k,k[23],u?Ct(p,k[23],$,N$):Ot(k[23]),Yc);const T={};$&41943073&&(T.$$scope={dirty:$,ctx:k}),o.$set(T),g&&g.p&&(!u||$&8388800)&&Mt(g,_,k,k[23],u?Ct(_,k[23],$,L$):Ot(k[23]),Wc),k[0].toDelete?b&&(re(),P(b,1,1,()=>{b=null}),ae()):b?(b.p(k,$),$&1&&A(b,1)):(b=Qc(k),b.c(),A(b,1),b.m(e,null))},i(k){u||(A(d,k),A(m,k),A(o.$$.fragment,k),A(g,k),A(b),u=!0)},o(k){P(d,k),P(m,k),P(o.$$.fragment,k),P(g,k),P(b),u=!1},d(k){k&&w(e),d&&d.d(k),m&&m.d(k),H(o),g&&g.d(k),b&&b.d()}}}function U$(n){let e,t,i,s,l,o,r,a,u,f,d,p=n[7]&&Zc();s=new de({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[q$]},$$scope:{ctx:n}}});const m=n[13].default,_=Tt(m,n,n[23],Jc);function g(T,C){if(T[0].toDelete)return V$;if(T[7])return j$}let b=g(n),k=b&&b(n),$=n[7]&&Xc(n);return{c(){e=y("div"),t=y("div"),p&&p.c(),i=E(),z(s.$$.fragment),l=E(),_&&_.c(),o=E(),k&&k.c(),r=E(),$&&$.c(),h(t,"class","schema-field-header"),h(e,"draggable",!0),h(e,"class","schema-field"),x(e,"drag-over",n[4])},m(T,C){S(T,e,C),v(e,t),p&&p.m(t,null),v(t,i),V(s,t,null),v(t,l),_&&_.m(t,null),v(t,o),k&&k.m(t,null),v(e,r),$&&$.m(e,null),u=!0,f||(d=[J(e,"dragstart",n[19]),J(e,"dragenter",n[20]),J(e,"drop",ft(n[21])),J(e,"dragleave",n[22]),J(e,"dragover",ft(n[14]))],f=!0)},p(T,[C]){T[7]?p||(p=Zc(),p.c(),p.m(t,i)):p&&(p.d(1),p=null);const D={};C&128&&(D.class="form-field required m-0 "+(T[7]?"":"disabled")),C&2&&(D.name="schema."+T[1]+".name"),C&8388773&&(D.$$scope={dirty:C,ctx:T}),s.$set(D),_&&_.p&&(!u||C&8388800)&&Mt(_,m,T,T[23],u?Ct(m,T[23],C,R$):Ot(T[23]),Jc),b===(b=g(T))&&k?k.p(T,C):(k&&k.d(1),k=b&&b(T),k&&(k.c(),k.m(t,null))),T[7]?$?($.p(T,C),C&128&&A($,1)):($=Xc(T),$.c(),A($,1),$.m(e,null)):$&&(re(),P($,1,1,()=>{$=null}),ae()),(!u||C&16)&&x(e,"drag-over",T[4])},i(T){u||(A(s.$$.fragment,T),A(_,T),A($),T&&nt(()=>{u&&(a||(a=Ve(e,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(T){P(s.$$.fragment,T),P(_,T),P($),T&&(a||(a=Ve(e,wt,{duration:150},!1)),a.run(0)),u=!1},d(T){T&&w(e),p&&p.d(),H(s),_&&_.d(T),k&&k.d(),$&&$.d(),T&&a&&a.end(),f=!1,De(d)}}}function W$(n,e,t){let i,s,l,o;Ke(n,gi,N=>t(12,o=N));let{$$slots:r={},$$scope:a}=e,{key:u=""}=e,{field:f=new wn}=e,d,p,m=!1;const _=kt(),g={bool:"Nonfalsey",number:"Nonzero"};function b(){f.id?t(0,f.toDelete=!0,f):_("remove")}function k(){t(0,f.toDelete=!1,f),dn({})}function $(N){return j.slugify(N)}xt(()=>{f.onMountSelect&&(t(0,f.onMountSelect=!1,f),d==null||d.select())});function T(N){pe.call(this,n,N)}function C(N){se[N?"unshift":"push"](()=>{d=N,t(2,d)})}const D=N=>{const q=f.name;t(0,f.name=$(N.target.value),f),N.target.value=f.name,_("rename",{oldName:q,newName:f.name})};function M(N){se[N?"unshift":"push"](()=>{p=N,t(3,p)})}function O(){f.required=this.checked,t(0,f)}const I=N=>{if(!N.target.classList.contains("drag-handle-wrapper")){N.preventDefault();return}const q=document.createElement("div");N.dataTransfer.setDragImage(q,0,0),i&&_("dragstart",N)},L=N=>{i&&(t(4,m=!0),_("dragenter",N))},F=N=>{i&&(t(4,m=!1),_("drop",N))},R=N=>{i&&(t(4,m=!1),_("dragleave",N))};return n.$$set=N=>{"key"in N&&t(1,u=N.key),"field"in N&&t(0,f=N.field),"$$scope"in N&&t(23,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&f.toDelete&&f.originalName&&f.name!==f.originalName&&t(0,f.name=f.originalName,f),n.$$.dirty&1&&!f.originalName&&f.name&&t(0,f.originalName=f.name,f),n.$$.dirty&1&&typeof f.toDelete>"u"&&t(0,f.toDelete=!1,f),n.$$.dirty&1&&f.required&&t(0,f.nullable=!1,f),n.$$.dirty&1&&t(7,i=!f.toDelete&&!(f.id&&f.system)),n.$$.dirty&4098&&t(6,s=!j.isEmpty(j.getNestedVal(o,`schema.${u}`))),n.$$.dirty&1&&t(5,l=g[f==null?void 0:f.type]||"Nonempty")},[f,u,d,p,m,l,s,i,_,b,k,$,o,r,T,C,D,M,O,I,L,F,R,a]}class li extends ve{constructor(e){super(),be(this,e,W$,U$,_e,{key:1,field:0})}}function Y$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min length"),s=E(),l=y("input"),h(e,"for",i=n[13]),h(l,"type","number"),h(l,"id",o=n[13]),h(l,"step","1"),h(l,"min","0")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.min),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&h(e,"for",i),f&8192&&o!==(o=u[13])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].options.min&&ue(l,u[0].options.min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function K$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max length"),s=E(),l=y("input"),h(e,"for",i=n[13]),h(l,"type","number"),h(l,"id",o=n[13]),h(l,"step","1"),h(l,"min",r=n[0].options.min||0)},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ue(l,n[0].options.max),a||(u=J(l,"input",n[4]),a=!0)},p(f,d){d&8192&&i!==(i=f[13])&&h(e,"for",i),d&8192&&o!==(o=f[13])&&h(l,"id",o),d&1&&r!==(r=f[0].options.min||0)&&h(l,"min",r),d&1&&_t(l.value)!==f[0].options.max&&ue(l,f[0].options.max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function J$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Regex pattern"),s=E(),l=y("input"),h(e,"for",i=n[13]),h(l,"type","text"),h(l,"id",o=n[13]),h(l,"placeholder","Valid Go regular expression, eg. ^w+$")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.pattern),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&h(e,"for",i),f&8192&&o!==(o=u[13])&&h(l,"id",o),f&1&&l.value!==u[0].options.pattern&&ue(l,u[0].options.pattern)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Z$(n){let e,t,i,s,l,o,r,a,u,f;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[Y$,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[K$,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[J$,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),h(t,"class","col-sm-3"),h(l,"class","col-sm-3"),h(a,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(d,p){S(d,e,p),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),V(u,a,null),f=!0},p(d,p){const m={};p&2&&(m.name="schema."+d[1]+".options.min"),p&24577&&(m.$$scope={dirty:p,ctx:d}),i.$set(m);const _={};p&2&&(_.name="schema."+d[1]+".options.max"),p&24577&&(_.$$scope={dirty:p,ctx:d}),o.$set(_);const g={};p&2&&(g.name="schema."+d[1]+".options.pattern"),p&24577&&(g.$$scope={dirty:p,ctx:d}),u.$set(g)},i(d){f||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),f=!0)},o(d){P(i.$$.fragment,d),P(o.$$.fragment,d),P(u.$$.fragment,d),f=!1},d(d){d&&w(e),H(i),H(o),H(u)}}}function G$(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[Z$]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("drop",n[9]),e.$on("dragstart",n[10]),e.$on("dragenter",n[11]),e.$on("dragleave",n[12]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};a&16387&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function X$(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=_t(this.value),t(0,l)}function a(){l.options.max=_t(this.value),t(0,l)}function u(){l.options.pattern=this.value,t(0,l)}function f(k){l=k,t(0,l)}function d(k){pe.call(this,n,k)}function p(k){pe.call(this,n,k)}function m(k){pe.call(this,n,k)}function _(k){pe.call(this,n,k)}function g(k){pe.call(this,n,k)}function b(k){pe.call(this,n,k)}return n.$$set=k=>{e=Re(Re({},e),Yt(k)),t(2,s=Xe(e,i)),"field"in k&&t(0,l=k.field),"key"in k&&t(1,o=k.key)},[l,o,s,r,a,u,f,d,p,m,_,g,b]}class Q$ extends ve{constructor(e){super(),be(this,e,X$,G$,_e,{field:0,key:1})}}function x$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min"),s=E(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.min),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].options.min&&ue(l,u[0].options.min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function eT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max"),s=E(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12]),h(l,"min",r=n[0].options.min)},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ue(l,n[0].options.max),a||(u=J(l,"input",n[4]),a=!0)},p(f,d){d&4096&&i!==(i=f[12])&&h(e,"for",i),d&4096&&o!==(o=f[12])&&h(l,"id",o),d&1&&r!==(r=f[0].options.min)&&h(l,"min",r),d&1&&_t(l.value)!==f[0].options.max&&ue(l,f[0].options.max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function tT(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[x$,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[eT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){S(a,e,u),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.max"),u&12289&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),H(i),H(o)}}}function nT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[tT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function iT(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=_t(this.value),t(0,l)}function a(){l.options.max=_t(this.value),t(0,l)}function u(b){l=b,t(0,l)}function f(b){pe.call(this,n,b)}function d(b){pe.call(this,n,b)}function p(b){pe.call(this,n,b)}function m(b){pe.call(this,n,b)}function _(b){pe.call(this,n,b)}function g(b){pe.call(this,n,b)}return n.$$set=b=>{e=Re(Re({},e),Yt(b)),t(2,s=Xe(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,s,r,a,u,f,d,p,m,_,g]}class sT extends ve{constructor(e){super(),be(this,e,iT,nT,_e,{field:0,key:1})}}function lT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function oT(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){pe.call(this,n,_)}function u(_){pe.call(this,n,_)}function f(_){pe.call(this,n,_)}function d(_){pe.call(this,n,_)}function p(_){pe.call(this,n,_)}function m(_){pe.call(this,n,_)}return n.$$set=_=>{e=Re(Re({},e),Yt(_)),t(2,s=Xe(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class rT extends ve{constructor(e){super(),be(this,e,oT,lT,_e,{field:0,key:1})}}function aT(n){let e,t,i,s,l=[{type:t=n[3].type||"text"},{value:n[2]},n[3]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=Re(Re({},e),Yt(u)),t(3,l=Xe(e,s)),"value"in u&&t(0,o=u.value),"separator"in u&&t(1,r=u.separator)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=(o||[]).join(", "))},[o,r,i,l,a]}class qs extends ve{constructor(e){super(),be(this,e,uT,aT,_e,{value:0,separator:1})}}function fT(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[3](b)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(g.value=n[0].options.exceptDomains),r=new qs({props:g}),se.push(()=>he(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),V(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!j.isEmpty(b[0].options.onlyDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function cT(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[4](b)}let g={id:n[12]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(g.value=n[0].options.onlyDomains),r=new qs({props:g}),se.push(()=>he(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]+".options.onlyDomains"),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),V(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]+".options.onlyDomains"))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]+".options.onlyDomains"),k&1&&($.disabled=!j.isEmpty(b[0].options.exceptDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function dT(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[fT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[cT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){S(a,e,u),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.onlyDomains"),u&12289&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),H(i),H(o)}}}function pT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[dT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function mT(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(b){n.$$.not_equal(l.options.exceptDomains,b)&&(l.options.exceptDomains=b,t(0,l))}function a(b){n.$$.not_equal(l.options.onlyDomains,b)&&(l.options.onlyDomains=b,t(0,l))}function u(b){l=b,t(0,l)}function f(b){pe.call(this,n,b)}function d(b){pe.call(this,n,b)}function p(b){pe.call(this,n,b)}function m(b){pe.call(this,n,b)}function _(b){pe.call(this,n,b)}function g(b){pe.call(this,n,b)}return n.$$set=b=>{e=Re(Re({},e),Yt(b)),t(2,s=Xe(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,s,r,a,u,f,d,p,m,_,g]}class sb extends ve{constructor(e){super(),be(this,e,mT,pT,_e,{field:0,key:1})}}function hT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function _T(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){pe.call(this,n,_)}function u(_){pe.call(this,n,_)}function f(_){pe.call(this,n,_)}function d(_){pe.call(this,n,_)}function p(_){pe.call(this,n,_)}function m(_){pe.call(this,n,_)}return n.$$set=_=>{e=Re(Re({},e),Yt(_)),t(2,s=Xe(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class gT extends ve{constructor(e){super(),be(this,e,_T,hT,_e,{field:0,key:1})}}function bT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?St(s,[a&2&&{key:r[1]},a&4&&Kt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function vT(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){pe.call(this,n,_)}function u(_){pe.call(this,n,_)}function f(_){pe.call(this,n,_)}function d(_){pe.call(this,n,_)}function p(_){pe.call(this,n,_)}function m(_){pe.call(this,n,_)}return n.$$set=_=>{e=Re(Re({},e),Yt(_)),t(2,s=Xe(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class yT extends ve{constructor(e){super(),be(this,e,vT,bT,_e,{field:0,key:1})}}var Or=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],$s={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},kl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},_n=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Fn=function(n){return n===!0?1:0};function xc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Dr=function(n){return n instanceof Array?n:[n]};function rn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ut(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function so(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function lb(n,e){if(e(n))return n;if(n.parentNode)return lb(n.parentNode,e)}function lo(n,e){var t=ut("div","numInputWrapper"),i=ut("input","numInput "+n),s=ut("span","arrowUp"),l=ut("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function $n(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Er=function(){},Fo=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},kT={D:Er,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Fn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Er,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Er,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Xi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ul={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ul.w(n,e,t)]},F:function(n,e,t){return Fo(ul.n(n,e,t)-1,!1,e)},G:function(n,e,t){return _n(ul.h(n,e,t))},H:function(n){return _n(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Fn(n.getHours()>11)]},M:function(n,e){return Fo(n.getMonth(),!0,e)},S:function(n){return _n(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return _n(n.getFullYear(),4)},d:function(n){return _n(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return _n(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return _n(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},ob=function(n){var e=n.config,t=e===void 0?$s:e,i=n.l10n,s=i===void 0?kl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(d,p,m){return ul[d]&&m[p-1]!=="\\"?ul[d](r,f,t):d!=="\\"?d:""}).join("")}},ha=function(n){var e=n.config,t=e===void 0?$s:e,i=n.l10n,s=i===void 0?kl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,d=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var p=o||(t||$s).dateFormat,m=String(l).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,p);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(l);else{for(var _=void 0,g=[],b=0,k=0,$="";bMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ne=Ir(t.config);K.setHours(ne.hours,ne.minutes,ne.seconds,K.getMilliseconds()),t.selectedDates=[K],t.latestSelectedDateObj=K}W!==void 0&&W.type!=="blur"&&Rl(W);var oe=t._input.value;d(),Xt(),t._input.value!==oe&&t._debouncedChange()}function u(W,K){return W%12+12*Fn(K===t.l10n.amPM[1])}function f(W){switch(W%24){case 0:case 12:return 12;default:return W%12}}function d(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var W=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,K=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(W=u(W,t.amPM.textContent));var oe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Tn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Tn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Ie=Ar(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Pe=Ar(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Oe=Ar(W,K,ne);if(Oe>Pe&&Oe=12)]),t.secondElement!==void 0&&(t.secondElement.value=_n(ne)))}function _(W){var K=$n(W),ne=parseInt(K.value)+(W.delta||0);(ne/1e3>1||W.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&we(ne)}function g(W,K,ne,oe){if(K instanceof Array)return K.forEach(function(Te){return g(W,Te,ne,oe)});if(W instanceof Array)return W.forEach(function(Te){return g(Te,K,ne,oe)});W.addEventListener(K,ne,oe),t._handlers.push({remove:function(){return W.removeEventListener(K,ne,oe)}})}function b(){tt("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(oe){return g(oe,"click",t[ne])})}),t.isMobile){us();return}var W=xc(te,50);if(t._debouncedChange=xc(b,TT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&We($n(ne))}),g(t._input,"keydown",Ze),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",Ze),!t.config.inline&&!t.config.static&&g(window,"resize",W),window.ontouchstart!==void 0?g(window.document,"touchstart",He):g(window.document,"mousedown",He),g(window.document,"focus",He,{capture:!0}),t.config.clickOpens===!0&&(g(t._input,"focus",t.open),g(t._input,"click",t.open)),t.daysContainer!==void 0&&(g(t.monthNav,"click",on),g(t.monthNav,["keyup","increment"],_),g(t.daysContainer,"click",je)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var K=function(ne){return $n(ne).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",T),g([t.hourElement,t.minuteElement],["focus","click"],K),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&g(t._input,"blur",mt)}function $(W,K){var ne=W!==void 0?t.parseDate(W):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(W);var Te=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Te&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ie=ut("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ie,t.element),Ie.appendChild(t.element),t.altInput&&Ie.appendChild(t.altInput),Ie.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function M(W,K,ne,oe){var Te=Ce(K,!0),Ie=ut("span",W,K.getDate().toString());return Ie.dateObj=K,Ie.$i=oe,Ie.setAttribute("aria-label",t.formatDate(K,t.config.ariaDateFormat)),W.indexOf("hidden")===-1&&Tn(K,t.now)===0&&(t.todayDateElem=Ie,Ie.classList.add("today"),Ie.setAttribute("aria-current","date")),Te?(Ie.tabIndex=-1,oi(K)&&(Ie.classList.add("selected"),t.selectedDateElem=Ie,t.config.mode==="range"&&(rn(Ie,"startRange",t.selectedDates[0]&&Tn(K,t.selectedDates[0],!0)===0),rn(Ie,"endRange",t.selectedDates[1]&&Tn(K,t.selectedDates[1],!0)===0),W==="nextMonthDay"&&Ie.classList.add("inRange")))):Ie.classList.add("flatpickr-disabled"),t.config.mode==="range"&&cs(K)&&!oi(K)&&Ie.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&W!=="prevMonthDay"&&oe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(K)+""),tt("onDayCreate",Ie),Ie}function O(W){W.focus(),t.config.mode==="range"&&We(W)}function I(W){for(var K=W>0?0:t.config.showMonths-1,ne=W>0?t.config.showMonths:-1,oe=K;oe!=ne;oe+=W)for(var Te=t.daysContainer.children[oe],Ie=W>0?0:Te.children.length-1,Pe=W>0?Te.children.length:-1,Oe=Ie;Oe!=Pe;Oe+=W){var Ye=Te.children[Oe];if(Ye.className.indexOf("hidden")===-1&&Ce(Ye.dateObj))return Ye}}function L(W,K){for(var ne=W.className.indexOf("Month")===-1?W.dateObj.getMonth():t.currentMonth,oe=K>0?t.config.showMonths:-1,Te=K>0?1:-1,Ie=ne-t.currentMonth;Ie!=oe;Ie+=Te)for(var Pe=t.daysContainer.children[Ie],Oe=ne-t.currentMonth===Ie?W.$i+K:K<0?Pe.children.length-1:0,Ye=Pe.children.length,Ne=Oe;Ne>=0&&Ne0?Ye:-1);Ne+=Te){var Be=Pe.children[Ne];if(Be.className.indexOf("hidden")===-1&&Ce(Be.dateObj)&&Math.abs(W.$i-Ne)>=Math.abs(K))return O(Be)}t.changeMonth(Te),F(I(Te),0)}function F(W,K){var ne=l(),oe=Je(ne||document.body),Te=W!==void 0?W:oe?ne:t.selectedDateElem!==void 0&&Je(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Je(t.todayDateElem)?t.todayDateElem:I(K>0?1:-1);Te===void 0?t._input.focus():oe?L(Te,K):O(Te)}function R(W,K){for(var ne=(new Date(W,K,1).getDay()-t.l10n.firstDayOfWeek+7)%7,oe=t.utils.getDaysInMonth((K-1+12)%12,W),Te=t.utils.getDaysInMonth(K,W),Ie=window.document.createDocumentFragment(),Pe=t.config.showMonths>1,Oe=Pe?"prevMonthDay hidden":"prevMonthDay",Ye=Pe?"nextMonthDay hidden":"nextMonthDay",Ne=oe+1-ne,Be=0;Ne<=oe;Ne++,Be++)Ie.appendChild(M("flatpickr-day "+Oe,new Date(W,K-1,Ne),Ne,Be));for(Ne=1;Ne<=Te;Ne++,Be++)Ie.appendChild(M("flatpickr-day",new Date(W,K,Ne),Ne,Be));for(var bt=Te+1;bt<=42-ne&&(t.config.showMonths===1||Be%7!==0);bt++,Be++)Ie.appendChild(M("flatpickr-day "+Ye,new Date(W,K+1,bt%Te),bt,Be));var Xn=ut("div","dayContainer");return Xn.appendChild(Ie),Xn}function N(){if(t.daysContainer!==void 0){so(t.daysContainer),t.weekNumbers&&so(t.weekNumbers);for(var W=document.createDocumentFragment(),K=0;K1||t.config.monthSelectorType!=="dropdown")){var W=function(oe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&oet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var K=0;K<12;K++)if(W(K)){var ne=ut("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,K).getMonth().toString(),ne.textContent=Fo(K,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===K&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function Y(){var W=ut("div","flatpickr-month"),K=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=ut("span","cur-month"):(t.monthsDropdownContainer=ut("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(Pe){var Oe=$n(Pe),Ye=parseInt(Oe.value,10);t.changeMonth(Ye-t.currentMonth),tt("onMonthChange")}),q(),ne=t.monthsDropdownContainer);var oe=lo("cur-year",{tabindex:"-1"}),Te=oe.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ie=ut("div","flatpickr-current-month");return Ie.appendChild(ne),Ie.appendChild(oe),K.appendChild(Ie),W.appendChild(K),{container:W,yearElement:Te,monthElement:ne}}function B(){so(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var W=t.config.showMonths;W--;){var K=Y();t.yearElements.push(K.yearElement),t.monthElements.push(K.monthElement),t.monthNav.appendChild(K.container)}t.monthNav.appendChild(t.nextMonthNav)}function Z(){return t.monthNav=ut("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ut("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ut("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,B(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(W){t.__hidePrevMonthArrow!==W&&(rn(t.prevMonthNav,"flatpickr-disabled",W),t.__hidePrevMonthArrow=W)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(W){t.__hideNextMonthArrow!==W&&(rn(t.nextMonthNav,"flatpickr-disabled",W),t.__hideNextMonthArrow=W)}}),t.currentYearElement=t.yearElements[0],Vi(),t.monthNav}function ee(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var W=Ir(t.config);t.timeContainer=ut("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var K=ut("span","flatpickr-time-separator",":"),ne=lo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var oe=lo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=oe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=_n(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?W.hours:f(W.hours)),t.minuteElement.value=_n(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():W.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ne),t.timeContainer.appendChild(K),t.timeContainer.appendChild(oe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=lo("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=_n(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():W.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ut("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=ut("span","flatpickr-am-pm",t.l10n.amPM[Fn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function ie(){t.weekdayContainer?so(t.weekdayContainer):t.weekdayContainer=ut("div","flatpickr-weekdays");for(var W=t.config.showMonths;W--;){var K=ut("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(K)}return X(),t.weekdayContainer}function X(){if(t.weekdayContainer){var W=t.l10n.firstDayOfWeek,K=ed(t.l10n.weekdays.shorthand);W>0&&W `+K.join("")+` - `}}function fe(){t.calendarContainer.classList.add("hasWeeks");var W=ut("div","flatpickr-weekwrapper");W.appendChild(ut("span","flatpickr-weekday",t.l10n.weekAbbreviation));var K=ut("div","flatpickr-weeks");return W.appendChild(K),{weekWrapper:W,weekNumbers:K}}function G(W,K){K===void 0&&(K=!0);var ne=K?W:W-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,tt("onYearChange"),q()),N(),tt("onMonthChange"),Vi())}function ce(W,K){if(W===void 0&&(W=!0),K===void 0&&(K=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,K===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Ir(t.config),oe=ne.hours,Te=ne.minutes,Ie=ne.seconds;m(oe,Te,Ie)}t.redraw(),W&&tt("onChange")}function ge(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),tt("onClose")}function Me(){t.config!==void 0&&tt("onDestroy");for(var W=t._handlers.length;W--;)t._handlers[W].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var K=t.calendarContainer.parentNode;if(K.lastChild&&K.removeChild(K.lastChild),K.parentNode){for(;K.firstChild;)K.parentNode.insertBefore(K.firstChild,K);K.parentNode.removeChild(K)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function qe(W){return t.calendarContainer.contains(W)}function He(W){if(t.isOpen&&!t.config.inline){var K=$n(W),ne=qe(K),oe=K===t.input||K===t.altInput||t.element.contains(K)||W.path&&W.path.indexOf&&(~W.path.indexOf(t.input)||~W.path.indexOf(t.altInput)),Te=!oe&&!ne&&!qe(W.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Pe){return Pe.contains(K)});Te&&Ie&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function we(W){if(!(!W||t.config.minDate&&Wt.config.maxDate.getFullYear())){var K=W,ne=t.currentYear!==K;t.currentYear=K||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),tt("onYearChange"),q())}}function Ce(W,K){var ne;K===void 0&&(K=!0);var oe=t.parseDate(W,void 0,K);if(t.config.minDate&&oe&&Tn(oe,t.config.minDate,K!==void 0?K:!t.minDateHasTime)<0||t.config.maxDate&&oe&&Tn(oe,t.config.maxDate,K!==void 0?K:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var Te=!!t.config.enable,Ie=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Pe=0,Oe=void 0;Pe=Oe.from.getTime()&&oe.getTime()<=Oe.to.getTime())return Te}return!Te}function Je(W){return t.daysContainer!==void 0?W.className.indexOf("hidden")===-1&&W.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(W):!1}function mt(W){var K=W.target===t._input,ne=t._input.value.trimEnd()!==Hi();K&&ne&&!(W.relatedTarget&&qe(W.relatedTarget))&&t.setDate(t._input.value,!0,W.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ze(W){var K=$n(W),ne=t.config.wrap?n.contains(K):K===t._input,oe=t.config.allowInput,Te=t.isOpen&&(!oe||!ne),Ie=t.config.inline&&ne&&!oe;if(W.keyCode===13&&ne){if(oe)return t.setDate(t._input.value,!0,K===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),K.blur();t.open()}else if(qe(K)||Te||Ie){var Pe=!!t.timeContainer&&t.timeContainer.contains(K);switch(W.keyCode){case 13:Pe?(W.preventDefault(),a(),ye()):je(W);break;case 27:W.preventDefault(),ye();break;case 8:case 46:ne&&!t.config.allowInput&&(W.preventDefault(),t.clear());break;case 37:case 39:if(!Pe&&!ne){W.preventDefault();var Oe=l();if(t.daysContainer!==void 0&&(oe===!1||Oe&&Je(Oe))){var Ye=W.keyCode===39?1:-1;W.ctrlKey?(W.stopPropagation(),G(Ye),F(I(1),0)):F(void 0,Ye)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:W.preventDefault();var Ne=W.keyCode===40?1:-1;t.daysContainer&&K.$i!==void 0||K===t.input||K===t.altInput?W.ctrlKey?(W.stopPropagation(),we(t.currentYear-Ne),F(I(1),0)):Pe||F(void 0,Ne*7):K===t.currentYearElement?we(t.currentYear-Ne):t.config.enableTime&&(!Pe&&t.hourElement&&t.hourElement.focus(),a(W),t._debouncedChange());break;case 9:if(Pe){var Be=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Sn){return Sn}),bt=Be.indexOf(K);if(bt!==-1){var Xn=Be[bt+(W.shiftKey?-1:1)];W.preventDefault(),(Xn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(K)&&W.shiftKey&&(W.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&K===t.amPM)switch(W.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],d(),Xt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],d(),Xt();break}(ne||qe(K))&&tt("onKeyDown",W)}function We(W,K){if(K===void 0&&(K="flatpickr-day"),!(t.selectedDates.length!==1||W&&(!W.classList.contains(K)||W.classList.contains("flatpickr-disabled")))){for(var ne=W?W.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),oe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(ne,t.selectedDates[0].getTime()),Ie=Math.max(ne,t.selectedDates[0].getTime()),Pe=!1,Oe=0,Ye=0,Ne=Te;NeTe&&NeOe)?Oe=Ne:Ne>oe&&(!Ye||Ne ."+K));Be.forEach(function(bt){var Xn=bt.dateObj,Sn=Xn.getTime(),js=Oe>0&&Sn0&&Sn>Ye;if(js){bt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ds){bt.classList.remove(ds)});return}else if(Pe&&!js)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ds){bt.classList.remove(ds)}),W!==void 0&&(W.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),oene&&Sn===oe&&bt.classList.add("endRange"),Sn>=Oe&&(Ye===0||Sn<=Ye)&&kT(Sn,oe,ne)&&bt.classList.add("inRange"))})}}function te(){t.isOpen&&!t.config.static&&!t.config.inline&&et()}function Fe(W,K){if(K===void 0&&(K=t._positionElement),t.isMobile===!0){if(W){W.preventDefault();var ne=$n(W);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),tt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var oe=t.isOpen;t.isOpen=!0,oe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),tt("onOpen"),et(K)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(W===void 0||!t.timeContainer.contains(W.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function Qe(W){return function(K){var ne=t.config["_"+W+"Date"]=t.parseDate(K,t.config.dateFormat),oe=t.config["_"+(W==="min"?"max":"min")+"Date"];ne!==void 0&&(t[W==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return Ce(Te)}),!t.selectedDates.length&&W==="min"&&p(ne),Xt()),t.daysContainer&&(jt(),ne!==void 0?t.currentYearElement[W]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(W),t.currentYearElement.disabled=!!oe&&ne!==void 0&&oe.getFullYear()===ne.getFullYear())}}function Gt(){var W=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],K=en(en({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=K.parseDate,t.config.formatDate=K.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Be){t.config._enable=yi(Be)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Be){t.config._disable=yi(Be)}});var oe=K.mode==="time";if(!K.dateFormat&&(K.enableTime||oe)){var Te=zt.defaultConfig.dateFormat||$s.dateFormat;ne.dateFormat=K.noCalendar||oe?"H:i"+(K.enableSeconds?":S":""):Te+" H:i"+(K.enableSeconds?":S":"")}if(K.altInput&&(K.enableTime||oe)&&!K.altFormat){var Ie=zt.defaultConfig.altFormat||$s.altFormat;ne.altFormat=K.noCalendar||oe?"h:i"+(K.enableSeconds?":S K":" K"):Ie+(" h:i"+(K.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Qe("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Qe("max")});var Pe=function(Be){return function(bt){t.config[Be==="min"?"_minTime":"_maxTime"]=t.parseDate(bt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Pe("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Pe("max")}),K.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,K);for(var Oe=0;Oe-1?t.config[Ne]=Dr(Ye[Ne]).map(o).concat(t.config[Ne]):typeof K[Ne]>"u"&&(t.config[Ne]=Ye[Ne])}K.altInputClass||(t.config.altInputClass=Le().className+" "+t.config.altInputClass),tt("onParseConfig")}function Le(){return t.config.wrap?n.querySelector("[data-input]"):n}function $e(){typeof t.config.locale!="object"&&typeof zt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=en(en({},zt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?zt.l10ns[t.config.locale]:void 0),Xi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Xi.l="("+t.l10n.weekdays.longhand.join("|")+")",Xi.M="("+t.l10n.months.shorthand.join("|")+")",Xi.F="("+t.l10n.months.longhand.join("|")+")",Xi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var W=en(en({},e),JSON.parse(JSON.stringify(n.dataset||{})));W.time_24hr===void 0&&zt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=lb(t),t.parseDate=ha({config:t.config,l10n:t.l10n})}function et(W){if(typeof t.config.position=="function")return void t.config.position(t,W);if(t.calendarContainer!==void 0){tt("onPreCalendarPosition");var K=W||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(bb,vb){return bb+vb.offsetHeight},0),oe=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Ie=Te[0],Pe=Te.length>1?Te[1]:null,Oe=K.getBoundingClientRect(),Ye=window.innerHeight-Oe.bottom,Ne=Ie==="above"||Ie!=="below"&&Yene,Be=window.pageYOffset+Oe.top+(Ne?-ne-2:K.offsetHeight+2);if(rn(t.calendarContainer,"arrowTop",!Ne),rn(t.calendarContainer,"arrowBottom",Ne),!t.config.inline){var bt=window.pageXOffset+Oe.left,Xn=!1,Sn=!1;Pe==="center"?(bt-=(oe-Oe.width)/2,Xn=!0):Pe==="right"&&(bt-=oe-Oe.width,Sn=!0),rn(t.calendarContainer,"arrowLeft",!Xn&&!Sn),rn(t.calendarContainer,"arrowCenter",Xn),rn(t.calendarContainer,"arrowRight",Sn);var js=window.document.body.offsetWidth-(window.pageXOffset+Oe.right),ds=bt+oe>window.document.body.offsetWidth,cb=js+oe>window.document.body.offsetWidth;if(rn(t.calendarContainer,"rightMost",ds),!t.config.static)if(t.calendarContainer.style.top=Be+"px",!ds)t.calendarContainer.style.left=bt+"px",t.calendarContainer.style.right="auto";else if(!cb)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=js+"px";else{var nr=Dt();if(nr===void 0)return;var db=window.document.body.offsetWidth,pb=Math.max(0,db/2-oe/2),mb=".flatpickr-calendar.centerMost:before",hb=".flatpickr-calendar.centerMost:after",_b=nr.cssRules.length,gb="{left:"+Oe.left+"px;right:auto;}";rn(t.calendarContainer,"rightMost",!1),rn(t.calendarContainer,"centerMost",!0),nr.insertRule(mb+","+hb+gb,_b),t.calendarContainer.style.left=pb+"px",t.calendarContainer.style.right="auto"}}}}function Dt(){for(var W=null,K=0;Kt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=oe,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var Pe=oi(Te);Pe?t.selectedDates.splice(parseInt(Pe),1):t.selectedDates.push(Te)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Te,t.selectedDates.push(Te),Tn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Be,bt){return Be.getTime()-bt.getTime()}));if(d(),Ie){var Oe=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),Oe&&(tt("onYearChange"),q()),tt("onMonthChange")}if(Vi(),N(),Xt(),!Ie&&t.config.mode!=="range"&&t.config.showMonths===1?O(oe):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Ye=t.config.mode==="single"&&!t.config.enableTime,Ne=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ye||Ne)&&ye()}b()}}var gt={locale:[$e,X],showMonths:[B,r,ie],minDate:[$],maxDate:[$],positionElement:[ji],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ge(W,K){if(W!==null&&typeof W=="object"){Object.assign(t.config,W);for(var ne in W)gt[ne]!==void 0&>[ne].forEach(function(oe){return oe()})}else t.config[W]=K,gt[W]!==void 0?gt[W].forEach(function(oe){return oe()}):Or.indexOf(W)>-1&&(t.config[W]=Dr(K));t.redraw(),Xt(!0)}function mn(W,K){var ne=[];if(W instanceof Array)ne=W.map(function(oe){return t.parseDate(oe,K)});else if(W instanceof Date||typeof W=="number")ne=[t.parseDate(W,K)];else if(typeof W=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(W,K)];break;case"multiple":ne=W.split(t.config.conjunction).map(function(oe){return t.parseDate(oe,K)});break;case"range":ne=W.split(t.l10n.rangeSeparator).map(function(oe){return t.parseDate(oe,K)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(W)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(oe){return oe instanceof Date&&Ce(oe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(oe,Te){return oe.getTime()-Te.getTime()})}function vi(W,K,ne){if(K===void 0&&(K=!1),ne===void 0&&(ne=t.config.dateFormat),W!==0&&!W||W instanceof Array&&W.length===0)return t.clear(K);mn(W,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),$(void 0,K),p(),t.selectedDates.length===0&&t.clear(!1),Xt(K),K&&tt("onChange")}function yi(W){return W.slice().map(function(K){return typeof K=="string"||typeof K=="number"||K instanceof Date?t.parseDate(K,void 0,!0):K&&typeof K=="object"&&K.from&&K.to?{from:t.parseDate(K.from,void 0),to:t.parseDate(K.to,void 0)}:K}).filter(function(K){return K})}function as(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var W=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);W&&mn(W,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Fl(){if(t.input=Le(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ut(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),ji()}function ji(){t._positionElement=t.config.positionElement||t._input}function us(){var W=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ut("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=W,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=W==="datetime-local"?"Y-m-d\\TH:i:S":W==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}g(t.mobileInput,"change",function(K){t.setDate($n(K).value,!1,t.mobileFormatStr),tt("onChange"),tt("onClose")})}function hn(W){if(t.isOpen===!0)return t.close();t.open(W)}function tt(W,K){if(t.config!==void 0){var ne=t.config[W];if(ne!==void 0&&ne.length>0)for(var oe=0;ne[oe]&&oe=0&&Tn(W,t.selectedDates[1])<=0}function Vi(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(W,K){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+K),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[K].textContent=Fo(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),W.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function Hi(W){var K=W||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,K)}).filter(function(ne,oe,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(ne)===oe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Xt(W){W===void 0&&(W=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Hi(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Hi(t.config.altFormat)),W!==!1&&tt("onValueUpdate")}function on(W){var K=$n(W),ne=t.prevMonthNav.contains(K),oe=t.nextMonthNav.contains(K);ne||oe?G(ne?-1:1):t.yearElements.indexOf(K)>=0?K.select():K.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):K.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Rl(W){W.preventDefault();var K=W.type==="keydown",ne=$n(W),oe=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Fn(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(oe.getAttribute("min")),Ie=parseFloat(oe.getAttribute("max")),Pe=parseFloat(oe.getAttribute("step")),Oe=parseInt(oe.value,10),Ye=W.delta||(K?W.which===38?1:-1:0),Ne=Oe+Pe*Ye;if(typeof oe.value<"u"&&oe.value.length===2){var Be=oe===t.hourElement,bt=oe===t.minuteElement;NeIe&&(Ne=oe===t.hourElement?Ne-Ie-Fn(!t.amPM):Te,bt&&C(void 0,1,t.hourElement)),t.amPM&&Be&&(Pe===1?Ne+Oe===23:Math.abs(Ne-Oe)>Pe)&&(t.amPM.textContent=t.l10n.amPM[Fn(t.amPM.textContent===t.l10n.amPM[0])]),oe.value=_n(Ne)}}return s(),t}function Ts(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function DT(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Xe(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:d=void 0}=e,{options:p={}}=e,m=!1,{input:_=void 0,flatpickr:g=void 0}=e;xt(()=>{const C=f??_,D=k(p);return D.onReady.push((M,O,I)=>{a===void 0&&$(M,O,I),ln().then(()=>{t(8,m=!0)})}),t(3,g=zt(C,Object.assign(D,f?{wrap:!0}:{}))),()=>{g.destroy()}});const b=kt();function k(C={}){C=Object.assign({},C);for(const D of r){const M=(O,I,L)=>{b(OT(D),[O,I,L])};D in C?(Array.isArray(C[D])||(C[D]=[C[D]]),C[D].push(M)):C[D]=[M]}return C.onChange&&!C.onChange.includes($)&&C.onChange.push($),C}function $(C,D,M){const O=td(M,C);!nd(a,O)&&(a||O)&&t(2,a=O),t(4,u=D)}function T(C){se[C?"unshift":"push"](()=>{_=C,t(0,_)})}return n.$$set=C=>{e=Re(Re({},e),Yt(C)),t(1,s=Xe(e,i)),"value"in C&&t(2,a=C.value),"formattedValue"in C&&t(4,u=C.formattedValue),"element"in C&&t(5,f=C.element),"dateFormat"in C&&t(6,d=C.dateFormat),"options"in C&&t(7,p=C.options),"input"in C&&t(0,_=C.input),"flatpickr"in C&&t(3,g=C.flatpickr),"$$scope"in C&&t(9,o=C.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&m&&(nd(a,td(g,g.selectedDates))||g.setDate(a,!0,d)),n.$$.dirty&392&&g&&m)for(const[C,D]of Object.entries(k(p)))g.set(C,D)},[_,s,a,g,u,f,d,p,m,o,l,T]}class lu extends ve{constructor(e){super(),be(this,e,DT,MT,_e,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function ET(n){let e,t,i,s,l,o,r,a;function u(p){n[6](p)}function f(p){n[7](p)}let d={id:n[19],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(d.value=n[2]),n[0].options.min!==void 0&&(d.formattedValue=n[0].options.min),l=new lu({props:d}),se.push(()=>he(l,"value",u)),se.push(()=>he(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=y("label"),t=U("Min date (UTC)"),s=E(),z(l.$$.fragment),h(e,"for",i=n[19])},m(p,m){S(p,e,m),v(e,t),S(p,s,m),V(l,p,m),a=!0},p(p,m){(!a||m&524288&&i!==(i=p[19]))&&h(e,"for",i);const _={};m&524288&&(_.id=p[19]),!o&&m&4&&(o=!0,_.value=p[2],ke(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=p[0].options.min,ke(()=>r=!1)),l.$set(_)},i(p){a||(A(l.$$.fragment,p),a=!0)},o(p){P(l.$$.fragment,p),a=!1},d(p){p&&w(e),p&&w(s),H(l,p)}}}function AT(n){let e,t,i,s,l,o,r,a;function u(p){n[9](p)}function f(p){n[10](p)}let d={id:n[19],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(d.value=n[3]),n[0].options.max!==void 0&&(d.formattedValue=n[0].options.max),l=new lu({props:d}),se.push(()=>he(l,"value",u)),se.push(()=>he(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=y("label"),t=U("Max date (UTC)"),s=E(),z(l.$$.fragment),h(e,"for",i=n[19])},m(p,m){S(p,e,m),v(e,t),S(p,s,m),V(l,p,m),a=!0},p(p,m){(!a||m&524288&&i!==(i=p[19]))&&h(e,"for",i);const _={};m&524288&&(_.id=p[19]),!o&&m&8&&(o=!0,_.value=p[3],ke(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=p[0].options.max,ke(()=>r=!1)),l.$set(_)},i(p){a||(A(l.$$.fragment,p),a=!0)},o(p){P(l.$$.fragment,p),a=!1},d(p){p&&w(e),p&&w(s),H(l,p)}}}function IT(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[ET,({uniqueId:a})=>({19:a}),({uniqueId:a})=>a?524288:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[AT,({uniqueId:a})=>({19:a}),({uniqueId:a})=>a?524288:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){S(a,e,u),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&1572869&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.max"),u&1572873&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),H(i),H(o)}}}function PT(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[IT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("drop",n[15]),e.$on("dragstart",n[16]),e.$on("dragenter",n[17]),e.$on("dragleave",n[18]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&34?St(s,[a&2&&{key:r[1]},a&32&&Kt(r[5])]):{};a&1048591&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function LT(n,e,t){var O,I;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e,r=(O=l==null?void 0:l.options)==null?void 0:O.min,a=(I=l==null?void 0:l.options)==null?void 0:I.max;function u(L,F){L.detail&&L.detail.length==3&&t(0,l.options[F]=L.detail[1],l)}function f(L){r=L,t(2,r),t(0,l)}function d(L){n.$$.not_equal(l.options.min,L)&&(l.options.min=L,t(0,l))}const p=L=>u(L,"min");function m(L){a=L,t(3,a),t(0,l)}function _(L){n.$$.not_equal(l.options.max,L)&&(l.options.max=L,t(0,l))}const g=L=>u(L,"max");function b(L){l=L,t(0,l)}function k(L){pe.call(this,n,L)}function $(L){pe.call(this,n,L)}function T(L){pe.call(this,n,L)}function C(L){pe.call(this,n,L)}function D(L){pe.call(this,n,L)}function M(L){pe.call(this,n,L)}return n.$$set=L=>{e=Re(Re({},e),Yt(L)),t(5,s=Xe(e,i)),"field"in L&&t(0,l=L.field),"key"in L&&t(1,o=L.key)},n.$$.update=()=>{var L,F,R,N;n.$$.dirty&5&&r!=((L=l==null?void 0:l.options)==null?void 0:L.min)&&t(2,r=(F=l==null?void 0:l.options)==null?void 0:F.min),n.$$.dirty&9&&a!=((R=l==null?void 0:l.options)==null?void 0:R.max)&&t(3,a=(N=l==null?void 0:l.options)==null?void 0:N.max)},[l,o,r,a,u,s,f,d,p,m,_,g,b,k,$,T,C,D,M]}class NT extends ve{constructor(e){super(),be(this,e,LT,PT,_e,{field:0,key:1})}}const FT=n=>({}),id=n=>({});function sd(n,e,t){const i=n.slice();return i[46]=e[t],i}const RT=n=>({}),ld=n=>({});function od(n,e,t){const i=n.slice();return i[46]=e[t],i[50]=t,i}function rd(n){let e,t,i;return{c(){e=y("div"),t=U(n[2]),i=E(),h(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5])},m(s,l){S(s,e,l),v(e,t),v(e,i)},p(s,l){l[0]&4&&le(t,s[2]),l[0]&32&&x(e,"link-hint",!s[5])},d(s){s&&w(e)}}}function qT(n){let e,t=n[46]+"",i;return{c(){e=y("span"),i=U(t),h(e,"class","txt")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l[0]&1&&t!==(t=s[46]+"")&&le(i,t)},i:Q,o:Q,d(s){s&&w(e)}}}function jT(n){let e,t,i;const s=[{item:n[46]},n[9]];var l=n[8];function o(r){let a={};for(let u=0;u{H(f,1)}),ae()}l?(e=Pt(l,o()),z(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function ad(n){let e,t,i;function s(){return n[34](n[46])}return{c(){e=y("span"),e.innerHTML='',h(e,"class","clear")},m(l,o){S(l,e,o),t||(i=[Ee(Ue.call(null,e,"Clear")),J(e,"click",En(ft(s)))],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,De(i)}}}function ud(n){let e,t,i,s,l,o;const r=[jT,qT],a=[];function u(d,p){return d[8]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&ad(n);return{c(){e=y("div"),i.c(),s=E(),f&&f.c(),l=E(),h(e,"class","option")},m(d,p){S(d,e,p),a[t].m(e,null),v(e,s),f&&f.m(e,null),v(e,l),o=!0},p(d,p){let m=t;t=u(d),t===m?a[t].p(d,p):(re(),P(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(d,p):(i=a[t]=r[t](d),i.c()),A(i,1),i.m(e,s)),d[4]||d[6]?f?f.p(d,p):(f=ad(d),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(d){o||(A(i),o=!0)},o(d){P(i),o=!1},d(d){d&&w(e),a[t].d(),f&&f.d()}}}function fd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[18],$$slots:{default:[zT]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[39](e),e.$on("show",n[24]),e.$on("hide",n[40]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&262144&&(o.trigger=s[18]),l[0]&1612938|l[1]&2048&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[39](null),H(e,s)}}}function cd(n){let e,t,i,s,l,o,r,a,u=n[15].length&&dd(n);return{c(){e=y("div"),t=y("label"),i=y("div"),i.innerHTML='',s=E(),l=y("input"),o=E(),u&&u.c(),h(i,"class","addon p-r-0"),l.autofocus=!0,h(l,"type","text"),h(l,"placeholder",n[3]),h(t,"class","input-group"),h(e,"class","form-field form-field-sm options-search")},m(f,d){S(f,e,d),v(e,t),v(t,i),v(t,s),v(t,l),ue(l,n[15]),v(t,o),u&&u.m(t,null),l.focus(),r||(a=J(l,"input",n[36]),r=!0)},p(f,d){d[0]&8&&h(l,"placeholder",f[3]),d[0]&32768&&l.value!==f[15]&&ue(l,f[15]),f[15].length?u?u.p(f,d):(u=dd(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&w(e),u&&u.d(),r=!1,a()}}}function dd(n){let e,t,i,s;return{c(){e=y("div"),t=y("button"),t.innerHTML='',h(t,"type","button"),h(t,"class","btn btn-sm btn-circle btn-transparent clear"),h(e,"class","addon suffix p-r-5")},m(l,o){S(l,e,o),v(e,t),i||(s=J(t,"click",En(ft(n[21]))),i=!0)},p:Q,d(l){l&&w(e),i=!1,s()}}}function pd(n){let e,t=n[1]&&md(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=md(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function md(n){let e,t;return{c(){e=y("div"),t=U(n[1]),h(e,"class","txt-missing")},m(i,s){S(i,e,s),v(e,t)},p(i,s){s[0]&2&&le(t,i[1])},d(i){i&&w(e)}}}function VT(n){let e=n[46]+"",t;return{c(){t=U(e)},m(i,s){S(i,t,s)},p(i,s){s[0]&1048576&&e!==(e=i[46]+"")&&le(t,e)},i:Q,o:Q,d(i){i&&w(t)}}}function HT(n){let e,t,i;const s=[{item:n[46]},n[11]];var l=n[10];function o(r){let a={};for(let u=0;u{H(f,1)}),ae()}l?(e=Pt(l,o()),z(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function hd(n){let e,t,i,s,l,o,r;const a=[HT,VT],u=[];function f(m,_){return m[10]?0:1}t=f(n),i=u[t]=a[t](n);function d(...m){return n[37](n[46],...m)}function p(...m){return n[38](n[46],...m)}return{c(){e=y("div"),i.c(),s=E(),h(e,"tabindex","0"),h(e,"class","dropdown-item option"),x(e,"closable",n[7]),x(e,"selected",n[19](n[46]))},m(m,_){S(m,e,_),u[t].m(e,null),v(e,s),l=!0,o||(r=[J(e,"click",d),J(e,"keydown",p)],o=!0)},p(m,_){n=m;let g=t;t=f(n),t===g?u[t].p(n,_):(re(),P(u[g],1,1,()=>{u[g]=null}),ae(),i=u[t],i?i.p(n,_):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||_[0]&128)&&x(e,"closable",n[7]),(!l||_[0]&1572864)&&x(e,"selected",n[19](n[46]))},i(m){l||(A(i),l=!0)},o(m){P(i),l=!1},d(m){m&&w(e),u[t].d(),o=!1,De(r)}}}function zT(n){let e,t,i,s,l,o=n[12]&&cd(n);const r=n[33].beforeOptions,a=Tt(r,n,n[42],ld);let u=n[20],f=[];for(let g=0;gP(f[g],1,1,()=>{f[g]=null});let p=null;u.length||(p=pd(n));const m=n[33].afterOptions,_=Tt(m,n,n[42],id);return{c(){o&&o.c(),e=E(),a&&a.c(),t=E(),i=y("div");for(let g=0;gP(a[p],1,1,()=>{a[p]=null});let f=null;r.length||(f=rd(n));let d=!n[5]&&fd(n);return{c(){e=y("div"),t=y("div");for(let p=0;p{d=null}),ae()):d?(d.p(p,m),m[0]&32&&A(d,1)):(d=fd(p),d.c(),A(d,1),d.m(e,null)),(!o||m[0]&8192&&l!==(l="select "+p[13]))&&h(e,"class",l),(!o||m[0]&8208)&&x(e,"multiple",p[4]),(!o||m[0]&8224)&&x(e,"disabled",p[5])},i(p){if(!o){for(let m=0;mQe(Gt,Fe))||[]}function G(te,Fe){te.preventDefault(),g&&p?Y(Fe):q(Fe)}function ce(te,Fe){(te.code==="Enter"||te.code==="Space")&&G(te,Fe)}function ge(){X(),setTimeout(()=>{const te=F==null?void 0:F.querySelector(".dropdown-item.option.selected");te&&(te.focus(),te.scrollIntoView({block:"nearest"}))},0)}function Me(te){te.stopPropagation(),!m&&(I==null||I.toggle())}xt(()=>{const te=document.querySelectorAll(`label[for="${r}"]`);for(const Fe of te)Fe.addEventListener("click",Me);return()=>{for(const Fe of te)Fe.removeEventListener("click",Me)}});const qe=te=>N(te);function He(te){se[te?"unshift":"push"](()=>{R=te,t(18,R)})}function we(){L=this.value,t(15,L)}const Ce=(te,Fe)=>G(Fe,te),Je=(te,Fe)=>ce(Fe,te);function mt(te){se[te?"unshift":"push"](()=>{I=te,t(16,I)})}function Ze(te){pe.call(this,n,te)}function We(te){se[te?"unshift":"push"](()=>{F=te,t(17,F)})}return n.$$set=te=>{"id"in te&&t(25,r=te.id),"noOptionsText"in te&&t(1,a=te.noOptionsText),"selectPlaceholder"in te&&t(2,u=te.selectPlaceholder),"searchPlaceholder"in te&&t(3,f=te.searchPlaceholder),"items"in te&&t(26,d=te.items),"multiple"in te&&t(4,p=te.multiple),"disabled"in te&&t(5,m=te.disabled),"selected"in te&&t(0,_=te.selected),"toggle"in te&&t(6,g=te.toggle),"closable"in te&&t(7,b=te.closable),"labelComponent"in te&&t(8,k=te.labelComponent),"labelComponentProps"in te&&t(9,$=te.labelComponentProps),"optionComponent"in te&&t(10,T=te.optionComponent),"optionComponentProps"in te&&t(11,C=te.optionComponentProps),"searchable"in te&&t(12,D=te.searchable),"searchFunc"in te&&t(27,M=te.searchFunc),"class"in te&&t(13,O=te.class),"$$scope"in te&&t(42,o=te.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&67108864&&d&&(ie(),X()),n.$$.dirty[0]&67141632&&t(20,i=fe(d,L)),n.$$.dirty[0]&1&&t(19,s=function(te){const Fe=j.toArray(_);return j.inArray(Fe,te)})},[_,a,u,f,p,m,g,b,k,$,T,C,D,O,N,L,I,F,R,s,i,X,G,ce,ge,r,d,M,q,Y,B,Z,ee,l,qe,He,we,Ce,Je,mt,Ze,We,o]}class ou extends ve{constructor(e){super(),be(this,e,WT,BT,_e,{id:25,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:26,multiple:4,disabled:5,selected:0,toggle:6,closable:7,labelComponent:8,labelComponentProps:9,optionComponent:10,optionComponentProps:11,searchable:12,searchFunc:27,class:13,deselectItem:14,selectItem:28,toggleItem:29,reset:30,showDropdown:31,hideDropdown:32},null,[-1,-1])}get deselectItem(){return this.$$.ctx[14]}get selectItem(){return this.$$.ctx[28]}get toggleItem(){return this.$$.ctx[29]}get reset(){return this.$$.ctx[30]}get showDropdown(){return this.$$.ctx[31]}get hideDropdown(){return this.$$.ctx[32]}}function _d(n){let e,t;return{c(){e=y("i"),h(e,"class",t="icon "+n[0].icon)},m(i,s){S(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&h(e,"class",t)},d(i){i&&w(e)}}}function YT(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&_d(n);return{c(){l&&l.c(),e=E(),t=y("span"),s=U(i),h(t,"class","txt")},m(o,r){l&&l.m(o,r),S(o,e,r),S(o,t,r),v(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=_d(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&le(s,i)},i:Q,o:Q,d(o){l&&l.d(o),o&&w(e),o&&w(t)}}}function KT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class gd extends ve{constructor(e){super(),be(this,e,KT,YT,_e,{item:0})}}const JT=n=>({}),bd=n=>({});function ZT(n){let e;const t=n[8].afterOptions,i=Tt(t,n,n[12],bd);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Mt(i,t,s,s[12],e?Ct(t,s[12],l,JT):Ot(s[12]),bd)},i(s){e||(A(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function GT(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[ZT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&62?St(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Kt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function XT(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Xe(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=gd}=e,{optionComponent:d=gd}=e,{selectionKey:p="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function _(T){T=j.toArray(T,!0);let C=[];for(let D of T){const M=j.findByKey(r,p,D);M&&C.push(M)}T.length&&!C.length||t(0,u=a?C:C[0])}async function g(T){let C=j.toArray(T,!0).map(D=>D[p]);r.length&&t(6,m=a?C:C[0])}function b(T){u=T,t(0,u)}function k(T){pe.call(this,n,T)}function $(T){pe.call(this,n,T)}return n.$$set=T=>{e=Re(Re({},e),Yt(T)),t(5,s=Xe(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,d=T.optionComponent),"selectionKey"in T&&t(7,p=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&_(m),n.$$.dirty&1&&g(u)},[u,r,a,f,d,s,m,p,l,b,k,$,o]}class Ri extends ve{constructor(e){super(),be(this,e,XT,GT,_e,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function QT(n){let e,t,i,s,l,o;function r(u){n[7](u)}let a={id:n[17],placeholder:"Choices: eg. optionA, optionB",required:!0,disabled:!n[18]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new qs({props:a}),se.push(()=>he(t,"value",r)),{c(){e=y("div"),z(t.$$.fragment)},m(u,f){S(u,e,f),V(t,e,null),s=!0,l||(o=Ee(Ue.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(u,f){const d={};f&131072&&(d.id=u[17]),f&262144&&(d.disabled=!u[18]),!i&&f&1&&(i=!0,d.value=u[0].options.values,ke(()=>i=!1)),t.$set(d)},i(u){s||(A(t.$$.fragment,u),s=!0)},o(u){P(t.$$.fragment,u),s=!1},d(u){u&&w(e),H(t),l=!1,o()}}}function xT(n){let e,t,i;function s(o){n[8](o)}let l={id:n[17],items:n[3],disabled:!n[18]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ri({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&131072&&(a.id=o[17]),r&262144&&(a.disabled=!o[18]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function eC(n){let e,t,i,s;return e=new de({props:{class:"form-field required "+(n[18]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[QT,({uniqueId:l})=>({17:l}),({uniqueId:l})=>l?131072:0]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field form-field-single-multiple-select "+(n[18]?"":"disabled"),inlineError:!0,$$slots:{default:[xT,({uniqueId:l})=>({17:l}),({uniqueId:l})=>l?131072:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o&262144&&(r.class="form-field required "+(l[18]?"":"disabled")),o&2&&(r.name="schema."+l[1]+".options.values"),o&917505&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&262144&&(a.class="form-field form-field-single-multiple-select "+(l[18]?"":"disabled")),o&917508&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function vd(n){let e,t;return e=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[tC,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.maxSelect"),s&655361&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function tC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[17]),h(l,"id",o=n[17]),h(l,"type","number"),h(l,"step","1"),h(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.maxSelect),r||(a=J(l,"input",n[6]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function nC(n){let e,t,i=!n[2]&&vd(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,l){s[2]?i&&(re(),P(i,1,1,()=>{i=null}),ae()):i?(i.p(s,l),l&4&&A(i,1)):(i=vd(s),i.c(),A(i,1),i.m(e.parentNode,e))},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function iC(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[nC],default:[eC,({interactive:r})=>({18:r}),({interactive:r})=>r?262144:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("drop",n[12]),e.$on("dragstart",n[13]),e.$on("dragenter",n[14]),e.$on("dragleave",n[15]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&18?St(s,[a&2&&{key:r[1]},a&16&&Kt(r[4])]):{};a&786439&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function sC(n,e,t){var D;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((D=l.options)==null?void 0:D.maxSelect)<=1,u=a;function f(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,u=a)}function d(){l.options.maxSelect=_t(this.value),t(0,l),t(5,u),t(2,a)}function p(M){n.$$.not_equal(l.options.values,M)&&(l.options.values=M,t(0,l),t(5,u),t(2,a))}function m(M){a=M,t(2,a)}function _(M){l=M,t(0,l),t(5,u),t(2,a)}function g(M){pe.call(this,n,M)}function b(M){pe.call(this,n,M)}function k(M){pe.call(this,n,M)}function $(M){pe.call(this,n,M)}function T(M){pe.call(this,n,M)}function C(M){pe.call(this,n,M)}return n.$$set=M=>{e=Re(Re({},e),Yt(M)),t(4,s=Xe(e,i)),"field"in M&&t(0,l=M.field),"key"in M&&t(1,o=M.key)},n.$$.update=()=>{var M,O;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((O=(M=l.options)==null?void 0:M.values)==null?void 0:O.length)||2,l)),n.$$.dirty&1&&j.isEmpty(l.options)&&f()},[l,o,a,r,s,u,d,p,m,_,g,b,k,$,T,C]}class lC extends ve{constructor(e){super(),be(this,e,sC,iC,_e,{field:0,key:1})}}function oC(n){let e;return{c(){e=y("i"),h(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function rC(n){let e;return{c(){e=y("i"),h(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function yd(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O='"{"a":1,"b":2}"',I,L,F,R,N,q,Y,B,Z,ee,ie,X,fe;return{c(){e=y("div"),t=y("div"),i=y("div"),s=U("In order to support seamlessly both "),l=y("code"),l.textContent="application/json",o=U(` and + `}}function fe(){t.calendarContainer.classList.add("hasWeeks");var W=ut("div","flatpickr-weekwrapper");W.appendChild(ut("span","flatpickr-weekday",t.l10n.weekAbbreviation));var K=ut("div","flatpickr-weeks");return W.appendChild(K),{weekWrapper:W,weekNumbers:K}}function G(W,K){K===void 0&&(K=!0);var ne=K?W:W-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,tt("onYearChange"),q()),N(),tt("onMonthChange"),Vi())}function ce(W,K){if(W===void 0&&(W=!0),K===void 0&&(K=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,K===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Ir(t.config),oe=ne.hours,Te=ne.minutes,Ie=ne.seconds;m(oe,Te,Ie)}t.redraw(),W&&tt("onChange")}function ge(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),tt("onClose")}function Me(){t.config!==void 0&&tt("onDestroy");for(var W=t._handlers.length;W--;)t._handlers[W].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var K=t.calendarContainer.parentNode;if(K.lastChild&&K.removeChild(K.lastChild),K.parentNode){for(;K.firstChild;)K.parentNode.insertBefore(K.firstChild,K);K.parentNode.removeChild(K)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function qe(W){return t.calendarContainer.contains(W)}function He(W){if(t.isOpen&&!t.config.inline){var K=$n(W),ne=qe(K),oe=K===t.input||K===t.altInput||t.element.contains(K)||W.path&&W.path.indexOf&&(~W.path.indexOf(t.input)||~W.path.indexOf(t.altInput)),Te=!oe&&!ne&&!qe(W.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Pe){return Pe.contains(K)});Te&&Ie&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function we(W){if(!(!W||t.config.minDate&&Wt.config.maxDate.getFullYear())){var K=W,ne=t.currentYear!==K;t.currentYear=K||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),tt("onYearChange"),q())}}function Ce(W,K){var ne;K===void 0&&(K=!0);var oe=t.parseDate(W,void 0,K);if(t.config.minDate&&oe&&Tn(oe,t.config.minDate,K!==void 0?K:!t.minDateHasTime)<0||t.config.maxDate&&oe&&Tn(oe,t.config.maxDate,K!==void 0?K:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var Te=!!t.config.enable,Ie=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Pe=0,Oe=void 0;Pe=Oe.from.getTime()&&oe.getTime()<=Oe.to.getTime())return Te}return!Te}function Je(W){return t.daysContainer!==void 0?W.className.indexOf("hidden")===-1&&W.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(W):!1}function mt(W){var K=W.target===t._input,ne=t._input.value.trimEnd()!==Hi();K&&ne&&!(W.relatedTarget&&qe(W.relatedTarget))&&t.setDate(t._input.value,!0,W.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ze(W){var K=$n(W),ne=t.config.wrap?n.contains(K):K===t._input,oe=t.config.allowInput,Te=t.isOpen&&(!oe||!ne),Ie=t.config.inline&&ne&&!oe;if(W.keyCode===13&&ne){if(oe)return t.setDate(t._input.value,!0,K===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),K.blur();t.open()}else if(qe(K)||Te||Ie){var Pe=!!t.timeContainer&&t.timeContainer.contains(K);switch(W.keyCode){case 13:Pe?(W.preventDefault(),a(),ye()):je(W);break;case 27:W.preventDefault(),ye();break;case 8:case 46:ne&&!t.config.allowInput&&(W.preventDefault(),t.clear());break;case 37:case 39:if(!Pe&&!ne){W.preventDefault();var Oe=l();if(t.daysContainer!==void 0&&(oe===!1||Oe&&Je(Oe))){var Ye=W.keyCode===39?1:-1;W.ctrlKey?(W.stopPropagation(),G(Ye),F(I(1),0)):F(void 0,Ye)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:W.preventDefault();var Ne=W.keyCode===40?1:-1;t.daysContainer&&K.$i!==void 0||K===t.input||K===t.altInput?W.ctrlKey?(W.stopPropagation(),we(t.currentYear-Ne),F(I(1),0)):Pe||F(void 0,Ne*7):K===t.currentYearElement?we(t.currentYear-Ne):t.config.enableTime&&(!Pe&&t.hourElement&&t.hourElement.focus(),a(W),t._debouncedChange());break;case 9:if(Pe){var Be=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Sn){return Sn}),bt=Be.indexOf(K);if(bt!==-1){var Xn=Be[bt+(W.shiftKey?-1:1)];W.preventDefault(),(Xn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(K)&&W.shiftKey&&(W.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&K===t.amPM)switch(W.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],d(),Xt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],d(),Xt();break}(ne||qe(K))&&tt("onKeyDown",W)}function We(W,K){if(K===void 0&&(K="flatpickr-day"),!(t.selectedDates.length!==1||W&&(!W.classList.contains(K)||W.classList.contains("flatpickr-disabled")))){for(var ne=W?W.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),oe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(ne,t.selectedDates[0].getTime()),Ie=Math.max(ne,t.selectedDates[0].getTime()),Pe=!1,Oe=0,Ye=0,Ne=Te;NeTe&&NeOe)?Oe=Ne:Ne>oe&&(!Ye||Ne ."+K));Be.forEach(function(bt){var Xn=bt.dateObj,Sn=Xn.getTime(),js=Oe>0&&Sn0&&Sn>Ye;if(js){bt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ds){bt.classList.remove(ds)});return}else if(Pe&&!js)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ds){bt.classList.remove(ds)}),W!==void 0&&(W.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),oene&&Sn===oe&&bt.classList.add("endRange"),Sn>=Oe&&(Ye===0||Sn<=Ye)&&wT(Sn,oe,ne)&&bt.classList.add("inRange"))})}}function te(){t.isOpen&&!t.config.static&&!t.config.inline&&et()}function Fe(W,K){if(K===void 0&&(K=t._positionElement),t.isMobile===!0){if(W){W.preventDefault();var ne=$n(W);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),tt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var oe=t.isOpen;t.isOpen=!0,oe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),tt("onOpen"),et(K)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(W===void 0||!t.timeContainer.contains(W.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function Qe(W){return function(K){var ne=t.config["_"+W+"Date"]=t.parseDate(K,t.config.dateFormat),oe=t.config["_"+(W==="min"?"max":"min")+"Date"];ne!==void 0&&(t[W==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return Ce(Te)}),!t.selectedDates.length&&W==="min"&&p(ne),Xt()),t.daysContainer&&(jt(),ne!==void 0?t.currentYearElement[W]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(W),t.currentYearElement.disabled=!!oe&&ne!==void 0&&oe.getFullYear()===ne.getFullYear())}}function Gt(){var W=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],K=en(en({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=K.parseDate,t.config.formatDate=K.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Be){t.config._enable=yi(Be)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Be){t.config._disable=yi(Be)}});var oe=K.mode==="time";if(!K.dateFormat&&(K.enableTime||oe)){var Te=zt.defaultConfig.dateFormat||$s.dateFormat;ne.dateFormat=K.noCalendar||oe?"H:i"+(K.enableSeconds?":S":""):Te+" H:i"+(K.enableSeconds?":S":"")}if(K.altInput&&(K.enableTime||oe)&&!K.altFormat){var Ie=zt.defaultConfig.altFormat||$s.altFormat;ne.altFormat=K.noCalendar||oe?"h:i"+(K.enableSeconds?":S K":" K"):Ie+(" h:i"+(K.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Qe("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Qe("max")});var Pe=function(Be){return function(bt){t.config[Be==="min"?"_minTime":"_maxTime"]=t.parseDate(bt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Pe("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Pe("max")}),K.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,K);for(var Oe=0;Oe-1?t.config[Ne]=Dr(Ye[Ne]).map(o).concat(t.config[Ne]):typeof K[Ne]>"u"&&(t.config[Ne]=Ye[Ne])}K.altInputClass||(t.config.altInputClass=Le().className+" "+t.config.altInputClass),tt("onParseConfig")}function Le(){return t.config.wrap?n.querySelector("[data-input]"):n}function $e(){typeof t.config.locale!="object"&&typeof zt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=en(en({},zt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?zt.l10ns[t.config.locale]:void 0),Xi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Xi.l="("+t.l10n.weekdays.longhand.join("|")+")",Xi.M="("+t.l10n.months.shorthand.join("|")+")",Xi.F="("+t.l10n.months.longhand.join("|")+")",Xi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var W=en(en({},e),JSON.parse(JSON.stringify(n.dataset||{})));W.time_24hr===void 0&&zt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=ob(t),t.parseDate=ha({config:t.config,l10n:t.l10n})}function et(W){if(typeof t.config.position=="function")return void t.config.position(t,W);if(t.calendarContainer!==void 0){tt("onPreCalendarPosition");var K=W||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(vb,yb){return vb+yb.offsetHeight},0),oe=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Ie=Te[0],Pe=Te.length>1?Te[1]:null,Oe=K.getBoundingClientRect(),Ye=window.innerHeight-Oe.bottom,Ne=Ie==="above"||Ie!=="below"&&Yene,Be=window.pageYOffset+Oe.top+(Ne?-ne-2:K.offsetHeight+2);if(rn(t.calendarContainer,"arrowTop",!Ne),rn(t.calendarContainer,"arrowBottom",Ne),!t.config.inline){var bt=window.pageXOffset+Oe.left,Xn=!1,Sn=!1;Pe==="center"?(bt-=(oe-Oe.width)/2,Xn=!0):Pe==="right"&&(bt-=oe-Oe.width,Sn=!0),rn(t.calendarContainer,"arrowLeft",!Xn&&!Sn),rn(t.calendarContainer,"arrowCenter",Xn),rn(t.calendarContainer,"arrowRight",Sn);var js=window.document.body.offsetWidth-(window.pageXOffset+Oe.right),ds=bt+oe>window.document.body.offsetWidth,db=js+oe>window.document.body.offsetWidth;if(rn(t.calendarContainer,"rightMost",ds),!t.config.static)if(t.calendarContainer.style.top=Be+"px",!ds)t.calendarContainer.style.left=bt+"px",t.calendarContainer.style.right="auto";else if(!db)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=js+"px";else{var nr=Dt();if(nr===void 0)return;var pb=window.document.body.offsetWidth,mb=Math.max(0,pb/2-oe/2),hb=".flatpickr-calendar.centerMost:before",_b=".flatpickr-calendar.centerMost:after",gb=nr.cssRules.length,bb="{left:"+Oe.left+"px;right:auto;}";rn(t.calendarContainer,"rightMost",!1),rn(t.calendarContainer,"centerMost",!0),nr.insertRule(hb+","+_b+bb,gb),t.calendarContainer.style.left=mb+"px",t.calendarContainer.style.right="auto"}}}}function Dt(){for(var W=null,K=0;Kt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=oe,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var Pe=oi(Te);Pe?t.selectedDates.splice(parseInt(Pe),1):t.selectedDates.push(Te)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Te,t.selectedDates.push(Te),Tn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Be,bt){return Be.getTime()-bt.getTime()}));if(d(),Ie){var Oe=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),Oe&&(tt("onYearChange"),q()),tt("onMonthChange")}if(Vi(),N(),Xt(),!Ie&&t.config.mode!=="range"&&t.config.showMonths===1?O(oe):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Ye=t.config.mode==="single"&&!t.config.enableTime,Ne=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ye||Ne)&&ye()}b()}}var gt={locale:[$e,X],showMonths:[B,r,ie],minDate:[$],maxDate:[$],positionElement:[ji],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ge(W,K){if(W!==null&&typeof W=="object"){Object.assign(t.config,W);for(var ne in W)gt[ne]!==void 0&>[ne].forEach(function(oe){return oe()})}else t.config[W]=K,gt[W]!==void 0?gt[W].forEach(function(oe){return oe()}):Or.indexOf(W)>-1&&(t.config[W]=Dr(K));t.redraw(),Xt(!0)}function mn(W,K){var ne=[];if(W instanceof Array)ne=W.map(function(oe){return t.parseDate(oe,K)});else if(W instanceof Date||typeof W=="number")ne=[t.parseDate(W,K)];else if(typeof W=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(W,K)];break;case"multiple":ne=W.split(t.config.conjunction).map(function(oe){return t.parseDate(oe,K)});break;case"range":ne=W.split(t.l10n.rangeSeparator).map(function(oe){return t.parseDate(oe,K)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(W)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(oe){return oe instanceof Date&&Ce(oe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(oe,Te){return oe.getTime()-Te.getTime()})}function vi(W,K,ne){if(K===void 0&&(K=!1),ne===void 0&&(ne=t.config.dateFormat),W!==0&&!W||W instanceof Array&&W.length===0)return t.clear(K);mn(W,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),$(void 0,K),p(),t.selectedDates.length===0&&t.clear(!1),Xt(K),K&&tt("onChange")}function yi(W){return W.slice().map(function(K){return typeof K=="string"||typeof K=="number"||K instanceof Date?t.parseDate(K,void 0,!0):K&&typeof K=="object"&&K.from&&K.to?{from:t.parseDate(K.from,void 0),to:t.parseDate(K.to,void 0)}:K}).filter(function(K){return K})}function as(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var W=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);W&&mn(W,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Fl(){if(t.input=Le(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ut(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),ji()}function ji(){t._positionElement=t.config.positionElement||t._input}function us(){var W=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ut("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=W,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=W==="datetime-local"?"Y-m-d\\TH:i:S":W==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}g(t.mobileInput,"change",function(K){t.setDate($n(K).value,!1,t.mobileFormatStr),tt("onChange"),tt("onClose")})}function hn(W){if(t.isOpen===!0)return t.close();t.open(W)}function tt(W,K){if(t.config!==void 0){var ne=t.config[W];if(ne!==void 0&&ne.length>0)for(var oe=0;ne[oe]&&oe=0&&Tn(W,t.selectedDates[1])<=0}function Vi(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(W,K){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+K),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[K].textContent=Fo(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),W.value=ne.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function Hi(W){var K=W||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,K)}).filter(function(ne,oe,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(ne)===oe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Xt(W){W===void 0&&(W=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Hi(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Hi(t.config.altFormat)),W!==!1&&tt("onValueUpdate")}function on(W){var K=$n(W),ne=t.prevMonthNav.contains(K),oe=t.nextMonthNav.contains(K);ne||oe?G(ne?-1:1):t.yearElements.indexOf(K)>=0?K.select():K.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):K.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Rl(W){W.preventDefault();var K=W.type==="keydown",ne=$n(W),oe=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Fn(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(oe.getAttribute("min")),Ie=parseFloat(oe.getAttribute("max")),Pe=parseFloat(oe.getAttribute("step")),Oe=parseInt(oe.value,10),Ye=W.delta||(K?W.which===38?1:-1:0),Ne=Oe+Pe*Ye;if(typeof oe.value<"u"&&oe.value.length===2){var Be=oe===t.hourElement,bt=oe===t.minuteElement;NeIe&&(Ne=oe===t.hourElement?Ne-Ie-Fn(!t.amPM):Te,bt&&C(void 0,1,t.hourElement)),t.amPM&&Be&&(Pe===1?Ne+Oe===23:Math.abs(Ne-Oe)>Pe)&&(t.amPM.textContent=t.l10n.amPM[Fn(t.amPM.textContent===t.l10n.amPM[0])]),oe.value=_n(Ne)}}return s(),t}function Ts(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function ET(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Xe(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:d=void 0}=e,{options:p={}}=e,m=!1,{input:_=void 0,flatpickr:g=void 0}=e;xt(()=>{const C=f??_,D=k(p);return D.onReady.push((M,O,I)=>{a===void 0&&$(M,O,I),ln().then(()=>{t(8,m=!0)})}),t(3,g=zt(C,Object.assign(D,f?{wrap:!0}:{}))),()=>{g.destroy()}});const b=kt();function k(C={}){C=Object.assign({},C);for(const D of r){const M=(O,I,L)=>{b(DT(D),[O,I,L])};D in C?(Array.isArray(C[D])||(C[D]=[C[D]]),C[D].push(M)):C[D]=[M]}return C.onChange&&!C.onChange.includes($)&&C.onChange.push($),C}function $(C,D,M){const O=td(M,C);!nd(a,O)&&(a||O)&&t(2,a=O),t(4,u=D)}function T(C){se[C?"unshift":"push"](()=>{_=C,t(0,_)})}return n.$$set=C=>{e=Re(Re({},e),Yt(C)),t(1,s=Xe(e,i)),"value"in C&&t(2,a=C.value),"formattedValue"in C&&t(4,u=C.formattedValue),"element"in C&&t(5,f=C.element),"dateFormat"in C&&t(6,d=C.dateFormat),"options"in C&&t(7,p=C.options),"input"in C&&t(0,_=C.input),"flatpickr"in C&&t(3,g=C.flatpickr),"$$scope"in C&&t(9,o=C.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&m&&(nd(a,td(g,g.selectedDates))||g.setDate(a,!0,d)),n.$$.dirty&392&&g&&m)for(const[C,D]of Object.entries(k(p)))g.set(C,D)},[_,s,a,g,u,f,d,p,m,o,l,T]}class lu extends ve{constructor(e){super(),be(this,e,ET,OT,_e,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function AT(n){let e,t,i,s,l,o,r,a;function u(p){n[6](p)}function f(p){n[7](p)}let d={id:n[19],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(d.value=n[2]),n[0].options.min!==void 0&&(d.formattedValue=n[0].options.min),l=new lu({props:d}),se.push(()=>he(l,"value",u)),se.push(()=>he(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=y("label"),t=U("Min date (UTC)"),s=E(),z(l.$$.fragment),h(e,"for",i=n[19])},m(p,m){S(p,e,m),v(e,t),S(p,s,m),V(l,p,m),a=!0},p(p,m){(!a||m&524288&&i!==(i=p[19]))&&h(e,"for",i);const _={};m&524288&&(_.id=p[19]),!o&&m&4&&(o=!0,_.value=p[2],ke(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=p[0].options.min,ke(()=>r=!1)),l.$set(_)},i(p){a||(A(l.$$.fragment,p),a=!0)},o(p){P(l.$$.fragment,p),a=!1},d(p){p&&w(e),p&&w(s),H(l,p)}}}function IT(n){let e,t,i,s,l,o,r,a;function u(p){n[9](p)}function f(p){n[10](p)}let d={id:n[19],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(d.value=n[3]),n[0].options.max!==void 0&&(d.formattedValue=n[0].options.max),l=new lu({props:d}),se.push(()=>he(l,"value",u)),se.push(()=>he(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=y("label"),t=U("Max date (UTC)"),s=E(),z(l.$$.fragment),h(e,"for",i=n[19])},m(p,m){S(p,e,m),v(e,t),S(p,s,m),V(l,p,m),a=!0},p(p,m){(!a||m&524288&&i!==(i=p[19]))&&h(e,"for",i);const _={};m&524288&&(_.id=p[19]),!o&&m&8&&(o=!0,_.value=p[3],ke(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=p[0].options.max,ke(()=>r=!1)),l.$set(_)},i(p){a||(A(l.$$.fragment,p),a=!0)},o(p){P(l.$$.fragment,p),a=!1},d(p){p&&w(e),p&&w(s),H(l,p)}}}function PT(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[AT,({uniqueId:a})=>({19:a}),({uniqueId:a})=>a?524288:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[IT,({uniqueId:a})=>({19:a}),({uniqueId:a})=>a?524288:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){S(a,e,u),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&1572869&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.max"),u&1572873&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),H(i),H(o)}}}function LT(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[PT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("drop",n[15]),e.$on("dragstart",n[16]),e.$on("dragenter",n[17]),e.$on("dragleave",n[18]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&34?St(s,[a&2&&{key:r[1]},a&32&&Kt(r[5])]):{};a&1048591&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function NT(n,e,t){var O,I;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e,r=(O=l==null?void 0:l.options)==null?void 0:O.min,a=(I=l==null?void 0:l.options)==null?void 0:I.max;function u(L,F){L.detail&&L.detail.length==3&&t(0,l.options[F]=L.detail[1],l)}function f(L){r=L,t(2,r),t(0,l)}function d(L){n.$$.not_equal(l.options.min,L)&&(l.options.min=L,t(0,l))}const p=L=>u(L,"min");function m(L){a=L,t(3,a),t(0,l)}function _(L){n.$$.not_equal(l.options.max,L)&&(l.options.max=L,t(0,l))}const g=L=>u(L,"max");function b(L){l=L,t(0,l)}function k(L){pe.call(this,n,L)}function $(L){pe.call(this,n,L)}function T(L){pe.call(this,n,L)}function C(L){pe.call(this,n,L)}function D(L){pe.call(this,n,L)}function M(L){pe.call(this,n,L)}return n.$$set=L=>{e=Re(Re({},e),Yt(L)),t(5,s=Xe(e,i)),"field"in L&&t(0,l=L.field),"key"in L&&t(1,o=L.key)},n.$$.update=()=>{var L,F,R,N;n.$$.dirty&5&&r!=((L=l==null?void 0:l.options)==null?void 0:L.min)&&t(2,r=(F=l==null?void 0:l.options)==null?void 0:F.min),n.$$.dirty&9&&a!=((R=l==null?void 0:l.options)==null?void 0:R.max)&&t(3,a=(N=l==null?void 0:l.options)==null?void 0:N.max)},[l,o,r,a,u,s,f,d,p,m,_,g,b,k,$,T,C,D,M]}class FT extends ve{constructor(e){super(),be(this,e,NT,LT,_e,{field:0,key:1})}}const RT=n=>({}),id=n=>({});function sd(n,e,t){const i=n.slice();return i[46]=e[t],i}const qT=n=>({}),ld=n=>({});function od(n,e,t){const i=n.slice();return i[46]=e[t],i[50]=t,i}function rd(n){let e,t,i;return{c(){e=y("div"),t=U(n[2]),i=E(),h(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5])},m(s,l){S(s,e,l),v(e,t),v(e,i)},p(s,l){l[0]&4&&le(t,s[2]),l[0]&32&&x(e,"link-hint",!s[5])},d(s){s&&w(e)}}}function jT(n){let e,t=n[46]+"",i;return{c(){e=y("span"),i=U(t),h(e,"class","txt")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l[0]&1&&t!==(t=s[46]+"")&&le(i,t)},i:Q,o:Q,d(s){s&&w(e)}}}function VT(n){let e,t,i;const s=[{item:n[46]},n[9]];var l=n[8];function o(r){let a={};for(let u=0;u{H(f,1)}),ae()}l?(e=Pt(l,o()),z(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function ad(n){let e,t,i;function s(){return n[34](n[46])}return{c(){e=y("span"),e.innerHTML='',h(e,"class","clear")},m(l,o){S(l,e,o),t||(i=[Ee(Ue.call(null,e,"Clear")),J(e,"click",En(ft(s)))],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,De(i)}}}function ud(n){let e,t,i,s,l,o;const r=[VT,jT],a=[];function u(d,p){return d[8]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&ad(n);return{c(){e=y("div"),i.c(),s=E(),f&&f.c(),l=E(),h(e,"class","option")},m(d,p){S(d,e,p),a[t].m(e,null),v(e,s),f&&f.m(e,null),v(e,l),o=!0},p(d,p){let m=t;t=u(d),t===m?a[t].p(d,p):(re(),P(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(d,p):(i=a[t]=r[t](d),i.c()),A(i,1),i.m(e,s)),d[4]||d[6]?f?f.p(d,p):(f=ad(d),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(d){o||(A(i),o=!0)},o(d){P(i),o=!1},d(d){d&&w(e),a[t].d(),f&&f.d()}}}function fd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[18],$$slots:{default:[BT]},$$scope:{ctx:n}};return e=new Bn({props:i}),n[39](e),e.$on("show",n[24]),e.$on("hide",n[40]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&262144&&(o.trigger=s[18]),l[0]&1612938|l[1]&2048&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[39](null),H(e,s)}}}function cd(n){let e,t,i,s,l,o,r,a,u=n[15].length&&dd(n);return{c(){e=y("div"),t=y("label"),i=y("div"),i.innerHTML='',s=E(),l=y("input"),o=E(),u&&u.c(),h(i,"class","addon p-r-0"),l.autofocus=!0,h(l,"type","text"),h(l,"placeholder",n[3]),h(t,"class","input-group"),h(e,"class","form-field form-field-sm options-search")},m(f,d){S(f,e,d),v(e,t),v(t,i),v(t,s),v(t,l),ue(l,n[15]),v(t,o),u&&u.m(t,null),l.focus(),r||(a=J(l,"input",n[36]),r=!0)},p(f,d){d[0]&8&&h(l,"placeholder",f[3]),d[0]&32768&&l.value!==f[15]&&ue(l,f[15]),f[15].length?u?u.p(f,d):(u=dd(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&w(e),u&&u.d(),r=!1,a()}}}function dd(n){let e,t,i,s;return{c(){e=y("div"),t=y("button"),t.innerHTML='',h(t,"type","button"),h(t,"class","btn btn-sm btn-circle btn-transparent clear"),h(e,"class","addon suffix p-r-5")},m(l,o){S(l,e,o),v(e,t),i||(s=J(t,"click",En(ft(n[21]))),i=!0)},p:Q,d(l){l&&w(e),i=!1,s()}}}function pd(n){let e,t=n[1]&&md(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=md(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function md(n){let e,t;return{c(){e=y("div"),t=U(n[1]),h(e,"class","txt-missing")},m(i,s){S(i,e,s),v(e,t)},p(i,s){s[0]&2&&le(t,i[1])},d(i){i&&w(e)}}}function HT(n){let e=n[46]+"",t;return{c(){t=U(e)},m(i,s){S(i,t,s)},p(i,s){s[0]&1048576&&e!==(e=i[46]+"")&&le(t,e)},i:Q,o:Q,d(i){i&&w(t)}}}function zT(n){let e,t,i;const s=[{item:n[46]},n[11]];var l=n[10];function o(r){let a={};for(let u=0;u{H(f,1)}),ae()}l?(e=Pt(l,o()),z(e.$$.fragment),A(e.$$.fragment,1),V(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function hd(n){let e,t,i,s,l,o,r;const a=[zT,HT],u=[];function f(m,_){return m[10]?0:1}t=f(n),i=u[t]=a[t](n);function d(...m){return n[37](n[46],...m)}function p(...m){return n[38](n[46],...m)}return{c(){e=y("div"),i.c(),s=E(),h(e,"tabindex","0"),h(e,"class","dropdown-item option"),x(e,"closable",n[7]),x(e,"selected",n[19](n[46]))},m(m,_){S(m,e,_),u[t].m(e,null),v(e,s),l=!0,o||(r=[J(e,"click",d),J(e,"keydown",p)],o=!0)},p(m,_){n=m;let g=t;t=f(n),t===g?u[t].p(n,_):(re(),P(u[g],1,1,()=>{u[g]=null}),ae(),i=u[t],i?i.p(n,_):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||_[0]&128)&&x(e,"closable",n[7]),(!l||_[0]&1572864)&&x(e,"selected",n[19](n[46]))},i(m){l||(A(i),l=!0)},o(m){P(i),l=!1},d(m){m&&w(e),u[t].d(),o=!1,De(r)}}}function BT(n){let e,t,i,s,l,o=n[12]&&cd(n);const r=n[33].beforeOptions,a=Tt(r,n,n[42],ld);let u=n[20],f=[];for(let g=0;gP(f[g],1,1,()=>{f[g]=null});let p=null;u.length||(p=pd(n));const m=n[33].afterOptions,_=Tt(m,n,n[42],id);return{c(){o&&o.c(),e=E(),a&&a.c(),t=E(),i=y("div");for(let g=0;gP(a[p],1,1,()=>{a[p]=null});let f=null;r.length||(f=rd(n));let d=!n[5]&&fd(n);return{c(){e=y("div"),t=y("div");for(let p=0;p{d=null}),ae()):d?(d.p(p,m),m[0]&32&&A(d,1)):(d=fd(p),d.c(),A(d,1),d.m(e,null)),(!o||m[0]&8192&&l!==(l="select "+p[13]))&&h(e,"class",l),(!o||m[0]&8208)&&x(e,"multiple",p[4]),(!o||m[0]&8224)&&x(e,"disabled",p[5])},i(p){if(!o){for(let m=0;mQe(Gt,Fe))||[]}function G(te,Fe){te.preventDefault(),g&&p?Y(Fe):q(Fe)}function ce(te,Fe){(te.code==="Enter"||te.code==="Space")&&G(te,Fe)}function ge(){X(),setTimeout(()=>{const te=F==null?void 0:F.querySelector(".dropdown-item.option.selected");te&&(te.focus(),te.scrollIntoView({block:"nearest"}))},0)}function Me(te){te.stopPropagation(),!m&&(I==null||I.toggle())}xt(()=>{const te=document.querySelectorAll(`label[for="${r}"]`);for(const Fe of te)Fe.addEventListener("click",Me);return()=>{for(const Fe of te)Fe.removeEventListener("click",Me)}});const qe=te=>N(te);function He(te){se[te?"unshift":"push"](()=>{R=te,t(18,R)})}function we(){L=this.value,t(15,L)}const Ce=(te,Fe)=>G(Fe,te),Je=(te,Fe)=>ce(Fe,te);function mt(te){se[te?"unshift":"push"](()=>{I=te,t(16,I)})}function Ze(te){pe.call(this,n,te)}function We(te){se[te?"unshift":"push"](()=>{F=te,t(17,F)})}return n.$$set=te=>{"id"in te&&t(25,r=te.id),"noOptionsText"in te&&t(1,a=te.noOptionsText),"selectPlaceholder"in te&&t(2,u=te.selectPlaceholder),"searchPlaceholder"in te&&t(3,f=te.searchPlaceholder),"items"in te&&t(26,d=te.items),"multiple"in te&&t(4,p=te.multiple),"disabled"in te&&t(5,m=te.disabled),"selected"in te&&t(0,_=te.selected),"toggle"in te&&t(6,g=te.toggle),"closable"in te&&t(7,b=te.closable),"labelComponent"in te&&t(8,k=te.labelComponent),"labelComponentProps"in te&&t(9,$=te.labelComponentProps),"optionComponent"in te&&t(10,T=te.optionComponent),"optionComponentProps"in te&&t(11,C=te.optionComponentProps),"searchable"in te&&t(12,D=te.searchable),"searchFunc"in te&&t(27,M=te.searchFunc),"class"in te&&t(13,O=te.class),"$$scope"in te&&t(42,o=te.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&67108864&&d&&(ie(),X()),n.$$.dirty[0]&67141632&&t(20,i=fe(d,L)),n.$$.dirty[0]&1&&t(19,s=function(te){const Fe=j.toArray(_);return j.inArray(Fe,te)})},[_,a,u,f,p,m,g,b,k,$,T,C,D,O,N,L,I,F,R,s,i,X,G,ce,ge,r,d,M,q,Y,B,Z,ee,l,qe,He,we,Ce,Je,mt,Ze,We,o]}class ou extends ve{constructor(e){super(),be(this,e,YT,UT,_e,{id:25,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:26,multiple:4,disabled:5,selected:0,toggle:6,closable:7,labelComponent:8,labelComponentProps:9,optionComponent:10,optionComponentProps:11,searchable:12,searchFunc:27,class:13,deselectItem:14,selectItem:28,toggleItem:29,reset:30,showDropdown:31,hideDropdown:32},null,[-1,-1])}get deselectItem(){return this.$$.ctx[14]}get selectItem(){return this.$$.ctx[28]}get toggleItem(){return this.$$.ctx[29]}get reset(){return this.$$.ctx[30]}get showDropdown(){return this.$$.ctx[31]}get hideDropdown(){return this.$$.ctx[32]}}function _d(n){let e,t;return{c(){e=y("i"),h(e,"class",t="icon "+n[0].icon)},m(i,s){S(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&h(e,"class",t)},d(i){i&&w(e)}}}function KT(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&_d(n);return{c(){l&&l.c(),e=E(),t=y("span"),s=U(i),h(t,"class","txt")},m(o,r){l&&l.m(o,r),S(o,e,r),S(o,t,r),v(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=_d(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&le(s,i)},i:Q,o:Q,d(o){l&&l.d(o),o&&w(e),o&&w(t)}}}function JT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class gd extends ve{constructor(e){super(),be(this,e,JT,KT,_e,{item:0})}}const ZT=n=>({}),bd=n=>({});function GT(n){let e;const t=n[8].afterOptions,i=Tt(t,n,n[12],bd);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Mt(i,t,s,s[12],e?Ct(t,s[12],l,ZT):Ot(s[12]),bd)},i(s){e||(A(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function XT(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[GT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&62?St(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Kt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function QT(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Xe(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=gd}=e,{optionComponent:d=gd}=e,{selectionKey:p="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function _(T){T=j.toArray(T,!0);let C=[];for(let D of T){const M=j.findByKey(r,p,D);M&&C.push(M)}T.length&&!C.length||t(0,u=a?C:C[0])}async function g(T){let C=j.toArray(T,!0).map(D=>D[p]);r.length&&t(6,m=a?C:C[0])}function b(T){u=T,t(0,u)}function k(T){pe.call(this,n,T)}function $(T){pe.call(this,n,T)}return n.$$set=T=>{e=Re(Re({},e),Yt(T)),t(5,s=Xe(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,d=T.optionComponent),"selectionKey"in T&&t(7,p=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&_(m),n.$$.dirty&1&&g(u)},[u,r,a,f,d,s,m,p,l,b,k,$,o]}class Ri extends ve{constructor(e){super(),be(this,e,QT,XT,_e,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function xT(n){let e,t,i,s,l,o;function r(u){n[7](u)}let a={id:n[17],placeholder:"Choices: eg. optionA, optionB",required:!0,disabled:!n[18]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new qs({props:a}),se.push(()=>he(t,"value",r)),{c(){e=y("div"),z(t.$$.fragment)},m(u,f){S(u,e,f),V(t,e,null),s=!0,l||(o=Ee(Ue.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(u,f){const d={};f&131072&&(d.id=u[17]),f&262144&&(d.disabled=!u[18]),!i&&f&1&&(i=!0,d.value=u[0].options.values,ke(()=>i=!1)),t.$set(d)},i(u){s||(A(t.$$.fragment,u),s=!0)},o(u){P(t.$$.fragment,u),s=!1},d(u){u&&w(e),H(t),l=!1,o()}}}function eC(n){let e,t,i;function s(o){n[8](o)}let l={id:n[17],items:n[3],disabled:!n[18]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ri({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&131072&&(a.id=o[17]),r&262144&&(a.disabled=!o[18]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function tC(n){let e,t,i,s;return e=new de({props:{class:"form-field required "+(n[18]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[xT,({uniqueId:l})=>({17:l}),({uniqueId:l})=>l?131072:0]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field form-field-single-multiple-select "+(n[18]?"":"disabled"),inlineError:!0,$$slots:{default:[eC,({uniqueId:l})=>({17:l}),({uniqueId:l})=>l?131072:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o&262144&&(r.class="form-field required "+(l[18]?"":"disabled")),o&2&&(r.name="schema."+l[1]+".options.values"),o&917505&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&262144&&(a.class="form-field form-field-single-multiple-select "+(l[18]?"":"disabled")),o&917508&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function vd(n){let e,t;return e=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[nC,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.maxSelect"),s&655361&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function nC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[17]),h(l,"id",o=n[17]),h(l,"type","number"),h(l,"step","1"),h(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.maxSelect),r||(a=J(l,"input",n[6]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function iC(n){let e,t,i=!n[2]&&vd(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,l){s[2]?i&&(re(),P(i,1,1,()=>{i=null}),ae()):i?(i.p(s,l),l&4&&A(i,1)):(i=vd(s),i.c(),A(i,1),i.m(e.parentNode,e))},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function sC(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[iC],default:[tC,({interactive:r})=>({18:r}),({interactive:r})=>r?262144:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("drop",n[12]),e.$on("dragstart",n[13]),e.$on("dragenter",n[14]),e.$on("dragleave",n[15]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&18?St(s,[a&2&&{key:r[1]},a&16&&Kt(r[4])]):{};a&786439&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function lC(n,e,t){var D;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((D=l.options)==null?void 0:D.maxSelect)<=1,u=a;function f(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,u=a)}function d(){l.options.maxSelect=_t(this.value),t(0,l),t(5,u),t(2,a)}function p(M){n.$$.not_equal(l.options.values,M)&&(l.options.values=M,t(0,l),t(5,u),t(2,a))}function m(M){a=M,t(2,a)}function _(M){l=M,t(0,l),t(5,u),t(2,a)}function g(M){pe.call(this,n,M)}function b(M){pe.call(this,n,M)}function k(M){pe.call(this,n,M)}function $(M){pe.call(this,n,M)}function T(M){pe.call(this,n,M)}function C(M){pe.call(this,n,M)}return n.$$set=M=>{e=Re(Re({},e),Yt(M)),t(4,s=Xe(e,i)),"field"in M&&t(0,l=M.field),"key"in M&&t(1,o=M.key)},n.$$.update=()=>{var M,O;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((O=(M=l.options)==null?void 0:M.values)==null?void 0:O.length)||2,l)),n.$$.dirty&1&&j.isEmpty(l.options)&&f()},[l,o,a,r,s,u,d,p,m,_,g,b,k,$,T,C]}class oC extends ve{constructor(e){super(),be(this,e,lC,sC,_e,{field:0,key:1})}}function rC(n){let e;return{c(){e=y("i"),h(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function aC(n){let e;return{c(){e=y("i"),h(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function yd(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O='"{"a":1,"b":2}"',I,L,F,R,N,q,Y,B,Z,ee,ie,X,fe;return{c(){e=y("div"),t=y("div"),i=y("div"),s=U("In order to support seamlessly both "),l=y("code"),l.textContent="application/json",o=U(` and `),r=y("code"),r.textContent="multipart/form-data",a=U(` requests, the following normalization rules are applied if the `),u=y("code"),u.textContent="json",f=U(` field is a `),d=y("strong"),d.textContent="plain string",p=U(`: `),m=y("ul"),_=y("li"),_.innerHTML=""true" is converted to the json true",g=E(),b=y("li"),b.innerHTML=""false" is converted to the json false",k=E(),$=y("li"),$.innerHTML=""null" is converted to the json null",T=E(),C=y("li"),C.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",D=E(),M=y("li"),I=U(O),L=U(" is converted to the json "),F=y("code"),F.textContent='{"a":1,"b":2}',R=E(),N=y("li"),N.textContent="numeric strings are converted to json number",q=E(),Y=y("li"),Y.textContent="double quoted strings are left as they are (aka. without normalizations)",B=E(),Z=y("li"),Z.textContent="any other string (empty string too) is double quoted",ee=U(` Alternatively, if you want to avoid the string value normalizations, you can wrap your - data inside an object, eg.`),ie=y("code"),ie.textContent='{"data": anything}',h(i,"class","content"),h(t,"class","alert alert-warning m-b-0 m-t-10"),h(e,"class","block")},m(G,ce){S(G,e,ce),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,m),v(m,_),v(m,g),v(m,b),v(m,k),v(m,$),v(m,T),v(m,C),v(m,D),v(m,M),v(M,I),v(M,L),v(M,F),v(m,R),v(m,N),v(m,q),v(m,Y),v(m,B),v(m,Z),v(i,ee),v(i,ie),fe=!0},i(G){fe||(G&&nt(()=>{fe&&(X||(X=Ve(e,wt,{duration:150},!0)),X.run(1))}),fe=!0)},o(G){G&&(X||(X=Ve(e,wt,{duration:150},!1)),X.run(0)),fe=!1},d(G){G&&w(e),G&&X&&X.end()}}}function aC(n){let e,t,i,s,l,o,r;function a(p,m){return p[2]?rC:oC}let u=a(n),f=u(n),d=n[2]&&yd();return{c(){e=y("button"),t=y("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),d&&d.c(),l=Se(),h(t,"class","txt"),h(e,"type","button"),h(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(p,m){S(p,e,m),v(e,t),v(e,i),f.m(e,null),S(p,s,m),d&&d.m(p,m),S(p,l,m),o||(r=J(e,"click",n[4]),o=!0)},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(e,null))),p[2]?d?m&4&&A(d,1):(d=yd(),d.c(),A(d,1),d.m(l.parentNode,l)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},d(p){p&&w(e),f.d(),p&&w(s),d&&d.d(p),p&&w(l),o=!1,r()}}}function uC(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[aC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&10?St(s,[a&2&&{key:r[1]},a&8&&Kt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function fC(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(b){l=b,t(0,l)}function f(b){pe.call(this,n,b)}function d(b){pe.call(this,n,b)}function p(b){pe.call(this,n,b)}function m(b){pe.call(this,n,b)}function _(b){pe.call(this,n,b)}function g(b){pe.call(this,n,b)}return n.$$set=b=>{e=Re(Re({},e),Yt(b)),t(3,s=Xe(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,r,s,a,u,f,d,p,m,_,g]}class cC extends ve{constructor(e){super(),be(this,e,fC,uC,_e,{field:0,key:1})}}function dC(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=y("span"),i=U(t),s=E(),l=y("small"),r=U(o),h(e,"class","txt"),h(l,"class","txt-hint")},m(a,u){S(a,e,u),v(e,i),S(a,s,u),S(a,l,u),v(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:Q,o:Q,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function pC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class kd extends ve{constructor(e){super(),be(this,e,pC,dC,_e,{item:0})}}const mC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function hC(n){let e,t,i;function s(o){n[16](o)}let l={id:n[26],items:n[4],disabled:!n[27]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ri({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&67108864&&(a.id=o[26]),r&134217728&&(a.disabled=!o[27]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function _C(n){let e,t;return e=new de({props:{class:"form-field form-field-single-multiple-select "+(n[27]?"":"disabled"),inlineError:!0,$$slots:{default:[hC,({uniqueId:i})=>({26:i}),({uniqueId:i})=>i?67108864:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&134217728&&(l.class="form-field form-field-single-multiple-select "+(i[27]?"":"disabled")),s&469762052&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function gC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=E(),i=y("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=E(),l=y("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=E(),r=y("button"),r.innerHTML='Archives (zip, 7zip, rar)',h(e,"type","button"),h(e,"class","dropdown-item closable"),h(i,"type","button"),h(i,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item closable"),h(r,"type","button"),h(r,"class","dropdown-item closable")},m(f,d){S(f,e,d),S(f,t,d),S(f,i,d),S(f,s,d),S(f,l,d),S(f,o,d),S(f,r,d),a||(u=[J(e,"click",n[9]),J(i,"click",n[10]),J(l,"click",n[11]),J(r,"click",n[12])],a=!0)},p:Q,d(f){f&&w(e),f&&w(t),f&&w(i),f&&w(s),f&&w(l),f&&w(o),f&&w(r),a=!1,De(u)}}}function bC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T;function C(M){n[8](M)}let D={id:n[26],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:kd,optionComponent:kd};return n[0].options.mimeTypes!==void 0&&(D.keyOfSelected=n[0].options.mimeTypes),r=new Ri({props:D}),se.push(()=>he(r,"keyOfSelected",C)),b=new Bn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[gC]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Allowed mime types",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),d=y("button"),p=y("span"),p.textContent="Choose presets",m=E(),_=y("i"),g=E(),z(b.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[26]),h(p,"class","txt link-primary"),h(_,"class","ri-arrow-drop-down-fill"),h(d,"type","button"),h(d,"class","inline-flex flex-gap-0"),h(f,"class","help-block")},m(M,O){S(M,e,O),v(e,t),v(e,i),v(e,s),S(M,o,O),V(r,M,O),S(M,u,O),S(M,f,O),v(f,d),v(d,p),v(d,m),v(d,_),v(d,g),V(b,d,null),k=!0,$||(T=Ee(Ue.call(null,s,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),$=!0)},p(M,O){(!k||O&67108864&&l!==(l=M[26]))&&h(e,"for",l);const I={};O&67108864&&(I.id=M[26]),O&8&&(I.items=M[3]),!a&&O&1&&(a=!0,I.keyOfSelected=M[0].options.mimeTypes,ke(()=>a=!1)),r.$set(I);const L={};O&268435457&&(L.$$scope={dirty:O,ctx:M}),b.$set(L)},i(M){k||(A(r.$$.fragment,M),A(b.$$.fragment,M),k=!0)},o(M){P(r.$$.fragment,M),P(b.$$.fragment,M),k=!1},d(M){M&&w(e),M&&w(o),H(r,M),M&&w(u),M&&w(f),H(b),$=!1,T()}}}function vC(n){let e;return{c(){e=y("ul"),e.innerHTML=`
  • WxH + data inside an object, eg.`),ie=y("code"),ie.textContent='{"data": anything}',h(i,"class","content"),h(t,"class","alert alert-warning m-b-0 m-t-10"),h(e,"class","block")},m(G,ce){S(G,e,ce),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,m),v(m,_),v(m,g),v(m,b),v(m,k),v(m,$),v(m,T),v(m,C),v(m,D),v(m,M),v(M,I),v(M,L),v(M,F),v(m,R),v(m,N),v(m,q),v(m,Y),v(m,B),v(m,Z),v(i,ee),v(i,ie),fe=!0},i(G){fe||(G&&nt(()=>{fe&&(X||(X=Ve(e,wt,{duration:150},!0)),X.run(1))}),fe=!0)},o(G){G&&(X||(X=Ve(e,wt,{duration:150},!1)),X.run(0)),fe=!1},d(G){G&&w(e),G&&X&&X.end()}}}function uC(n){let e,t,i,s,l,o,r;function a(p,m){return p[2]?aC:rC}let u=a(n),f=u(n),d=n[2]&&yd();return{c(){e=y("button"),t=y("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),d&&d.c(),l=Se(),h(t,"class","txt"),h(e,"type","button"),h(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(p,m){S(p,e,m),v(e,t),v(e,i),f.m(e,null),S(p,s,m),d&&d.m(p,m),S(p,l,m),o||(r=J(e,"click",n[4]),o=!0)},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(e,null))),p[2]?d?m&4&&A(d,1):(d=yd(),d.c(),A(d,1),d.m(l.parentNode,l)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},d(p){p&&w(e),f.d(),p&&w(s),d&&d.d(p),p&&w(l),o=!1,r()}}}function fC(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[uC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&10?St(s,[a&2&&{key:r[1]},a&8&&Kt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function cC(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(b){l=b,t(0,l)}function f(b){pe.call(this,n,b)}function d(b){pe.call(this,n,b)}function p(b){pe.call(this,n,b)}function m(b){pe.call(this,n,b)}function _(b){pe.call(this,n,b)}function g(b){pe.call(this,n,b)}return n.$$set=b=>{e=Re(Re({},e),Yt(b)),t(3,s=Xe(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,r,s,a,u,f,d,p,m,_,g]}class dC extends ve{constructor(e){super(),be(this,e,cC,fC,_e,{field:0,key:1})}}function pC(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=y("span"),i=U(t),s=E(),l=y("small"),r=U(o),h(e,"class","txt"),h(l,"class","txt-hint")},m(a,u){S(a,e,u),v(e,i),S(a,s,u),S(a,l,u),v(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:Q,o:Q,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function mC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class kd extends ve{constructor(e){super(),be(this,e,mC,pC,_e,{item:0})}}const hC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function _C(n){let e,t,i;function s(o){n[16](o)}let l={id:n[26],items:n[4],disabled:!n[27]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ri({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&67108864&&(a.id=o[26]),r&134217728&&(a.disabled=!o[27]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function gC(n){let e,t;return e=new de({props:{class:"form-field form-field-single-multiple-select "+(n[27]?"":"disabled"),inlineError:!0,$$slots:{default:[_C,({uniqueId:i})=>({26:i}),({uniqueId:i})=>i?67108864:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&134217728&&(l.class="form-field form-field-single-multiple-select "+(i[27]?"":"disabled")),s&469762052&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=E(),i=y("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=E(),l=y("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=E(),r=y("button"),r.innerHTML='Archives (zip, 7zip, rar)',h(e,"type","button"),h(e,"class","dropdown-item closable"),h(i,"type","button"),h(i,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item closable"),h(r,"type","button"),h(r,"class","dropdown-item closable")},m(f,d){S(f,e,d),S(f,t,d),S(f,i,d),S(f,s,d),S(f,l,d),S(f,o,d),S(f,r,d),a||(u=[J(e,"click",n[9]),J(i,"click",n[10]),J(l,"click",n[11]),J(r,"click",n[12])],a=!0)},p:Q,d(f){f&&w(e),f&&w(t),f&&w(i),f&&w(s),f&&w(l),f&&w(o),f&&w(r),a=!1,De(u)}}}function vC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T;function C(M){n[8](M)}let D={id:n[26],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:kd,optionComponent:kd};return n[0].options.mimeTypes!==void 0&&(D.keyOfSelected=n[0].options.mimeTypes),r=new Ri({props:D}),se.push(()=>he(r,"keyOfSelected",C)),b=new Bn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[bC]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Allowed mime types",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),d=y("button"),p=y("span"),p.textContent="Choose presets",m=E(),_=y("i"),g=E(),z(b.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[26]),h(p,"class","txt link-primary"),h(_,"class","ri-arrow-drop-down-fill"),h(d,"type","button"),h(d,"class","inline-flex flex-gap-0"),h(f,"class","help-block")},m(M,O){S(M,e,O),v(e,t),v(e,i),v(e,s),S(M,o,O),V(r,M,O),S(M,u,O),S(M,f,O),v(f,d),v(d,p),v(d,m),v(d,_),v(d,g),V(b,d,null),k=!0,$||(T=Ee(Ue.call(null,s,{text:`Allow files ONLY with the listed mime types. + Leave empty for no restriction.`,position:"top"})),$=!0)},p(M,O){(!k||O&67108864&&l!==(l=M[26]))&&h(e,"for",l);const I={};O&67108864&&(I.id=M[26]),O&8&&(I.items=M[3]),!a&&O&1&&(a=!0,I.keyOfSelected=M[0].options.mimeTypes,ke(()=>a=!1)),r.$set(I);const L={};O&268435457&&(L.$$scope={dirty:O,ctx:M}),b.$set(L)},i(M){k||(A(r.$$.fragment,M),A(b.$$.fragment,M),k=!0)},o(M){P(r.$$.fragment,M),P(b.$$.fragment,M),k=!1},d(M){M&&w(e),M&&w(o),H(r,M),M&&w(u),M&&w(f),H(b),$=!1,T()}}}function yC(n){let e;return{c(){e=y("ul"),e.innerHTML=`
  • WxH (eg. 100x50) - crop to WxH viewbox (from center)
  • WxHt (eg. 100x50t) - crop to WxH viewbox (from top)
  • @@ -75,81 +75,81 @@
  • 0xH (eg. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 - (eg. 100x0) - resize to W width preserving the aspect ratio
  • `,h(e,"class","m-0")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function yC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D;function M(I){n[13](I)}let O={id:n[26],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new qs({props:O}),se.push(()=>he(r,"value",M)),$=new Bn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[vC]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Thumb sizes",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),d=y("span"),d.textContent="Use comma as separator.",p=E(),m=y("button"),_=y("span"),_.textContent="Supported formats",g=E(),b=y("i"),k=E(),z($.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[26]),h(d,"class","txt"),h(_,"class","txt link-primary"),h(b,"class","ri-arrow-drop-down-fill"),h(m,"type","button"),h(m,"class","inline-flex flex-gap-0"),h(f,"class","help-block")},m(I,L){S(I,e,L),v(e,t),v(e,i),v(e,s),S(I,o,L),V(r,I,L),S(I,u,L),S(I,f,L),v(f,d),v(f,p),v(f,m),v(m,_),v(m,g),v(m,b),v(m,k),V($,m,null),T=!0,C||(D=Ee(Ue.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),C=!0)},p(I,L){(!T||L&67108864&&l!==(l=I[26]))&&h(e,"for",l);const F={};L&67108864&&(F.id=I[26]),!a&&L&1&&(a=!0,F.value=I[0].options.thumbs,ke(()=>a=!1)),r.$set(F);const R={};L&268435456&&(R.$$scope={dirty:L,ctx:I}),$.$set(R)},i(I){T||(A(r.$$.fragment,I),A($.$$.fragment,I),T=!0)},o(I){P(r.$$.fragment,I),P($.$$.fragment,I),T=!1},d(I){I&&w(e),I&&w(o),H(r,I),I&&w(u),I&&w(f),H($),C=!1,D()}}}function kC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Max file size"),s=E(),l=y("input"),r=E(),a=y("div"),a.textContent="Must be in bytes.",h(e,"for",i=n[26]),h(l,"type","number"),h(l,"id",o=n[26]),h(l,"step","1"),h(l,"min","0"),h(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[0].options.maxSize),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[14]),u=!0)},p(d,p){p&67108864&&i!==(i=d[26])&&h(e,"for",i),p&67108864&&o!==(o=d[26])&&h(l,"id",o),p&1&&_t(l.value)!==d[0].options.maxSize&&ue(l,d[0].options.maxSize)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function wd(n){let e,t,i;return t=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[wC,({uniqueId:s})=>({26:s}),({uniqueId:s})=>s?67108864:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","col-sm-3")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&335544321&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function wC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[26]),h(l,"id",o=n[26]),h(l,"type","number"),h(l,"step","1"),h(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.maxSelect),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&h(e,"for",i),f&67108864&&o!==(o=u[26])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function SC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[bC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[yC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[kC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}});let _=!n[2]&&wd(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),a=E(),u=y("div"),z(f.$$.fragment),p=E(),_&&_.c(),h(t,"class","col-sm-12"),h(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),h(u,"class",d=n[2]?"col-sm-4":"col-sm-3"),h(e,"class","grid grid-sm")},m(g,b){S(g,e,b),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,a),v(e,u),V(f,u,null),v(e,p),_&&_.m(e,null),m=!0},p(g,b){const k={};b&2&&(k.name="schema."+g[1]+".options.mimeTypes"),b&335544329&&(k.$$scope={dirty:b,ctx:g}),i.$set(k);const $={};b&2&&($.name="schema."+g[1]+".options.thumbs"),b&335544321&&($.$$scope={dirty:b,ctx:g}),o.$set($),(!m||b&4&&r!==(r=g[2]?"col-sm-8":"col-sm-6"))&&h(l,"class",r);const T={};b&2&&(T.name="schema."+g[1]+".options.maxSize"),b&335544321&&(T.$$scope={dirty:b,ctx:g}),f.$set(T),(!m||b&4&&d!==(d=g[2]?"col-sm-4":"col-sm-3"))&&h(u,"class",d),g[2]?_&&(re(),P(_,1,1,()=>{_=null}),ae()):_?(_.p(g,b),b&4&&A(_,1)):(_=wd(g),_.c(),A(_,1),_.m(e,null))},i(g){m||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(f.$$.fragment,g),A(_),m=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(f.$$.fragment,g),P(_),m=!1},d(g){g&&w(e),H(i),H(o),H(f),_&&_.d()}}}function $C(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Private",o=E(),r=y("i"),u=E(),f=y("a"),f.textContent="Learn more",h(e,"type","checkbox"),h(e,"id",t=n[26]),h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[26]),h(f,"href","https://pocketbase.io/docs/files-handling/#private-files"),h(f,"class","toggle-info txt-sm txt-hint m-l-5"),h(f,"target","_blank"),h(f,"rel","noopener")},m(m,_){S(m,e,_),e.checked=n[0].options.private,S(m,i,_),S(m,s,_),v(s,l),v(s,o),v(s,r),S(m,u,_),S(m,f,_),d||(p=[J(e,"change",n[7]),Ee(Ue.call(null,r,{text:`Only those with "View API" rule access will be able to preview or download the file(s). -Authenticated user can pass a file token via the "token" query param.`,position:"top"}))],d=!0)},p(m,_){_&67108864&&t!==(t=m[26])&&h(e,"id",t),_&1&&(e.checked=m[0].options.private),_&67108864&&a!==(a=m[26])&&h(s,"for",a)},d(m){m&&w(e),m&&w(i),m&&w(s),m&&w(u),m&&w(f),d=!1,De(p)}}}function TC(n){let e,t,i;return t=new de({props:{class:"form-field form-field-toggle m-0",name:"schema."+n[1]+".options.private",$$slots:{default:[$C,({uniqueId:s})=>({26:s}),({uniqueId:s})=>s?67108864:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","col-sm-4")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.private"),l&335544321&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function CC(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{afterNonempty:[TC],options:[SC],default:[_C,({interactive:r})=>({27:r}),({interactive:r})=>r?134217728:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("drop",n[20]),e.$on("dragstart",n[21]),e.$on("dragenter",n[22]),e.$on("dragleave",n[23]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&34?St(s,[a&2&&{key:r[1]},a&32&&Kt(r[5])]):{};a&402653199&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function MC(n,e,t){var Y;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=mC.slice(),u=((Y=l.options)==null?void 0:Y.maxSelect)<=1,f=u;function d(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function p(){if(j.isEmpty(l.options.mimeTypes))return;const B=[];for(const Z of l.options.mimeTypes)a.find(ee=>ee.mimeType===Z)||B.push({mimeType:Z});B.length&&t(3,a=a.concat(B))}function m(){l.options.private=this.checked,t(0,l),t(6,f),t(2,u)}function _(B){n.$$.not_equal(l.options.mimeTypes,B)&&(l.options.mimeTypes=B,t(0,l),t(6,f),t(2,u))}const g=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},b=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},k=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},$=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function T(B){n.$$.not_equal(l.options.thumbs,B)&&(l.options.thumbs=B,t(0,l),t(6,f),t(2,u))}function C(){l.options.maxSize=_t(this.value),t(0,l),t(6,f),t(2,u)}function D(){l.options.maxSelect=_t(this.value),t(0,l),t(6,f),t(2,u)}function M(B){u=B,t(2,u)}function O(B){l=B,t(0,l),t(6,f),t(2,u)}function I(B){pe.call(this,n,B)}function L(B){pe.call(this,n,B)}function F(B){pe.call(this,n,B)}function R(B){pe.call(this,n,B)}function N(B){pe.call(this,n,B)}function q(B){pe.call(this,n,B)}return n.$$set=B=>{e=Re(Re({},e),Yt(B)),t(5,s=Xe(e,i)),"field"in B&&t(0,l=B.field),"key"in B&&t(1,o=B.key)},n.$$.update=()=>{var B,Z;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((Z=(B=l.options)==null?void 0:B.values)==null?void 0:Z.length)||99,l)),n.$$.dirty&1&&(j.isEmpty(l.options)?d():p())},[l,o,u,a,r,s,f,m,_,g,b,k,$,T,C,D,M,O,I,L,F,R,N,q]}class OC extends ve{constructor(e){super(),be(this,e,MC,CC,_e,{field:0,key:1})}}function DC(n){let e,t,i,s,l;return{c(){e=y("hr"),t=E(),i=y("button"),i.innerHTML=` - New collection`,h(i,"type","button"),h(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=J(i,"click",n[15]),s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function EC(n){let e,t,i;function s(o){n[16](o)}let l={id:n[32],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],disabled:!n[33]||n[0].id,$$slots:{afterOptions:[DC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Ri({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[0]&1|r[1]&4&&(a.disabled=!o[33]||o[0].id),r[0]&16|r[1]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function AC(n){let e,t,i;function s(o){n[17](o)}let l={id:n[32],items:n[6],disabled:!n[33]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ri({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[1]&4&&(a.disabled=!o[33]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function IC(n){let e,t,i,s;return e=new de({props:{class:"form-field required "+(n[33]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[EC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field form-field-single-multiple-select "+(n[33]?"":"disabled"),inlineError:!0,$$slots:{default:[AC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[1]&4&&(r.class="form-field required "+(l[33]?"":"disabled")),o[0]&2&&(r.name="schema."+l[1]+".options.collectionId"),o[0]&25|o[1]&14&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o[1]&4&&(a.class="form-field form-field-single-multiple-select "+(l[33]?"":"disabled")),o[0]&4|o[1]&14&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function Sd(n){let e,t,i,s,l,o;return t=new de({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[PC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[LC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),i=E(),s=y("div"),z(l.$$.fragment),h(e,"class","col-sm-6"),h(s,"class","col-sm-6")},m(r,a){S(r,e,a),V(t,e,null),S(r,i,a),S(r,s,a),V(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&1|a[1]&10&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&1|a[1]&10&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),H(t),r&&w(i),r&&w(s),H(l)}}}function PC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min select"),s=E(),l=y("input"),h(e,"for",i=n[32]),h(l,"type","number"),h(l,"id",o=n[32]),h(l,"step","1"),h(l,"min","1"),h(l,"placeholder","No min limit")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minSelect),r||(a=J(l,"input",n[11]),r=!0)},p(u,f){f[1]&2&&i!==(i=u[32])&&h(e,"for",i),f[1]&2&&o!==(o=u[32])&&h(l,"id",o),f[0]&1&&_t(l.value)!==u[0].options.minSelect&&ue(l,u[0].options.minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function LC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[32]),h(l,"type","number"),h(l,"id",o=n[32]),h(l,"step","1"),h(l,"placeholder","No max limit"),h(l,"min",r=n[0].options.minSelect||2)},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ue(l,n[0].options.maxSelect),a||(u=J(l,"input",n[12]),a=!0)},p(f,d){d[1]&2&&i!==(i=f[32])&&h(e,"for",i),d[1]&2&&o!==(o=f[32])&&h(l,"id",o),d[0]&1&&r!==(r=f[0].options.minSelect||2)&&h(l,"min",r),d[0]&1&&_t(l.value)!==f[0].options.maxSelect&&ue(l,f[0].options.maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function NC(n){let e,t,i,s,l,o,r,a,u,f,d;function p(_){n[13](_)}let m={multiple:!0,searchable:!0,id:n[32],selectPlaceholder:"Auto",items:n[5]};return n[0].options.displayFields!==void 0&&(m.selected=n[0].options.displayFields),r=new ou({props:m}),se.push(()=>he(r,"selected",p)),{c(){e=y("label"),t=y("span"),t.textContent="Display fields",i=E(),s=y("i"),o=E(),z(r.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[32])},m(_,g){S(_,e,g),v(e,t),v(e,i),v(e,s),S(_,o,g),V(r,_,g),u=!0,f||(d=Ee(Ue.call(null,s,{text:"Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(_,g){(!u||g[1]&2&&l!==(l=_[32]))&&h(e,"for",l);const b={};g[1]&2&&(b.id=_[32]),g[0]&32&&(b.items=_[5]),!a&&g[0]&1&&(a=!0,b.selected=_[0].options.displayFields,ke(()=>a=!1)),r.$set(b)},i(_){u||(A(r.$$.fragment,_),u=!0)},o(_){P(r.$$.fragment,_),u=!1},d(_){_&&w(e),_&&w(o),H(r,_),f=!1,d()}}}function FC(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[32],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(u.keyOfSelected=n[0].options.cascadeDelete),l=new Ri({props:u}),se.push(()=>he(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("Delete main record on relation delete"),s=E(),z(l.$$.fragment),h(e,"for",i=n[32])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&2&&i!==(i=f[32]))&&h(e,"for",i);const p={};d[1]&2&&(p.id=f[32]),!o&&d[0]&1&&(o=!0,p.keyOfSelected=f[0].options.cascadeDelete,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function RC(n){let e,t,i,s,l,o,r,a,u=!n[2]&&Sd(n);return s=new de({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[NC,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[FC,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),u&&u.c(),t=E(),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(f,d){S(f,e,d),u&&u.m(e,null),v(e,t),v(e,i),V(s,i,null),v(e,l),v(e,o),V(r,o,null),a=!0},p(f,d){f[2]?u&&(re(),P(u,1,1,()=>{u=null}),ae()):u?(u.p(f,d),d[0]&4&&A(u,1)):(u=Sd(f),u.c(),A(u,1),u.m(e,t));const p={};d[0]&2&&(p.name="schema."+f[1]+".options.displayFields"),d[0]&33|d[1]&10&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d[0]&2&&(m.name="schema."+f[1]+".options.cascadeDelete"),d[0]&1|d[1]&10&&(m.$$scope={dirty:d,ctx:f}),r.$set(m)},i(f){a||(A(u),A(s.$$.fragment,f),A(r.$$.fragment,f),a=!0)},o(f){P(u),P(s.$$.fragment,f),P(r.$$.fragment,f),a=!1},d(f){f&&w(e),u&&u.d(),H(s),H(r)}}}function qC(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[18](f)}let a={$$slots:{options:[RC],default:[IC,({interactive:f})=>({33:f}),({interactive:f})=>[0,f?4:0]]},$$scope:{ctx:n}};for(let f=0;fhe(e,"field",r)),e.$on("rename",n[19]),e.$on("remove",n[20]),e.$on("drop",n[21]),e.$on("dragstart",n[22]),e.$on("dragenter",n[23]),e.$on("dragleave",n[24]);let u={};return s=new ru({props:u}),n[25](s),s.$on("save",n[26]),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment)},m(f,d){V(e,f,d),S(f,i,d),V(s,f,d),l=!0},p(f,d){const p=d[0]&258?St(o,[d[0]&2&&{key:f[1]},d[0]&256&&Kt(f[8])]):{};d[0]&63|d[1]&12&&(p.$$scope={dirty:d,ctx:f}),!t&&d[0]&1&&(t=!0,p.field=f[0],ke(()=>t=!1)),e.$set(p);const m={};s.$set(m)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),P(s.$$.fragment,f),l=!1},d(f){H(e,f),f&&w(i),n[25](null),H(s,f)}}}function jC(n,e,t){var fe;let i;const s=["field","key"];let l=Xe(e,s),o;Ke(n,si,G=>t(3,o=G));let{field:r}=e,{key:a=""}=e;const u=[{label:"Single",value:!0},{label:"Multiple",value:!1}],f=[{label:"False",value:!1},{label:"True",value:!0}],d=["id","created","updated"],p=["username","email","emailVisibility","verified"];let m=null,_=[],g=null,b=((fe=r.options)==null?void 0:fe.maxSelect)==1,k=b;function $(){t(0,r.options={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]},r),t(2,b=!0),t(10,k=b)}function T(){var G,ce;if(t(5,_=d.slice(0)),!!i){i.isAuth&&t(5,_=_.concat(p));for(const ge of i.schema)_.push(ge.name);if(((ce=(G=r.options)==null?void 0:G.displayFields)==null?void 0:ce.length)>0)for(let ge=r.options.displayFields.length-1;ge>=0;ge--)_.includes(r.options.displayFields[ge])||r.options.displayFields.splice(ge,1)}}function C(){r.options.minSelect=_t(this.value),t(0,r),t(10,k),t(2,b)}function D(){r.options.maxSelect=_t(this.value),t(0,r),t(10,k),t(2,b)}function M(G){n.$$.not_equal(r.options.displayFields,G)&&(r.options.displayFields=G,t(0,r),t(10,k),t(2,b))}function O(G){n.$$.not_equal(r.options.cascadeDelete,G)&&(r.options.cascadeDelete=G,t(0,r),t(10,k),t(2,b))}const I=()=>m==null?void 0:m.show();function L(G){n.$$.not_equal(r.options.collectionId,G)&&(r.options.collectionId=G,t(0,r),t(10,k),t(2,b))}function F(G){b=G,t(2,b)}function R(G){r=G,t(0,r),t(10,k),t(2,b)}function N(G){pe.call(this,n,G)}function q(G){pe.call(this,n,G)}function Y(G){pe.call(this,n,G)}function B(G){pe.call(this,n,G)}function Z(G){pe.call(this,n,G)}function ee(G){pe.call(this,n,G)}function ie(G){se[G?"unshift":"push"](()=>{m=G,t(4,m)})}const X=G=>{var ce,ge;(ge=(ce=G==null?void 0:G.detail)==null?void 0:ce.collection)!=null&&ge.id&&t(0,r.options.collectionId=G.detail.collection.id,r)};return n.$$set=G=>{e=Re(Re({},e),Yt(G)),t(8,l=Xe(e,s)),"field"in G&&t(0,r=G.field),"key"in G&&t(1,a=G.key)},n.$$.update=()=>{n.$$.dirty[0]&1028&&k!=b&&(t(10,k=b),b?(t(0,r.options.minSelect=null,r),t(0,r.options.maxSelect=1,r)):t(0,r.options.maxSelect=null,r)),n.$$.dirty[0]&1&&j.isEmpty(r.options)&&$(),n.$$.dirty[0]&9&&(i=o.find(G=>G.id==r.options.collectionId)||null),n.$$.dirty[0]&513&&g!=r.options.collectionId&&(t(9,g=r.options.collectionId),T())},[r,a,b,o,m,_,u,f,l,g,k,C,D,M,O,I,L,F,R,N,q,Y,B,Z,ee,ie,X]}class VC extends ve{constructor(e){super(),be(this,e,jC,qC,_e,{field:0,key:1},null,[-1,-1])}}function $d(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function Td(n){let e,t,i,s,l,o,r,a;return{c(){e=U(`, + (eg. 100x0) - resize to W width preserving the aspect ratio`,h(e,"class","m-0")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function kC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D;function M(I){n[13](I)}let O={id:n[26],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new qs({props:O}),se.push(()=>he(r,"value",M)),$=new Bn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[yC]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Thumb sizes",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),d=y("span"),d.textContent="Use comma as separator.",p=E(),m=y("button"),_=y("span"),_.textContent="Supported formats",g=E(),b=y("i"),k=E(),z($.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[26]),h(d,"class","txt"),h(_,"class","txt link-primary"),h(b,"class","ri-arrow-drop-down-fill"),h(m,"type","button"),h(m,"class","inline-flex flex-gap-0"),h(f,"class","help-block")},m(I,L){S(I,e,L),v(e,t),v(e,i),v(e,s),S(I,o,L),V(r,I,L),S(I,u,L),S(I,f,L),v(f,d),v(f,p),v(f,m),v(m,_),v(m,g),v(m,b),v(m,k),V($,m,null),T=!0,C||(D=Ee(Ue.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),C=!0)},p(I,L){(!T||L&67108864&&l!==(l=I[26]))&&h(e,"for",l);const F={};L&67108864&&(F.id=I[26]),!a&&L&1&&(a=!0,F.value=I[0].options.thumbs,ke(()=>a=!1)),r.$set(F);const R={};L&268435456&&(R.$$scope={dirty:L,ctx:I}),$.$set(R)},i(I){T||(A(r.$$.fragment,I),A($.$$.fragment,I),T=!0)},o(I){P(r.$$.fragment,I),P($.$$.fragment,I),T=!1},d(I){I&&w(e),I&&w(o),H(r,I),I&&w(u),I&&w(f),H($),C=!1,D()}}}function wC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Max file size"),s=E(),l=y("input"),r=E(),a=y("div"),a.textContent="Must be in bytes.",h(e,"for",i=n[26]),h(l,"type","number"),h(l,"id",o=n[26]),h(l,"step","1"),h(l,"min","0"),h(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[0].options.maxSize),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[14]),u=!0)},p(d,p){p&67108864&&i!==(i=d[26])&&h(e,"for",i),p&67108864&&o!==(o=d[26])&&h(l,"id",o),p&1&&_t(l.value)!==d[0].options.maxSize&&ue(l,d[0].options.maxSize)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function wd(n){let e,t,i;return t=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[SC,({uniqueId:s})=>({26:s}),({uniqueId:s})=>s?67108864:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","col-sm-3")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&335544321&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function SC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[26]),h(l,"id",o=n[26]),h(l,"type","number"),h(l,"step","1"),h(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.maxSelect),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&h(e,"for",i),f&67108864&&o!==(o=u[26])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function $C(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[vC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[kC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[wC,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}});let _=!n[2]&&wd(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),a=E(),u=y("div"),z(f.$$.fragment),p=E(),_&&_.c(),h(t,"class","col-sm-12"),h(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),h(u,"class",d=n[2]?"col-sm-4":"col-sm-3"),h(e,"class","grid grid-sm")},m(g,b){S(g,e,b),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,a),v(e,u),V(f,u,null),v(e,p),_&&_.m(e,null),m=!0},p(g,b){const k={};b&2&&(k.name="schema."+g[1]+".options.mimeTypes"),b&335544329&&(k.$$scope={dirty:b,ctx:g}),i.$set(k);const $={};b&2&&($.name="schema."+g[1]+".options.thumbs"),b&335544321&&($.$$scope={dirty:b,ctx:g}),o.$set($),(!m||b&4&&r!==(r=g[2]?"col-sm-8":"col-sm-6"))&&h(l,"class",r);const T={};b&2&&(T.name="schema."+g[1]+".options.maxSize"),b&335544321&&(T.$$scope={dirty:b,ctx:g}),f.$set(T),(!m||b&4&&d!==(d=g[2]?"col-sm-4":"col-sm-3"))&&h(u,"class",d),g[2]?_&&(re(),P(_,1,1,()=>{_=null}),ae()):_?(_.p(g,b),b&4&&A(_,1)):(_=wd(g),_.c(),A(_,1),_.m(e,null))},i(g){m||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(f.$$.fragment,g),A(_),m=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(f.$$.fragment,g),P(_),m=!1},d(g){g&&w(e),H(i),H(o),H(f),_&&_.d()}}}function TC(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Private",o=E(),r=y("i"),u=E(),f=y("a"),f.textContent="Learn more",h(e,"type","checkbox"),h(e,"id",t=n[26]),h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[26]),h(f,"href","https://pocketbase.io/docs/files-handling/#private-files"),h(f,"class","toggle-info txt-sm txt-hint m-l-5"),h(f,"target","_blank"),h(f,"rel","noopener")},m(m,_){S(m,e,_),e.checked=n[0].options.private,S(m,i,_),S(m,s,_),v(s,l),v(s,o),v(s,r),S(m,u,_),S(m,f,_),d||(p=[J(e,"change",n[7]),Ee(Ue.call(null,r,{text:`Only those with "View API" rule access will be able to preview or download the file(s). +Authenticated user can pass a file token via the "token" query param.`,position:"top"}))],d=!0)},p(m,_){_&67108864&&t!==(t=m[26])&&h(e,"id",t),_&1&&(e.checked=m[0].options.private),_&67108864&&a!==(a=m[26])&&h(s,"for",a)},d(m){m&&w(e),m&&w(i),m&&w(s),m&&w(u),m&&w(f),d=!1,De(p)}}}function CC(n){let e,t,i;return t=new de({props:{class:"form-field form-field-toggle m-0",name:"schema."+n[1]+".options.private",$$slots:{default:[TC,({uniqueId:s})=>({26:s}),({uniqueId:s})=>s?67108864:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","col-sm-4")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.private"),l&335544321&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function MC(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{afterNonempty:[CC],options:[$C],default:[gC,({interactive:r})=>({27:r}),({interactive:r})=>r?134217728:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("drop",n[20]),e.$on("dragstart",n[21]),e.$on("dragenter",n[22]),e.$on("dragleave",n[23]),{c(){z(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&34?St(s,[a&2&&{key:r[1]},a&32&&Kt(r[5])]):{};a&402653199&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function OC(n,e,t){var Y;const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=hC.slice(),u=((Y=l.options)==null?void 0:Y.maxSelect)<=1,f=u;function d(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function p(){if(j.isEmpty(l.options.mimeTypes))return;const B=[];for(const Z of l.options.mimeTypes)a.find(ee=>ee.mimeType===Z)||B.push({mimeType:Z});B.length&&t(3,a=a.concat(B))}function m(){l.options.private=this.checked,t(0,l),t(6,f),t(2,u)}function _(B){n.$$.not_equal(l.options.mimeTypes,B)&&(l.options.mimeTypes=B,t(0,l),t(6,f),t(2,u))}const g=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},b=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},k=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},$=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function T(B){n.$$.not_equal(l.options.thumbs,B)&&(l.options.thumbs=B,t(0,l),t(6,f),t(2,u))}function C(){l.options.maxSize=_t(this.value),t(0,l),t(6,f),t(2,u)}function D(){l.options.maxSelect=_t(this.value),t(0,l),t(6,f),t(2,u)}function M(B){u=B,t(2,u)}function O(B){l=B,t(0,l),t(6,f),t(2,u)}function I(B){pe.call(this,n,B)}function L(B){pe.call(this,n,B)}function F(B){pe.call(this,n,B)}function R(B){pe.call(this,n,B)}function N(B){pe.call(this,n,B)}function q(B){pe.call(this,n,B)}return n.$$set=B=>{e=Re(Re({},e),Yt(B)),t(5,s=Xe(e,i)),"field"in B&&t(0,l=B.field),"key"in B&&t(1,o=B.key)},n.$$.update=()=>{var B,Z;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((Z=(B=l.options)==null?void 0:B.values)==null?void 0:Z.length)||99,l)),n.$$.dirty&1&&(j.isEmpty(l.options)?d():p())},[l,o,u,a,r,s,f,m,_,g,b,k,$,T,C,D,M,O,I,L,F,R,N,q]}class DC extends ve{constructor(e){super(),be(this,e,OC,MC,_e,{field:0,key:1})}}function EC(n){let e,t,i,s,l;return{c(){e=y("hr"),t=E(),i=y("button"),i.innerHTML=` + New collection`,h(i,"type","button"),h(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=J(i,"click",n[15]),s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function AC(n){let e,t,i;function s(o){n[16](o)}let l={id:n[32],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],disabled:!n[33]||n[0].id,$$slots:{afterOptions:[EC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Ri({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[0]&1|r[1]&4&&(a.disabled=!o[33]||o[0].id),r[0]&16|r[1]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function IC(n){let e,t,i;function s(o){n[17](o)}let l={id:n[32],items:n[6],disabled:!n[33]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ri({props:l}),se.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[1]&4&&(a.disabled=!o[33]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function PC(n){let e,t,i,s;return e=new de({props:{class:"form-field required "+(n[33]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[AC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field form-field-single-multiple-select "+(n[33]?"":"disabled"),inlineError:!0,$$slots:{default:[IC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[1]&4&&(r.class="form-field required "+(l[33]?"":"disabled")),o[0]&2&&(r.name="schema."+l[1]+".options.collectionId"),o[0]&25|o[1]&14&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o[1]&4&&(a.class="form-field form-field-single-multiple-select "+(l[33]?"":"disabled")),o[0]&4|o[1]&14&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function Sd(n){let e,t,i,s,l,o;return t=new de({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[LC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[NC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),i=E(),s=y("div"),z(l.$$.fragment),h(e,"class","col-sm-6"),h(s,"class","col-sm-6")},m(r,a){S(r,e,a),V(t,e,null),S(r,i,a),S(r,s,a),V(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&1|a[1]&10&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&1|a[1]&10&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),H(t),r&&w(i),r&&w(s),H(l)}}}function LC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min select"),s=E(),l=y("input"),h(e,"for",i=n[32]),h(l,"type","number"),h(l,"id",o=n[32]),h(l,"step","1"),h(l,"min","1"),h(l,"placeholder","No min limit")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minSelect),r||(a=J(l,"input",n[11]),r=!0)},p(u,f){f[1]&2&&i!==(i=u[32])&&h(e,"for",i),f[1]&2&&o!==(o=u[32])&&h(l,"id",o),f[0]&1&&_t(l.value)!==u[0].options.minSelect&&ue(l,u[0].options.minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function NC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[32]),h(l,"type","number"),h(l,"id",o=n[32]),h(l,"step","1"),h(l,"placeholder","No max limit"),h(l,"min",r=n[0].options.minSelect||2)},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ue(l,n[0].options.maxSelect),a||(u=J(l,"input",n[12]),a=!0)},p(f,d){d[1]&2&&i!==(i=f[32])&&h(e,"for",i),d[1]&2&&o!==(o=f[32])&&h(l,"id",o),d[0]&1&&r!==(r=f[0].options.minSelect||2)&&h(l,"min",r),d[0]&1&&_t(l.value)!==f[0].options.maxSelect&&ue(l,f[0].options.maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function FC(n){let e,t,i,s,l,o,r,a,u,f,d;function p(_){n[13](_)}let m={multiple:!0,searchable:!0,id:n[32],selectPlaceholder:"Auto",items:n[5]};return n[0].options.displayFields!==void 0&&(m.selected=n[0].options.displayFields),r=new ou({props:m}),se.push(()=>he(r,"selected",p)),{c(){e=y("label"),t=y("span"),t.textContent="Display fields",i=E(),s=y("i"),o=E(),z(r.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[32])},m(_,g){S(_,e,g),v(e,t),v(e,i),v(e,s),S(_,o,g),V(r,_,g),u=!0,f||(d=Ee(Ue.call(null,s,{text:"Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(_,g){(!u||g[1]&2&&l!==(l=_[32]))&&h(e,"for",l);const b={};g[1]&2&&(b.id=_[32]),g[0]&32&&(b.items=_[5]),!a&&g[0]&1&&(a=!0,b.selected=_[0].options.displayFields,ke(()=>a=!1)),r.$set(b)},i(_){u||(A(r.$$.fragment,_),u=!0)},o(_){P(r.$$.fragment,_),u=!1},d(_){_&&w(e),_&&w(o),H(r,_),f=!1,d()}}}function RC(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[32],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(u.keyOfSelected=n[0].options.cascadeDelete),l=new Ri({props:u}),se.push(()=>he(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("Delete main record on relation delete"),s=E(),z(l.$$.fragment),h(e,"for",i=n[32])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&2&&i!==(i=f[32]))&&h(e,"for",i);const p={};d[1]&2&&(p.id=f[32]),!o&&d[0]&1&&(o=!0,p.keyOfSelected=f[0].options.cascadeDelete,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function qC(n){let e,t,i,s,l,o,r,a,u=!n[2]&&Sd(n);return s=new de({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[FC,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[RC,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),u&&u.c(),t=E(),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(f,d){S(f,e,d),u&&u.m(e,null),v(e,t),v(e,i),V(s,i,null),v(e,l),v(e,o),V(r,o,null),a=!0},p(f,d){f[2]?u&&(re(),P(u,1,1,()=>{u=null}),ae()):u?(u.p(f,d),d[0]&4&&A(u,1)):(u=Sd(f),u.c(),A(u,1),u.m(e,t));const p={};d[0]&2&&(p.name="schema."+f[1]+".options.displayFields"),d[0]&33|d[1]&10&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d[0]&2&&(m.name="schema."+f[1]+".options.cascadeDelete"),d[0]&1|d[1]&10&&(m.$$scope={dirty:d,ctx:f}),r.$set(m)},i(f){a||(A(u),A(s.$$.fragment,f),A(r.$$.fragment,f),a=!0)},o(f){P(u),P(s.$$.fragment,f),P(r.$$.fragment,f),a=!1},d(f){f&&w(e),u&&u.d(),H(s),H(r)}}}function jC(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[18](f)}let a={$$slots:{options:[qC],default:[PC,({interactive:f})=>({33:f}),({interactive:f})=>[0,f?4:0]]},$$scope:{ctx:n}};for(let f=0;fhe(e,"field",r)),e.$on("rename",n[19]),e.$on("remove",n[20]),e.$on("drop",n[21]),e.$on("dragstart",n[22]),e.$on("dragenter",n[23]),e.$on("dragleave",n[24]);let u={};return s=new ru({props:u}),n[25](s),s.$on("save",n[26]),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment)},m(f,d){V(e,f,d),S(f,i,d),V(s,f,d),l=!0},p(f,d){const p=d[0]&258?St(o,[d[0]&2&&{key:f[1]},d[0]&256&&Kt(f[8])]):{};d[0]&63|d[1]&12&&(p.$$scope={dirty:d,ctx:f}),!t&&d[0]&1&&(t=!0,p.field=f[0],ke(()=>t=!1)),e.$set(p);const m={};s.$set(m)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),P(s.$$.fragment,f),l=!1},d(f){H(e,f),f&&w(i),n[25](null),H(s,f)}}}function VC(n,e,t){var fe;let i;const s=["field","key"];let l=Xe(e,s),o;Ke(n,si,G=>t(3,o=G));let{field:r}=e,{key:a=""}=e;const u=[{label:"Single",value:!0},{label:"Multiple",value:!1}],f=[{label:"False",value:!1},{label:"True",value:!0}],d=["id","created","updated"],p=["username","email","emailVisibility","verified"];let m=null,_=[],g=null,b=((fe=r.options)==null?void 0:fe.maxSelect)==1,k=b;function $(){t(0,r.options={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]},r),t(2,b=!0),t(10,k=b)}function T(){var G,ce;if(t(5,_=d.slice(0)),!!i){i.isAuth&&t(5,_=_.concat(p));for(const ge of i.schema)_.push(ge.name);if(((ce=(G=r.options)==null?void 0:G.displayFields)==null?void 0:ce.length)>0)for(let ge=r.options.displayFields.length-1;ge>=0;ge--)_.includes(r.options.displayFields[ge])||r.options.displayFields.splice(ge,1)}}function C(){r.options.minSelect=_t(this.value),t(0,r),t(10,k),t(2,b)}function D(){r.options.maxSelect=_t(this.value),t(0,r),t(10,k),t(2,b)}function M(G){n.$$.not_equal(r.options.displayFields,G)&&(r.options.displayFields=G,t(0,r),t(10,k),t(2,b))}function O(G){n.$$.not_equal(r.options.cascadeDelete,G)&&(r.options.cascadeDelete=G,t(0,r),t(10,k),t(2,b))}const I=()=>m==null?void 0:m.show();function L(G){n.$$.not_equal(r.options.collectionId,G)&&(r.options.collectionId=G,t(0,r),t(10,k),t(2,b))}function F(G){b=G,t(2,b)}function R(G){r=G,t(0,r),t(10,k),t(2,b)}function N(G){pe.call(this,n,G)}function q(G){pe.call(this,n,G)}function Y(G){pe.call(this,n,G)}function B(G){pe.call(this,n,G)}function Z(G){pe.call(this,n,G)}function ee(G){pe.call(this,n,G)}function ie(G){se[G?"unshift":"push"](()=>{m=G,t(4,m)})}const X=G=>{var ce,ge;(ge=(ce=G==null?void 0:G.detail)==null?void 0:ce.collection)!=null&&ge.id&&t(0,r.options.collectionId=G.detail.collection.id,r)};return n.$$set=G=>{e=Re(Re({},e),Yt(G)),t(8,l=Xe(e,s)),"field"in G&&t(0,r=G.field),"key"in G&&t(1,a=G.key)},n.$$.update=()=>{n.$$.dirty[0]&1028&&k!=b&&(t(10,k=b),b?(t(0,r.options.minSelect=null,r),t(0,r.options.maxSelect=1,r)):t(0,r.options.maxSelect=null,r)),n.$$.dirty[0]&1&&j.isEmpty(r.options)&&$(),n.$$.dirty[0]&9&&(i=o.find(G=>G.id==r.options.collectionId)||null),n.$$.dirty[0]&513&&g!=r.options.collectionId&&(t(9,g=r.options.collectionId),T())},[r,a,b,o,m,_,u,f,l,g,k,C,D,M,O,I,L,F,R,N,q,Y,B,Z,ee,ie,X]}class HC extends ve{constructor(e){super(),be(this,e,VC,jC,_e,{field:0,key:1},null,[-1,-1])}}function $d(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function Td(n){let e,t,i,s,l,o,r,a;return{c(){e=U(`, `),t=y("code"),t.textContent="username",i=U(` , `),s=y("code"),s.textContent="email",l=U(` , `),o=y("code"),o.textContent="emailVisibility",r=U(` , - `),a=y("code"),a.textContent="verified",h(t,"class","txt-sm"),h(s,"class","txt-sm"),h(o,"class","txt-sm"),h(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function Cd(n,e){let t,i,s,l,o;function r(m){e[7](m,e[17],e[18],e[19])}function a(){return e[8](e[19])}function u(...m){return e[10](e[19],...m)}function f(...m){return e[11](e[19],...m)}var d=e[1][e[17].type];function p(m){let _={key:m[4](m[17])};return m[17]!==void 0&&(_.field=m[17]),{props:_}}return d&&(i=Pt(d,p(e)),se.push(()=>he(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f)),{key:n,first:null,c(){t=Se(),i&&z(i.$$.fragment),l=Se(),this.first=t},m(m,_){S(m,t,_),i&&V(i,m,_),S(m,l,_),o=!0},p(m,_){e=m;const g={};if(_&1&&(g.key=e[4](e[17])),!s&&_&1&&(s=!0,g.field=e[17],ke(()=>s=!1)),_&1&&d!==(d=e[1][e[17].type])){if(i){re();const b=i;P(b.$$.fragment,1,0,()=>{H(b,1)}),ae()}d?(i=Pt(d,p(e)),se.push(()=>he(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f),z(i.$$.fragment),A(i.$$.fragment,1),V(i,l.parentNode,l)):i=null}else d&&i.$set(g)},i(m){o||(i&&A(i.$$.fragment,m),o=!0)},o(m){i&&P(i.$$.fragment,m),o=!1},d(m){m&&w(t),m&&w(l),i&&H(i,m)}}}function HC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m=[],_=new Map,g,b,k,$,T,C,D,M,O=n[0].$isAuth&&Td(),I=n[0].schema;const L=N=>N[17];for(let N=0;Nhe(C,"collection",F)),{c(){e=y("div"),t=y("p"),i=U(`System fields: + `),a=y("code"),a.textContent="verified",h(t,"class","txt-sm"),h(s,"class","txt-sm"),h(o,"class","txt-sm"),h(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function Cd(n,e){let t,i,s,l,o;function r(m){e[7](m,e[17],e[18],e[19])}function a(){return e[8](e[19])}function u(...m){return e[10](e[19],...m)}function f(...m){return e[11](e[19],...m)}var d=e[1][e[17].type];function p(m){let _={key:m[4](m[17])};return m[17]!==void 0&&(_.field=m[17]),{props:_}}return d&&(i=Pt(d,p(e)),se.push(()=>he(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f)),{key:n,first:null,c(){t=Se(),i&&z(i.$$.fragment),l=Se(),this.first=t},m(m,_){S(m,t,_),i&&V(i,m,_),S(m,l,_),o=!0},p(m,_){e=m;const g={};if(_&1&&(g.key=e[4](e[17])),!s&&_&1&&(s=!0,g.field=e[17],ke(()=>s=!1)),_&1&&d!==(d=e[1][e[17].type])){if(i){re();const b=i;P(b.$$.fragment,1,0,()=>{H(b,1)}),ae()}d?(i=Pt(d,p(e)),se.push(()=>he(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f),z(i.$$.fragment),A(i.$$.fragment,1),V(i,l.parentNode,l)):i=null}else d&&i.$set(g)},i(m){o||(i&&A(i.$$.fragment,m),o=!0)},o(m){i&&P(i.$$.fragment,m),o=!1},d(m){m&&w(t),m&&w(l),i&&H(i,m)}}}function zC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m=[],_=new Map,g,b,k,$,T,C,D,M,O=n[0].$isAuth&&Td(),I=n[0].schema;const L=N=>N[17];for(let N=0;Nhe(C,"collection",F)),{c(){e=y("div"),t=y("p"),i=U(`System fields: `),s=y("code"),s.textContent="id",l=U(` , `),o=y("code"),o.textContent="created",r=U(` , `),a=y("code"),a.textContent="updated",u=E(),O&&O.c(),f=U(` - .`),d=E(),p=y("div");for(let N=0;ND=!1)),C.$set(Y)},i(N){if(!M){for(let q=0;qD.name===C)}function f(C){return i.findIndex(D=>D===C)}function d(C,D){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||C===D||!D||t(0,s.indexes=s.indexes.map(O=>j.replaceIndexColumn(O,C,D)),s)}function p(C,D){if(!C)return;C.dataTransfer.dropEffect="move";const M=parseInt(C.dataTransfer.getData("text/plain")),O=s.schema;Mo(C),g=C=>d(C.detail.oldName,C.detail.newName),b=(C,D)=>zC(D.detail,C),k=(C,D)=>p(D.detail,C),$=C=>r(C.detail);function T(C){s=C,t(0,s)}return n.$$set=C=>{"collection"in C&&t(0,s=C.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new kn),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter(C=>!C.toDelete)||[])},[s,l,o,r,f,d,p,m,_,g,b,k,$,T]}class UC extends ve{constructor(e){super(),be(this,e,BC,HC,_e,{collection:0})}}const WC=n=>({isAdminOnly:n&512}),Md=n=>({isAdminOnly:n[9]});function YC(n){let e,t;return e=new de({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[JC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function KC(n){let e;return{c(){e=y("div"),e.innerHTML='',h(e,"class","txt-center")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function Od(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` + .`),d=E(),p=y("div");for(let N=0;ND=!1)),C.$set(Y)},i(N){if(!M){for(let q=0;qD.name===C)}function f(C){return i.findIndex(D=>D===C)}function d(C,D){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||C===D||!D||t(0,s.indexes=s.indexes.map(O=>j.replaceIndexColumn(O,C,D)),s)}function p(C,D){if(!C)return;C.dataTransfer.dropEffect="move";const M=parseInt(C.dataTransfer.getData("text/plain")),O=s.schema;Mo(C),g=C=>d(C.detail.oldName,C.detail.newName),b=(C,D)=>BC(D.detail,C),k=(C,D)=>p(D.detail,C),$=C=>r(C.detail);function T(C){s=C,t(0,s)}return n.$$set=C=>{"collection"in C&&t(0,s=C.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new kn),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter(C=>!C.toDelete)||[])},[s,l,o,r,f,d,p,m,_,g,b,k,$,T]}class WC extends ve{constructor(e){super(),be(this,e,UC,zC,_e,{collection:0})}}const YC=n=>({isAdminOnly:n&512}),Md=n=>({isAdminOnly:n[9]});function KC(n){let e,t;return e=new de({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[ZC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function JC(n){let e;return{c(){e=y("div"),e.innerHTML='',h(e,"class","txt-center")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function Od(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` Set Admins only`,h(e,"type","button"),h(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Dd(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=`Unlock and set custom rule -
    `,h(e,"type","button"),h(e,"class","unlock-overlay svelte-1akuazq"),h(e,"aria-label","Unlock and set custom rule")},m(o,r){S(o,e,r),i=!0,s||(l=J(e,"click",n[10]),s=!0)},p:Q,i(o){i||(o&&nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Bt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function JC(n){let e,t,i,s,l,o=n[9]?"- Admins only":"",r,a,u,f,d,p,m,_,g,b,k=!n[9]&&Od(n);function $(I){n[14](I)}var T=n[7];function C(I){let L={id:I[18],baseCollection:I[1],disabled:I[9],placeholder:I[9]?"":I[5]};return I[0]!==void 0&&(L.value=I[0]),{props:L}}T&&(d=Pt(T,C(n)),n[13](d),se.push(()=>he(d,"value",$)));let D=n[9]&&Dd(n);const M=n[12].default,O=Tt(M,n,n[15],Md);return{c(){e=y("div"),t=y("label"),i=y("span"),s=U(n[2]),l=E(),r=U(o),a=E(),k&&k.c(),f=E(),d&&z(d.$$.fragment),m=E(),D&&D.c(),_=E(),g=y("div"),O&&O.c(),h(i,"class","txt"),x(i,"txt-hint",n[9]),h(t,"for",u=n[18]),h(e,"class","input-wrapper svelte-1akuazq"),h(g,"class","help-block")},m(I,L){S(I,e,L),v(e,t),v(t,i),v(i,s),v(i,l),v(i,r),v(t,a),k&&k.m(t,null),v(e,f),d&&V(d,e,null),v(e,m),D&&D.m(e,null),S(I,_,L),S(I,g,L),O&&O.m(g,null),b=!0},p(I,L){(!b||L&4)&&le(s,I[2]),(!b||L&512)&&o!==(o=I[9]?"- Admins only":"")&&le(r,o),(!b||L&512)&&x(i,"txt-hint",I[9]),I[9]?k&&(k.d(1),k=null):k?k.p(I,L):(k=Od(I),k.c(),k.m(t,null)),(!b||L&262144&&u!==(u=I[18]))&&h(t,"for",u);const F={};if(L&262144&&(F.id=I[18]),L&2&&(F.baseCollection=I[1]),L&512&&(F.disabled=I[9]),L&544&&(F.placeholder=I[9]?"":I[5]),!p&&L&1&&(p=!0,F.value=I[0],ke(()=>p=!1)),L&128&&T!==(T=I[7])){if(d){re();const R=d;P(R.$$.fragment,1,0,()=>{H(R,1)}),ae()}T?(d=Pt(T,C(I)),I[13](d),se.push(()=>he(d,"value",$)),z(d.$$.fragment),A(d.$$.fragment,1),V(d,e,m)):d=null}else T&&d.$set(F);I[9]?D?(D.p(I,L),L&512&&A(D,1)):(D=Dd(I),D.c(),A(D,1),D.m(e,null)):D&&(re(),P(D,1,1,()=>{D=null}),ae()),O&&O.p&&(!b||L&33280)&&Mt(O,M,I,I[15],b?Ct(M,I[15],L,WC):Ot(I[15]),Md)},i(I){b||(d&&A(d.$$.fragment,I),A(D),A(O,I),b=!0)},o(I){d&&P(d.$$.fragment,I),P(D),P(O,I),b=!1},d(I){I&&w(e),k&&k.d(),n[13](null),d&&H(d),D&&D.d(),I&&w(_),I&&w(g),O&&O.d(I)}}}function ZC(n){let e,t,i,s;const l=[KC,YC],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},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()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let Ed;function GC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:d="Leave empty to grant everyone access..."}=e,p=null,m=null,_=Ed,g=!1;b();async function b(){_||g||(t(8,g=!0),t(7,_=(await rt(()=>import("./FilterAutocompleteInput-89bda33f.js"),["./FilterAutocompleteInput-89bda33f.js","./index-6f704b4c.js"],import.meta.url)).default),Ed=_,t(8,g=!1))}async function k(){t(0,r=m||""),await ln(),p==null||p.focus()}async function $(){m=r,t(0,r=null)}function T(D){se[D?"unshift":"push"](()=>{p=D,t(6,p)})}function C(D){r=D,t(0,r)}return n.$$set=D=>{"collection"in D&&t(1,o=D.collection),"rule"in D&&t(0,r=D.rule),"label"in D&&t(2,a=D.label),"formKey"in D&&t(3,u=D.formKey),"required"in D&&t(4,f=D.required),"placeholder"in D&&t(5,d=D.placeholder),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,d,p,_,g,i,k,$,s,T,C,l]}class Cs extends ve{constructor(e){super(),be(this,e,GC,ZC,_e,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Ad(n,e,t){const i=n.slice();return i[10]=e[t],i}function Id(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L=n[2],F=[];for(let R=0;R@request filter:",d=E(),p=y("div"),p.innerHTML=`@request.headers.* +
    `,h(e,"type","button"),h(e,"class","unlock-overlay svelte-1akuazq"),h(e,"aria-label","Unlock and set custom rule")},m(o,r){S(o,e,r),i=!0,s||(l=J(e,"click",n[10]),s=!0)},p:Q,i(o){i||(o&&nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Bt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function ZC(n){let e,t,i,s,l,o=n[9]?"- Admins only":"",r,a,u,f,d,p,m,_,g,b,k=!n[9]&&Od(n);function $(I){n[14](I)}var T=n[7];function C(I){let L={id:I[18],baseCollection:I[1],disabled:I[9],placeholder:I[9]?"":I[5]};return I[0]!==void 0&&(L.value=I[0]),{props:L}}T&&(d=Pt(T,C(n)),n[13](d),se.push(()=>he(d,"value",$)));let D=n[9]&&Dd(n);const M=n[12].default,O=Tt(M,n,n[15],Md);return{c(){e=y("div"),t=y("label"),i=y("span"),s=U(n[2]),l=E(),r=U(o),a=E(),k&&k.c(),f=E(),d&&z(d.$$.fragment),m=E(),D&&D.c(),_=E(),g=y("div"),O&&O.c(),h(i,"class","txt"),x(i,"txt-hint",n[9]),h(t,"for",u=n[18]),h(e,"class","input-wrapper svelte-1akuazq"),h(g,"class","help-block")},m(I,L){S(I,e,L),v(e,t),v(t,i),v(i,s),v(i,l),v(i,r),v(t,a),k&&k.m(t,null),v(e,f),d&&V(d,e,null),v(e,m),D&&D.m(e,null),S(I,_,L),S(I,g,L),O&&O.m(g,null),b=!0},p(I,L){(!b||L&4)&&le(s,I[2]),(!b||L&512)&&o!==(o=I[9]?"- Admins only":"")&&le(r,o),(!b||L&512)&&x(i,"txt-hint",I[9]),I[9]?k&&(k.d(1),k=null):k?k.p(I,L):(k=Od(I),k.c(),k.m(t,null)),(!b||L&262144&&u!==(u=I[18]))&&h(t,"for",u);const F={};if(L&262144&&(F.id=I[18]),L&2&&(F.baseCollection=I[1]),L&512&&(F.disabled=I[9]),L&544&&(F.placeholder=I[9]?"":I[5]),!p&&L&1&&(p=!0,F.value=I[0],ke(()=>p=!1)),L&128&&T!==(T=I[7])){if(d){re();const R=d;P(R.$$.fragment,1,0,()=>{H(R,1)}),ae()}T?(d=Pt(T,C(I)),I[13](d),se.push(()=>he(d,"value",$)),z(d.$$.fragment),A(d.$$.fragment,1),V(d,e,m)):d=null}else T&&d.$set(F);I[9]?D?(D.p(I,L),L&512&&A(D,1)):(D=Dd(I),D.c(),A(D,1),D.m(e,null)):D&&(re(),P(D,1,1,()=>{D=null}),ae()),O&&O.p&&(!b||L&33280)&&Mt(O,M,I,I[15],b?Ct(M,I[15],L,YC):Ot(I[15]),Md)},i(I){b||(d&&A(d.$$.fragment,I),A(D),A(O,I),b=!0)},o(I){d&&P(d.$$.fragment,I),P(D),P(O,I),b=!1},d(I){I&&w(e),k&&k.d(),n[13](null),d&&H(d),D&&D.d(),I&&w(_),I&&w(g),O&&O.d(I)}}}function GC(n){let e,t,i,s;const l=[JC,KC],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},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()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let Ed;function XC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:d="Leave empty to grant everyone access..."}=e,p=null,m=null,_=Ed,g=!1;b();async function b(){_||g||(t(8,g=!0),t(7,_=(await rt(()=>import("./FilterAutocompleteInput-773533b0.js"),["./FilterAutocompleteInput-773533b0.js","./index-c4d2d831.js"],import.meta.url)).default),Ed=_,t(8,g=!1))}async function k(){t(0,r=m||""),await ln(),p==null||p.focus()}async function $(){m=r,t(0,r=null)}function T(D){se[D?"unshift":"push"](()=>{p=D,t(6,p)})}function C(D){r=D,t(0,r)}return n.$$set=D=>{"collection"in D&&t(1,o=D.collection),"rule"in D&&t(0,r=D.rule),"label"in D&&t(2,a=D.label),"formKey"in D&&t(3,u=D.formKey),"required"in D&&t(4,f=D.required),"placeholder"in D&&t(5,d=D.placeholder),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,d,p,_,g,i,k,$,s,T,C,l]}class Cs extends ve{constructor(e){super(),be(this,e,XC,GC,_e,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Ad(n,e,t){const i=n.slice();return i[10]=e[t],i}function Id(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L=n[2],F=[];for(let R=0;R@request filter:",d=E(),p=y("div"),p.innerHTML=`@request.headers.* @request.query.* @request.data.* @request.auth.*`,m=E(),_=y("hr"),g=E(),b=y("p"),b.innerHTML="You could also add constraints and query other collections using the @collection filter:",k=E(),$=y("div"),$.innerHTML="@collection.ANY_COLLECTION_NAME.*",T=E(),C=y("hr"),D=E(),M=y("p"),M.innerHTML=`Example rule:
    - @request.auth.id != "" && created > "2022-01-01 00:00:00"`,h(s,"class","m-b-0"),h(o,"class","inline-flex flex-gap-5"),h(a,"class","m-t-10 m-b-5"),h(f,"class","m-b-0"),h(p,"class","inline-flex flex-gap-5"),h(_,"class","m-t-10 m-b-5"),h(b,"class","m-b-0"),h($,"class","inline-flex flex-gap-5"),h(C,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(R,N){S(R,e,N),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o);for(let q=0;q{I&&(O||(O=Ve(e,wt,{duration:150},!0)),O.run(1))}),I=!0)},o(R){R&&(O||(O=Ve(e,wt,{duration:150},!1)),O.run(0)),I=!1},d(R){R&&w(e),dt(F,R),R&&O&&O.end()}}}function Pd(n){let e,t=n[10]+"",i;return{c(){e=y("code"),i=U(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function Ld(n){let e,t,i,s,l,o,r,a,u;function f(b){n[6](b)}let d={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(d.rule=n[0].createRule),e=new Cs({props:d}),se.push(()=>he(e,"rule",f));function p(b){n[7](b)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),s=new Cs({props:m}),se.push(()=>he(s,"rule",p));function _(b){n[8](b)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new Cs({props:g}),se.push(()=>he(r,"rule",_)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(b,k){V(e,b,k),S(b,i,k),V(s,b,k),S(b,o,k),V(r,b,k),u=!0},p(b,k){const $={};k&1&&($.collection=b[0]),!t&&k&1&&(t=!0,$.rule=b[0].createRule,ke(()=>t=!1)),e.$set($);const T={};k&1&&(T.collection=b[0]),!l&&k&1&&(l=!0,T.rule=b[0].updateRule,ke(()=>l=!1)),s.$set(T);const C={};k&1&&(C.collection=b[0]),!a&&k&1&&(a=!0,C.rule=b[0].deleteRule,ke(()=>a=!1)),r.$set(C)},i(b){u||(A(e.$$.fragment,b),A(s.$$.fragment,b),A(r.$$.fragment,b),u=!0)},o(b){P(e.$$.fragment,b),P(s.$$.fragment,b),P(r.$$.fragment,b),u=!1},d(b){H(e,b),b&&w(i),H(s,b),b&&w(o),H(r,b)}}}function Nd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[XC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Cs({props:l}),se.push(()=>he(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&8192&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function XC(n){let e,t,i;return{c(){e=y("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. + @request.auth.id != "" && created > "2022-01-01 00:00:00"`,h(s,"class","m-b-0"),h(o,"class","inline-flex flex-gap-5"),h(a,"class","m-t-10 m-b-5"),h(f,"class","m-b-0"),h(p,"class","inline-flex flex-gap-5"),h(_,"class","m-t-10 m-b-5"),h(b,"class","m-b-0"),h($,"class","inline-flex flex-gap-5"),h(C,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(R,N){S(R,e,N),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o);for(let q=0;q{I&&(O||(O=Ve(e,wt,{duration:150},!0)),O.run(1))}),I=!0)},o(R){R&&(O||(O=Ve(e,wt,{duration:150},!1)),O.run(0)),I=!1},d(R){R&&w(e),dt(F,R),R&&O&&O.end()}}}function Pd(n){let e,t=n[10]+"",i;return{c(){e=y("code"),i=U(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function Ld(n){let e,t,i,s,l,o,r,a,u;function f(b){n[6](b)}let d={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(d.rule=n[0].createRule),e=new Cs({props:d}),se.push(()=>he(e,"rule",f));function p(b){n[7](b)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),s=new Cs({props:m}),se.push(()=>he(s,"rule",p));function _(b){n[8](b)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new Cs({props:g}),se.push(()=>he(r,"rule",_)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(b,k){V(e,b,k),S(b,i,k),V(s,b,k),S(b,o,k),V(r,b,k),u=!0},p(b,k){const $={};k&1&&($.collection=b[0]),!t&&k&1&&(t=!0,$.rule=b[0].createRule,ke(()=>t=!1)),e.$set($);const T={};k&1&&(T.collection=b[0]),!l&&k&1&&(l=!0,T.rule=b[0].updateRule,ke(()=>l=!1)),s.$set(T);const C={};k&1&&(C.collection=b[0]),!a&&k&1&&(a=!0,C.rule=b[0].deleteRule,ke(()=>a=!1)),r.$set(C)},i(b){u||(A(e.$$.fragment,b),A(s.$$.fragment,b),A(r.$$.fragment,b),u=!0)},o(b){P(e.$$.fragment,b),P(s.$$.fragment,b),P(r.$$.fragment,b),u=!1},d(b){H(e,b),b&&w(i),H(s,b),b&&w(o),H(r,b)}}}function Nd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[QC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Cs({props:l}),se.push(()=>he(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&8192&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function QC(n){let e,t,i;return{c(){e=y("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. changing the password without requiring to enter the old one, directly updating the verified - state or email, etc.`,t=E(),i=y("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:Q,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function QC(n){var N,q;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,d,p,m,_,g,b,k,$,T,C,D=n[1]&&Id(n);function M(Y){n[4](Y)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Cs({props:O}),se.push(()=>he(f,"rule",M));function I(Y){n[5](Y)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Cs({props:L}),se.push(()=>he(m,"rule",I));let F=!((N=n[0])!=null&&N.isView)&&Ld(n),R=((q=n[0])==null?void 0:q.isAuth)&&Nd(n);return{c(){e=y("div"),t=y("div"),i=y("p"),i.innerHTML=`All rules follow the + state or email, etc.`,t=E(),i=y("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:Q,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function xC(n){var N,q;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,d,p,m,_,g,b,k,$,T,C,D=n[1]&&Id(n);function M(Y){n[4](Y)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Cs({props:O}),se.push(()=>he(f,"rule",M));function I(Y){n[5](Y)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Cs({props:L}),se.push(()=>he(m,"rule",I));let F=!((N=n[0])!=null&&N.isView)&&Ld(n),R=((q=n[0])==null?void 0:q.isAuth)&&Nd(n);return{c(){e=y("div"),t=y("div"),i=y("p"),i.innerHTML=`All rules follow the
    PocketBase filter syntax and operators - .`,s=E(),l=y("button"),r=U(o),a=E(),D&&D.c(),u=E(),z(f.$$.fragment),p=E(),z(m.$$.fragment),g=E(),F&&F.c(),b=E(),R&&R.c(),k=Se(),h(l,"type","button"),h(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),h(t,"class","flex txt-sm txt-hint m-b-5"),h(e,"class","block m-b-sm handle")},m(Y,B){S(Y,e,B),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),D&&D.m(e,null),S(Y,u,B),V(f,Y,B),S(Y,p,B),V(m,Y,B),S(Y,g,B),F&&F.m(Y,B),S(Y,b,B),R&&R.m(Y,B),S(Y,k,B),$=!0,T||(C=J(l,"click",n[3]),T=!0)},p(Y,[B]){var ie,X;(!$||B&2)&&o!==(o=Y[1]?"Hide available fields":"Show available fields")&&le(r,o),Y[1]?D?(D.p(Y,B),B&2&&A(D,1)):(D=Id(Y),D.c(),A(D,1),D.m(e,null)):D&&(re(),P(D,1,1,()=>{D=null}),ae());const Z={};B&1&&(Z.collection=Y[0]),!d&&B&1&&(d=!0,Z.rule=Y[0].listRule,ke(()=>d=!1)),f.$set(Z);const ee={};B&1&&(ee.collection=Y[0]),!_&&B&1&&(_=!0,ee.rule=Y[0].viewRule,ke(()=>_=!1)),m.$set(ee),(ie=Y[0])!=null&&ie.isView?F&&(re(),P(F,1,1,()=>{F=null}),ae()):F?(F.p(Y,B),B&1&&A(F,1)):(F=Ld(Y),F.c(),A(F,1),F.m(b.parentNode,b)),(X=Y[0])!=null&&X.isAuth?R?(R.p(Y,B),B&1&&A(R,1)):(R=Nd(Y),R.c(),A(R,1),R.m(k.parentNode,k)):R&&(re(),P(R,1,1,()=>{R=null}),ae())},i(Y){$||(A(D),A(f.$$.fragment,Y),A(m.$$.fragment,Y),A(F),A(R),$=!0)},o(Y){P(D),P(f.$$.fragment,Y),P(m.$$.fragment,Y),P(F),P(R),$=!1},d(Y){Y&&w(e),D&&D.d(),Y&&w(u),H(f,Y),Y&&w(p),H(m,Y),Y&&w(g),F&&F.d(Y),Y&&w(b),R&&R.d(Y),Y&&w(k),T=!1,C()}}}function xC(n,e,t){let i,{collection:s=new kn}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function d(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function p(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,d,p]}class e4 extends ve{constructor(e){super(),be(this,e,xC,QC,_e,{collection:0})}}function Fd(n,e,t){const i=n.slice();return i[9]=e[t],i}function t4(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>he(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>he(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function n4(n){let e;return{c(){e=y("textarea"),e.disabled=!0,h(e,"rows","7"),h(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function Rd(n){let e,t,i=n[3],s=[];for(let l=0;l
  • Wildcard columns (*) are not supported.
  • + .`,s=E(),l=y("button"),r=U(o),a=E(),D&&D.c(),u=E(),z(f.$$.fragment),p=E(),z(m.$$.fragment),g=E(),F&&F.c(),b=E(),R&&R.c(),k=Se(),h(l,"type","button"),h(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),h(t,"class","flex txt-sm txt-hint m-b-5"),h(e,"class","block m-b-sm handle")},m(Y,B){S(Y,e,B),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),D&&D.m(e,null),S(Y,u,B),V(f,Y,B),S(Y,p,B),V(m,Y,B),S(Y,g,B),F&&F.m(Y,B),S(Y,b,B),R&&R.m(Y,B),S(Y,k,B),$=!0,T||(C=J(l,"click",n[3]),T=!0)},p(Y,[B]){var ie,X;(!$||B&2)&&o!==(o=Y[1]?"Hide available fields":"Show available fields")&&le(r,o),Y[1]?D?(D.p(Y,B),B&2&&A(D,1)):(D=Id(Y),D.c(),A(D,1),D.m(e,null)):D&&(re(),P(D,1,1,()=>{D=null}),ae());const Z={};B&1&&(Z.collection=Y[0]),!d&&B&1&&(d=!0,Z.rule=Y[0].listRule,ke(()=>d=!1)),f.$set(Z);const ee={};B&1&&(ee.collection=Y[0]),!_&&B&1&&(_=!0,ee.rule=Y[0].viewRule,ke(()=>_=!1)),m.$set(ee),(ie=Y[0])!=null&&ie.isView?F&&(re(),P(F,1,1,()=>{F=null}),ae()):F?(F.p(Y,B),B&1&&A(F,1)):(F=Ld(Y),F.c(),A(F,1),F.m(b.parentNode,b)),(X=Y[0])!=null&&X.isAuth?R?(R.p(Y,B),B&1&&A(R,1)):(R=Nd(Y),R.c(),A(R,1),R.m(k.parentNode,k)):R&&(re(),P(R,1,1,()=>{R=null}),ae())},i(Y){$||(A(D),A(f.$$.fragment,Y),A(m.$$.fragment,Y),A(F),A(R),$=!0)},o(Y){P(D),P(f.$$.fragment,Y),P(m.$$.fragment,Y),P(F),P(R),$=!1},d(Y){Y&&w(e),D&&D.d(),Y&&w(u),H(f,Y),Y&&w(p),H(m,Y),Y&&w(g),F&&F.d(Y),Y&&w(b),R&&R.d(Y),Y&&w(k),T=!1,C()}}}function e4(n,e,t){let i,{collection:s=new kn}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function d(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function p(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,d,p]}class t4 extends ve{constructor(e){super(),be(this,e,e4,xC,_e,{collection:0})}}function Fd(n,e,t){const i=n.slice();return i[9]=e[t],i}function n4(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>he(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>he(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function i4(n){let e;return{c(){e=y("textarea"),e.disabled=!0,h(e,"rows","7"),h(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function Rd(n){let e,t,i=n[3],s=[];for(let l=0;l
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column.
    If your query doesn't have a suitable one, you can use the universal (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name (eg. - MAX(balance) as maxBalance).
  • `,u=E(),g&&g.c(),f=Se(),h(t,"class","txt"),h(e,"for",i=n[8]),h(a,"class","help-block")},m(b,k){S(b,e,k),v(e,t),S(b,s,k),m[l].m(b,k),S(b,r,k),S(b,a,k),S(b,u,k),g&&g.m(b,k),S(b,f,k),d=!0},p(b,k){(!d||k&256&&i!==(i=b[8]))&&h(e,"for",i);let $=l;l=_(b),l===$?m[l].p(b,k):(re(),P(m[$],1,1,()=>{m[$]=null}),ae(),o=m[l],o?o.p(b,k):(o=m[l]=p[l](b),o.c()),A(o,1),o.m(r.parentNode,r)),b[3].length?g?g.p(b,k):(g=Rd(b),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(b){d||(A(o),d=!0)},o(b){P(o),d=!1},d(b){b&&w(e),b&&w(s),m[l].d(b),b&&w(r),b&&w(a),b&&w(u),g&&g.d(b),b&&w(f)}}}function s4(n){let e,t;return e=new de({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[i4,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function l4(n,e,t){let i;Ke(n,gi,d=>t(4,i=d));let{collection:s=new kn}=e,l,o=!1,r=[];function a(d){var _;t(3,r=[]);const p=j.getNestedVal(d,"schema",null);if(j.isEmpty(p))return;if(p!=null&&p.message){r.push(p==null?void 0:p.message);return}const m=j.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let g in p)for(let b in p[g]){const k=p[g][b].message,$=m[g]||g;r.push(j.sentenize($+": "+k))}}xt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-55647829.js"),["./CodeEditor-55647829.js","./index-6f704b4c.js"],import.meta.url)).default)}catch(d){console.warn(d)}t(2,o=!1)});function u(d){n.$$.not_equal(s.options.query,d)&&(s.options.query=d,t(0,s))}const f=()=>{r.length&&Ai("schema")};return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class o4 extends ve{constructor(e){super(),be(this,e,l4,s4,_e,{collection:0})}}const r4=n=>({active:n&1}),jd=n=>({active:n[0]});function Vd(n){let e,t,i;const s=n[15].default,l=Tt(s,n,n[14],null);return{c(){e=y("div"),l&&l.c(),h(e,"class","accordion-content")},m(o,r){S(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Mt(l,s,o,o[14],i?Ct(s,o[14],r,null):Ot(o[14]),null)},i(o){i||(A(l,o),o&&nt(()=>{i&&(t||(t=Ve(e,wt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=Ve(e,wt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function a4(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Tt(a,n,n[14],jd);let f=n[0]&&Vd(n);return{c(){e=y("div"),t=y("button"),u&&u.c(),i=E(),f&&f.c(),h(t,"type","button"),h(t,"class","accordion-header"),h(t,"draggable",n[2]),x(t,"interactive",n[3]),h(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(d,p){S(d,e,p),v(e,t),u&&u.m(t,null),v(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[J(t,"click",ft(n[17])),J(t,"drop",ft(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",ft(n[16]))],o=!0)},p(d,[p]){u&&u.p&&(!l||p&16385)&&Mt(u,a,d,d[14],l?Ct(a,d[14],p,r4):Ot(d[14]),jd),(!l||p&4)&&h(t,"draggable",d[2]),(!l||p&8)&&x(t,"interactive",d[3]),d[0]?f?(f.p(d,p),p&1&&A(f,1)):(f=Vd(d),f.c(),A(f,1),f.m(e,null)):f&&(re(),P(f,1,1,()=>{f=null}),ae()),(!l||p&130&&s!==(s="accordion "+(d[7]?"drag-over":"")+" "+d[1]))&&h(e,"class",s),(!l||p&131)&&x(e,"active",d[0])},i(d){l||(A(u,d),A(f),l=!0)},o(d){P(u,d),P(f),l=!1},d(d){d&&w(e),u&&u.d(d),f&&f.d(),n[22](null),o=!1,De(r)}}}function u4(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=kt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:d=!0}=e,{single:p=!1}=e,m=!1;function _(){return!!f}function g(){$(),t(0,f=!0),l("expand")}function b(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?b():g()}function $(){if(p&&o.closest(".accordions")){const F=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const R of F)R.click()}}xt(()=>()=>clearTimeout(r));function T(F){pe.call(this,n,F)}const C=()=>d&&k(),D=F=>{u&&(t(7,m=!1),$(),l("drop",F))},M=F=>u&&l("dragstart",F),O=F=>{u&&(t(7,m=!0),l("dragenter",F))},I=F=>{u&&(t(7,m=!1),l("dragleave",F))};function L(F){se[F?"unshift":"push"](()=>{o=F,t(6,o)})}return n.$$set=F=>{"class"in F&&t(1,a=F.class),"draggable"in F&&t(2,u=F.draggable),"active"in F&&t(0,f=F.active),"interactive"in F&&t(3,d=F.interactive),"single"in F&&t(9,p=F.single),"$$scope"in F&&t(14,s=F.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,d,k,$,o,m,l,p,_,g,b,r,s,i,T,C,D,M,O,I,L]}class po extends ve{constructor(e){super(),be(this,e,u4,a4,_e,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function f4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowUsernameAuth,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function c4(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[f4,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function d4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function p4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Hd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function m4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowUsernameAuth?p4:d4}let u=a(n),f=u(n),d=n[3]&&Hd();return{c(){e=y("div"),e.innerHTML=` - Username/Password`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[3]?d?m&8&&A(d,1):(d=Hd(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(A(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function h4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function zd(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[_4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[g4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),a=!0},p(u,f){const d={};f&1&&(d.class="form-field "+(j.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&1&&(p.class="form-field "+(j.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(p.$$scope={dirty:f,ctx:u}),o.$set(p)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&nt(()=>{a&&(r||(r=Ve(e,wt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=Ve(e,wt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),H(i),H(o),u&&r&&r.end()}}}function _4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[7](b)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new qs({props:g}),se.push(()=>he(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),V(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`Email domains that are NOT allowed to sign up. - This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!j.isEmpty(b[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function g4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[8](b)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new qs({props:g}),se.push(()=>he(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),V(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`Email domains that are ONLY allowed to sign up. - This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!j.isEmpty(b[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function b4(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[h4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&zd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){V(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=zd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){H(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function v4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function y4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Bd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function k4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowEmailAuth?y4:v4}let u=a(n),f=u(n),d=n[2]&&Bd();return{c(){e=y("div"),e.innerHTML=` - Email/Password`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[2]?d?m&4&&A(d,1):(d=Bd(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(A(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function w4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Ud(n){let e,t,i;return{c(){e=y("div"),e.innerHTML='',h(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&nt(()=>{i&&(t||(t=Ve(e,wt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,wt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function S4(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[w4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Ud();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){V(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Ud(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){H(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function $4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function T4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Wd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function C4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowOAuth2Auth?T4:$4}let u=a(n),f=u(n),d=n[1]&&Wd();return{c(){e=y("div"),e.innerHTML=` - OAuth2`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[1]?d?m&2&&A(d,1):(d=Wd(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(A(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function M4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Minimum password length"),s=E(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12]),l.required=!0,h(l,"min","6"),h(l,"max","72")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minPasswordLength),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].options.minPasswordLength&&ue(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function O4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Always require email",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(l,"class","txt"),h(r,"class","ri-information-line txt-sm link-hint"),h(s,"for",a=n[12])},m(d,p){S(d,e,p),e.checked=n[0].options.requireEmail,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[11]),Ee(Ue.call(null,r,{text:`The constraint is applied only for new records. -Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(d,p){p&4096&&t!==(t=d[12])&&h(e,"id",t),p&1&&(e.checked=d[0].options.requireEmail),p&4096&&a!==(a=d[12])&&h(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function D4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;return s=new po({props:{single:!0,$$slots:{header:[m4],default:[c4]},$$scope:{ctx:n}}}),o=new po({props:{single:!0,$$slots:{header:[k4],default:[b4]},$$scope:{ctx:n}}}),a=new po({props:{single:!0,$$slots:{header:[C4],default:[S4]},$$scope:{ctx:n}}}),_=new de({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[M4,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),b=new de({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[O4,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("h4"),e.textContent="Auth methods",t=E(),i=y("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=y("hr"),d=E(),p=y("h4"),p.textContent="General",m=E(),z(_.$$.fragment),g=E(),z(b.$$.fragment),h(e,"class","section-title"),h(i,"class","accordions"),h(p,"class","section-title")},m($,T){S($,e,T),S($,t,T),S($,i,T),V(s,i,null),v(i,l),V(o,i,null),v(i,r),V(a,i,null),S($,u,T),S($,f,T),S($,d,T),S($,p,T),S($,m,T),V(_,$,T),S($,g,T),V(b,$,T),k=!0},p($,[T]){const C={};T&8201&&(C.$$scope={dirty:T,ctx:$}),s.$set(C);const D={};T&8197&&(D.$$scope={dirty:T,ctx:$}),o.$set(D);const M={};T&8195&&(M.$$scope={dirty:T,ctx:$}),a.$set(M);const O={};T&12289&&(O.$$scope={dirty:T,ctx:$}),_.$set(O);const I={};T&12289&&(I.$$scope={dirty:T,ctx:$}),b.$set(I)},i($){k||(A(s.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(_.$$.fragment,$),A(b.$$.fragment,$),k=!0)},o($){P(s.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),P(_.$$.fragment,$),P(b.$$.fragment,$),k=!1},d($){$&&w(e),$&&w(t),$&&w(i),H(s),H(o),H(a),$&&w(u),$&&w(f),$&&w(d),$&&w(p),$&&w(m),H(_,$),$&&w(g),H(b,$)}}}function E4(n,e,t){let i,s,l,o;Ke(n,gi,g=>t(4,o=g));let{collection:r=new kn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function d(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function p(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=_t(this.value),t(0,r)}function _(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,b,k,$;n.$$.dirty&1&&r.$isAuth&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!j.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!j.isEmpty(($=o==null?void 0:o.options)==null?void 0:$.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,d,p,m,_]}class A4 extends ve{constructor(e){super(),be(this,e,E4,D4,_e,{collection:0})}}function Yd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Kd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Jd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Zd(n){let e;return{c(){e=y("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Gd(n){var r;let e,t,i,s,l=n[3]&&Xd(n),o=!((r=n[2])!=null&&r.$isView)&&Qd(n);return{c(){e=y("h6"),e.textContent="Changes:",t=E(),i=y("ul"),l&&l.c(),s=E(),o&&o.c(),h(i,"class","changes-list svelte-xqpcsf")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),v(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=Xd(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.$isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Qd(a),o.c(),o.m(i,null))},d(a){a&&w(e),a&&w(t),a&&w(i),l&&l.d(),o&&o.d()}}}function Xd(n){var m,_;let e,t,i,s,l=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,d=((_=n[2])==null?void 0:_.name)+"",p;return{c(){e=y("li"),t=y("div"),i=U(`Renamed collection + MAX(balance) as maxBalance).`,u=E(),g&&g.c(),f=Se(),h(t,"class","txt"),h(e,"for",i=n[8]),h(a,"class","help-block")},m(b,k){S(b,e,k),v(e,t),S(b,s,k),m[l].m(b,k),S(b,r,k),S(b,a,k),S(b,u,k),g&&g.m(b,k),S(b,f,k),d=!0},p(b,k){(!d||k&256&&i!==(i=b[8]))&&h(e,"for",i);let $=l;l=_(b),l===$?m[l].p(b,k):(re(),P(m[$],1,1,()=>{m[$]=null}),ae(),o=m[l],o?o.p(b,k):(o=m[l]=p[l](b),o.c()),A(o,1),o.m(r.parentNode,r)),b[3].length?g?g.p(b,k):(g=Rd(b),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(b){d||(A(o),d=!0)},o(b){P(o),d=!1},d(b){b&&w(e),b&&w(s),m[l].d(b),b&&w(r),b&&w(a),b&&w(u),g&&g.d(b),b&&w(f)}}}function l4(n){let e,t;return e=new de({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[s4,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function o4(n,e,t){let i;Ke(n,gi,d=>t(4,i=d));let{collection:s=new kn}=e,l,o=!1,r=[];function a(d){var _;t(3,r=[]);const p=j.getNestedVal(d,"schema",null);if(j.isEmpty(p))return;if(p!=null&&p.message){r.push(p==null?void 0:p.message);return}const m=j.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let g in p)for(let b in p[g]){const k=p[g][b].message,$=m[g]||g;r.push(j.sentenize($+": "+k))}}xt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-c5150b8e.js"),["./CodeEditor-c5150b8e.js","./index-c4d2d831.js"],import.meta.url)).default)}catch(d){console.warn(d)}t(2,o=!1)});function u(d){n.$$.not_equal(s.options.query,d)&&(s.options.query=d,t(0,s))}const f=()=>{r.length&&Ai("schema")};return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class r4 extends ve{constructor(e){super(),be(this,e,o4,l4,_e,{collection:0})}}const a4=n=>({active:n&1}),jd=n=>({active:n[0]});function Vd(n){let e,t,i;const s=n[15].default,l=Tt(s,n,n[14],null);return{c(){e=y("div"),l&&l.c(),h(e,"class","accordion-content")},m(o,r){S(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Mt(l,s,o,o[14],i?Ct(s,o[14],r,null):Ot(o[14]),null)},i(o){i||(A(l,o),o&&nt(()=>{i&&(t||(t=Ve(e,wt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=Ve(e,wt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function u4(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Tt(a,n,n[14],jd);let f=n[0]&&Vd(n);return{c(){e=y("div"),t=y("button"),u&&u.c(),i=E(),f&&f.c(),h(t,"type","button"),h(t,"class","accordion-header"),h(t,"draggable",n[2]),x(t,"interactive",n[3]),h(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(d,p){S(d,e,p),v(e,t),u&&u.m(t,null),v(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[J(t,"click",ft(n[17])),J(t,"drop",ft(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",ft(n[16]))],o=!0)},p(d,[p]){u&&u.p&&(!l||p&16385)&&Mt(u,a,d,d[14],l?Ct(a,d[14],p,a4):Ot(d[14]),jd),(!l||p&4)&&h(t,"draggable",d[2]),(!l||p&8)&&x(t,"interactive",d[3]),d[0]?f?(f.p(d,p),p&1&&A(f,1)):(f=Vd(d),f.c(),A(f,1),f.m(e,null)):f&&(re(),P(f,1,1,()=>{f=null}),ae()),(!l||p&130&&s!==(s="accordion "+(d[7]?"drag-over":"")+" "+d[1]))&&h(e,"class",s),(!l||p&131)&&x(e,"active",d[0])},i(d){l||(A(u,d),A(f),l=!0)},o(d){P(u,d),P(f),l=!1},d(d){d&&w(e),u&&u.d(d),f&&f.d(),n[22](null),o=!1,De(r)}}}function f4(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=kt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:d=!0}=e,{single:p=!1}=e,m=!1;function _(){return!!f}function g(){$(),t(0,f=!0),l("expand")}function b(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?b():g()}function $(){if(p&&o.closest(".accordions")){const F=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const R of F)R.click()}}xt(()=>()=>clearTimeout(r));function T(F){pe.call(this,n,F)}const C=()=>d&&k(),D=F=>{u&&(t(7,m=!1),$(),l("drop",F))},M=F=>u&&l("dragstart",F),O=F=>{u&&(t(7,m=!0),l("dragenter",F))},I=F=>{u&&(t(7,m=!1),l("dragleave",F))};function L(F){se[F?"unshift":"push"](()=>{o=F,t(6,o)})}return n.$$set=F=>{"class"in F&&t(1,a=F.class),"draggable"in F&&t(2,u=F.draggable),"active"in F&&t(0,f=F.active),"interactive"in F&&t(3,d=F.interactive),"single"in F&&t(9,p=F.single),"$$scope"in F&&t(14,s=F.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,d,k,$,o,m,l,p,_,g,b,r,s,i,T,C,D,M,O,I,L]}class po extends ve{constructor(e){super(),be(this,e,f4,u4,_e,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function c4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowUsernameAuth,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function d4(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[c4,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function p4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function m4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Hd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function h4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowUsernameAuth?m4:p4}let u=a(n),f=u(n),d=n[3]&&Hd();return{c(){e=y("div"),e.innerHTML=` + Username/Password`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[3]?d?m&8&&A(d,1):(d=Hd(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(A(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function _4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function zd(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[g4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[b4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),a=!0},p(u,f){const d={};f&1&&(d.class="form-field "+(j.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&1&&(p.class="form-field "+(j.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(p.$$scope={dirty:f,ctx:u}),o.$set(p)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&nt(()=>{a&&(r||(r=Ve(e,wt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=Ve(e,wt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),H(i),H(o),u&&r&&r.end()}}}function g4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[7](b)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new qs({props:g}),se.push(()=>he(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),V(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`Email domains that are NOT allowed to sign up. + This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!j.isEmpty(b[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function b4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(b){n[8](b)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new qs({props:g}),se.push(()=>he(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),V(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`Email domains that are ONLY allowed to sign up. + This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&h(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!j.isEmpty(b[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set($)},i(b){d||(A(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,m()}}}function v4(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[_4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&zd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){V(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=zd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){H(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function y4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function k4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Bd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function w4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowEmailAuth?k4:y4}let u=a(n),f=u(n),d=n[2]&&Bd();return{c(){e=y("div"),e.innerHTML=` + Email/Password`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[2]?d?m&4&&A(d,1):(d=Bd(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(A(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function S4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Ud(n){let e,t,i;return{c(){e=y("div"),e.innerHTML='',h(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&nt(()=>{i&&(t||(t=Ve(e,wt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,wt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function $4(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[S4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Ud();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){V(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Ud(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){H(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function T4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function C4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Wd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function M4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowOAuth2Auth?C4:T4}let u=a(n),f=u(n),d=n[1]&&Wd();return{c(){e=y("div"),e.innerHTML=` + OAuth2`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){S(p,e,m),S(p,t,m),S(p,i,m),S(p,s,m),f.m(p,m),S(p,l,m),d&&d.m(p,m),S(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[1]?d?m&2&&A(d,1):(d=Wd(),d.c(),A(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(A(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function O4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Minimum password length"),s=E(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12]),l.required=!0,h(l,"min","6"),h(l,"max","72")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minPasswordLength),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].options.minPasswordLength&&ue(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function D4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Always require email",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(l,"class","txt"),h(r,"class","ri-information-line txt-sm link-hint"),h(s,"for",a=n[12])},m(d,p){S(d,e,p),e.checked=n[0].options.requireEmail,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[11]),Ee(Ue.call(null,r,{text:`The constraint is applied only for new records. +Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(d,p){p&4096&&t!==(t=d[12])&&h(e,"id",t),p&1&&(e.checked=d[0].options.requireEmail),p&4096&&a!==(a=d[12])&&h(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function E4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;return s=new po({props:{single:!0,$$slots:{header:[h4],default:[d4]},$$scope:{ctx:n}}}),o=new po({props:{single:!0,$$slots:{header:[w4],default:[v4]},$$scope:{ctx:n}}}),a=new po({props:{single:!0,$$slots:{header:[M4],default:[$4]},$$scope:{ctx:n}}}),_=new de({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[O4,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),b=new de({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[D4,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("h4"),e.textContent="Auth methods",t=E(),i=y("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=y("hr"),d=E(),p=y("h4"),p.textContent="General",m=E(),z(_.$$.fragment),g=E(),z(b.$$.fragment),h(e,"class","section-title"),h(i,"class","accordions"),h(p,"class","section-title")},m($,T){S($,e,T),S($,t,T),S($,i,T),V(s,i,null),v(i,l),V(o,i,null),v(i,r),V(a,i,null),S($,u,T),S($,f,T),S($,d,T),S($,p,T),S($,m,T),V(_,$,T),S($,g,T),V(b,$,T),k=!0},p($,[T]){const C={};T&8201&&(C.$$scope={dirty:T,ctx:$}),s.$set(C);const D={};T&8197&&(D.$$scope={dirty:T,ctx:$}),o.$set(D);const M={};T&8195&&(M.$$scope={dirty:T,ctx:$}),a.$set(M);const O={};T&12289&&(O.$$scope={dirty:T,ctx:$}),_.$set(O);const I={};T&12289&&(I.$$scope={dirty:T,ctx:$}),b.$set(I)},i($){k||(A(s.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(_.$$.fragment,$),A(b.$$.fragment,$),k=!0)},o($){P(s.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),P(_.$$.fragment,$),P(b.$$.fragment,$),k=!1},d($){$&&w(e),$&&w(t),$&&w(i),H(s),H(o),H(a),$&&w(u),$&&w(f),$&&w(d),$&&w(p),$&&w(m),H(_,$),$&&w(g),H(b,$)}}}function A4(n,e,t){let i,s,l,o;Ke(n,gi,g=>t(4,o=g));let{collection:r=new kn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function d(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function p(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=_t(this.value),t(0,r)}function _(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,b,k,$;n.$$.dirty&1&&r.$isAuth&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!j.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!j.isEmpty(($=o==null?void 0:o.options)==null?void 0:$.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,d,p,m,_]}class I4 extends ve{constructor(e){super(),be(this,e,A4,E4,_e,{collection:0})}}function Yd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Kd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Jd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Zd(n){let e;return{c(){e=y("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Gd(n){var r;let e,t,i,s,l=n[3]&&Xd(n),o=!((r=n[2])!=null&&r.$isView)&&Qd(n);return{c(){e=y("h6"),e.textContent="Changes:",t=E(),i=y("ul"),l&&l.c(),s=E(),o&&o.c(),h(i,"class","changes-list svelte-xqpcsf")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),v(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=Xd(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.$isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Qd(a),o.c(),o.m(i,null))},d(a){a&&w(e),a&&w(t),a&&w(i),l&&l.d(),o&&o.d()}}}function Xd(n){var m,_;let e,t,i,s,l=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,d=((_=n[2])==null?void 0:_.name)+"",p;return{c(){e=y("li"),t=y("div"),i=U(`Renamed collection `),s=y("strong"),o=U(l),r=E(),a=y("i"),u=E(),f=y("strong"),p=U(d),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex"),h(e,"class","svelte-xqpcsf")},m(g,b){S(g,e,b),v(e,t),v(t,i),v(t,s),v(s,o),v(t,r),v(t,a),v(t,u),v(t,f),v(f,p)},p(g,b){var k,$;b&2&&l!==(l=((k=g[1])==null?void 0:k.name)+"")&&le(o,l),b&4&&d!==(d=(($=g[2])==null?void 0:$.name)+"")&&le(p,d)},d(g){g&&w(e)}}}function Qd(n){let e,t,i,s=n[5],l=[];for(let f=0;f
    ',i=E(),s=y("div"),l=y("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query, - you'll have to update it manually!`,o=E(),u&&u.c(),r=E(),f&&f.c(),a=Se(),h(t,"class","icon"),h(s,"class","content txt-bold"),h(e,"class","alert alert-warning")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),u&&u.m(s,null),S(d,r,p),f&&f.m(d,p),S(d,a,p)},p(d,p){d[6].length?u||(u=Zd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),d[8]?f?f.p(d,p):(f=Gd(d),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(d){d&&w(e),u&&u.d(),d&&w(r),f&&f.d(d),d&&w(a)}}}function P4(n){let e;return{c(){e=y("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function L4(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='Cancel',t=E(),i=y("button"),i.innerHTML='Confirm',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[J(e,"click",n[11]),J(i,"click",n[12])],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function N4(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[L4],header:[P4],default:[I4]},$$scope:{ctx:n}};return e=new pn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[13](null),H(e,s)}}}function F4(n,e,t){let i,s,l,o,r;const a=kt();let u,f,d;async function p(C,D){t(1,f=C),t(2,d=D),await ln(),i||s.length||l.length||o.length?u==null||u.show():_()}function m(){u==null||u.hide()}function _(){m(),a("confirm")}const g=()=>m(),b=()=>_();function k(C){se[C?"unshift":"push"](()=>{u=C,t(4,u)})}function $(C){pe.call(this,n,C)}function T(C){pe.call(this,n,C)}return n.$$.update=()=>{var C,D,M;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(7,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(O=>O.id&&!O.toDelete&&O.originalName!=O.name))||[]),n.$$.dirty&4&&t(6,l=((D=d==null?void 0:d.schema)==null?void 0:D.filter(O=>O.id&&O.toDelete))||[]),n.$$.dirty&6&&t(5,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(O=>{var L,F,R;const I=(L=f==null?void 0:f.schema)==null?void 0:L.find(N=>N.id==O.id);return I?((F=I.options)==null?void 0:F.maxSelect)!=1&&((R=O.options)==null?void 0:R.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(d!=null&&d.$isView)||i)},[m,f,d,i,u,o,l,s,r,_,p,g,b,k,$,T]}class R4 extends ve{constructor(e){super(),be(this,e,F4,N4,_e,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function np(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function q4(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new UC({props:l}),se.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function j4(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new o4({props:l}),se.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ip(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new e4({props:o}),se.push(()=>he(t,"collection",l)),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){S(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),H(t)}}}function sp(n){let e,t,i,s;function l(r){n[35](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new A4({props:o}),se.push(()=>he(t,"collection",l)),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[3]===Is)},m(r,a){S(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&x(e,"active",r[3]===Is)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),H(t)}}}function V4(n){let e,t,i,s,l,o,r;const a=[j4,q4],u=[];function f(m,_){return m[2].$isView?0:1}i=f(n),s=u[i]=a[i](n);let d=n[3]===wl&&ip(n),p=n[2].$isAuth&&sp(n);return{c(){e=y("div"),t=y("div"),s.c(),l=E(),d&&d.c(),o=E(),p&&p.c(),h(t,"class","tab-item"),x(t,"active",n[3]===Mi),h(e,"class","tabs-content svelte-12y0yzb")},m(m,_){S(m,e,_),v(e,t),u[i].m(t,null),v(e,l),d&&d.m(e,null),v(e,o),p&&p.m(e,null),r=!0},p(m,_){let g=i;i=f(m),i===g?u[i].p(m,_):(re(),P(u[g],1,1,()=>{u[g]=null}),ae(),s=u[i],s?s.p(m,_):(s=u[i]=a[i](m),s.c()),A(s,1),s.m(t,null)),(!r||_[0]&8)&&x(t,"active",m[3]===Mi),m[3]===wl?d?(d.p(m,_),_[0]&8&&A(d,1)):(d=ip(m),d.c(),A(d,1),d.m(e,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae()),m[2].$isAuth?p?(p.p(m,_),_[0]&4&&A(p,1)):(p=sp(m),p.c(),A(p,1),p.m(e,null)):p&&(re(),P(p,1,1,()=>{p=null}),ae())},i(m){r||(A(s),A(d),A(p),r=!0)},o(m){P(s),P(d),P(p),r=!1},d(m){m&&w(e),u[i].d(),d&&d.d(),p&&p.d()}}}function lp(n){let e,t,i,s,l,o,r;return o=new Bn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[H4]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=E(),i=y("button"),s=y("i"),l=E(),z(o.$$.fragment),h(e,"class","flex-fill"),h(s,"class","ri-more-line"),h(i,"type","button"),h(i,"aria-label","More"),h(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),v(i,s),v(i,l),V(o,i,null),r=!0},p(a,u){const f={};u[1]&1048576&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),H(o)}}}function H4(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=` + `),s=y("strong"),o=U(l),r=E(),a=y("i"),u=E(),f=y("strong"),p=U(d),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex"),h(e,"class","svelte-xqpcsf")},m(m,_){S(m,e,_),v(e,t),v(t,i),v(t,s),v(s,o),v(t,r),v(t,a),v(t,u),v(t,f),v(f,p)},p(m,_){_&128&&l!==(l=m[17].originalName+"")&&le(o,l),_&128&&d!==(d=m[17].name+"")&&le(p,d)},d(m){m&&w(e)}}}function tp(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=y("li"),t=U("Removed field "),i=y("span"),l=U(s),o=E(),h(i,"class","txt-bold"),h(e,"class","txt-danger svelte-xqpcsf")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(i,l),v(e,o)},p(r,a){a&64&&s!==(s=r[17].name+"")&&le(l,s)},d(r){r&&w(e)}}}function P4(n){let e,t,i,s,l,o,r,a,u=n[6].length&&Zd(),f=n[8]&&Gd(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='',i=E(),s=y("div"),l=y("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query, + you'll have to update it manually!`,o=E(),u&&u.c(),r=E(),f&&f.c(),a=Se(),h(t,"class","icon"),h(s,"class","content txt-bold"),h(e,"class","alert alert-warning")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),u&&u.m(s,null),S(d,r,p),f&&f.m(d,p),S(d,a,p)},p(d,p){d[6].length?u||(u=Zd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),d[8]?f?f.p(d,p):(f=Gd(d),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(d){d&&w(e),u&&u.d(),d&&w(r),f&&f.d(d),d&&w(a)}}}function L4(n){let e;return{c(){e=y("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function N4(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='Cancel',t=E(),i=y("button"),i.innerHTML='Confirm',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[J(e,"click",n[11]),J(i,"click",n[12])],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function F4(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[N4],header:[L4],default:[P4]},$$scope:{ctx:n}};return e=new pn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[13](null),H(e,s)}}}function R4(n,e,t){let i,s,l,o,r;const a=kt();let u,f,d;async function p(C,D){t(1,f=C),t(2,d=D),await ln(),i||s.length||l.length||o.length?u==null||u.show():_()}function m(){u==null||u.hide()}function _(){m(),a("confirm")}const g=()=>m(),b=()=>_();function k(C){se[C?"unshift":"push"](()=>{u=C,t(4,u)})}function $(C){pe.call(this,n,C)}function T(C){pe.call(this,n,C)}return n.$$.update=()=>{var C,D,M;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(7,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(O=>O.id&&!O.toDelete&&O.originalName!=O.name))||[]),n.$$.dirty&4&&t(6,l=((D=d==null?void 0:d.schema)==null?void 0:D.filter(O=>O.id&&O.toDelete))||[]),n.$$.dirty&6&&t(5,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(O=>{var L,F,R;const I=(L=f==null?void 0:f.schema)==null?void 0:L.find(N=>N.id==O.id);return I?((F=I.options)==null?void 0:F.maxSelect)!=1&&((R=O.options)==null?void 0:R.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(d!=null&&d.$isView)||i)},[m,f,d,i,u,o,l,s,r,_,p,g,b,k,$,T]}class q4 extends ve{constructor(e){super(),be(this,e,R4,F4,_e,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function np(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function j4(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new WC({props:l}),se.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function V4(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new r4({props:l}),se.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ip(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new t4({props:o}),se.push(()=>he(t,"collection",l)),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){S(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),H(t)}}}function sp(n){let e,t,i,s;function l(r){n[35](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new I4({props:o}),se.push(()=>he(t,"collection",l)),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[3]===Is)},m(r,a){S(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&x(e,"active",r[3]===Is)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),H(t)}}}function H4(n){let e,t,i,s,l,o,r;const a=[V4,j4],u=[];function f(m,_){return m[2].$isView?0:1}i=f(n),s=u[i]=a[i](n);let d=n[3]===wl&&ip(n),p=n[2].$isAuth&&sp(n);return{c(){e=y("div"),t=y("div"),s.c(),l=E(),d&&d.c(),o=E(),p&&p.c(),h(t,"class","tab-item"),x(t,"active",n[3]===Mi),h(e,"class","tabs-content svelte-12y0yzb")},m(m,_){S(m,e,_),v(e,t),u[i].m(t,null),v(e,l),d&&d.m(e,null),v(e,o),p&&p.m(e,null),r=!0},p(m,_){let g=i;i=f(m),i===g?u[i].p(m,_):(re(),P(u[g],1,1,()=>{u[g]=null}),ae(),s=u[i],s?s.p(m,_):(s=u[i]=a[i](m),s.c()),A(s,1),s.m(t,null)),(!r||_[0]&8)&&x(t,"active",m[3]===Mi),m[3]===wl?d?(d.p(m,_),_[0]&8&&A(d,1)):(d=ip(m),d.c(),A(d,1),d.m(e,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae()),m[2].$isAuth?p?(p.p(m,_),_[0]&4&&A(p,1)):(p=sp(m),p.c(),A(p,1),p.m(e,null)):p&&(re(),P(p,1,1,()=>{p=null}),ae())},i(m){r||(A(s),A(d),A(p),r=!0)},o(m){P(s),P(d),P(p),r=!1},d(m){m&&w(e),u[i].d(),d&&d.d(),p&&p.d()}}}function lp(n){let e,t,i,s,l,o,r;return o=new Bn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[z4]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=E(),i=y("button"),s=y("i"),l=E(),z(o.$$.fragment),h(e,"class","flex-fill"),h(s,"class","ri-more-line"),h(i,"type","button"),h(i,"aria-label","More"),h(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),v(i,s),v(i,l),V(o,i,null),r=!0},p(a,u){const f={};u[1]&1048576&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),H(o)}}}function z4(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=` Duplicate`,t=E(),i=y("button"),i.innerHTML=` - Delete`,h(e,"type","button"),h(e,"class","dropdown-item closable"),h(i,"type","button"),h(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[J(e,"click",n[24]),J(i,"click",En(ft(n[25])))],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function op(n){let e,t,i,s;return i=new Bn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[z4]},$$scope:{ctx:n}}}),{c(){e=y("i"),t=E(),z(i.$$.fragment),h(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),V(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||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),H(i,l)}}}function rp(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,d;function p(){return n[27](n[47])}return{c(){e=y("button"),t=y("i"),s=E(),l=y("span"),r=U(o),a=U(" collection"),u=E(),h(t,"class",i=Ei(j.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),h(l,"class","txt"),h(e,"type","button"),h(e,"class","dropdown-item closable"),x(e,"selected",n[47]==n[2].type)},m(m,_){S(m,e,_),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),v(e,u),f||(d=J(e,"click",p),f=!0)},p(m,_){n=m,_[0]&64&&i!==(i=Ei(j.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&h(t,"class",i),_[0]&64&&o!==(o=n[48]+"")&&le(r,o),_[0]&68&&x(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,d()}}}function z4(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s{R=null}),ae()),(!I||Y[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(q[2].$isNew?"btn-outline":"btn-transparent")))&&h(p,"class",C),(!I||Y[0]&4&&D!==(D=!q[2].$isNew))&&(p.disabled=D),q[2].system?N||(N=ap(),N.c(),N.m(O.parentNode,O)):N&&(N.d(1),N=null)},i(q){I||(A(R),I=!0)},o(q){P(R),I=!1},d(q){q&&w(e),q&&w(s),q&&w(l),q&&w(f),q&&w(d),R&&R.d(),q&&w(M),N&&N.d(q),q&&w(O),L=!1,F()}}}function up(n){let e,t,i,s,l,o;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ee(t=Ue.call(null,e,n[11])),l=!0)},p(r,a){t&&Ut(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&nt(()=>{s&&(i||(i=Ve(e,Bt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=Ve(e,Bt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function fp(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function cp(n){var a,u,f;let e,t,i,s=!j.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&&dp();return{c(){e=y("button"),t=y("span"),t.textContent="Options",i=E(),r&&r.c(),h(t,"class","txt"),h(e,"type","button"),h(e,"class","tab-item"),x(e,"active",n[3]===Is)},m(d,p){S(d,e,p),v(e,t),v(e,i),r&&r.m(e,null),l||(o=J(e,"click",n[31]),l=!0)},p(d,p){var m,_,g;p[0]&32&&(s=!j.isEmpty((m=d[5])==null?void 0:m.options)&&!((g=(_=d[5])==null?void 0:_.options)!=null&&g.manageRule)),s?r?p[0]&32&&A(r,1):(r=dp(),r.c(),A(r,1),r.m(e,null)):r&&(re(),P(r,1,1,()=>{r=null}),ae()),p[0]&8&&x(e,"active",d[3]===Is)},d(d){d&&w(e),r&&r.d(),l=!1,o()}}}function dp(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function U4(n){var B,Z,ee,ie,X,fe,G,ce;let e,t=n[2].$isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,d,p,m,_=(B=n[2])!=null&&B.$isView?"Query":"Fields",g,b,k=!j.isEmpty(n[11]),$,T,C,D,M=!j.isEmpty((Z=n[5])==null?void 0:Z.listRule)||!j.isEmpty((ee=n[5])==null?void 0:ee.viewRule)||!j.isEmpty((ie=n[5])==null?void 0:ie.createRule)||!j.isEmpty((X=n[5])==null?void 0:X.updateRule)||!j.isEmpty((fe=n[5])==null?void 0:fe.deleteRule)||!j.isEmpty((ce=(G=n[5])==null?void 0:G.options)==null?void 0:ce.manageRule),O,I,L,F,R=!n[2].$isNew&&!n[2].system&&lp(n);r=new de({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[B4,({uniqueId:ge})=>({46:ge}),({uniqueId:ge})=>[0,ge?32768:0]]},$$scope:{ctx:n}}});let N=k&&up(n),q=M&&fp(),Y=n[2].$isAuth&&cp(n);return{c(){e=y("h4"),i=U(t),s=E(),R&&R.c(),l=E(),o=y("form"),z(r.$$.fragment),a=E(),u=y("input"),f=E(),d=y("div"),p=y("button"),m=y("span"),g=U(_),b=E(),N&&N.c(),$=E(),T=y("button"),C=y("span"),C.textContent="API Rules",D=E(),q&&q.c(),O=E(),Y&&Y.c(),h(e,"class","upsert-panel-title svelte-12y0yzb"),h(u,"type","submit"),h(u,"class","hidden"),h(u,"tabindex","-1"),h(o,"class","block"),h(m,"class","txt"),h(p,"type","button"),h(p,"class","tab-item"),x(p,"active",n[3]===Mi),h(C,"class","txt"),h(T,"type","button"),h(T,"class","tab-item"),x(T,"active",n[3]===wl),h(d,"class","tabs-header stretched")},m(ge,Me){S(ge,e,Me),v(e,i),S(ge,s,Me),R&&R.m(ge,Me),S(ge,l,Me),S(ge,o,Me),V(r,o,null),v(o,a),v(o,u),S(ge,f,Me),S(ge,d,Me),v(d,p),v(p,m),v(m,g),v(p,b),N&&N.m(p,null),v(d,$),v(d,T),v(T,C),v(T,D),q&&q.m(T,null),v(d,O),Y&&Y.m(d,null),I=!0,L||(F=[J(o,"submit",ft(n[28])),J(p,"click",n[29]),J(T,"click",n[30])],L=!0)},p(ge,Me){var He,we,Ce,Je,mt,Ze,We,te;(!I||Me[0]&4)&&t!==(t=ge[2].$isNew?"New collection":"Edit collection")&&le(i,t),!ge[2].$isNew&&!ge[2].system?R?(R.p(ge,Me),Me[0]&4&&A(R,1)):(R=lp(ge),R.c(),A(R,1),R.m(l.parentNode,l)):R&&(re(),P(R,1,1,()=>{R=null}),ae());const qe={};Me[0]&8192&&(qe.class="form-field collection-field-name required m-b-0 "+(ge[13]?"disabled":"")),Me[0]&8260|Me[1]&1081344&&(qe.$$scope={dirty:Me,ctx:ge}),r.$set(qe),(!I||Me[0]&4)&&_!==(_=(He=ge[2])!=null&&He.$isView?"Query":"Fields")&&le(g,_),Me[0]&2048&&(k=!j.isEmpty(ge[11])),k?N?(N.p(ge,Me),Me[0]&2048&&A(N,1)):(N=up(ge),N.c(),A(N,1),N.m(p,null)):N&&(re(),P(N,1,1,()=>{N=null}),ae()),(!I||Me[0]&8)&&x(p,"active",ge[3]===Mi),Me[0]&32&&(M=!j.isEmpty((we=ge[5])==null?void 0:we.listRule)||!j.isEmpty((Ce=ge[5])==null?void 0:Ce.viewRule)||!j.isEmpty((Je=ge[5])==null?void 0:Je.createRule)||!j.isEmpty((mt=ge[5])==null?void 0:mt.updateRule)||!j.isEmpty((Ze=ge[5])==null?void 0:Ze.deleteRule)||!j.isEmpty((te=(We=ge[5])==null?void 0:We.options)==null?void 0:te.manageRule)),M?q?Me[0]&32&&A(q,1):(q=fp(),q.c(),A(q,1),q.m(T,null)):q&&(re(),P(q,1,1,()=>{q=null}),ae()),(!I||Me[0]&8)&&x(T,"active",ge[3]===wl),ge[2].$isAuth?Y?Y.p(ge,Me):(Y=cp(ge),Y.c(),Y.m(d,null)):Y&&(Y.d(1),Y=null)},i(ge){I||(A(R),A(r.$$.fragment,ge),A(N),A(q),I=!0)},o(ge){P(R),P(r.$$.fragment,ge),P(N),P(q),I=!1},d(ge){ge&&w(e),ge&&w(s),R&&R.d(ge),ge&&w(l),ge&&w(o),H(r),ge&&w(f),ge&&w(d),N&&N.d(),q&&q.d(),Y&&Y.d(),L=!1,De(F)}}}function W4(n){let e,t,i,s,l,o=n[2].$isNew?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),r=U(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[9],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],x(s,"btn-loading",n[9])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(l,r),u||(f=[J(e,"click",n[22]),J(s,"click",n[23])],u=!0)},p(d,p){p[0]&512&&(e.disabled=d[9]),p[0]&4&&o!==(o=d[2].$isNew?"Create":"Save changes")&&le(r,o),p[0]&4608&&a!==(a=!d[12]||d[9])&&(s.disabled=a),p[0]&512&&x(s,"btn-loading",d[9])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function Y4(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[36],$$slots:{footer:[W4],header:[U4],default:[V4]},$$scope:{ctx:n}};e=new pn({props:l}),n[37](e),e.$on("hide",n[38]),e.$on("show",n[39]);let o={};return i=new R4({props:o}),n[40](i),i.$on("confirm",n[41]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){V(e,r,a),S(r,t,a),V(i,r,a),s=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[36]),a[0]&14956|a[1]&1048576&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[37](null),H(e,r),r&&w(t),n[40](null),H(i,r)}}}const Mi="schema",wl="api_rules",Is="options",K4="base",pp="auth",mp="view";function Pr(n){return JSON.stringify(n)}function J4(n,e,t){let i,s,l,o;Ke(n,gi,te=>t(5,o=te));const r={};r[K4]="Base",r[mp]="View",r[pp]="Auth";const a=kt();let u,f,d=null,p=new kn,m=!1,_=!1,g=Mi,b=Pr(p),k="";function $(te){t(3,g=te)}function T(te){return D(te),t(10,_=!0),$(Mi),u==null?void 0:u.show()}function C(){return u==null?void 0:u.hide()}async function D(te){dn({}),typeof te<"u"?(t(20,d=te),t(2,p=te.$clone())):(t(20,d=null),t(2,p=new kn)),t(2,p.schema=p.schema||[],p),t(2,p.originalName=p.name||"",p),await ln(),t(21,b=Pr(p))}function M(){p.$isNew?O():f==null||f.show(d,p)}function O(){if(m)return;t(9,m=!0);const te=I();let Fe;p.$isNew?Fe=me.collections.create(te):Fe=me.collections.update(p.id,te),Fe.then(Qe=>{Ea(),c$(Qe),t(10,_=!1),C(),Jt(p.$isNew?"Successfully created collection.":"Successfully updated collection."),a("save",{isNew:p.$isNew,collection:Qe})}).catch(Qe=>{me.errorResponseHandler(Qe)}).finally(()=>{t(9,m=!1)})}function I(){const te=p.$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 L(){d!=null&&d.id&&vn(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>me.collections.delete(d==null?void 0:d.id).then(()=>{C(),Jt(`Successfully deleted collection "${d==null?void 0:d.name}".`),a("delete",d),d$(d)}).catch(te=>{me.errorResponseHandler(te)}))}function F(te){t(2,p.type=te,p),Ai("schema")}function R(){s?vn("You have unsaved changes. Do you really want to discard them?",()=>{N()}):N()}async function N(){const te=d==null?void 0:d.$clone();if(te){if(te.id="",te.created="",te.updated="",te.name+="_duplicate",!j.isEmpty(te.schema))for(const Fe of te.schema)Fe.id="";if(!j.isEmpty(te.indexes))for(let Fe=0;FeC(),Y=()=>M(),B=()=>R(),Z=()=>L(),ee=te=>{t(2,p.name=j.slugify(te.target.value),p),te.target.value=p.name},ie=te=>F(te),X=()=>{l&&M()},fe=()=>$(Mi),G=()=>$(wl),ce=()=>$(Is);function ge(te){p=te,t(2,p),t(20,d)}function Me(te){p=te,t(2,p),t(20,d)}function qe(te){p=te,t(2,p),t(20,d)}function He(te){p=te,t(2,p),t(20,d)}const we=()=>s&&_?(vn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),C()}),!1):!0;function Ce(te){se[te?"unshift":"push"](()=>{u=te,t(7,u)})}function Je(te){pe.call(this,n,te)}function mt(te){pe.call(this,n,te)}function Ze(te){se[te?"unshift":"push"](()=>{f=te,t(8,f)})}const We=()=>O();return n.$$.update=()=>{var te,Fe;n.$$.dirty[0]&32&&(o.schema||(te=o.options)!=null&&te.query?t(11,k=j.getNestedVal(o,"schema.message")||"Has errors"):t(11,k="")),n.$$.dirty[0]&4&&p.type===mp&&(t(2,p.createRule=null,p),t(2,p.updateRule=null,p),t(2,p.deleteRule=null,p),t(2,p.indexes=[],p)),n.$$.dirty[0]&1048580&&p!=null&&p.name&&(d==null?void 0:d.name)!=(p==null?void 0:p.name)&&t(2,p.indexes=(Fe=p.indexes)==null?void 0:Fe.map(Qe=>j.replaceIndexTableName(Qe,p.name)),p),n.$$.dirty[0]&4&&t(13,i=!p.$isNew&&p.system),n.$$.dirty[0]&2097156&&t(4,s=b!=Pr(p)),n.$$.dirty[0]&20&&t(12,l=p.$isNew||s),n.$$.dirty[0]&12&&g===Is&&p.type!==pp&&$(Mi)},[$,C,p,g,s,o,r,u,f,m,_,k,l,i,M,O,L,F,R,T,d,b,q,Y,B,Z,ee,ie,X,fe,G,ce,ge,Me,qe,He,we,Ce,Je,mt,Ze,We]}class ru extends ve{constructor(e){super(),be(this,e,J4,Y4,_e,{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 hp(n,e,t){const i=n.slice();return i[15]=e[t],i}function _p(n){let e,t=n[1].length&&gp();return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1].length?t||(t=gp(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function gp(n){let e;return{c(){e=y("p"),e.textContent="No collections found.",h(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 bp(n,e){let t,i,s,l,o,r=e[15].name+"",a,u,f,d,p;return{key:n,first:null,c(){var m;t=y("a"),i=y("i"),l=E(),o=y("span"),a=U(r),u=E(),h(i,"class",s=j.getCollectionTypeIcon(e[15].type)),h(o,"class","txt"),h(t,"href",f="/collections?collectionId="+e[15].id),h(t,"class","sidebar-list-item"),x(t,"active",((m=e[5])==null?void 0:m.id)===e[15].id),this.first=t},m(m,_){S(m,t,_),v(t,i),v(t,l),v(t,o),v(o,a),v(t,u),d||(p=Ee(an.call(null,t)),d=!0)},p(m,_){var g;e=m,_&8&&s!==(s=j.getCollectionTypeIcon(e[15].type))&&h(i,"class",s),_&8&&r!==(r=e[15].name+"")&&le(a,r),_&8&&f!==(f="/collections?collectionId="+e[15].id)&&h(t,"href",f),_&40&&x(t,"active",((g=e[5])==null?void 0:g.id)===e[15].id)},d(m){m&&w(t),d=!1,p()}}}function vp(n){let e,t,i,s;return{c(){e=y("footer"),t=y("button"),t.innerHTML=` - New collection`,h(t,"type","button"),h(t,"class","btn btn-block btn-outline"),h(e,"class","sidebar-footer")},m(l,o){S(l,e,o),v(e,t),i||(s=J(t,"click",n[12]),i=!0)},p:Q,d(l){l&&w(e),i=!1,s()}}}function Z4(n){let e,t,i,s,l,o,r,a,u,f,d,p=[],m=new Map,_,g,b,k,$,T,C=n[3];const D=L=>L[15].id;for(let L=0;L
    ',o=E(),r=y("input"),a=E(),u=y("hr"),f=E(),d=y("div");for(let L=0;L20),h(e,"class","page-sidebar collection-sidebar")},m(L,F){S(L,e,F),v(e,t),v(t,i),v(i,s),v(s,l),v(i,o),v(i,r),ue(r,n[0]),v(e,a),v(e,u),v(e,f),v(e,d);for(let R=0;R20),L[7]?O&&(O.d(1),O=null):O?O.p(L,F):(O=vp(L),O.c(),O.m(e,null));const R={};b.$set(R)},i(L){k||(A(b.$$.fragment,L),k=!0)},o(L){P(b.$$.fragment,L),k=!1},d(L){L&&w(e);for(let F=0;F{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function X4(n,e,t){let i,s,l,o,r,a,u;Ke(n,_i,$=>t(5,o=$)),Ke(n,si,$=>t(9,r=$)),Ke(n,No,$=>t(6,a=$)),Ke(n,Os,$=>t(7,u=$));let f,d="";function p($){sn(_i,o=$,o)}const m=()=>t(0,d="");function _(){d=this.value,t(0,d)}const g=()=>f==null?void 0:f.show();function b($){se[$?"unshift":"push"](()=>{f=$,t(2,f)})}const k=$=>{var T;(T=$.detail)!=null&&T.isNew&&$.detail.collection&&p($.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&G4(),n.$$.dirty&1&&t(1,i=d.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=d!==""),n.$$.dirty&515&&t(3,l=r.filter($=>$.id==d||$.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[d,i,f,l,s,o,a,u,p,r,m,_,g,b,k]}class Q4 extends ve{constructor(e){super(),be(this,e,X4,Z4,_e,{})}}function yp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function kp(n){n[18]=n[19].default}function wp(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=y("hr"),h(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function $p(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,d=i&&Sp();function p(){return e[9](e[14])}return{key:n,first:null,c(){t=Se(),d&&d.c(),s=E(),l=y("button"),r=U(o),a=E(),h(l,"type","button"),h(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(m,_){S(m,t,_),d&&d.m(m,_),S(m,s,_),S(m,l,_),v(l,r),v(l,a),u||(f=J(l,"click",p),u=!0)},p(m,_){e=m,_&8&&(i=e[21]===Object.keys(e[6]).length),i?d||(d=Sp(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),_&8&&o!==(o=e[15].label+"")&&le(r,o),_&40&&x(l,"active",e[5]===e[14])},d(m){m&&w(t),d&&d.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function Tp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:t5,then:e5,catch:x4,value:19,blocks:[,,,]};return pu(t=n[15].component,s),{c(){e=Se(),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)&&pu(t,s)||Fb(s,n,o)},i(l){i||(A(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 x4(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function e5(n){kp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){z(e.$$.fragment),t=E()},m(s,l){V(e,s,l),S(s,t,l),i=!0},p(s,l){kp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){P(e.$$.fragment,s),i=!1},d(s){H(e,s),s&&w(t)}}}function t5(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Cp(n,e){let t,i,s,l=e[5]===e[14]&&Tp(e);return{key:n,first:null,c(){t=Se(),l&&l.c(),i=Se(),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&&A(l,1)):(l=Tp(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(A(l),s=!0)},o(o){P(l),s=!1},d(o){o&&w(t),l&&l.d(o),o&&w(i)}}}function n5(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,d=Object.entries(n[3]);const p=g=>g[14];for(let g=0;gg[14];for(let g=0;gClose',h(e,"type","button"),h(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[8]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function s5(n){let e,t,i={class:"docs-panel",$$slots:{footer:[i5],default:[n5]},$$scope:{ctx:n}};return e=new pn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function l5(n,e,t){const i={list:{label:"List/Search",component:rt(()=>import("./ListApiDocs-b8dd0881.js"),["./ListApiDocs-b8dd0881.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:rt(()=>import("./ViewApiDocs-ae021a6a.js"),["./ViewApiDocs-ae021a6a.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},create:{label:"Create",component:rt(()=>import("./CreateApiDocs-b9e14de9.js"),["./CreateApiDocs-b9e14de9.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},update:{label:"Update",component:rt(()=>import("./UpdateApiDocs-36690f06.js"),["./UpdateApiDocs-36690f06.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},delete:{label:"Delete",component:rt(()=>import("./DeleteApiDocs-dd93a5e5.js"),["./DeleteApiDocs-dd93a5e5.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:rt(()=>import("./RealtimeApiDocs-bced41f9.js"),["./RealtimeApiDocs-bced41f9.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:rt(()=>import("./AuthWithPasswordDocs-ae1991de.js"),["./AuthWithPasswordDocs-ae1991de.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:rt(()=>import("./AuthWithOAuth2Docs-99dc3f64.js"),["./AuthWithOAuth2Docs-99dc3f64.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},refresh:{label:"Auth refresh",component:rt(()=>import("./AuthRefreshDocs-9617aab2.js"),["./AuthRefreshDocs-9617aab2.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-verification":{label:"Request verification",component:rt(()=>import("./RequestVerificationDocs-22ab5e9b.js"),["./RequestVerificationDocs-22ab5e9b.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:rt(()=>import("./ConfirmVerificationDocs-2fa1a3fb.js"),["./ConfirmVerificationDocs-2fa1a3fb.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:rt(()=>import("./RequestPasswordResetDocs-a862cf14.js"),["./RequestPasswordResetDocs-a862cf14.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:rt(()=>import("./ConfirmPasswordResetDocs-c75c630b.js"),["./ConfirmPasswordResetDocs-c75c630b.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:rt(()=>import("./RequestEmailChangeDocs-722c2a76.js"),["./RequestEmailChangeDocs-722c2a76.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:rt(()=>import("./ConfirmEmailChangeDocs-683ed386.js"),["./ConfirmEmailChangeDocs-683ed386.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:rt(()=>import("./AuthMethodsDocs-ec276195.js"),["./AuthMethodsDocs-ec276195.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:rt(()=>import("./ListExternalAuthsDocs-6141ba63.js"),["./ListExternalAuthsDocs-6141ba63.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:rt(()=>import("./UnlinkExternalAuthDocs-574393fc.js"),["./UnlinkExternalAuthDocs-574393fc.js","./SdkTabs-259b2687.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o=new kn,r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),d(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function d(k){t(5,r=k)}const p=()=>f(),m=k=>d(k);function _(k){se[k?"unshift":"push"](()=>{l=k,t(4,l)})}function g(k){pe.call(this,n,k)}function b(k){pe.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,d,o,a,l,r,i,u,p,m,_,g,b]}class o5 extends ve{constructor(e){super(),be(this,e,l5,s5,_e,{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 r5(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Username",o=E(),r=y("input"),h(t,"class",j.getFieldTypeIcon("user")),h(s,"class","txt"),h(e,"for",l=n[12]),h(r,"type","text"),h(r,"requried",a=!n[0].$isNew),h(r,"placeholder",u=n[0].$isNew?"Leave empty to auto generate...":n[3]),h(r,"id",f=n[12])},m(m,_){S(m,e,_),v(e,t),v(e,i),v(e,s),S(m,o,_),S(m,r,_),ue(r,n[0].username),d||(p=J(r,"input",n[4]),d=!0)},p(m,_){_&4096&&l!==(l=m[12])&&h(e,"for",l),_&1&&a!==(a=!m[0].$isNew)&&h(r,"requried",a),_&1&&u!==(u=m[0].$isNew?"Leave empty to auto generate...":m[3])&&h(r,"placeholder",u),_&4096&&f!==(f=m[12])&&h(r,"id",f),_&1&&r.value!==m[0].username&&ue(r,m[0].username)},d(m){m&&w(e),m&&w(o),m&&w(r),d=!1,p()}}}function a5(n){let e,t,i,s,l,o,r,a,u,f,d=n[0].emailVisibility?"On":"Off",p,m,_,g,b,k,$,T,C;return{c(){var D;e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Email",o=E(),r=y("div"),a=y("button"),u=y("span"),f=U("Public: "),p=U(d),_=E(),g=y("input"),h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[12]),h(u,"class","txt"),h(a,"type","button"),h(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),h(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),h(g,"type","email"),g.autofocus=b=n[0].$isNew,h(g,"autocomplete","off"),h(g,"id",k=n[12]),g.required=$=(D=n[1].options)==null?void 0:D.requireEmail,h(g,"class","svelte-1751a4d")},m(D,M){S(D,e,M),v(e,t),v(e,i),v(e,s),S(D,o,M),S(D,r,M),v(r,a),v(a,u),v(u,f),v(u,p),S(D,_,M),S(D,g,M),ue(g,n[0].email),n[0].$isNew&&g.focus(),T||(C=[Ee(Ue.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",n[5]),J(g,"input",n[6])],T=!0)},p(D,M){var O;M&4096&&l!==(l=D[12])&&h(e,"for",l),M&1&&d!==(d=D[0].emailVisibility?"On":"Off")&&le(p,d),M&1&&m!==(m="btn btn-sm btn-transparent "+(D[0].emailVisibility?"btn-success":"btn-hint"))&&h(a,"class",m),M&1&&b!==(b=D[0].$isNew)&&(g.autofocus=b),M&4096&&k!==(k=D[12])&&h(g,"id",k),M&2&&$!==($=(O=D[1].options)==null?void 0:O.requireEmail)&&(g.required=$),M&1&&g.value!==D[0].email&&ue(g,D[0].email)},d(D){D&&w(e),D&&w(o),D&&w(r),D&&w(_),D&&w(g),T=!1,De(C)}}}function Mp(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[u5,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&12292&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function u5(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[2],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[7]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&4&&(e.checked=u[2]),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Op(n){let e,t,i,s,l,o,r,a,u;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[f5,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[c5,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),x(t,"p-t-xs",n[2]),h(e,"class","block")},m(f,d){S(f,e,d),v(e,t),v(t,i),V(s,i,null),v(t,l),v(t,o),V(r,o,null),u=!0},p(f,d){const p={};d&12289&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d&12289&&(m.$$scope={dirty:d,ctx:f}),r.$set(m),(!u||d&4)&&x(t,"p-t-xs",f[2])},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&nt(()=>{u&&(a||(a=Ve(e,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Ve(e,wt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),H(s),H(r),f&&a&&a.end()}}}function f5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[12]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[12]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[0].password),u||(f=J(r,"input",n[8]),u=!0)},p(d,p){p&4096&&l!==(l=d[12])&&h(e,"for",l),p&4096&&a!==(a=d[12])&&h(r,"id",a),p&1&&r.value!==d[0].password&&ue(r,d[0].password)},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function c5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password confirm",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[12]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[12]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[0].passwordConfirm),u||(f=J(r,"input",n[9]),u=!0)},p(d,p){p&4096&&l!==(l=d[12])&&h(e,"for",l),p&4096&&a!==(a=d[12])&&h(r,"id",a),p&1&&r.value!==d[0].passwordConfirm&&ue(r,d[0].passwordConfirm)},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function d5(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Verified"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(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),v(s,l),r||(a=[J(e,"change",n[10]),J(e,"change",ft(n[11]))],r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].verified),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,De(a)}}}function p5(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,m;i=new de({props:{class:"form-field "+(n[0].$isNew?"":"required"),name:"username",$$slots:{default:[r5,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+((b=n[1].options)!=null&&b.requireEmail?"required":""),name:"email",$$slots:{default:[a5,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}});let _=!n[0].$isNew&&Mp(n),g=(n[0].$isNew||n[2])&&Op(n);return p=new de({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[d5,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),_&&_.c(),u=E(),g&&g.c(),f=E(),d=y("div"),z(p.$$.fragment),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(a,"class","col-lg-12"),h(d,"class","col-lg-12"),h(e,"class","grid m-b-base")},m(k,$){S(k,e,$),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),_&&_.m(a,null),v(a,u),g&&g.m(a,null),v(e,f),v(e,d),V(p,d,null),m=!0},p(k,[$]){var M;const T={};$&1&&(T.class="form-field "+(k[0].$isNew?"":"required")),$&12289&&(T.$$scope={dirty:$,ctx:k}),i.$set(T);const C={};$&2&&(C.class="form-field "+((M=k[1].options)!=null&&M.requireEmail?"required":"")),$&12291&&(C.$$scope={dirty:$,ctx:k}),o.$set(C),k[0].$isNew?_&&(re(),P(_,1,1,()=>{_=null}),ae()):_?(_.p(k,$),$&1&&A(_,1)):(_=Mp(k),_.c(),A(_,1),_.m(a,u)),k[0].$isNew||k[2]?g?(g.p(k,$),$&5&&A(g,1)):(g=Op(k),g.c(),A(g,1),g.m(a,null)):g&&(re(),P(g,1,1,()=>{g=null}),ae());const D={};$&12289&&(D.$$scope={dirty:$,ctx:k}),p.$set(D)},i(k){m||(A(i.$$.fragment,k),A(o.$$.fragment,k),A(_),A(g),A(p.$$.fragment,k),m=!0)},o(k){P(i.$$.fragment,k),P(o.$$.fragment,k),P(_),P(g),P(p.$$.fragment,k),m=!1},d(k){k&&w(e),H(i),H(o),_&&_.d(),g&&g.d(),H(p)}}}function m5(n,e,t){let{collection:i=new kn}=e,{record:s=new pi}=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 d(){s.password=this.value,t(0,s),t(2,o)}function p(){s.passwordConfirm=this.value,t(0,s),t(2,o)}function m(){s.verified=this.checked,t(0,s),t(2,o)}const _=g=>{s.$isNew||vn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,s.verified=!g.target.checked,s)})};return n.$$set=g=>{"collection"in g&&t(1,i=g.collection),"record"in g&&t(0,s=g.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),Ai("password"),Ai("passwordConfirm")))},[s,i,o,l,r,a,u,f,d,p,m,_]}class h5 extends ve{constructor(e){super(),be(this,e,m5,p5,_e,{collection:1,record:0})}}function _5(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 _=r.closest("form");_!=null&&_.requestSubmit&&_.requestSubmit()}}xt(()=>(u(),()=>clearTimeout(a)));function d(m){se[m?"unshift":"push"](()=>{r=m,t(1,r)})}function p(){l=this.value,t(0,l)}return n.$$set=m=>{e=Re(Re({},e),Yt(m)),t(3,s=Xe(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,d,p]}class b5 extends ve{constructor(e){super(),be(this,e,g5,_5,_e,{value:0,maxHeight:4})}}function v5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p;function m(g){n[2](g)}let _={id:n[3],required:n[1].required};return n[0]!==void 0&&(_.value=n[0]),f=new b5({props:_}),se.push(()=>he(f,"value",m)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),z(f.$$.fragment),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3])},m(g,b){S(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(g,u,b),V(f,g,b),p=!0},p(g,b){(!p||b&2&&i!==(i=j.getFieldTypeIcon(g[1].type)))&&h(t,"class",i),(!p||b&2)&&o!==(o=g[1].name+"")&&le(r,o),(!p||b&8&&a!==(a=g[3]))&&h(e,"for",a);const k={};b&8&&(k.id=g[3]),b&2&&(k.required=g[1].required),!d&&b&1&&(d=!0,k.value=g[0],ke(()=>d=!1)),f.$set(k)},i(g){p||(A(f.$$.fragment,g),p=!0)},o(g){P(f.$$.fragment,g),p=!1},d(g){g&&w(e),g&&w(u),H(f,g)}}}function y5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[v5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function k5(n,e,t){let{field:i=new wn}=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 w5 extends ve{constructor(e){super(),be(this,e,k5,y5,_e,{field:1,value:0})}}function S5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_,g,b;return{c(){var k,$;e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("input"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","number"),h(f,"id",d=n[3]),f.required=p=n[1].required,h(f,"min",m=(k=n[1].options)==null?void 0:k.min),h(f,"max",_=($=n[1].options)==null?void 0:$.max),h(f,"step","any")},m(k,$){S(k,e,$),v(e,t),v(e,s),v(e,l),v(l,r),S(k,u,$),S(k,f,$),ue(f,n[0]),g||(b=J(f,"input",n[2]),g=!0)},p(k,$){var T,C;$&2&&i!==(i=j.getFieldTypeIcon(k[1].type))&&h(t,"class",i),$&2&&o!==(o=k[1].name+"")&&le(r,o),$&8&&a!==(a=k[3])&&h(e,"for",a),$&8&&d!==(d=k[3])&&h(f,"id",d),$&2&&p!==(p=k[1].required)&&(f.required=p),$&2&&m!==(m=(T=k[1].options)==null?void 0:T.min)&&h(f,"min",m),$&2&&_!==(_=(C=k[1].options)==null?void 0:C.max)&&h(f,"max",_),$&1&&_t(f.value)!==k[0]&&ue(f,k[0])},d(k){k&&w(e),k&&w(u),k&&w(f),g=!1,b()}}}function $5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[S5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function T5(n,e,t){let{field:i=new wn}=e,{value:s=void 0}=e;function l(){s=_t(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 C5 extends ve{constructor(e){super(),be(this,e,T5,$5,_e,{field:1,value:0})}}function M5(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=y("input"),i=E(),s=y("label"),o=U(l),h(e,"type","checkbox"),h(e,"id",t=n[3]),h(s,"for",r=n[3])},m(f,d){S(f,e,d),e.checked=n[0],S(f,i,d),S(f,s,d),v(s,o),a||(u=J(e,"change",n[2]),a=!0)},p(f,d){d&8&&t!==(t=f[3])&&h(e,"id",t),d&1&&(e.checked=f[0]),d&2&&l!==(l=f[1].name+"")&&le(o,l),d&8&&r!==(r=f[3])&&h(s,"for",r)},d(f){f&&w(e),f&&w(i),f&&w(s),a=!1,u()}}}function O5(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[M5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function D5(n,e,t){let{field:i=new wn}=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 E5 extends ve{constructor(e){super(),be(this,e,D5,O5,_e,{field:1,value:0})}}function A5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("input"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","email"),h(f,"id",d=n[3]),f.required=p=n[1].required},m(g,b){S(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(g,u,b),S(g,f,b),ue(f,n[0]),m||(_=J(f,"input",n[2]),m=!0)},p(g,b){b&2&&i!==(i=j.getFieldTypeIcon(g[1].type))&&h(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&8&&a!==(a=g[3])&&h(e,"for",a),b&8&&d!==(d=g[3])&&h(f,"id",d),b&2&&p!==(p=g[1].required)&&(f.required=p),b&1&&f.value!==g[0]&&ue(f,g[0])},d(g){g&&w(e),g&&w(u),g&&w(f),m=!1,_()}}}function I5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[A5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function P5(n,e,t){let{field:i=new wn}=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 L5 extends ve{constructor(e){super(),be(this,e,P5,I5,_e,{field:1,value:0})}}function N5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("input"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","url"),h(f,"id",d=n[3]),f.required=p=n[1].required},m(g,b){S(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(g,u,b),S(g,f,b),ue(f,n[0]),m||(_=J(f,"input",n[2]),m=!0)},p(g,b){b&2&&i!==(i=j.getFieldTypeIcon(g[1].type))&&h(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&8&&a!==(a=g[3])&&h(e,"for",a),b&8&&d!==(d=g[3])&&h(f,"id",d),b&2&&p!==(p=g[1].required)&&(f.required=p),b&1&&f.value!==g[0]&&ue(f,g[0])},d(g){g&&w(e),g&&w(u),g&&w(f),m=!1,_()}}}function F5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[N5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function R5(n,e,t){let{field:i=new wn}=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 q5 extends ve{constructor(e){super(),be(this,e,R5,F5,_e,{field:1,value:0})}}function Dp(n){let e,t,i,s;return{c(){e=y("div"),t=y("button"),t.innerHTML='',h(t,"type","button"),h(t,"class","link-hint clear-btn svelte-11df51y"),h(e,"class","form-field-addon")},m(l,o){S(l,e,o),v(e,t),i||(s=[Ee(Ue.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:Q,d(l){l&&w(e),i=!1,De(s)}}}function j5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_,g,b=n[0]&&!n[1].required&&Dp(n);function k(C){n[6](C)}function $(C){n[7](C)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),p=new lu({props:T}),se.push(()=>he(p,"value",k)),se.push(()=>he(p,"formattedValue",$)),p.$on("close",n[3]),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),a=U(" (UTC)"),f=E(),b&&b.c(),d=E(),z(p.$$.fragment),h(t,"class",i=Ei(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),h(l,"class","txt"),h(e,"for",u=n[8])},m(C,D){S(C,e,D),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),S(C,f,D),b&&b.m(C,D),S(C,d,D),V(p,C,D),g=!0},p(C,D){(!g||D&2&&i!==(i=Ei(j.getFieldTypeIcon(C[1].type))+" svelte-11df51y"))&&h(t,"class",i),(!g||D&2)&&o!==(o=C[1].name+"")&&le(r,o),(!g||D&256&&u!==(u=C[8]))&&h(e,"for",u),C[0]&&!C[1].required?b?b.p(C,D):(b=Dp(C),b.c(),b.m(d.parentNode,d)):b&&(b.d(1),b=null);const M={};D&256&&(M.id=C[8]),!m&&D&4&&(m=!0,M.value=C[2],ke(()=>m=!1)),!_&&D&1&&(_=!0,M.formattedValue=C[0],ke(()=>_=!1)),p.$set(M)},i(C){g||(A(p.$$.fragment,C),g=!0)},o(C){P(p.$$.fragment,C),g=!1},d(C){C&&w(e),C&&w(f),b&&b.d(C),C&&w(d),H(p,C)}}}function V5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[j5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function H5(n,e,t){let{field:i=new wn}=e,{value:s=void 0}=e,l=s;function o(d){d.detail&&d.detail.length==3&&t(0,s=d.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(d){l=d,t(2,l),t(0,s)}function f(d){s=d,t(0,s)}return n.$$set=d=>{"field"in d&&t(1,i=d.field),"value"in d&&t(0,s=d.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 z5 extends ve{constructor(e){super(),be(this,e,H5,V5,_e,{field:1,value:0})}}function Ep(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=y("div"),t=U("Select up to "),s=U(i),l=U(" items."),h(e,"class","help-block")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&w(e)}}}function B5(n){var $,T,C,D,M;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;function g(O){n[3](O)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||(($=n[0])==null?void 0:$.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:(C=n[1].options)==null?void 0:C.values,searchable:((D=n[1].options)==null?void 0:D.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new ou({props:b}),se.push(()=>he(f,"selected",g));let k=((M=n[1].options)==null?void 0:M.maxSelect)>1&&Ep(n);return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),z(f.$$.fragment),p=E(),k&&k.c(),m=Se(),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[4])},m(O,I){S(O,e,I),v(e,t),v(e,s),v(e,l),v(l,r),S(O,u,I),V(f,O,I),S(O,p,I),k&&k.m(O,I),S(O,m,I),_=!0},p(O,I){var F,R,N,q,Y;(!_||I&2&&i!==(i=j.getFieldTypeIcon(O[1].type)))&&h(t,"class",i),(!_||I&2)&&o!==(o=O[1].name+"")&&le(r,o),(!_||I&16&&a!==(a=O[4]))&&h(e,"for",a);const L={};I&16&&(L.id=O[4]),I&6&&(L.toggle=!O[1].required||O[2]),I&4&&(L.multiple=O[2]),I&7&&(L.closable=!O[2]||((F=O[0])==null?void 0:F.length)>=((R=O[1].options)==null?void 0:R.maxSelect)),I&2&&(L.items=(N=O[1].options)==null?void 0:N.values),I&2&&(L.searchable=((q=O[1].options)==null?void 0:q.values)>5),!d&&I&1&&(d=!0,L.selected=O[0],ke(()=>d=!1)),f.$set(L),((Y=O[1].options)==null?void 0:Y.maxSelect)>1?k?k.p(O,I):(k=Ep(O),k.c(),k.m(m.parentNode,m)):k&&(k.d(1),k=null)},i(O){_||(A(f.$$.fragment,O),_=!0)},o(O){P(f.$$.fragment,O),_=!1},d(O){O&&w(e),O&&w(u),H(f,O),O&&w(p),k&&k.d(O),O&&w(m)}}}function U5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[B5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function W5(n,e,t){let i,{field:s=new wn}=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 Y5 extends ve{constructor(e){super(),be(this,e,W5,U5,_e,{field:1,value:0})}}function K5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("textarea"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[4]),h(f,"id",d=n[4]),h(f,"class","txt-mono"),f.required=p=n[1].required,f.value=n[2]},m(g,b){S(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(g,u,b),S(g,f,b),m||(_=J(f,"input",n[3]),m=!0)},p(g,b){b&2&&i!==(i=j.getFieldTypeIcon(g[1].type))&&h(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&16&&a!==(a=g[4])&&h(e,"for",a),b&16&&d!==(d=g[4])&&h(f,"id",d),b&2&&p!==(p=g[1].required)&&(f.required=p),b&4&&(f.value=g[2])},d(g){g&&w(e),g&&w(u),g&&w(f),m=!1,_()}}}function J5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[K5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Z5(n,e,t){let{field:i=new wn}=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 G5 extends ve{constructor(e){super(),be(this,e,Z5,J5,_e,{field:1,value:0})}}function X5(n){let e,t;return{c(){e=y("i"),h(e,"class","ri-file-line"),h(e,"alt",t=n[0].name)},m(i,s){S(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&h(e,"alt",t)},d(i){i&&w(e)}}}function Q5(n){let e,t,i;return{c(){e=y("img"),Dn(e.src,t=n[2])||h(e,"src",t),h(e,"width",n[1]),h(e,"height",n[1]),h(e,"alt",i=n[0].name)},m(s,l){S(s,e,l)},p(s,l){l&4&&!Dn(e.src,t=s[2])&&h(e,"src",t),l&2&&h(e,"width",s[1]),l&2&&h(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&h(e,"alt",i)},d(s){s&&w(e)}}}function x5(n){let e;function t(l,o){return l[2]?Q5:X5}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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:Q,o:Q,d(l){s.d(l),l&&w(e)}}}function eM(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),j.hasImageExtension(s==null?void 0:s.name)&&j.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 tM extends ve{constructor(e){super(),be(this,e,eM,x5,_e,{file:0,size:1})}}function Ap(n){let e;function t(l,o){return l[4]==="image"?iM:nM}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 nM(n){let e,t;return{c(){e=y("object"),t=U("Cannot preview the file."),h(e,"title",n[2]),h(e,"data",n[1])},m(i,s){S(i,e,s),v(e,t)},p(i,s){s&4&&h(e,"title",i[2]),s&2&&h(e,"data",i[1])},d(i){i&&w(e)}}}function iM(n){let e,t,i;return{c(){e=y("img"),Dn(e.src,t=n[1])||h(e,"src",t),h(e,"alt",i="Preview "+n[2])},m(s,l){S(s,e,l)},p(s,l){l&2&&!Dn(e.src,t=s[1])&&h(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&h(e,"alt",i)},d(s){s&&w(e)}}}function sM(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Ap(n);return{c(){i&&i.c(),t=Se()},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=Ap(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&w(t)}}}function lM(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=J(e,"click",ft(n[0])),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function oM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("a"),t=U(n[2]),i=E(),s=y("i"),l=E(),o=y("div"),r=E(),a=y("button"),a.textContent="Close",h(s,"class","ri-external-link-line"),h(e,"href",n[1]),h(e,"title",n[2]),h(e,"target","_blank"),h(e,"rel","noreferrer noopener"),h(e,"class","link-hint txt-ellipsis inline-flex"),h(o,"class","flex-fill"),h(a,"type","button"),h(a,"class","btn btn-transparent")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,l,p),S(d,o,p),S(d,r,p),S(d,a,p),u||(f=J(a,"click",n[0]),u=!0)},p(d,p){p&4&&le(t,d[2]),p&2&&h(e,"href",d[1]),p&4&&h(e,"title",d[2])},d(d){d&&w(e),d&&w(l),d&&w(o),d&&w(r),d&&w(a),u=!1,f()}}}function rM(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[oM],header:[lM],default:[sM]},$$scope:{ctx:n}};return e=new pn({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&1054&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function aM(n,e,t){let i,s,l,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(m){se[m?"unshift":"push"](()=>{o=m,t(3,o)})}function d(m){pe.call(this,n,m)}function p(m){pe.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=j.getFileType(s))},[u,r,s,o,l,a,i,f,d,p]}class uM extends ve{constructor(e){super(),be(this,e,aM,rM,_e,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function fM(n){let e,t,i,s,l;function o(u,f){return u[3]==="image"?mM:u[3]==="video"||u[3]==="audio"?pM:dM}let r=o(n),a=r(n);return{c(){e=y("a"),a.c(),h(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),h(e,"href",n[6]),h(e,"target","_blank"),h(e,"rel","noreferrer"),h(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){S(u,e,f),a.m(e,null),s||(l=J(e,"click",En(n[13])),s=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&h(e,"class",t),f&64&&h(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&h(e,"title",i)},d(u){u&&w(e),a.d(),s=!1,l()}}}function cM(n){let e,t;return{c(){e=y("div"),h(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,s){S(i,e,s)},p(i,s){s&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&h(e,"class",t)},d(i){i&&w(e)}}}function dM(n){let e;return{c(){e=y("i"),h(e,"class","ri-file-3-line")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function pM(n){let e;return{c(){e=y("i"),h(e,"class","ri-video-line")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function mM(n){let e,t,i,s,l;return{c(){e=y("img"),Dn(e.src,t=n[5])||h(e,"src",t),h(e,"alt",n[0]),h(e,"title",i="Preview "+n[0])},m(o,r){S(o,e,r),s||(l=J(e,"error",n[8]),s=!0)},p(o,r){r&32&&!Dn(e.src,t=o[5])&&h(e,"src",t),r&1&&h(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&h(e,"title",i)},d(o){o&&w(e),s=!1,l()}}}function hM(n){let e,t,i;function s(a,u){return a[2]?cM:fM}let l=s(n),o=l(n),r={};return t=new uM({props:r}),n[14](t),{c(){o.c(),e=E(),z(t.$$.fragment)},m(a,u){o.m(a,u),S(a,e,u),V(t,a,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const f={};t.$set(f)},i(a){i||(A(t.$$.fragment,a),i=!0)},o(a){P(t.$$.fragment,a),i=!1},d(a){o.d(a),a&&w(e),n[14](null),H(t,a)}}}function _M(n,e,t){let i,s,l,o;Ke(n,tb,T=>t(12,o=T));let{record:r=null}=e,{filename:a=""}=e,{size:u=""}=e,f,d="",p="",m="",_=!1;async function g(){t(2,_=!0);try{t(10,m=await me.getAdminFileToken())}catch(T){console.warn("File token failure:",T)}t(2,_=!1)}function b(){t(5,d="")}const k=T=>{l&&(T.preventDefault(),f==null||f.show(p))};function $(T){se[T?"unshift":"push"](()=>{f=T,t(4,f)})}return n.$$set=T=>{"record"in T&&t(9,r=T.record),"filename"in T&&t(0,a=T.filename),"size"in T&&t(1,u=T.size)},n.$$.update=()=>{n.$$.dirty&4608&&t(11,i=typeof o[r==null?void 0:r.collectionId]<"u"?o[r==null?void 0:r.collectionId]:!0),n.$$.dirty&2048&&(i?g():t(10,m="")),n.$$.dirty&1&&t(3,s=j.getFileType(a)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(s)||a.endsWith(".pdf")),n.$$.dirty&1541&&t(6,p=_?"":me.files.getUrl(r,a,{token:m})),n.$$.dirty&1541&&t(5,d=_?"":me.files.getUrl(r,a,{thumb:"100x100",token:m}))},[a,u,_,s,f,d,p,l,b,r,m,i,o,k,$]}class au extends ve{constructor(e){super(),be(this,e,_M,hM,_e,{record:9,filename:0,size:1})}}function Ip(n,e,t){const i=n.slice();return i[26]=e[t],i[28]=t,i}function Pp(n,e,t){const i=n.slice();i[29]=e[t],i[28]=t;const s=i[1].includes(i[28]);return i[30]=s,i}function gM(n){let e,t,i;function s(){return n[16](n[28])}return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){S(l,e,o),t||(i=[Ee(Ue.call(null,e,"Remove file")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,De(i)}}}function bM(n){let e,t,i;function s(){return n[15](n[28])}return{c(){e=y("button"),e.innerHTML='Restore',h(e,"type","button"),h(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){S(l,e,o),t||(i=J(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,i()}}}function Lp(n,e){let t,i,s,l,o,r,a=e[29]+"",u,f,d,p,m,_,g;s=new au({props:{record:e[2],filename:e[29]}});function b(T,C){return C[0]&18&&(_=null),_==null&&(_=!!T[1].includes(T[28])),_?bM:gM}let k=b(e,[-1,-1]),$=k(e);return{key:n,first:null,c(){t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),r=y("a"),u=U(a),p=E(),m=y("div"),$.c(),x(i,"fade",e[1].includes(e[28])),h(r,"href",f=me.files.getUrl(e[2],e[29])),h(r,"class",d="txt-ellipsis "+(e[30]?"txt-strikethrough txt-hint":"link-primary")),h(r,"title","Download"),h(r,"target","_blank"),h(r,"rel","noopener noreferrer"),h(o,"class","content"),h(m,"class","actions"),h(t,"class","list-item"),this.first=t},m(T,C){S(T,t,C),v(t,i),V(s,i,null),v(t,l),v(t,o),v(o,r),v(r,u),v(t,p),v(t,m),$.m(m,null),g=!0},p(T,C){e=T;const D={};C[0]&4&&(D.record=e[2]),C[0]&16&&(D.filename=e[29]),s.$set(D),(!g||C[0]&18)&&x(i,"fade",e[1].includes(e[28])),(!g||C[0]&16)&&a!==(a=e[29]+"")&&le(u,a),(!g||C[0]&20&&f!==(f=me.files.getUrl(e[2],e[29])))&&h(r,"href",f),(!g||C[0]&18&&d!==(d="txt-ellipsis "+(e[30]?"txt-strikethrough txt-hint":"link-primary")))&&h(r,"class",d),k===(k=b(e,C))&&$?$.p(e,C):($.d(1),$=k(e),$&&($.c(),$.m(m,null)))},i(T){g||(A(s.$$.fragment,T),g=!0)},o(T){P(s.$$.fragment,T),g=!1},d(T){T&&w(t),H(s),$.d()}}}function Np(n){let e,t,i,s,l,o,r,a,u=n[26].name+"",f,d,p,m,_,g,b;i=new tM({props:{file:n[26]}});function k(){return n[17](n[28])}return{c(){e=y("div"),t=y("figure"),z(i.$$.fragment),s=E(),l=y("div"),o=y("small"),o.textContent="New",r=E(),a=y("span"),f=U(u),p=E(),m=y("button"),m.innerHTML='',h(t,"class","thumb"),h(o,"class","label label-success m-r-5"),h(a,"class","txt"),h(l,"class","filename m-r-auto"),h(l,"title",d=n[26].name),h(m,"type","button"),h(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),h(e,"class","list-item")},m($,T){S($,e,T),v(e,t),V(i,t,null),v(e,s),v(e,l),v(l,o),v(l,r),v(l,a),v(a,f),v(e,p),v(e,m),_=!0,g||(b=[Ee(Ue.call(null,m,"Remove file")),J(m,"click",k)],g=!0)},p($,T){n=$;const C={};T[0]&1&&(C.file=n[26]),i.$set(C),(!_||T[0]&1)&&u!==(u=n[26].name+"")&&le(f,u),(!_||T[0]&1&&d!==(d=n[26].name))&&h(l,"title",d)},i($){_||(A(i.$$.fragment,$),_=!0)},o($){P(i.$$.fragment,$),_=!1},d($){$&&w(e),H(i),g=!1,De(b)}}}function vM(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,d=[],p=new Map,m,_,g,b,k,$,T,C,D,M,O,I,L=n[4];const F=Y=>Y[29]+Y[2].id;for(let Y=0;YP(N[Y],1,1,()=>{N[Y]=null});return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("div");for(let Y=0;YDelete`,h(e,"type","button"),h(e,"class","dropdown-item closable"),h(i,"type","button"),h(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[J(e,"click",n[24]),J(i,"click",En(ft(n[25])))],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function op(n){let e,t,i,s;return i=new Bn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[B4]},$$scope:{ctx:n}}}),{c(){e=y("i"),t=E(),z(i.$$.fragment),h(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),V(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||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),H(i,l)}}}function rp(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,d;function p(){return n[27](n[47])}return{c(){e=y("button"),t=y("i"),s=E(),l=y("span"),r=U(o),a=U(" collection"),u=E(),h(t,"class",i=Ei(j.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),h(l,"class","txt"),h(e,"type","button"),h(e,"class","dropdown-item closable"),x(e,"selected",n[47]==n[2].type)},m(m,_){S(m,e,_),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),v(e,u),f||(d=J(e,"click",p),f=!0)},p(m,_){n=m,_[0]&64&&i!==(i=Ei(j.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&h(t,"class",i),_[0]&64&&o!==(o=n[48]+"")&&le(r,o),_[0]&68&&x(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,d()}}}function B4(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s{R=null}),ae()),(!I||Y[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(q[2].$isNew?"btn-outline":"btn-transparent")))&&h(p,"class",C),(!I||Y[0]&4&&D!==(D=!q[2].$isNew))&&(p.disabled=D),q[2].system?N||(N=ap(),N.c(),N.m(O.parentNode,O)):N&&(N.d(1),N=null)},i(q){I||(A(R),I=!0)},o(q){P(R),I=!1},d(q){q&&w(e),q&&w(s),q&&w(l),q&&w(f),q&&w(d),R&&R.d(),q&&w(M),N&&N.d(q),q&&w(O),L=!1,F()}}}function up(n){let e,t,i,s,l,o;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ee(t=Ue.call(null,e,n[11])),l=!0)},p(r,a){t&&Ut(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&nt(()=>{s&&(i||(i=Ve(e,Bt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=Ve(e,Bt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function fp(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function cp(n){var a,u,f;let e,t,i,s=!j.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&&dp();return{c(){e=y("button"),t=y("span"),t.textContent="Options",i=E(),r&&r.c(),h(t,"class","txt"),h(e,"type","button"),h(e,"class","tab-item"),x(e,"active",n[3]===Is)},m(d,p){S(d,e,p),v(e,t),v(e,i),r&&r.m(e,null),l||(o=J(e,"click",n[31]),l=!0)},p(d,p){var m,_,g;p[0]&32&&(s=!j.isEmpty((m=d[5])==null?void 0:m.options)&&!((g=(_=d[5])==null?void 0:_.options)!=null&&g.manageRule)),s?r?p[0]&32&&A(r,1):(r=dp(),r.c(),A(r,1),r.m(e,null)):r&&(re(),P(r,1,1,()=>{r=null}),ae()),p[0]&8&&x(e,"active",d[3]===Is)},d(d){d&&w(e),r&&r.d(),l=!1,o()}}}function dp(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function W4(n){var B,Z,ee,ie,X,fe,G,ce;let e,t=n[2].$isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,d,p,m,_=(B=n[2])!=null&&B.$isView?"Query":"Fields",g,b,k=!j.isEmpty(n[11]),$,T,C,D,M=!j.isEmpty((Z=n[5])==null?void 0:Z.listRule)||!j.isEmpty((ee=n[5])==null?void 0:ee.viewRule)||!j.isEmpty((ie=n[5])==null?void 0:ie.createRule)||!j.isEmpty((X=n[5])==null?void 0:X.updateRule)||!j.isEmpty((fe=n[5])==null?void 0:fe.deleteRule)||!j.isEmpty((ce=(G=n[5])==null?void 0:G.options)==null?void 0:ce.manageRule),O,I,L,F,R=!n[2].$isNew&&!n[2].system&&lp(n);r=new de({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[U4,({uniqueId:ge})=>({46:ge}),({uniqueId:ge})=>[0,ge?32768:0]]},$$scope:{ctx:n}}});let N=k&&up(n),q=M&&fp(),Y=n[2].$isAuth&&cp(n);return{c(){e=y("h4"),i=U(t),s=E(),R&&R.c(),l=E(),o=y("form"),z(r.$$.fragment),a=E(),u=y("input"),f=E(),d=y("div"),p=y("button"),m=y("span"),g=U(_),b=E(),N&&N.c(),$=E(),T=y("button"),C=y("span"),C.textContent="API Rules",D=E(),q&&q.c(),O=E(),Y&&Y.c(),h(e,"class","upsert-panel-title svelte-12y0yzb"),h(u,"type","submit"),h(u,"class","hidden"),h(u,"tabindex","-1"),h(o,"class","block"),h(m,"class","txt"),h(p,"type","button"),h(p,"class","tab-item"),x(p,"active",n[3]===Mi),h(C,"class","txt"),h(T,"type","button"),h(T,"class","tab-item"),x(T,"active",n[3]===wl),h(d,"class","tabs-header stretched")},m(ge,Me){S(ge,e,Me),v(e,i),S(ge,s,Me),R&&R.m(ge,Me),S(ge,l,Me),S(ge,o,Me),V(r,o,null),v(o,a),v(o,u),S(ge,f,Me),S(ge,d,Me),v(d,p),v(p,m),v(m,g),v(p,b),N&&N.m(p,null),v(d,$),v(d,T),v(T,C),v(T,D),q&&q.m(T,null),v(d,O),Y&&Y.m(d,null),I=!0,L||(F=[J(o,"submit",ft(n[28])),J(p,"click",n[29]),J(T,"click",n[30])],L=!0)},p(ge,Me){var He,we,Ce,Je,mt,Ze,We,te;(!I||Me[0]&4)&&t!==(t=ge[2].$isNew?"New collection":"Edit collection")&&le(i,t),!ge[2].$isNew&&!ge[2].system?R?(R.p(ge,Me),Me[0]&4&&A(R,1)):(R=lp(ge),R.c(),A(R,1),R.m(l.parentNode,l)):R&&(re(),P(R,1,1,()=>{R=null}),ae());const qe={};Me[0]&8192&&(qe.class="form-field collection-field-name required m-b-0 "+(ge[13]?"disabled":"")),Me[0]&8260|Me[1]&1081344&&(qe.$$scope={dirty:Me,ctx:ge}),r.$set(qe),(!I||Me[0]&4)&&_!==(_=(He=ge[2])!=null&&He.$isView?"Query":"Fields")&&le(g,_),Me[0]&2048&&(k=!j.isEmpty(ge[11])),k?N?(N.p(ge,Me),Me[0]&2048&&A(N,1)):(N=up(ge),N.c(),A(N,1),N.m(p,null)):N&&(re(),P(N,1,1,()=>{N=null}),ae()),(!I||Me[0]&8)&&x(p,"active",ge[3]===Mi),Me[0]&32&&(M=!j.isEmpty((we=ge[5])==null?void 0:we.listRule)||!j.isEmpty((Ce=ge[5])==null?void 0:Ce.viewRule)||!j.isEmpty((Je=ge[5])==null?void 0:Je.createRule)||!j.isEmpty((mt=ge[5])==null?void 0:mt.updateRule)||!j.isEmpty((Ze=ge[5])==null?void 0:Ze.deleteRule)||!j.isEmpty((te=(We=ge[5])==null?void 0:We.options)==null?void 0:te.manageRule)),M?q?Me[0]&32&&A(q,1):(q=fp(),q.c(),A(q,1),q.m(T,null)):q&&(re(),P(q,1,1,()=>{q=null}),ae()),(!I||Me[0]&8)&&x(T,"active",ge[3]===wl),ge[2].$isAuth?Y?Y.p(ge,Me):(Y=cp(ge),Y.c(),Y.m(d,null)):Y&&(Y.d(1),Y=null)},i(ge){I||(A(R),A(r.$$.fragment,ge),A(N),A(q),I=!0)},o(ge){P(R),P(r.$$.fragment,ge),P(N),P(q),I=!1},d(ge){ge&&w(e),ge&&w(s),R&&R.d(ge),ge&&w(l),ge&&w(o),H(r),ge&&w(f),ge&&w(d),N&&N.d(),q&&q.d(),Y&&Y.d(),L=!1,De(F)}}}function Y4(n){let e,t,i,s,l,o=n[2].$isNew?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),r=U(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[9],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],x(s,"btn-loading",n[9])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(l,r),u||(f=[J(e,"click",n[22]),J(s,"click",n[23])],u=!0)},p(d,p){p[0]&512&&(e.disabled=d[9]),p[0]&4&&o!==(o=d[2].$isNew?"Create":"Save changes")&&le(r,o),p[0]&4608&&a!==(a=!d[12]||d[9])&&(s.disabled=a),p[0]&512&&x(s,"btn-loading",d[9])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function K4(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[36],$$slots:{footer:[Y4],header:[W4],default:[H4]},$$scope:{ctx:n}};e=new pn({props:l}),n[37](e),e.$on("hide",n[38]),e.$on("show",n[39]);let o={};return i=new q4({props:o}),n[40](i),i.$on("confirm",n[41]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){V(e,r,a),S(r,t,a),V(i,r,a),s=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[36]),a[0]&14956|a[1]&1048576&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[37](null),H(e,r),r&&w(t),n[40](null),H(i,r)}}}const Mi="schema",wl="api_rules",Is="options",J4="base",pp="auth",mp="view";function Pr(n){return JSON.stringify(n)}function Z4(n,e,t){let i,s,l,o;Ke(n,gi,te=>t(5,o=te));const r={};r[J4]="Base",r[mp]="View",r[pp]="Auth";const a=kt();let u,f,d=null,p=new kn,m=!1,_=!1,g=Mi,b=Pr(p),k="";function $(te){t(3,g=te)}function T(te){return D(te),t(10,_=!0),$(Mi),u==null?void 0:u.show()}function C(){return u==null?void 0:u.hide()}async function D(te){dn({}),typeof te<"u"?(t(20,d=te),t(2,p=te.$clone())):(t(20,d=null),t(2,p=new kn)),t(2,p.schema=p.schema||[],p),t(2,p.originalName=p.name||"",p),await ln(),t(21,b=Pr(p))}function M(){p.$isNew?O():f==null||f.show(d,p)}function O(){if(m)return;t(9,m=!0);const te=I();let Fe;p.$isNew?Fe=me.collections.create(te):Fe=me.collections.update(p.id,te),Fe.then(Qe=>{Ea(),d$(Qe),t(10,_=!1),C(),Jt(p.$isNew?"Successfully created collection.":"Successfully updated collection."),a("save",{isNew:p.$isNew,collection:Qe})}).catch(Qe=>{me.errorResponseHandler(Qe)}).finally(()=>{t(9,m=!1)})}function I(){const te=p.$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 L(){d!=null&&d.id&&vn(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>me.collections.delete(d==null?void 0:d.id).then(()=>{C(),Jt(`Successfully deleted collection "${d==null?void 0:d.name}".`),a("delete",d),p$(d)}).catch(te=>{me.errorResponseHandler(te)}))}function F(te){t(2,p.type=te,p),Ai("schema")}function R(){s?vn("You have unsaved changes. Do you really want to discard them?",()=>{N()}):N()}async function N(){const te=d==null?void 0:d.$clone();if(te){if(te.id="",te.created="",te.updated="",te.name+="_duplicate",!j.isEmpty(te.schema))for(const Fe of te.schema)Fe.id="";if(!j.isEmpty(te.indexes))for(let Fe=0;FeC(),Y=()=>M(),B=()=>R(),Z=()=>L(),ee=te=>{t(2,p.name=j.slugify(te.target.value),p),te.target.value=p.name},ie=te=>F(te),X=()=>{l&&M()},fe=()=>$(Mi),G=()=>$(wl),ce=()=>$(Is);function ge(te){p=te,t(2,p),t(20,d)}function Me(te){p=te,t(2,p),t(20,d)}function qe(te){p=te,t(2,p),t(20,d)}function He(te){p=te,t(2,p),t(20,d)}const we=()=>s&&_?(vn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),C()}),!1):!0;function Ce(te){se[te?"unshift":"push"](()=>{u=te,t(7,u)})}function Je(te){pe.call(this,n,te)}function mt(te){pe.call(this,n,te)}function Ze(te){se[te?"unshift":"push"](()=>{f=te,t(8,f)})}const We=()=>O();return n.$$.update=()=>{var te,Fe;n.$$.dirty[0]&32&&(o.schema||(te=o.options)!=null&&te.query?t(11,k=j.getNestedVal(o,"schema.message")||"Has errors"):t(11,k="")),n.$$.dirty[0]&4&&p.type===mp&&(t(2,p.createRule=null,p),t(2,p.updateRule=null,p),t(2,p.deleteRule=null,p),t(2,p.indexes=[],p)),n.$$.dirty[0]&1048580&&p!=null&&p.name&&(d==null?void 0:d.name)!=(p==null?void 0:p.name)&&t(2,p.indexes=(Fe=p.indexes)==null?void 0:Fe.map(Qe=>j.replaceIndexTableName(Qe,p.name)),p),n.$$.dirty[0]&4&&t(13,i=!p.$isNew&&p.system),n.$$.dirty[0]&2097156&&t(4,s=b!=Pr(p)),n.$$.dirty[0]&20&&t(12,l=p.$isNew||s),n.$$.dirty[0]&12&&g===Is&&p.type!==pp&&$(Mi)},[$,C,p,g,s,o,r,u,f,m,_,k,l,i,M,O,L,F,R,T,d,b,q,Y,B,Z,ee,ie,X,fe,G,ce,ge,Me,qe,He,we,Ce,Je,mt,Ze,We]}class ru extends ve{constructor(e){super(),be(this,e,Z4,K4,_e,{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 hp(n,e,t){const i=n.slice();return i[15]=e[t],i}function _p(n){let e,t=n[1].length&&gp();return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1].length?t||(t=gp(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function gp(n){let e;return{c(){e=y("p"),e.textContent="No collections found.",h(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 bp(n,e){let t,i,s,l,o,r=e[15].name+"",a,u,f,d,p;return{key:n,first:null,c(){var m;t=y("a"),i=y("i"),l=E(),o=y("span"),a=U(r),u=E(),h(i,"class",s=j.getCollectionTypeIcon(e[15].type)),h(o,"class","txt"),h(t,"href",f="/collections?collectionId="+e[15].id),h(t,"class","sidebar-list-item"),x(t,"active",((m=e[5])==null?void 0:m.id)===e[15].id),this.first=t},m(m,_){S(m,t,_),v(t,i),v(t,l),v(t,o),v(o,a),v(t,u),d||(p=Ee(an.call(null,t)),d=!0)},p(m,_){var g;e=m,_&8&&s!==(s=j.getCollectionTypeIcon(e[15].type))&&h(i,"class",s),_&8&&r!==(r=e[15].name+"")&&le(a,r),_&8&&f!==(f="/collections?collectionId="+e[15].id)&&h(t,"href",f),_&40&&x(t,"active",((g=e[5])==null?void 0:g.id)===e[15].id)},d(m){m&&w(t),d=!1,p()}}}function vp(n){let e,t,i,s;return{c(){e=y("footer"),t=y("button"),t.innerHTML=` + New collection`,h(t,"type","button"),h(t,"class","btn btn-block btn-outline"),h(e,"class","sidebar-footer")},m(l,o){S(l,e,o),v(e,t),i||(s=J(t,"click",n[12]),i=!0)},p:Q,d(l){l&&w(e),i=!1,s()}}}function G4(n){let e,t,i,s,l,o,r,a,u,f,d,p=[],m=new Map,_,g,b,k,$,T,C=n[3];const D=L=>L[15].id;for(let L=0;L',o=E(),r=y("input"),a=E(),u=y("hr"),f=E(),d=y("div");for(let L=0;L20),h(e,"class","page-sidebar collection-sidebar")},m(L,F){S(L,e,F),v(e,t),v(t,i),v(i,s),v(s,l),v(i,o),v(i,r),ue(r,n[0]),v(e,a),v(e,u),v(e,f),v(e,d);for(let R=0;R20),L[7]?O&&(O.d(1),O=null):O?O.p(L,F):(O=vp(L),O.c(),O.m(e,null));const R={};b.$set(R)},i(L){k||(A(b.$$.fragment,L),k=!0)},o(L){P(b.$$.fragment,L),k=!1},d(L){L&&w(e);for(let F=0;F{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function Q4(n,e,t){let i,s,l,o,r,a,u;Ke(n,_i,$=>t(5,o=$)),Ke(n,si,$=>t(9,r=$)),Ke(n,No,$=>t(6,a=$)),Ke(n,Os,$=>t(7,u=$));let f,d="";function p($){sn(_i,o=$,o)}const m=()=>t(0,d="");function _(){d=this.value,t(0,d)}const g=()=>f==null?void 0:f.show();function b($){se[$?"unshift":"push"](()=>{f=$,t(2,f)})}const k=$=>{var T;(T=$.detail)!=null&&T.isNew&&$.detail.collection&&p($.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&X4(),n.$$.dirty&1&&t(1,i=d.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=d!==""),n.$$.dirty&515&&t(3,l=r.filter($=>$.id==d||$.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[d,i,f,l,s,o,a,u,p,r,m,_,g,b,k]}class x4 extends ve{constructor(e){super(),be(this,e,Q4,G4,_e,{})}}function yp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function kp(n){n[18]=n[19].default}function wp(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=y("hr"),h(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function $p(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,d=i&&Sp();function p(){return e[9](e[14])}return{key:n,first:null,c(){t=Se(),d&&d.c(),s=E(),l=y("button"),r=U(o),a=E(),h(l,"type","button"),h(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(m,_){S(m,t,_),d&&d.m(m,_),S(m,s,_),S(m,l,_),v(l,r),v(l,a),u||(f=J(l,"click",p),u=!0)},p(m,_){e=m,_&8&&(i=e[21]===Object.keys(e[6]).length),i?d||(d=Sp(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),_&8&&o!==(o=e[15].label+"")&&le(r,o),_&40&&x(l,"active",e[5]===e[14])},d(m){m&&w(t),d&&d.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function Tp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:n5,then:t5,catch:e5,value:19,blocks:[,,,]};return pu(t=n[15].component,s),{c(){e=Se(),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)&&pu(t,s)||Rb(s,n,o)},i(l){i||(A(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 e5(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function t5(n){kp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){z(e.$$.fragment),t=E()},m(s,l){V(e,s,l),S(s,t,l),i=!0},p(s,l){kp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){P(e.$$.fragment,s),i=!1},d(s){H(e,s),s&&w(t)}}}function n5(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Cp(n,e){let t,i,s,l=e[5]===e[14]&&Tp(e);return{key:n,first:null,c(){t=Se(),l&&l.c(),i=Se(),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&&A(l,1)):(l=Tp(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(A(l),s=!0)},o(o){P(l),s=!1},d(o){o&&w(t),l&&l.d(o),o&&w(i)}}}function i5(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,d=Object.entries(n[3]);const p=g=>g[14];for(let g=0;gg[14];for(let g=0;gClose',h(e,"type","button"),h(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[8]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function l5(n){let e,t,i={class:"docs-panel",$$slots:{footer:[s5],default:[i5]},$$scope:{ctx:n}};return e=new pn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function o5(n,e,t){const i={list:{label:"List/Search",component:rt(()=>import("./ListApiDocs-c17b41f3.js"),["./ListApiDocs-c17b41f3.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:rt(()=>import("./ViewApiDocs-e9c275a8.js"),["./ViewApiDocs-e9c275a8.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},create:{label:"Create",component:rt(()=>import("./CreateApiDocs-17994c62.js"),["./CreateApiDocs-17994c62.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},update:{label:"Update",component:rt(()=>import("./UpdateApiDocs-ede3b5de.js"),["./UpdateApiDocs-ede3b5de.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},delete:{label:"Delete",component:rt(()=>import("./DeleteApiDocs-ec495d28.js"),["./DeleteApiDocs-ec495d28.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:rt(()=>import("./RealtimeApiDocs-889519a5.js"),["./RealtimeApiDocs-889519a5.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:rt(()=>import("./AuthWithPasswordDocs-0a891eec.js"),["./AuthWithPasswordDocs-0a891eec.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:rt(()=>import("./AuthWithOAuth2Docs-a9549379.js"),["./AuthWithOAuth2Docs-a9549379.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},refresh:{label:"Auth refresh",component:rt(()=>import("./AuthRefreshDocs-044488a5.js"),["./AuthRefreshDocs-044488a5.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-verification":{label:"Request verification",component:rt(()=>import("./RequestVerificationDocs-a0cadc33.js"),["./RequestVerificationDocs-a0cadc33.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:rt(()=>import("./ConfirmVerificationDocs-2c3a2637.js"),["./ConfirmVerificationDocs-2c3a2637.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:rt(()=>import("./RequestPasswordResetDocs-47c14851.js"),["./RequestPasswordResetDocs-47c14851.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:rt(()=>import("./ConfirmPasswordResetDocs-b73e2d36.js"),["./ConfirmPasswordResetDocs-b73e2d36.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:rt(()=>import("./RequestEmailChangeDocs-255e4d9a.js"),["./RequestEmailChangeDocs-255e4d9a.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:rt(()=>import("./ConfirmEmailChangeDocs-aeccb441.js"),["./ConfirmEmailChangeDocs-aeccb441.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:rt(()=>import("./AuthMethodsDocs-f25f00e8.js"),["./AuthMethodsDocs-f25f00e8.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:rt(()=>import("./ListExternalAuthsDocs-57438e41.js"),["./ListExternalAuthsDocs-57438e41.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:rt(()=>import("./UnlinkExternalAuthDocs-6ea2668d.js"),["./UnlinkExternalAuthDocs-6ea2668d.js","./SdkTabs-ea1c7c68.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o=new kn,r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),d(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function d(k){t(5,r=k)}const p=()=>f(),m=k=>d(k);function _(k){se[k?"unshift":"push"](()=>{l=k,t(4,l)})}function g(k){pe.call(this,n,k)}function b(k){pe.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,d,o,a,l,r,i,u,p,m,_,g,b]}class r5 extends ve{constructor(e){super(),be(this,e,o5,l5,_e,{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 a5(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Username",o=E(),r=y("input"),h(t,"class",j.getFieldTypeIcon("user")),h(s,"class","txt"),h(e,"for",l=n[12]),h(r,"type","text"),h(r,"requried",a=!n[0].$isNew),h(r,"placeholder",u=n[0].$isNew?"Leave empty to auto generate...":n[3]),h(r,"id",f=n[12])},m(m,_){S(m,e,_),v(e,t),v(e,i),v(e,s),S(m,o,_),S(m,r,_),ue(r,n[0].username),d||(p=J(r,"input",n[4]),d=!0)},p(m,_){_&4096&&l!==(l=m[12])&&h(e,"for",l),_&1&&a!==(a=!m[0].$isNew)&&h(r,"requried",a),_&1&&u!==(u=m[0].$isNew?"Leave empty to auto generate...":m[3])&&h(r,"placeholder",u),_&4096&&f!==(f=m[12])&&h(r,"id",f),_&1&&r.value!==m[0].username&&ue(r,m[0].username)},d(m){m&&w(e),m&&w(o),m&&w(r),d=!1,p()}}}function u5(n){let e,t,i,s,l,o,r,a,u,f,d=n[0].emailVisibility?"On":"Off",p,m,_,g,b,k,$,T,C;return{c(){var D;e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Email",o=E(),r=y("div"),a=y("button"),u=y("span"),f=U("Public: "),p=U(d),_=E(),g=y("input"),h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[12]),h(u,"class","txt"),h(a,"type","button"),h(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),h(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),h(g,"type","email"),g.autofocus=b=n[0].$isNew,h(g,"autocomplete","off"),h(g,"id",k=n[12]),g.required=$=(D=n[1].options)==null?void 0:D.requireEmail,h(g,"class","svelte-1751a4d")},m(D,M){S(D,e,M),v(e,t),v(e,i),v(e,s),S(D,o,M),S(D,r,M),v(r,a),v(a,u),v(u,f),v(u,p),S(D,_,M),S(D,g,M),ue(g,n[0].email),n[0].$isNew&&g.focus(),T||(C=[Ee(Ue.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",n[5]),J(g,"input",n[6])],T=!0)},p(D,M){var O;M&4096&&l!==(l=D[12])&&h(e,"for",l),M&1&&d!==(d=D[0].emailVisibility?"On":"Off")&&le(p,d),M&1&&m!==(m="btn btn-sm btn-transparent "+(D[0].emailVisibility?"btn-success":"btn-hint"))&&h(a,"class",m),M&1&&b!==(b=D[0].$isNew)&&(g.autofocus=b),M&4096&&k!==(k=D[12])&&h(g,"id",k),M&2&&$!==($=(O=D[1].options)==null?void 0:O.requireEmail)&&(g.required=$),M&1&&g.value!==D[0].email&&ue(g,D[0].email)},d(D){D&&w(e),D&&w(o),D&&w(r),D&&w(_),D&&w(g),T=!1,De(C)}}}function Mp(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[f5,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&12292&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f5(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[2],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[7]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&4&&(e.checked=u[2]),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Op(n){let e,t,i,s,l,o,r,a,u;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[c5,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[d5,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),x(t,"p-t-xs",n[2]),h(e,"class","block")},m(f,d){S(f,e,d),v(e,t),v(t,i),V(s,i,null),v(t,l),v(t,o),V(r,o,null),u=!0},p(f,d){const p={};d&12289&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d&12289&&(m.$$scope={dirty:d,ctx:f}),r.$set(m),(!u||d&4)&&x(t,"p-t-xs",f[2])},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&nt(()=>{u&&(a||(a=Ve(e,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Ve(e,wt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),H(s),H(r),f&&a&&a.end()}}}function c5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[12]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[12]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[0].password),u||(f=J(r,"input",n[8]),u=!0)},p(d,p){p&4096&&l!==(l=d[12])&&h(e,"for",l),p&4096&&a!==(a=d[12])&&h(r,"id",a),p&1&&r.value!==d[0].password&&ue(r,d[0].password)},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function d5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password confirm",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[12]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[12]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[0].passwordConfirm),u||(f=J(r,"input",n[9]),u=!0)},p(d,p){p&4096&&l!==(l=d[12])&&h(e,"for",l),p&4096&&a!==(a=d[12])&&h(r,"id",a),p&1&&r.value!==d[0].passwordConfirm&&ue(r,d[0].passwordConfirm)},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function p5(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Verified"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(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),v(s,l),r||(a=[J(e,"change",n[10]),J(e,"change",ft(n[11]))],r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].verified),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,De(a)}}}function m5(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,m;i=new de({props:{class:"form-field "+(n[0].$isNew?"":"required"),name:"username",$$slots:{default:[a5,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+((b=n[1].options)!=null&&b.requireEmail?"required":""),name:"email",$$slots:{default:[u5,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}});let _=!n[0].$isNew&&Mp(n),g=(n[0].$isNew||n[2])&&Op(n);return p=new de({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[p5,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),_&&_.c(),u=E(),g&&g.c(),f=E(),d=y("div"),z(p.$$.fragment),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(a,"class","col-lg-12"),h(d,"class","col-lg-12"),h(e,"class","grid m-b-base")},m(k,$){S(k,e,$),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),_&&_.m(a,null),v(a,u),g&&g.m(a,null),v(e,f),v(e,d),V(p,d,null),m=!0},p(k,[$]){var M;const T={};$&1&&(T.class="form-field "+(k[0].$isNew?"":"required")),$&12289&&(T.$$scope={dirty:$,ctx:k}),i.$set(T);const C={};$&2&&(C.class="form-field "+((M=k[1].options)!=null&&M.requireEmail?"required":"")),$&12291&&(C.$$scope={dirty:$,ctx:k}),o.$set(C),k[0].$isNew?_&&(re(),P(_,1,1,()=>{_=null}),ae()):_?(_.p(k,$),$&1&&A(_,1)):(_=Mp(k),_.c(),A(_,1),_.m(a,u)),k[0].$isNew||k[2]?g?(g.p(k,$),$&5&&A(g,1)):(g=Op(k),g.c(),A(g,1),g.m(a,null)):g&&(re(),P(g,1,1,()=>{g=null}),ae());const D={};$&12289&&(D.$$scope={dirty:$,ctx:k}),p.$set(D)},i(k){m||(A(i.$$.fragment,k),A(o.$$.fragment,k),A(_),A(g),A(p.$$.fragment,k),m=!0)},o(k){P(i.$$.fragment,k),P(o.$$.fragment,k),P(_),P(g),P(p.$$.fragment,k),m=!1},d(k){k&&w(e),H(i),H(o),_&&_.d(),g&&g.d(),H(p)}}}function h5(n,e,t){let{collection:i=new kn}=e,{record:s=new pi}=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 d(){s.password=this.value,t(0,s),t(2,o)}function p(){s.passwordConfirm=this.value,t(0,s),t(2,o)}function m(){s.verified=this.checked,t(0,s),t(2,o)}const _=g=>{s.$isNew||vn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,s.verified=!g.target.checked,s)})};return n.$$set=g=>{"collection"in g&&t(1,i=g.collection),"record"in g&&t(0,s=g.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),Ai("password"),Ai("passwordConfirm")))},[s,i,o,l,r,a,u,f,d,p,m,_]}class _5 extends ve{constructor(e){super(),be(this,e,h5,m5,_e,{collection:1,record:0})}}function g5(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 _=r.closest("form");_!=null&&_.requestSubmit&&_.requestSubmit()}}xt(()=>(u(),()=>clearTimeout(a)));function d(m){se[m?"unshift":"push"](()=>{r=m,t(1,r)})}function p(){l=this.value,t(0,l)}return n.$$set=m=>{e=Re(Re({},e),Yt(m)),t(3,s=Xe(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,d,p]}class v5 extends ve{constructor(e){super(),be(this,e,b5,g5,_e,{value:0,maxHeight:4})}}function y5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p;function m(g){n[2](g)}let _={id:n[3],required:n[1].required};return n[0]!==void 0&&(_.value=n[0]),f=new v5({props:_}),se.push(()=>he(f,"value",m)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),z(f.$$.fragment),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3])},m(g,b){S(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(g,u,b),V(f,g,b),p=!0},p(g,b){(!p||b&2&&i!==(i=j.getFieldTypeIcon(g[1].type)))&&h(t,"class",i),(!p||b&2)&&o!==(o=g[1].name+"")&&le(r,o),(!p||b&8&&a!==(a=g[3]))&&h(e,"for",a);const k={};b&8&&(k.id=g[3]),b&2&&(k.required=g[1].required),!d&&b&1&&(d=!0,k.value=g[0],ke(()=>d=!1)),f.$set(k)},i(g){p||(A(f.$$.fragment,g),p=!0)},o(g){P(f.$$.fragment,g),p=!1},d(g){g&&w(e),g&&w(u),H(f,g)}}}function k5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[y5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function w5(n,e,t){let{field:i=new wn}=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 S5 extends ve{constructor(e){super(),be(this,e,w5,k5,_e,{field:1,value:0})}}function $5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_,g,b;return{c(){var k,$;e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("input"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","number"),h(f,"id",d=n[3]),f.required=p=n[1].required,h(f,"min",m=(k=n[1].options)==null?void 0:k.min),h(f,"max",_=($=n[1].options)==null?void 0:$.max),h(f,"step","any")},m(k,$){S(k,e,$),v(e,t),v(e,s),v(e,l),v(l,r),S(k,u,$),S(k,f,$),ue(f,n[0]),g||(b=J(f,"input",n[2]),g=!0)},p(k,$){var T,C;$&2&&i!==(i=j.getFieldTypeIcon(k[1].type))&&h(t,"class",i),$&2&&o!==(o=k[1].name+"")&&le(r,o),$&8&&a!==(a=k[3])&&h(e,"for",a),$&8&&d!==(d=k[3])&&h(f,"id",d),$&2&&p!==(p=k[1].required)&&(f.required=p),$&2&&m!==(m=(T=k[1].options)==null?void 0:T.min)&&h(f,"min",m),$&2&&_!==(_=(C=k[1].options)==null?void 0:C.max)&&h(f,"max",_),$&1&&_t(f.value)!==k[0]&&ue(f,k[0])},d(k){k&&w(e),k&&w(u),k&&w(f),g=!1,b()}}}function T5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function C5(n,e,t){let{field:i=new wn}=e,{value:s=void 0}=e;function l(){s=_t(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 M5 extends ve{constructor(e){super(),be(this,e,C5,T5,_e,{field:1,value:0})}}function O5(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=y("input"),i=E(),s=y("label"),o=U(l),h(e,"type","checkbox"),h(e,"id",t=n[3]),h(s,"for",r=n[3])},m(f,d){S(f,e,d),e.checked=n[0],S(f,i,d),S(f,s,d),v(s,o),a||(u=J(e,"change",n[2]),a=!0)},p(f,d){d&8&&t!==(t=f[3])&&h(e,"id",t),d&1&&(e.checked=f[0]),d&2&&l!==(l=f[1].name+"")&&le(o,l),d&8&&r!==(r=f[3])&&h(s,"for",r)},d(f){f&&w(e),f&&w(i),f&&w(s),a=!1,u()}}}function D5(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[O5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function E5(n,e,t){let{field:i=new wn}=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 A5 extends ve{constructor(e){super(),be(this,e,E5,D5,_e,{field:1,value:0})}}function I5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("input"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","email"),h(f,"id",d=n[3]),f.required=p=n[1].required},m(g,b){S(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(g,u,b),S(g,f,b),ue(f,n[0]),m||(_=J(f,"input",n[2]),m=!0)},p(g,b){b&2&&i!==(i=j.getFieldTypeIcon(g[1].type))&&h(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&8&&a!==(a=g[3])&&h(e,"for",a),b&8&&d!==(d=g[3])&&h(f,"id",d),b&2&&p!==(p=g[1].required)&&(f.required=p),b&1&&f.value!==g[0]&&ue(f,g[0])},d(g){g&&w(e),g&&w(u),g&&w(f),m=!1,_()}}}function P5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[I5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function L5(n,e,t){let{field:i=new wn}=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 N5 extends ve{constructor(e){super(),be(this,e,L5,P5,_e,{field:1,value:0})}}function F5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("input"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","url"),h(f,"id",d=n[3]),f.required=p=n[1].required},m(g,b){S(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(g,u,b),S(g,f,b),ue(f,n[0]),m||(_=J(f,"input",n[2]),m=!0)},p(g,b){b&2&&i!==(i=j.getFieldTypeIcon(g[1].type))&&h(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&8&&a!==(a=g[3])&&h(e,"for",a),b&8&&d!==(d=g[3])&&h(f,"id",d),b&2&&p!==(p=g[1].required)&&(f.required=p),b&1&&f.value!==g[0]&&ue(f,g[0])},d(g){g&&w(e),g&&w(u),g&&w(f),m=!1,_()}}}function R5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[F5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function q5(n,e,t){let{field:i=new wn}=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 j5 extends ve{constructor(e){super(),be(this,e,q5,R5,_e,{field:1,value:0})}}function Dp(n){let e,t,i,s;return{c(){e=y("div"),t=y("button"),t.innerHTML='',h(t,"type","button"),h(t,"class","link-hint clear-btn svelte-11df51y"),h(e,"class","form-field-addon")},m(l,o){S(l,e,o),v(e,t),i||(s=[Ee(Ue.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:Q,d(l){l&&w(e),i=!1,De(s)}}}function V5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_,g,b=n[0]&&!n[1].required&&Dp(n);function k(C){n[6](C)}function $(C){n[7](C)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),p=new lu({props:T}),se.push(()=>he(p,"value",k)),se.push(()=>he(p,"formattedValue",$)),p.$on("close",n[3]),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),a=U(" (UTC)"),f=E(),b&&b.c(),d=E(),z(p.$$.fragment),h(t,"class",i=Ei(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),h(l,"class","txt"),h(e,"for",u=n[8])},m(C,D){S(C,e,D),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),S(C,f,D),b&&b.m(C,D),S(C,d,D),V(p,C,D),g=!0},p(C,D){(!g||D&2&&i!==(i=Ei(j.getFieldTypeIcon(C[1].type))+" svelte-11df51y"))&&h(t,"class",i),(!g||D&2)&&o!==(o=C[1].name+"")&&le(r,o),(!g||D&256&&u!==(u=C[8]))&&h(e,"for",u),C[0]&&!C[1].required?b?b.p(C,D):(b=Dp(C),b.c(),b.m(d.parentNode,d)):b&&(b.d(1),b=null);const M={};D&256&&(M.id=C[8]),!m&&D&4&&(m=!0,M.value=C[2],ke(()=>m=!1)),!_&&D&1&&(_=!0,M.formattedValue=C[0],ke(()=>_=!1)),p.$set(M)},i(C){g||(A(p.$$.fragment,C),g=!0)},o(C){P(p.$$.fragment,C),g=!1},d(C){C&&w(e),C&&w(f),b&&b.d(C),C&&w(d),H(p,C)}}}function H5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[V5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function z5(n,e,t){let{field:i=new wn}=e,{value:s=void 0}=e,l=s;function o(d){d.detail&&d.detail.length==3&&t(0,s=d.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(d){l=d,t(2,l),t(0,s)}function f(d){s=d,t(0,s)}return n.$$set=d=>{"field"in d&&t(1,i=d.field),"value"in d&&t(0,s=d.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 B5 extends ve{constructor(e){super(),be(this,e,z5,H5,_e,{field:1,value:0})}}function Ep(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=y("div"),t=U("Select up to "),s=U(i),l=U(" items."),h(e,"class","help-block")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&w(e)}}}function U5(n){var $,T,C,D,M;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;function g(O){n[3](O)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||(($=n[0])==null?void 0:$.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:(C=n[1].options)==null?void 0:C.values,searchable:((D=n[1].options)==null?void 0:D.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new ou({props:b}),se.push(()=>he(f,"selected",g));let k=((M=n[1].options)==null?void 0:M.maxSelect)>1&&Ep(n);return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),z(f.$$.fragment),p=E(),k&&k.c(),m=Se(),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[4])},m(O,I){S(O,e,I),v(e,t),v(e,s),v(e,l),v(l,r),S(O,u,I),V(f,O,I),S(O,p,I),k&&k.m(O,I),S(O,m,I),_=!0},p(O,I){var F,R,N,q,Y;(!_||I&2&&i!==(i=j.getFieldTypeIcon(O[1].type)))&&h(t,"class",i),(!_||I&2)&&o!==(o=O[1].name+"")&&le(r,o),(!_||I&16&&a!==(a=O[4]))&&h(e,"for",a);const L={};I&16&&(L.id=O[4]),I&6&&(L.toggle=!O[1].required||O[2]),I&4&&(L.multiple=O[2]),I&7&&(L.closable=!O[2]||((F=O[0])==null?void 0:F.length)>=((R=O[1].options)==null?void 0:R.maxSelect)),I&2&&(L.items=(N=O[1].options)==null?void 0:N.values),I&2&&(L.searchable=((q=O[1].options)==null?void 0:q.values)>5),!d&&I&1&&(d=!0,L.selected=O[0],ke(()=>d=!1)),f.$set(L),((Y=O[1].options)==null?void 0:Y.maxSelect)>1?k?k.p(O,I):(k=Ep(O),k.c(),k.m(m.parentNode,m)):k&&(k.d(1),k=null)},i(O){_||(A(f.$$.fragment,O),_=!0)},o(O){P(f.$$.fragment,O),_=!1},d(O){O&&w(e),O&&w(u),H(f,O),O&&w(p),k&&k.d(O),O&&w(m)}}}function W5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[U5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Y5(n,e,t){let i,{field:s=new wn}=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 K5 extends ve{constructor(e){super(),be(this,e,Y5,W5,_e,{field:1,value:0})}}function J5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("textarea"),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[4]),h(f,"id",d=n[4]),h(f,"class","txt-mono"),f.required=p=n[1].required,f.value=n[2]},m(g,b){S(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(g,u,b),S(g,f,b),m||(_=J(f,"input",n[3]),m=!0)},p(g,b){b&2&&i!==(i=j.getFieldTypeIcon(g[1].type))&&h(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&16&&a!==(a=g[4])&&h(e,"for",a),b&16&&d!==(d=g[4])&&h(f,"id",d),b&2&&p!==(p=g[1].required)&&(f.required=p),b&4&&(f.value=g[2])},d(g){g&&w(e),g&&w(u),g&&w(f),m=!1,_()}}}function Z5(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[J5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function G5(n,e,t){let{field:i=new wn}=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 X5 extends ve{constructor(e){super(),be(this,e,G5,Z5,_e,{field:1,value:0})}}function Q5(n){let e,t;return{c(){e=y("i"),h(e,"class","ri-file-line"),h(e,"alt",t=n[0].name)},m(i,s){S(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&h(e,"alt",t)},d(i){i&&w(e)}}}function x5(n){let e,t,i;return{c(){e=y("img"),Dn(e.src,t=n[2])||h(e,"src",t),h(e,"width",n[1]),h(e,"height",n[1]),h(e,"alt",i=n[0].name)},m(s,l){S(s,e,l)},p(s,l){l&4&&!Dn(e.src,t=s[2])&&h(e,"src",t),l&2&&h(e,"width",s[1]),l&2&&h(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&h(e,"alt",i)},d(s){s&&w(e)}}}function eM(n){let e;function t(l,o){return l[2]?x5:Q5}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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:Q,o:Q,d(l){s.d(l),l&&w(e)}}}function tM(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),j.hasImageExtension(s==null?void 0:s.name)&&j.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 nM extends ve{constructor(e){super(),be(this,e,tM,eM,_e,{file:0,size:1})}}function Ap(n){let e;function t(l,o){return l[4]==="image"?sM:iM}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 iM(n){let e,t;return{c(){e=y("object"),t=U("Cannot preview the file."),h(e,"title",n[2]),h(e,"data",n[1])},m(i,s){S(i,e,s),v(e,t)},p(i,s){s&4&&h(e,"title",i[2]),s&2&&h(e,"data",i[1])},d(i){i&&w(e)}}}function sM(n){let e,t,i;return{c(){e=y("img"),Dn(e.src,t=n[1])||h(e,"src",t),h(e,"alt",i="Preview "+n[2])},m(s,l){S(s,e,l)},p(s,l){l&2&&!Dn(e.src,t=s[1])&&h(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&h(e,"alt",i)},d(s){s&&w(e)}}}function lM(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Ap(n);return{c(){i&&i.c(),t=Se()},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=Ap(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&w(t)}}}function oM(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=J(e,"click",ft(n[0])),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function rM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("a"),t=U(n[2]),i=E(),s=y("i"),l=E(),o=y("div"),r=E(),a=y("button"),a.textContent="Close",h(s,"class","ri-external-link-line"),h(e,"href",n[1]),h(e,"title",n[2]),h(e,"target","_blank"),h(e,"rel","noreferrer noopener"),h(e,"class","link-hint txt-ellipsis inline-flex"),h(o,"class","flex-fill"),h(a,"type","button"),h(a,"class","btn btn-transparent")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,l,p),S(d,o,p),S(d,r,p),S(d,a,p),u||(f=J(a,"click",n[0]),u=!0)},p(d,p){p&4&&le(t,d[2]),p&2&&h(e,"href",d[1]),p&4&&h(e,"title",d[2])},d(d){d&&w(e),d&&w(l),d&&w(o),d&&w(r),d&&w(a),u=!1,f()}}}function aM(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[rM],header:[oM],default:[lM]},$$scope:{ctx:n}};return e=new pn({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&1054&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function uM(n,e,t){let i,s,l,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(m){se[m?"unshift":"push"](()=>{o=m,t(3,o)})}function d(m){pe.call(this,n,m)}function p(m){pe.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=j.getFileType(s))},[u,r,s,o,l,a,i,f,d,p]}class fM extends ve{constructor(e){super(),be(this,e,uM,aM,_e,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function cM(n){let e,t,i,s,l;function o(u,f){return u[3]==="image"?hM:u[3]==="video"||u[3]==="audio"?mM:pM}let r=o(n),a=r(n);return{c(){e=y("a"),a.c(),h(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),h(e,"href",n[6]),h(e,"target","_blank"),h(e,"rel","noreferrer"),h(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){S(u,e,f),a.m(e,null),s||(l=J(e,"click",En(n[13])),s=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&h(e,"class",t),f&64&&h(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&h(e,"title",i)},d(u){u&&w(e),a.d(),s=!1,l()}}}function dM(n){let e,t;return{c(){e=y("div"),h(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,s){S(i,e,s)},p(i,s){s&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&h(e,"class",t)},d(i){i&&w(e)}}}function pM(n){let e;return{c(){e=y("i"),h(e,"class","ri-file-3-line")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function mM(n){let e;return{c(){e=y("i"),h(e,"class","ri-video-line")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function hM(n){let e,t,i,s,l;return{c(){e=y("img"),Dn(e.src,t=n[5])||h(e,"src",t),h(e,"alt",n[0]),h(e,"title",i="Preview "+n[0])},m(o,r){S(o,e,r),s||(l=J(e,"error",n[8]),s=!0)},p(o,r){r&32&&!Dn(e.src,t=o[5])&&h(e,"src",t),r&1&&h(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&h(e,"title",i)},d(o){o&&w(e),s=!1,l()}}}function _M(n){let e,t,i;function s(a,u){return a[2]?dM:cM}let l=s(n),o=l(n),r={};return t=new fM({props:r}),n[14](t),{c(){o.c(),e=E(),z(t.$$.fragment)},m(a,u){o.m(a,u),S(a,e,u),V(t,a,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const f={};t.$set(f)},i(a){i||(A(t.$$.fragment,a),i=!0)},o(a){P(t.$$.fragment,a),i=!1},d(a){o.d(a),a&&w(e),n[14](null),H(t,a)}}}function gM(n,e,t){let i,s,l,o;Ke(n,nb,T=>t(12,o=T));let{record:r=null}=e,{filename:a=""}=e,{size:u=""}=e,f,d="",p="",m="",_=!1;async function g(){t(2,_=!0);try{t(10,m=await me.getAdminFileToken())}catch(T){console.warn("File token failure:",T)}t(2,_=!1)}function b(){t(5,d="")}const k=T=>{l&&(T.preventDefault(),f==null||f.show(p))};function $(T){se[T?"unshift":"push"](()=>{f=T,t(4,f)})}return n.$$set=T=>{"record"in T&&t(9,r=T.record),"filename"in T&&t(0,a=T.filename),"size"in T&&t(1,u=T.size)},n.$$.update=()=>{n.$$.dirty&4608&&t(11,i=typeof o[r==null?void 0:r.collectionId]<"u"?o[r==null?void 0:r.collectionId]:!0),n.$$.dirty&2048&&(i?g():t(10,m="")),n.$$.dirty&1&&t(3,s=j.getFileType(a)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(s)||a.endsWith(".pdf")),n.$$.dirty&1541&&t(6,p=_?"":me.files.getUrl(r,a,{token:m})),n.$$.dirty&1541&&t(5,d=_?"":me.files.getUrl(r,a,{thumb:"100x100",token:m}))},[a,u,_,s,f,d,p,l,b,r,m,i,o,k,$]}class au extends ve{constructor(e){super(),be(this,e,gM,_M,_e,{record:9,filename:0,size:1})}}function Ip(n,e,t){const i=n.slice();return i[26]=e[t],i[28]=t,i}function Pp(n,e,t){const i=n.slice();i[29]=e[t],i[28]=t;const s=i[1].includes(i[28]);return i[30]=s,i}function bM(n){let e,t,i;function s(){return n[16](n[28])}return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){S(l,e,o),t||(i=[Ee(Ue.call(null,e,"Remove file")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,De(i)}}}function vM(n){let e,t,i;function s(){return n[15](n[28])}return{c(){e=y("button"),e.innerHTML='Restore',h(e,"type","button"),h(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){S(l,e,o),t||(i=J(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,i()}}}function Lp(n,e){let t,i,s,l,o,r,a=e[29]+"",u,f,d,p,m,_,g;s=new au({props:{record:e[2],filename:e[29]}});function b(T,C){return C[0]&18&&(_=null),_==null&&(_=!!T[1].includes(T[28])),_?vM:bM}let k=b(e,[-1,-1]),$=k(e);return{key:n,first:null,c(){t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),r=y("a"),u=U(a),p=E(),m=y("div"),$.c(),x(i,"fade",e[1].includes(e[28])),h(r,"href",f=me.files.getUrl(e[2],e[29])),h(r,"class",d="txt-ellipsis "+(e[30]?"txt-strikethrough txt-hint":"link-primary")),h(r,"title","Download"),h(r,"target","_blank"),h(r,"rel","noopener noreferrer"),h(o,"class","content"),h(m,"class","actions"),h(t,"class","list-item"),this.first=t},m(T,C){S(T,t,C),v(t,i),V(s,i,null),v(t,l),v(t,o),v(o,r),v(r,u),v(t,p),v(t,m),$.m(m,null),g=!0},p(T,C){e=T;const D={};C[0]&4&&(D.record=e[2]),C[0]&16&&(D.filename=e[29]),s.$set(D),(!g||C[0]&18)&&x(i,"fade",e[1].includes(e[28])),(!g||C[0]&16)&&a!==(a=e[29]+"")&&le(u,a),(!g||C[0]&20&&f!==(f=me.files.getUrl(e[2],e[29])))&&h(r,"href",f),(!g||C[0]&18&&d!==(d="txt-ellipsis "+(e[30]?"txt-strikethrough txt-hint":"link-primary")))&&h(r,"class",d),k===(k=b(e,C))&&$?$.p(e,C):($.d(1),$=k(e),$&&($.c(),$.m(m,null)))},i(T){g||(A(s.$$.fragment,T),g=!0)},o(T){P(s.$$.fragment,T),g=!1},d(T){T&&w(t),H(s),$.d()}}}function Np(n){let e,t,i,s,l,o,r,a,u=n[26].name+"",f,d,p,m,_,g,b;i=new nM({props:{file:n[26]}});function k(){return n[17](n[28])}return{c(){e=y("div"),t=y("figure"),z(i.$$.fragment),s=E(),l=y("div"),o=y("small"),o.textContent="New",r=E(),a=y("span"),f=U(u),p=E(),m=y("button"),m.innerHTML='',h(t,"class","thumb"),h(o,"class","label label-success m-r-5"),h(a,"class","txt"),h(l,"class","filename m-r-auto"),h(l,"title",d=n[26].name),h(m,"type","button"),h(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),h(e,"class","list-item")},m($,T){S($,e,T),v(e,t),V(i,t,null),v(e,s),v(e,l),v(l,o),v(l,r),v(l,a),v(a,f),v(e,p),v(e,m),_=!0,g||(b=[Ee(Ue.call(null,m,"Remove file")),J(m,"click",k)],g=!0)},p($,T){n=$;const C={};T[0]&1&&(C.file=n[26]),i.$set(C),(!_||T[0]&1)&&u!==(u=n[26].name+"")&&le(f,u),(!_||T[0]&1&&d!==(d=n[26].name))&&h(l,"title",d)},i($){_||(A(i.$$.fragment,$),_=!0)},o($){P(i.$$.fragment,$),_=!1},d($){$&&w(e),H(i),g=!1,De(b)}}}function yM(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,d=[],p=new Map,m,_,g,b,k,$,T,C,D,M,O,I,L=n[4];const F=Y=>Y[29]+Y[2].id;for(let Y=0;YP(N[Y],1,1,()=>{N[Y]=null});return{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("div");for(let Y=0;Y({25:o}),({uniqueId:o})=>[o?33554432:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","block")},m(o,r){S(o,e,r),V(t,e,null),i=!0,s||(l=[J(e,"dragover",ft(n[22])),J(e,"dragleave",n[23]),J(e,"drop",n[13])],s=!0)},p(o,r){const a={};r[0]&264&&(a.class=` + `,name:n[3].name,$$slots:{default:[yM,({uniqueId:o})=>({25:o}),({uniqueId:o})=>[o?33554432:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","block")},m(o,r){S(o,e,r),V(t,e,null),i=!0,s||(l=[J(e,"dragover",ft(n[22])),J(e,"dragleave",n[23]),J(e,"drop",n[13])],s=!0)},p(o,r){const a={};r[0]&264&&(a.class=` form-field form-field-list form-field-file `+(o[3].required?"required":"")+` `+(o[8]?"dragover":"")+` - `),r[0]&8&&(a.name=o[3].name),r[0]&33555199|r[1]&2&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){P(t.$$.fragment,o),i=!1},d(o){o&&w(e),H(t),s=!1,De(l)}}}function kM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new wn}=e,d,p,m=!1;function _(N){j.removeByValue(u,N),t(1,u)}function g(N){j.pushUnique(u,N),t(1,u)}function b(N){j.isEmpty(a[N])||a.splice(N,1),t(0,a)}function k(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}function $(N){var Y,B;N.preventDefault(),t(8,m=!1);const q=((Y=N.dataTransfer)==null?void 0:Y.files)||[];if(!(l||!q.length)){for(const Z of q){const ee=s.length+a.length-u.length;if(((B=f.options)==null?void 0:B.maxSelect)<=ee)break;a.push(Z)}t(0,a)}}const T=N=>_(N),C=N=>g(N),D=N=>b(N);function M(N){se[N?"unshift":"push"](()=>{d=N,t(6,d)})}const O=()=>{for(let N of d.files)a.push(N);t(0,a),t(6,d.value=null,d)},I=()=>d==null?void 0:d.click();function L(N){se[N?"unshift":"push"](()=>{p=N,t(7,p)})}const F=()=>{t(8,m=!0)},R=()=>{t(8,m=!1)};return n.$$set=N=>{"record"in N&&t(2,o=N.record),"value"in N&&t(14,r=N.value),"uploadedFiles"in N&&t(0,a=N.uploadedFiles),"deletedFileIndexes"in N&&t(1,u=N.deletedFileIndexes),"field"in N&&t(3,f=N.field)},n.$$.update=()=>{var N,q;n.$$.dirty[0]&1&&(Array.isArray(a)||t(0,a=j.toArray(a))),n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=j.toArray(u))),n.$$.dirty[0]&8&&t(5,i=((N=f.options)==null?void 0:N.maxSelect)>1),n.$$.dirty[0]&16416&&j.isEmpty(r)&&t(14,r=i?[]:""),n.$$.dirty[0]&16384&&t(4,s=j.toArray(r)),n.$$.dirty[0]&27&&t(9,l=(s.length||a.length)&&((q=f.options)==null?void 0:q.maxSelect)<=s.length+a.length-u.length),n.$$.dirty[0]&3&&(a!==-1||u!==-1)&&k()},[a,u,o,f,s,i,d,p,m,l,_,g,b,$,r,T,C,D,M,O,I,L,F,R]}class wM extends ve{constructor(e){super(),be(this,e,kM,yM,_e,{record:2,value:14,uploadedFiles:0,deletedFileIndexes:1,field:3},null,[-1,-1])}}function Fp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function SM(n,e){e=Fp(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=Fp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}const $M=n=>({dragging:n&2,dragover:n&4}),Rp=n=>({dragging:n[1],dragover:n[2]});function TM(n){let e,t,i,s;const l=n[8].default,o=Tt(l,n,n[7],Rp);return{c(){e=y("div"),o&&o.c(),h(e,"draggable",!0),h(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=[J(e,"dragover",ft(n[9])),J(e,"dragleave",ft(n[10])),J(e,"dragend",n[11]),J(e,"dragstart",n[12]),J(e,"drop",n[13])],i=!0)},p(r,[a]){o&&o.p&&(!t||a&134)&&Mt(o,l,r,r[7],t?Ct(l,r[7],a,$M):Ot(r[7]),Rp),(!t||a&2)&&x(e,"dragging",r[1]),(!t||a&4)&&x(e,"dragover",r[2])},i(r){t||(A(o,r),t=!0)},o(r){P(o,r),t=!1},d(r){r&&w(e),o&&o.d(r),i=!1,De(s)}}}function CM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=kt();let{index:o}=e,{list:r=[]}=e,{disabled:a=!1}=e,u=!1,f=!1;function d($,T){!$&&!a||(t(1,u=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",T))}function p($,T){if(!$&&!a)return;t(2,f=!1),t(1,u=!1),$.dataTransfer.dropEffect="move";const C=parseInt($.dataTransfer.getData("text/plain"));C{t(2,f=!0)},_=()=>{t(2,f=!1)},g=()=>{t(2,f=!1),t(1,u=!1)},b=$=>d($,o),k=$=>p($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(5,r=$.list),"disabled"in $&&t(6,a=$.disabled),"$$scope"in $&&t(7,s=$.$$scope)},[o,u,f,d,p,r,a,s,i,m,_,g,b,k]}class MM extends ve{constructor(e){super(),be(this,e,CM,TM,_e,{index:0,list:5,disabled:6})}}function qp(n,e,t){const i=n.slice();i[6]=e[t];const s=j.toArray(i[0][i[6]]).slice(0,5);return i[7]=s,i}function jp(n,e,t){const i=n.slice();return i[10]=e[t],i}function Vp(n){let e,t;return e=new au({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Hp(n){let e=!j.isEmpty(n[10]),t,i,s=e&&Vp(n);return{c(){s&&s.c(),t=Se()},m(l,o){s&&s.m(l,o),S(l,t,o),i=!0},p(l,o){o&3&&(e=!j.isEmpty(l[10])),e?s?(s.p(l,o),o&3&&A(s,1)):(s=Vp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(re(),P(s,1,1,()=>{s=null}),ae())},i(l){i||(A(s),i=!0)},o(l){P(s),i=!1},d(l){s&&s.d(l),l&&w(t)}}}function zp(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[g],1,1,()=>{m[g]=null});return{c(){e=y("div"),t=y("i"),s=E();for(let g=0;gt(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(d=>d.name==u&&d.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 er extends ve{constructor(e){super(),be(this,e,DM,OM,_e,{record:0,displayFields:3})}}function Bp(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function Up(n,e,t){const i=n.slice();i[49]=e[t];const s=i[8](i[49]);return i[6]=s,i}function Wp(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='
    New record
    ',h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint p-l-sm p-r-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[31]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Yp(n){let e,t;function i(o,r){return o[12]?AM:EM}let s=i(n),l=s(n);return{c(){e=y("div"),l.c(),t=E(),h(e,"class","list-item")},m(o,r){S(o,e,r),l.m(e,null),v(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 EM(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&Kp(n);return{c(){e=y("span"),e.textContent="No records found.",t=E(),s&&s.c(),i=Se(),h(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=Kp(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 AM(n){let e;return{c(){e=y("div"),e.innerHTML='',h(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Kp(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[35]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function IM(n){let e;return{c(){e=y("i"),h(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function PM(n){let e;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Jp(n){let e,t,i,s;function l(){return n[32](n[49])}return{c(){e=y("div"),t=y("button"),t.innerHTML='',h(t,"type","button"),h(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),h(e,"class","actions nonintrusive")},m(o,r){S(o,e,r),v(e,t),i||(s=[Ee(Ue.call(null,t,"Edit")),J(t,"keydown",En(n[27])),J(t,"click",En(l))],i=!0)},p(o,r){n=o},d(o){o&&w(e),i=!1,De(s)}}}function Zp(n,e){var k;let t,i,s,l,o,r,a,u,f;function d($,T){return $[6]?PM:IM}let p=d(e),m=p(e);l=new er({props:{record:e[49],displayFields:e[13]}});let _=!((k=e[10])!=null&&k.$isView)&&Jp(e);function g(){return e[33](e[49])}function b(...$){return e[34](e[49],...$)}return{key:n,first:null,c(){t=y("div"),m.c(),i=E(),s=y("div"),z(l.$$.fragment),o=E(),_&&_.c(),r=E(),h(s,"class","content"),h(t,"tabindex","0"),h(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[5]>1&&!e[9]),this.first=t},m($,T){S($,t,T),m.m(t,null),v(t,i),v(t,s),V(l,s,null),v(t,o),_&&_.m(t,null),v(t,r),a=!0,u||(f=[J(t,"click",g),J(t,"keydown",b)],u=!0)},p($,T){var D;e=$,p!==(p=d(e))&&(m.d(1),m=p(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),(D=e[10])!=null&&D.$isView?_&&(_.d(1),_=null):_?_.p(e,T):(_=Jp(e),_.c(),_.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($){a||(A(l.$$.fragment,$),a=!0)},o($){P(l.$$.fragment,$),a=!1},d($){$&&w(t),m.d(),H(l),_&&_.d(),u=!1,De(f)}}}function Gp(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=U("("),i=U(t),s=U(" of MAX "),l=U(n[5]),o=U(")")},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 LM(n){let e;return{c(){e=y("p"),e.textContent="No selected records.",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function NM(n){let e,t,i=n[6],s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){e=y("div");for(let o=0;o',l=E(),h(s,"type","button"),h(s,"title","Remove"),h(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),h(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(f,d){S(f,e,d),V(t,e,null),v(e,i),v(e,s),S(f,l,d),o=!0,r||(a=J(s,"click",u),r=!0)},p(f,d){n=f;const p={};d[0]&64&&(p.record=n[49]),d[0]&8192&&(p.displayFields=n[13]),t.$set(p),(!o||d[1]&2097152)&&x(e,"label-danger",n[52]),(!o||d[1]&4194304)&&x(e,"label-warning",n[53])},i(f){o||(A(t.$$.fragment,f),o=!0)},o(f){P(t.$$.fragment,f),o=!1},d(f){f&&w(e),H(t),f&&w(l),r=!1,a()}}}function Xp(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[FM,({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 MM({props:l}),se.push(()=>he(e,"list",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function RM(n){var R;let e,t,i,s,l,o=[],r=new Map,a,u,f,d,p,m,_,g,b,k,$;t=new Ko({props:{value:n[2],autocompleteCollection:n[10]}}),t.$on("submit",n[30]);let T=!((R=n[10])!=null&&R.$isView)&&Wp(n),C=n[3];const D=N=>N[49].id;for(let N=0;N1&&Gp(n);const I=[NM,LM],L=[];function F(N,q){return N[6].length?0:1}return m=F(n),_=L[m]=I[m](n),{c(){e=y("div"),z(t.$$.fragment),i=E(),T&&T.c(),s=E(),l=y("div");for(let N=0;N1?O?O.p(N,q):(O=Gp(N),O.c(),O.m(f,null)):O&&(O.d(1),O=null);let B=m;m=F(N),m===B?L[m].p(N,q):(re(),P(L[B],1,1,()=>{L[B]=null}),ae(),_=L[m],_?_.p(N,q):(_=L[m]=I[m](N),_.c()),A(_,1),_.m(g.parentNode,g))},i(N){if(!b){A(t.$$.fragment,N);for(let q=0;qCancel',t=E(),i=y("button"),i.innerHTML='Save selection',h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[J(e,"click",n[28]),J(i,"click",n[29])],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function VM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[jM],header:[qM],default:[RM]},$$scope:{ctx:n}};for(let a=0;at(26,m=Le));const _=kt(),g="picker_"+j.randomString(5);let{value:b}=e,{field:k}=e,$,T,C="",D=[],M=[],O=1,I=0,L=!1,F=!1;function R(){return t(2,C=""),t(3,D=[]),t(6,M=[]),q(),Y(!0),$==null?void 0:$.show()}function N(){return $==null?void 0:$.hide()}async function q(){const Le=j.toArray(b);if(!s||!Le.length)return;t(24,F=!0);let $e=[];const et=Le.slice(),Dt=[];for(;et.length>0;){const Ft=[];for(const jt of et.splice(0,Lr))Ft.push(`id="${jt}"`);Dt.push(me.collection(s).getFullList(Lr,{filter:Ft.join("||"),$autoCancel:!1}))}try{await Promise.all(Dt).then(Ft=>{$e=$e.concat(...Ft)}),t(6,M=[]);for(const Ft of Le){const jt=j.findByKey($e,"id",Ft);jt&&M.push(jt)}C.trim()||t(3,D=j.filterDuplicatesByKey(M.concat(D)))}catch(Ft){me.errorResponseHandler(Ft)}t(24,F=!1)}async function Y(Le=!1){if(s){t(4,L=!0),Le&&(C.trim()?t(3,D=[]):t(3,D=j.toArray(M).slice()));try{const $e=Le?1:O+1,et=j.getAllCollectionIdentifiers(o),Dt=await me.collection(s).getList($e,Lr,{filter:j.normalizeSearchFilter(C,et),sort:o!=null&&o.$isView?"":"-created",$cancelKey:g+"loadList"});t(3,D=j.filterDuplicatesByKey(D.concat(Dt.items))),O=Dt.page,t(23,I=Dt.totalItems)}catch($e){me.errorResponseHandler($e)}t(4,L=!1)}}function B(Le){i==1?t(6,M=[Le]):u&&(j.pushOrReplaceByKey(M,Le),t(6,M))}function Z(Le){j.removeByKey(M,"id",Le.id),t(6,M)}function ee(Le){f(Le)?Z(Le):B(Le)}function ie(){var Le;i!=1?t(20,b=M.map($e=>$e.id)):t(20,b=((Le=M==null?void 0:M[0])==null?void 0:Le.id)||""),_("save",M),N()}function X(Le){pe.call(this,n,Le)}const fe=()=>N(),G=()=>ie(),ce=Le=>t(2,C=Le.detail),ge=()=>T==null?void 0:T.show(),Me=Le=>T==null?void 0:T.show(Le),qe=Le=>ee(Le),He=(Le,$e)=>{($e.code==="Enter"||$e.code==="Space")&&($e.preventDefault(),$e.stopPropagation(),ee(Le))},we=()=>t(2,C=""),Ce=()=>{a&&!L&&Y()},Je=Le=>Z(Le);function mt(Le){M=Le,t(6,M)}function Ze(Le){se[Le?"unshift":"push"](()=>{$=Le,t(1,$)})}function We(Le){pe.call(this,n,Le)}function te(Le){pe.call(this,n,Le)}function Fe(Le){se[Le?"unshift":"push"](()=>{T=Le,t(7,T)})}const Qe=Le=>{j.removeByKey(D,"id",Le.detail.id),D.unshift(Le.detail),t(3,D),B(Le.detail)},Gt=Le=>{j.removeByKey(D,"id",Le.detail.id),t(3,D),Z(Le.detail)};return n.$$set=Le=>{e=Re(Re({},e),Yt(Le)),t(19,p=Xe(e,d)),"value"in Le&&t(20,b=Le.value),"field"in Le&&t(21,k=Le.field)},n.$$.update=()=>{var Le,$e,et;n.$$.dirty[0]&2097152&&t(5,i=((Le=k==null?void 0:k.options)==null?void 0:Le.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=($e=k==null?void 0:k.options)==null?void 0:$e.collectionId),n.$$.dirty[0]&2097152&&t(13,l=(et=k==null?void 0:k.options)==null?void 0:et.displayFields),n.$$.dirty[0]&100663296&&t(10,o=m.find(Dt=>Dt.id==s)||null),n.$$.dirty[0]&16777222&&typeof C<"u"&&!F&&$!=null&&$.isActive()&&Y(!0),n.$$.dirty[0]&16777232&&t(12,r=L||F),n.$$.dirty[0]&8388616&&t(11,a=I>D.length),n.$$.dirty[0]&96&&t(9,u=i===null||i>M.length),n.$$.dirty[0]&64&&t(8,f=function(Dt){return j.findByKey(M,"id",Dt.id)})},[N,$,C,D,L,i,M,T,f,u,o,a,r,l,Y,B,Z,ee,ie,p,b,k,R,I,F,s,m,X,fe,G,ce,ge,Me,qe,He,we,Ce,Je,mt,Ze,We,te,Fe,Qe,Gt]}class zM extends ve{constructor(e){super(),be(this,e,HM,VM,_e,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Qp(n,e,t){const i=n.slice();return i[15]=e[t],i}function xp(n,e,t){const i=n.slice();return i[18]=e[t],i}function em(n){let e,t=n[5]&&tm(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=tm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function tm(n){let e,t=j.toArray(n[0]).slice(0,10),i=[];for(let s=0;s
    - `,h(e,"class","list-item")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function im(n){var p;let e,t,i,s,l,o,r,a,u,f;i=new er({props:{record:n[15],displayFields:(p=n[2].options)==null?void 0:p.displayFields}});function d(){return n[8](n[15])}return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),o=y("button"),o.innerHTML='',r=E(),h(t,"class","content"),h(o,"type","button"),h(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),h(l,"class","actions"),h(e,"class","list-item")},m(m,_){S(m,e,_),v(e,t),V(i,t,null),v(e,s),v(e,l),v(l,o),v(e,r),a=!0,u||(f=[Ee(Ue.call(null,o,"Remove")),J(o,"click",d)],u=!0)},p(m,_){var b;n=m;const g={};_&16&&(g.record=n[15]),_&4&&(g.displayFields=(b=n[2].options)==null?void 0:b.displayFields),i.$set(g)},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),H(i),u=!1,De(f)}}}function BM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,g,b,k,$=n[4],T=[];for(let M=0;M<$.length;M+=1)T[M]=im(Qp(n,$,M));const C=M=>P(T[M],1,1,()=>{T[M]=null});let D=null;return $.length||(D=em(n)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("div"),d=y("div");for(let M=0;M + `),r[0]&8&&(a.name=o[3].name),r[0]&33555199|r[1]&2&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){P(t.$$.fragment,o),i=!1},d(o){o&&w(e),H(t),s=!1,De(l)}}}function wM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new wn}=e,d,p,m=!1;function _(N){j.removeByValue(u,N),t(1,u)}function g(N){j.pushUnique(u,N),t(1,u)}function b(N){j.isEmpty(a[N])||a.splice(N,1),t(0,a)}function k(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}function $(N){var Y,B;N.preventDefault(),t(8,m=!1);const q=((Y=N.dataTransfer)==null?void 0:Y.files)||[];if(!(l||!q.length)){for(const Z of q){const ee=s.length+a.length-u.length;if(((B=f.options)==null?void 0:B.maxSelect)<=ee)break;a.push(Z)}t(0,a)}}const T=N=>_(N),C=N=>g(N),D=N=>b(N);function M(N){se[N?"unshift":"push"](()=>{d=N,t(6,d)})}const O=()=>{for(let N of d.files)a.push(N);t(0,a),t(6,d.value=null,d)},I=()=>d==null?void 0:d.click();function L(N){se[N?"unshift":"push"](()=>{p=N,t(7,p)})}const F=()=>{t(8,m=!0)},R=()=>{t(8,m=!1)};return n.$$set=N=>{"record"in N&&t(2,o=N.record),"value"in N&&t(14,r=N.value),"uploadedFiles"in N&&t(0,a=N.uploadedFiles),"deletedFileIndexes"in N&&t(1,u=N.deletedFileIndexes),"field"in N&&t(3,f=N.field)},n.$$.update=()=>{var N,q;n.$$.dirty[0]&1&&(Array.isArray(a)||t(0,a=j.toArray(a))),n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=j.toArray(u))),n.$$.dirty[0]&8&&t(5,i=((N=f.options)==null?void 0:N.maxSelect)>1),n.$$.dirty[0]&16416&&j.isEmpty(r)&&t(14,r=i?[]:""),n.$$.dirty[0]&16384&&t(4,s=j.toArray(r)),n.$$.dirty[0]&27&&t(9,l=(s.length||a.length)&&((q=f.options)==null?void 0:q.maxSelect)<=s.length+a.length-u.length),n.$$.dirty[0]&3&&(a!==-1||u!==-1)&&k()},[a,u,o,f,s,i,d,p,m,l,_,g,b,$,r,T,C,D,M,O,I,L,F,R]}class SM extends ve{constructor(e){super(),be(this,e,wM,kM,_e,{record:2,value:14,uploadedFiles:0,deletedFileIndexes:1,field:3},null,[-1,-1])}}function Fp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function $M(n,e){e=Fp(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=Fp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}const TM=n=>({dragging:n&2,dragover:n&4}),Rp=n=>({dragging:n[1],dragover:n[2]});function CM(n){let e,t,i,s;const l=n[8].default,o=Tt(l,n,n[7],Rp);return{c(){e=y("div"),o&&o.c(),h(e,"draggable",!0),h(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=[J(e,"dragover",ft(n[9])),J(e,"dragleave",ft(n[10])),J(e,"dragend",n[11]),J(e,"dragstart",n[12]),J(e,"drop",n[13])],i=!0)},p(r,[a]){o&&o.p&&(!t||a&134)&&Mt(o,l,r,r[7],t?Ct(l,r[7],a,TM):Ot(r[7]),Rp),(!t||a&2)&&x(e,"dragging",r[1]),(!t||a&4)&&x(e,"dragover",r[2])},i(r){t||(A(o,r),t=!0)},o(r){P(o,r),t=!1},d(r){r&&w(e),o&&o.d(r),i=!1,De(s)}}}function MM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=kt();let{index:o}=e,{list:r=[]}=e,{disabled:a=!1}=e,u=!1,f=!1;function d($,T){!$&&!a||(t(1,u=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",T))}function p($,T){if(!$&&!a)return;t(2,f=!1),t(1,u=!1),$.dataTransfer.dropEffect="move";const C=parseInt($.dataTransfer.getData("text/plain"));C{t(2,f=!0)},_=()=>{t(2,f=!1)},g=()=>{t(2,f=!1),t(1,u=!1)},b=$=>d($,o),k=$=>p($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(5,r=$.list),"disabled"in $&&t(6,a=$.disabled),"$$scope"in $&&t(7,s=$.$$scope)},[o,u,f,d,p,r,a,s,i,m,_,g,b,k]}class OM extends ve{constructor(e){super(),be(this,e,MM,CM,_e,{index:0,list:5,disabled:6})}}function qp(n,e,t){const i=n.slice();i[6]=e[t];const s=j.toArray(i[0][i[6]]).slice(0,5);return i[7]=s,i}function jp(n,e,t){const i=n.slice();return i[10]=e[t],i}function Vp(n){let e,t;return e=new au({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Hp(n){let e=!j.isEmpty(n[10]),t,i,s=e&&Vp(n);return{c(){s&&s.c(),t=Se()},m(l,o){s&&s.m(l,o),S(l,t,o),i=!0},p(l,o){o&3&&(e=!j.isEmpty(l[10])),e?s?(s.p(l,o),o&3&&A(s,1)):(s=Vp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(re(),P(s,1,1,()=>{s=null}),ae())},i(l){i||(A(s),i=!0)},o(l){P(s),i=!1},d(l){s&&s.d(l),l&&w(t)}}}function zp(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[g],1,1,()=>{m[g]=null});return{c(){e=y("div"),t=y("i"),s=E();for(let g=0;gt(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(d=>d.name==u&&d.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 er extends ve{constructor(e){super(),be(this,e,EM,DM,_e,{record:0,displayFields:3})}}function Bp(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function Up(n,e,t){const i=n.slice();i[49]=e[t];const s=i[8](i[49]);return i[6]=s,i}function Wp(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='
    New record
    ',h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint p-l-sm p-r-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[31]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Yp(n){let e,t;function i(o,r){return o[12]?IM:AM}let s=i(n),l=s(n);return{c(){e=y("div"),l.c(),t=E(),h(e,"class","list-item")},m(o,r){S(o,e,r),l.m(e,null),v(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 AM(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&Kp(n);return{c(){e=y("span"),e.textContent="No records found.",t=E(),s&&s.c(),i=Se(),h(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=Kp(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 IM(n){let e;return{c(){e=y("div"),e.innerHTML='',h(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Kp(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[35]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function PM(n){let e;return{c(){e=y("i"),h(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function LM(n){let e;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Jp(n){let e,t,i,s;function l(){return n[32](n[49])}return{c(){e=y("div"),t=y("button"),t.innerHTML='',h(t,"type","button"),h(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),h(e,"class","actions nonintrusive")},m(o,r){S(o,e,r),v(e,t),i||(s=[Ee(Ue.call(null,t,"Edit")),J(t,"keydown",En(n[27])),J(t,"click",En(l))],i=!0)},p(o,r){n=o},d(o){o&&w(e),i=!1,De(s)}}}function Zp(n,e){var k;let t,i,s,l,o,r,a,u,f;function d($,T){return $[6]?LM:PM}let p=d(e),m=p(e);l=new er({props:{record:e[49],displayFields:e[13]}});let _=!((k=e[10])!=null&&k.$isView)&&Jp(e);function g(){return e[33](e[49])}function b(...$){return e[34](e[49],...$)}return{key:n,first:null,c(){t=y("div"),m.c(),i=E(),s=y("div"),z(l.$$.fragment),o=E(),_&&_.c(),r=E(),h(s,"class","content"),h(t,"tabindex","0"),h(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[5]>1&&!e[9]),this.first=t},m($,T){S($,t,T),m.m(t,null),v(t,i),v(t,s),V(l,s,null),v(t,o),_&&_.m(t,null),v(t,r),a=!0,u||(f=[J(t,"click",g),J(t,"keydown",b)],u=!0)},p($,T){var D;e=$,p!==(p=d(e))&&(m.d(1),m=p(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),(D=e[10])!=null&&D.$isView?_&&(_.d(1),_=null):_?_.p(e,T):(_=Jp(e),_.c(),_.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($){a||(A(l.$$.fragment,$),a=!0)},o($){P(l.$$.fragment,$),a=!1},d($){$&&w(t),m.d(),H(l),_&&_.d(),u=!1,De(f)}}}function Gp(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=U("("),i=U(t),s=U(" of MAX "),l=U(n[5]),o=U(")")},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 NM(n){let e;return{c(){e=y("p"),e.textContent="No selected records.",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function FM(n){let e,t,i=n[6],s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){e=y("div");for(let o=0;o',l=E(),h(s,"type","button"),h(s,"title","Remove"),h(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),h(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(f,d){S(f,e,d),V(t,e,null),v(e,i),v(e,s),S(f,l,d),o=!0,r||(a=J(s,"click",u),r=!0)},p(f,d){n=f;const p={};d[0]&64&&(p.record=n[49]),d[0]&8192&&(p.displayFields=n[13]),t.$set(p),(!o||d[1]&2097152)&&x(e,"label-danger",n[52]),(!o||d[1]&4194304)&&x(e,"label-warning",n[53])},i(f){o||(A(t.$$.fragment,f),o=!0)},o(f){P(t.$$.fragment,f),o=!1},d(f){f&&w(e),H(t),f&&w(l),r=!1,a()}}}function Xp(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[RM,({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 OM({props:l}),se.push(()=>he(e,"list",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function qM(n){var R;let e,t,i,s,l,o=[],r=new Map,a,u,f,d,p,m,_,g,b,k,$;t=new Ko({props:{value:n[2],autocompleteCollection:n[10]}}),t.$on("submit",n[30]);let T=!((R=n[10])!=null&&R.$isView)&&Wp(n),C=n[3];const D=N=>N[49].id;for(let N=0;N1&&Gp(n);const I=[FM,NM],L=[];function F(N,q){return N[6].length?0:1}return m=F(n),_=L[m]=I[m](n),{c(){e=y("div"),z(t.$$.fragment),i=E(),T&&T.c(),s=E(),l=y("div");for(let N=0;N1?O?O.p(N,q):(O=Gp(N),O.c(),O.m(f,null)):O&&(O.d(1),O=null);let B=m;m=F(N),m===B?L[m].p(N,q):(re(),P(L[B],1,1,()=>{L[B]=null}),ae(),_=L[m],_?_.p(N,q):(_=L[m]=I[m](N),_.c()),A(_,1),_.m(g.parentNode,g))},i(N){if(!b){A(t.$$.fragment,N);for(let q=0;qCancel',t=E(),i=y("button"),i.innerHTML='Save selection',h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[J(e,"click",n[28]),J(i,"click",n[29])],s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function HM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[VM],header:[jM],default:[qM]},$$scope:{ctx:n}};for(let a=0;at(26,m=Le));const _=kt(),g="picker_"+j.randomString(5);let{value:b}=e,{field:k}=e,$,T,C="",D=[],M=[],O=1,I=0,L=!1,F=!1;function R(){return t(2,C=""),t(3,D=[]),t(6,M=[]),q(),Y(!0),$==null?void 0:$.show()}function N(){return $==null?void 0:$.hide()}async function q(){const Le=j.toArray(b);if(!s||!Le.length)return;t(24,F=!0);let $e=[];const et=Le.slice(),Dt=[];for(;et.length>0;){const Ft=[];for(const jt of et.splice(0,Lr))Ft.push(`id="${jt}"`);Dt.push(me.collection(s).getFullList(Lr,{filter:Ft.join("||"),$autoCancel:!1}))}try{await Promise.all(Dt).then(Ft=>{$e=$e.concat(...Ft)}),t(6,M=[]);for(const Ft of Le){const jt=j.findByKey($e,"id",Ft);jt&&M.push(jt)}C.trim()||t(3,D=j.filterDuplicatesByKey(M.concat(D)))}catch(Ft){me.errorResponseHandler(Ft)}t(24,F=!1)}async function Y(Le=!1){if(s){t(4,L=!0),Le&&(C.trim()?t(3,D=[]):t(3,D=j.toArray(M).slice()));try{const $e=Le?1:O+1,et=j.getAllCollectionIdentifiers(o),Dt=await me.collection(s).getList($e,Lr,{filter:j.normalizeSearchFilter(C,et),sort:o!=null&&o.$isView?"":"-created",$cancelKey:g+"loadList"});t(3,D=j.filterDuplicatesByKey(D.concat(Dt.items))),O=Dt.page,t(23,I=Dt.totalItems)}catch($e){me.errorResponseHandler($e)}t(4,L=!1)}}function B(Le){i==1?t(6,M=[Le]):u&&(j.pushOrReplaceByKey(M,Le),t(6,M))}function Z(Le){j.removeByKey(M,"id",Le.id),t(6,M)}function ee(Le){f(Le)?Z(Le):B(Le)}function ie(){var Le;i!=1?t(20,b=M.map($e=>$e.id)):t(20,b=((Le=M==null?void 0:M[0])==null?void 0:Le.id)||""),_("save",M),N()}function X(Le){pe.call(this,n,Le)}const fe=()=>N(),G=()=>ie(),ce=Le=>t(2,C=Le.detail),ge=()=>T==null?void 0:T.show(),Me=Le=>T==null?void 0:T.show(Le),qe=Le=>ee(Le),He=(Le,$e)=>{($e.code==="Enter"||$e.code==="Space")&&($e.preventDefault(),$e.stopPropagation(),ee(Le))},we=()=>t(2,C=""),Ce=()=>{a&&!L&&Y()},Je=Le=>Z(Le);function mt(Le){M=Le,t(6,M)}function Ze(Le){se[Le?"unshift":"push"](()=>{$=Le,t(1,$)})}function We(Le){pe.call(this,n,Le)}function te(Le){pe.call(this,n,Le)}function Fe(Le){se[Le?"unshift":"push"](()=>{T=Le,t(7,T)})}const Qe=Le=>{j.removeByKey(D,"id",Le.detail.id),D.unshift(Le.detail),t(3,D),B(Le.detail)},Gt=Le=>{j.removeByKey(D,"id",Le.detail.id),t(3,D),Z(Le.detail)};return n.$$set=Le=>{e=Re(Re({},e),Yt(Le)),t(19,p=Xe(e,d)),"value"in Le&&t(20,b=Le.value),"field"in Le&&t(21,k=Le.field)},n.$$.update=()=>{var Le,$e,et;n.$$.dirty[0]&2097152&&t(5,i=((Le=k==null?void 0:k.options)==null?void 0:Le.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=($e=k==null?void 0:k.options)==null?void 0:$e.collectionId),n.$$.dirty[0]&2097152&&t(13,l=(et=k==null?void 0:k.options)==null?void 0:et.displayFields),n.$$.dirty[0]&100663296&&t(10,o=m.find(Dt=>Dt.id==s)||null),n.$$.dirty[0]&16777222&&typeof C<"u"&&!F&&$!=null&&$.isActive()&&Y(!0),n.$$.dirty[0]&16777232&&t(12,r=L||F),n.$$.dirty[0]&8388616&&t(11,a=I>D.length),n.$$.dirty[0]&96&&t(9,u=i===null||i>M.length),n.$$.dirty[0]&64&&t(8,f=function(Dt){return j.findByKey(M,"id",Dt.id)})},[N,$,C,D,L,i,M,T,f,u,o,a,r,l,Y,B,Z,ee,ie,p,b,k,R,I,F,s,m,X,fe,G,ce,ge,Me,qe,He,we,Ce,Je,mt,Ze,We,te,Fe,Qe,Gt]}class BM extends ve{constructor(e){super(),be(this,e,zM,HM,_e,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Qp(n,e,t){const i=n.slice();return i[15]=e[t],i}function xp(n,e,t){const i=n.slice();return i[18]=e[t],i}function em(n){let e,t=n[5]&&tm(n);return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=tm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function tm(n){let e,t=j.toArray(n[0]).slice(0,10),i=[];for(let s=0;s
    + `,h(e,"class","list-item")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function im(n){var p;let e,t,i,s,l,o,r,a,u,f;i=new er({props:{record:n[15],displayFields:(p=n[2].options)==null?void 0:p.displayFields}});function d(){return n[8](n[15])}return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),o=y("button"),o.innerHTML='',r=E(),h(t,"class","content"),h(o,"type","button"),h(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),h(l,"class","actions"),h(e,"class","list-item")},m(m,_){S(m,e,_),v(e,t),V(i,t,null),v(e,s),v(e,l),v(l,o),v(e,r),a=!0,u||(f=[Ee(Ue.call(null,o,"Remove")),J(o,"click",d)],u=!0)},p(m,_){var b;n=m;const g={};_&16&&(g.record=n[15]),_&4&&(g.displayFields=(b=n[2].options)==null?void 0:b.displayFields),i.$set(g)},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),H(i),u=!1,De(f)}}}function UM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,g,b,k,$=n[4],T=[];for(let M=0;M<$.length;M+=1)T[M]=im(Qp(n,$,M));const C=M=>P(T[M],1,1,()=>{T[M]=null});let D=null;return $.length||(D=em(n)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("div"),d=y("div");for(let M=0;M - Open picker`,h(t,"class",i=Ei(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),h(l,"class","txt"),h(e,"for",a=n[14]),h(d,"class","relations-list svelte-1ynw0pc"),h(_,"type","button"),h(_,"class","btn btn-transparent btn-sm btn-block"),h(m,"class","list-item list-item-btn"),h(f,"class","list")},m(M,O){S(M,e,O),v(e,t),v(e,s),v(e,l),v(l,r),S(M,u,O),S(M,f,O),v(f,d);for(let I=0;I({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new de({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new zM({props:o}),n[11](i),i.$on("save",n[12]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){V(e,r,a),S(r,t,a),V(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||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),H(e,r),r&&w(t),n[11](null),H(i,r)}}}const sm=100;function WM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new wn}=e,r,a=[],u=!1;f();async function f(){var C,D;const k=j.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 $=k.slice(),T=[];for(;$.length>0;){const M=[];for(const O of $.splice(0,sm))M.push(`id="${O}"`);T.push(me.collection((D=o==null?void 0:o.options)==null?void 0:D.collectionId).getFullList(sm,{filter:M.join("||"),$autoCancel:!1}))}try{let M=[];await Promise.all(T).then(O=>{M=M.concat(...O)});for(const O of k){const I=j.findByKey(M,"id",O);I&&a.push(I)}t(4,a)}catch(M){me.errorResponseHandler(M)}t(5,u=!1)}function d(k){var $;j.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=(($=a[0])==null?void 0:$.id)||"")}const p=k=>d(k),m=()=>l==null?void 0:l.show();function _(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function g(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const b=k=>{var $;t(4,a=k.detail||[]),t(0,s=i?a.map(T=>T.id):(($=a[0])==null?void 0:$.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,d,p,m,_,g,b]}class YM extends ve{constructor(e){super(),be(this,e,WM,UM,_e,{value:0,picker:1,field:2})}}const KM=["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"],JM=(n,e)=>{KM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function ZM(n){let e;return{c(){e=y("textarea"),h(e,"id",n[0]),qr(e,"visibility","hidden")},m(t,i){S(t,e,i),n[18](e)},p(t,i){i&1&&h(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function GM(n){let e;return{c(){e=y("div"),h(e,"id",n[0])},m(t,i){S(t,e,i),n[17](e)},p(t,i){i&1&&h(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function XM(n){let e;function t(l,o){return l[1]?GM:ZM}let i=t(n),s=i(n);return{c(){e=y("div"),s.c(),h(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&&h(e,"class",l[2])},i:Q,o:Q,d(l){l&&w(e),s.d(),n[19](null)}}}const ob=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),QM=()=>{let n={listeners:[],scriptId:ob("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 xM=QM();function eO(n,e,t){var i;let{id:s=ob("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:d="change input undo redo"}=e,{value:p=""}=e,{text:m=""}=e,{cssClass:_="tinymce-wrapper"}=e,g,b,k,$=p,T=o;const C=kt(),D=()=>{const R=(()=>typeof window<"u"?window:global)();return R&&R.tinymce?R.tinymce:null},M=()=>{const F=Object.assign(Object.assign({},f),{target:b,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:R=>{t(14,k=R),R.on("init",()=>{R.setContent(p),R.on(d,()=>{t(15,$=R.getContent()),$!==p&&(t(5,p=$),t(6,m=R.getContent({format:"text"})))})}),JM(R,C),typeof f.setup=="function"&&f.setup(R)}});t(4,b.style.visibility="",b),D().init(F)};xt(()=>{if(D()!==null)M();else{const F=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;xM.load(g.ownerDocument,F,()=>{M()})}}),z_(()=>{var F;k&&((F=D())===null||F===void 0||F.remove(k))});function O(F){se[F?"unshift":"push"](()=>{b=F,t(4,b)})}function I(F){se[F?"unshift":"push"](()=>{b=F,t(4,b)})}function L(F){se[F?"unshift":"push"](()=>{g=F,t(3,g)})}return n.$$set=F=>{"id"in F&&t(0,s=F.id),"inline"in F&&t(1,l=F.inline),"disabled"in F&&t(7,o=F.disabled),"apiKey"in F&&t(8,r=F.apiKey),"channel"in F&&t(9,a=F.channel),"scriptSrc"in F&&t(10,u=F.scriptSrc),"conf"in F&&t(11,f=F.conf),"modelEvents"in F&&t(12,d=F.modelEvents),"value"in F&&t(5,p=F.value),"text"in F&&t(6,m=F.text),"cssClass"in F&&t(2,_=F.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(k&&$!==p&&(k.setContent(p),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,_,g,b,p,m,o,r,a,u,f,d,i,k,$,T,O,I,L]}class uu extends ve{constructor(e){super(),be(this,e,eO,XM,_e,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function tO(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p;function m(g){n[2](g)}let _={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:j.defaultEditorOptions()};return n[0]!==void 0&&(_.value=n[0]),f=new uu({props:_}),se.push(()=>he(f,"value",m)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),z(f.$$.fragment),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3])},m(g,b){S(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(g,u,b),V(f,g,b),p=!0},p(g,b){(!p||b&2&&i!==(i=j.getFieldTypeIcon(g[1].type)))&&h(t,"class",i),(!p||b&2)&&o!==(o=g[1].name+"")&&le(r,o),(!p||b&8&&a!==(a=g[3]))&&h(e,"for",a);const k={};b&8&&(k.id=g[3]),!d&&b&1&&(d=!0,k.value=g[0],ke(()=>d=!1)),f.$set(k)},i(g){p||(A(f.$$.fragment,g),p=!0)},o(g){P(f.$$.fragment,g),p=!1},d(g){g&&w(e),g&&w(u),H(f,g)}}}function nO(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[tO,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function iO(n,e,t){let{field:i=new wn}=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 sO extends ve{constructor(e){super(),be(this,e,iO,nO,_e,{field:1,value:0})}}function lO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Auth URL"),s=E(),l=y("input"),h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].authUrl),r||(a=J(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&l.value!==u[0].authUrl&&ue(l,u[0].authUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function oO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Token URL"),s=E(),l=y("input"),h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].tokenUrl),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&ue(l,u[0].tokenUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function rO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("User API URL"),s=E(),l=y("input"),h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].userApiUrl),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&ue(l,u[0].userApiUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function aO(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[lO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[oO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[rO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Selfhosted endpoints (optional)",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),o=E(),z(r.$$.fragment),h(e,"class","section-title")},m(u,f){S(u,e,f),S(u,t,f),V(i,u,f),S(u,s,f),V(l,u,f),S(u,o,f),V(r,u,f),a=!0},p(u,[f]){const d={};f&2&&(d.name=u[1]+".authUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&2&&(p.name=u[1]+".tokenUrl"),f&97&&(p.$$scope={dirty:f,ctx:u}),l.$set(p);const m={};f&2&&(m.name=u[1]+".userApiUrl"),f&97&&(m.$$scope={dirty:f,ctx:u}),r.$set(m)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){P(i.$$.fragment,u),P(l.$$.fragment,u),P(r.$$.fragment,u),a=!1},d(u){u&&w(e),u&&w(t),H(i,u),u&&w(s),H(l,u),u&&w(o),H(r,u)}}}function uO(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 lm extends ve{constructor(e){super(),be(this,e,uO,aO,_e,{key:1,config:0})}}function fO(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Auth URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",h(e,"for",i=n[4]),h(l,"type","url"),h(l,"id",o=n[4]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0].authUrl),S(p,a,m),S(p,u,m),f||(d=J(l,"input",n[2]),f=!0)},p(p,m){m&16&&i!==(i=p[4])&&h(e,"for",i),m&16&&o!==(o=p[4])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].authUrl&&ue(l,p[0].authUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function cO(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Token URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",h(e,"for",i=n[4]),h(l,"type","url"),h(l,"id",o=n[4]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0].tokenUrl),S(p,a,m),S(p,u,m),f||(d=J(l,"input",n[3]),f=!0)},p(p,m){m&16&&i!==(i=p[4])&&h(e,"for",i),m&16&&o!==(o=p[4])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].tokenUrl&&ue(l,p[0].tokenUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function dO(n){let e,t,i,s,l,o;return i=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[fO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[cO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Azure AD endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),h(e,"class","section-title")},m(r,a){S(r,e,a),S(r,t,a),V(i,r,a),S(r,s,a),V(l,r,a),o=!0},p(r,[a]){const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".authUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".tokenUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),r&&w(t),H(i,r),r&&w(s),H(l,r)}}}function pO(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 mO extends ve{constructor(e){super(),be(this,e,pO,dO,_e,{key:1,config:0})}}function hO(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Auth URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://example.com/authorize/",h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0].authUrl),S(p,a,m),S(p,u,m),f||(d=J(l,"input",n[2]),f=!0)},p(p,m){m&32&&i!==(i=p[5])&&h(e,"for",i),m&32&&o!==(o=p[5])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].authUrl&&ue(l,p[0].authUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function _O(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Token URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://example.com/token/",h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0].tokenUrl),S(p,a,m),S(p,u,m),f||(d=J(l,"input",n[3]),f=!0)},p(p,m){m&32&&i!==(i=p[5])&&h(e,"for",i),m&32&&o!==(o=p[5])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].tokenUrl&&ue(l,p[0].tokenUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function gO(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("User API URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://example.com/userinfo/",h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0].userApiUrl),S(p,a,m),S(p,u,m),f||(d=J(l,"input",n[4]),f=!0)},p(p,m){m&32&&i!==(i=p[5])&&h(e,"for",i),m&32&&o!==(o=p[5])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].userApiUrl&&ue(l,p[0].userApiUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function bO(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[hO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[_O,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[gO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),o=E(),z(r.$$.fragment),h(e,"class","section-title")},m(u,f){S(u,e,f),S(u,t,f),V(i,u,f),S(u,s,f),V(l,u,f),S(u,o,f),V(r,u,f),a=!0},p(u,[f]){const d={};f&1&&(d.class="form-field "+(u[0].enabled?"required":"")),f&2&&(d.name=u[1]+".authUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&1&&(p.class="form-field "+(u[0].enabled?"required":"")),f&2&&(p.name=u[1]+".tokenUrl"),f&97&&(p.$$scope={dirty:f,ctx:u}),l.$set(p);const m={};f&1&&(m.class="form-field "+(u[0].enabled?"required":"")),f&2&&(m.name=u[1]+".userApiUrl"),f&97&&(m.$$scope={dirty:f,ctx:u}),r.$set(m)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){P(i.$$.fragment,u),P(l.$$.fragment,u),P(r.$$.fragment,u),a=!1},d(u){u&&w(e),u&&w(t),H(i,u),u&&w(s),H(l,u),u&&w(o),H(r,u)}}}function vO(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 Nr extends ve{constructor(e){super(),be(this,e,vO,bO,_e,{key:1,config:0})}}function yO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Client ID"),s=E(),l=y("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[2]),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&4&&l.value!==u[2]&&ue(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function kO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Team ID"),s=E(),l=y("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[3]),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&8&&l.value!==u[3]&&ue(l,u[3])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function wO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Key ID"),s=E(),l=y("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[4]),r||(a=J(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&16&&l.value!==u[4]&&ue(l,u[4])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function SO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("span"),t.textContent="Duration (in seconds)",i=E(),s=y("i"),o=E(),r=y("input"),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[23]),h(r,"type","text"),h(r,"id",a=n[23]),h(r,"max",mo),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[6]),u||(f=[Ee(Ue.call(null,s,{text:`Max ${mo} seconds (~${mo/(60*60*24*30)<<0} months).`,position:"top"})),J(r,"input",n[15])],u=!0)},p(d,p){p&8388608&&l!==(l=d[23])&&h(e,"for",l),p&8388608&&a!==(a=d[23])&&h(r,"id",a),p&64&&r.value!==d[6]&&ue(r,d[6])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,De(f)}}}function $O(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Private key"),s=E(),l=y("textarea"),r=E(),a=y("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",h(e,"for",i=n[23]),h(l,"id",o=n[23]),l.required=!0,h(l,"rows","8"),h(l,"placeholder",`-----BEGIN PRIVATE KEY----- + Open picker`,h(t,"class",i=Ei(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),h(l,"class","txt"),h(e,"for",a=n[14]),h(d,"class","relations-list svelte-1ynw0pc"),h(_,"type","button"),h(_,"class","btn btn-transparent btn-sm btn-block"),h(m,"class","list-item list-item-btn"),h(f,"class","list")},m(M,O){S(M,e,O),v(e,t),v(e,s),v(e,l),v(l,r),S(M,u,O),S(M,f,O),v(f,d);for(let I=0;I({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new de({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new BM({props:o}),n[11](i),i.$on("save",n[12]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){V(e,r,a),S(r,t,a),V(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||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),H(e,r),r&&w(t),n[11](null),H(i,r)}}}const sm=100;function YM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new wn}=e,r,a=[],u=!1;f();async function f(){var C,D;const k=j.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 $=k.slice(),T=[];for(;$.length>0;){const M=[];for(const O of $.splice(0,sm))M.push(`id="${O}"`);T.push(me.collection((D=o==null?void 0:o.options)==null?void 0:D.collectionId).getFullList(sm,{filter:M.join("||"),$autoCancel:!1}))}try{let M=[];await Promise.all(T).then(O=>{M=M.concat(...O)});for(const O of k){const I=j.findByKey(M,"id",O);I&&a.push(I)}t(4,a)}catch(M){me.errorResponseHandler(M)}t(5,u=!1)}function d(k){var $;j.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=(($=a[0])==null?void 0:$.id)||"")}const p=k=>d(k),m=()=>l==null?void 0:l.show();function _(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function g(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const b=k=>{var $;t(4,a=k.detail||[]),t(0,s=i?a.map(T=>T.id):(($=a[0])==null?void 0:$.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,d,p,m,_,g,b]}class KM extends ve{constructor(e){super(),be(this,e,YM,WM,_e,{value:0,picker:1,field:2})}}const JM=["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"],ZM=(n,e)=>{JM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function GM(n){let e;return{c(){e=y("textarea"),h(e,"id",n[0]),qr(e,"visibility","hidden")},m(t,i){S(t,e,i),n[18](e)},p(t,i){i&1&&h(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function XM(n){let e;return{c(){e=y("div"),h(e,"id",n[0])},m(t,i){S(t,e,i),n[17](e)},p(t,i){i&1&&h(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function QM(n){let e;function t(l,o){return l[1]?XM:GM}let i=t(n),s=i(n);return{c(){e=y("div"),s.c(),h(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&&h(e,"class",l[2])},i:Q,o:Q,d(l){l&&w(e),s.d(),n[19](null)}}}const rb=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),xM=()=>{let n={listeners:[],scriptId:rb("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 eO=xM();function tO(n,e,t){var i;let{id:s=rb("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:d="change input undo redo"}=e,{value:p=""}=e,{text:m=""}=e,{cssClass:_="tinymce-wrapper"}=e,g,b,k,$=p,T=o;const C=kt(),D=()=>{const R=(()=>typeof window<"u"?window:global)();return R&&R.tinymce?R.tinymce:null},M=()=>{const F=Object.assign(Object.assign({},f),{target:b,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:R=>{t(14,k=R),R.on("init",()=>{R.setContent(p),R.on(d,()=>{t(15,$=R.getContent()),$!==p&&(t(5,p=$),t(6,m=R.getContent({format:"text"})))})}),ZM(R,C),typeof f.setup=="function"&&f.setup(R)}});t(4,b.style.visibility="",b),D().init(F)};xt(()=>{if(D()!==null)M();else{const F=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;eO.load(g.ownerDocument,F,()=>{M()})}}),B_(()=>{var F;k&&((F=D())===null||F===void 0||F.remove(k))});function O(F){se[F?"unshift":"push"](()=>{b=F,t(4,b)})}function I(F){se[F?"unshift":"push"](()=>{b=F,t(4,b)})}function L(F){se[F?"unshift":"push"](()=>{g=F,t(3,g)})}return n.$$set=F=>{"id"in F&&t(0,s=F.id),"inline"in F&&t(1,l=F.inline),"disabled"in F&&t(7,o=F.disabled),"apiKey"in F&&t(8,r=F.apiKey),"channel"in F&&t(9,a=F.channel),"scriptSrc"in F&&t(10,u=F.scriptSrc),"conf"in F&&t(11,f=F.conf),"modelEvents"in F&&t(12,d=F.modelEvents),"value"in F&&t(5,p=F.value),"text"in F&&t(6,m=F.text),"cssClass"in F&&t(2,_=F.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(k&&$!==p&&(k.setContent(p),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,_,g,b,p,m,o,r,a,u,f,d,i,k,$,T,O,I,L]}class uu extends ve{constructor(e){super(),be(this,e,tO,QM,_e,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function nO(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p;function m(g){n[2](g)}let _={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:j.defaultEditorOptions()};return n[0]!==void 0&&(_.value=n[0]),f=new uu({props:_}),se.push(()=>he(f,"value",m)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),z(f.$$.fragment),h(t,"class",i=j.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3])},m(g,b){S(g,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(g,u,b),V(f,g,b),p=!0},p(g,b){(!p||b&2&&i!==(i=j.getFieldTypeIcon(g[1].type)))&&h(t,"class",i),(!p||b&2)&&o!==(o=g[1].name+"")&&le(r,o),(!p||b&8&&a!==(a=g[3]))&&h(e,"for",a);const k={};b&8&&(k.id=g[3]),!d&&b&1&&(d=!0,k.value=g[0],ke(()=>d=!1)),f.$set(k)},i(g){p||(A(f.$$.fragment,g),p=!0)},o(g){P(f.$$.fragment,g),p=!1},d(g){g&&w(e),g&&w(u),H(f,g)}}}function iO(n){let e,t;return e=new de({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[nO,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function sO(n,e,t){let{field:i=new wn}=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 lO extends ve{constructor(e){super(),be(this,e,sO,iO,_e,{field:1,value:0})}}function oO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Auth URL"),s=E(),l=y("input"),h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].authUrl),r||(a=J(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&l.value!==u[0].authUrl&&ue(l,u[0].authUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function rO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Token URL"),s=E(),l=y("input"),h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].tokenUrl),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&ue(l,u[0].tokenUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function aO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("User API URL"),s=E(),l=y("input"),h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].userApiUrl),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&ue(l,u[0].userApiUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function uO(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[oO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[rO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[aO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Selfhosted endpoints (optional)",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),o=E(),z(r.$$.fragment),h(e,"class","section-title")},m(u,f){S(u,e,f),S(u,t,f),V(i,u,f),S(u,s,f),V(l,u,f),S(u,o,f),V(r,u,f),a=!0},p(u,[f]){const d={};f&2&&(d.name=u[1]+".authUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&2&&(p.name=u[1]+".tokenUrl"),f&97&&(p.$$scope={dirty:f,ctx:u}),l.$set(p);const m={};f&2&&(m.name=u[1]+".userApiUrl"),f&97&&(m.$$scope={dirty:f,ctx:u}),r.$set(m)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){P(i.$$.fragment,u),P(l.$$.fragment,u),P(r.$$.fragment,u),a=!1},d(u){u&&w(e),u&&w(t),H(i,u),u&&w(s),H(l,u),u&&w(o),H(r,u)}}}function fO(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 lm extends ve{constructor(e){super(),be(this,e,fO,uO,_e,{key:1,config:0})}}function cO(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Auth URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",h(e,"for",i=n[4]),h(l,"type","url"),h(l,"id",o=n[4]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0].authUrl),S(p,a,m),S(p,u,m),f||(d=J(l,"input",n[2]),f=!0)},p(p,m){m&16&&i!==(i=p[4])&&h(e,"for",i),m&16&&o!==(o=p[4])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].authUrl&&ue(l,p[0].authUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function dO(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Token URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",h(e,"for",i=n[4]),h(l,"type","url"),h(l,"id",o=n[4]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0].tokenUrl),S(p,a,m),S(p,u,m),f||(d=J(l,"input",n[3]),f=!0)},p(p,m){m&16&&i!==(i=p[4])&&h(e,"for",i),m&16&&o!==(o=p[4])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].tokenUrl&&ue(l,p[0].tokenUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function pO(n){let e,t,i,s,l,o;return i=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[cO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[dO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Azure AD endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),h(e,"class","section-title")},m(r,a){S(r,e,a),S(r,t,a),V(i,r,a),S(r,s,a),V(l,r,a),o=!0},p(r,[a]){const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".authUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".tokenUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),r&&w(t),H(i,r),r&&w(s),H(l,r)}}}function mO(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 hO extends ve{constructor(e){super(),be(this,e,mO,pO,_e,{key:1,config:0})}}function _O(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Auth URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://example.com/authorize/",h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0].authUrl),S(p,a,m),S(p,u,m),f||(d=J(l,"input",n[2]),f=!0)},p(p,m){m&32&&i!==(i=p[5])&&h(e,"for",i),m&32&&o!==(o=p[5])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].authUrl&&ue(l,p[0].authUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function gO(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Token URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://example.com/token/",h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0].tokenUrl),S(p,a,m),S(p,u,m),f||(d=J(l,"input",n[3]),f=!0)},p(p,m){m&32&&i!==(i=p[5])&&h(e,"for",i),m&32&&o!==(o=p[5])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].tokenUrl&&ue(l,p[0].tokenUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function bO(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("User API URL"),s=E(),l=y("input"),a=E(),u=y("div"),u.textContent="Eg. https://example.com/userinfo/",h(e,"for",i=n[5]),h(l,"type","url"),h(l,"id",o=n[5]),l.required=r=n[0].enabled,h(u,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0].userApiUrl),S(p,a,m),S(p,u,m),f||(d=J(l,"input",n[4]),f=!0)},p(p,m){m&32&&i!==(i=p[5])&&h(e,"for",i),m&32&&o!==(o=p[5])&&h(l,"id",o),m&1&&r!==(r=p[0].enabled)&&(l.required=r),m&1&&l.value!==p[0].userApiUrl&&ue(l,p[0].userApiUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function vO(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[_O,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[gO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[bO,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),o=E(),z(r.$$.fragment),h(e,"class","section-title")},m(u,f){S(u,e,f),S(u,t,f),V(i,u,f),S(u,s,f),V(l,u,f),S(u,o,f),V(r,u,f),a=!0},p(u,[f]){const d={};f&1&&(d.class="form-field "+(u[0].enabled?"required":"")),f&2&&(d.name=u[1]+".authUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&1&&(p.class="form-field "+(u[0].enabled?"required":"")),f&2&&(p.name=u[1]+".tokenUrl"),f&97&&(p.$$scope={dirty:f,ctx:u}),l.$set(p);const m={};f&1&&(m.class="form-field "+(u[0].enabled?"required":"")),f&2&&(m.name=u[1]+".userApiUrl"),f&97&&(m.$$scope={dirty:f,ctx:u}),r.$set(m)},i(u){a||(A(i.$$.fragment,u),A(l.$$.fragment,u),A(r.$$.fragment,u),a=!0)},o(u){P(i.$$.fragment,u),P(l.$$.fragment,u),P(r.$$.fragment,u),a=!1},d(u){u&&w(e),u&&w(t),H(i,u),u&&w(s),H(l,u),u&&w(o),H(r,u)}}}function yO(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 Nr extends ve{constructor(e){super(),be(this,e,yO,vO,_e,{key:1,config:0})}}function kO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Client ID"),s=E(),l=y("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[2]),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&4&&l.value!==u[2]&&ue(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function wO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Team ID"),s=E(),l=y("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[3]),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&8&&l.value!==u[3]&&ue(l,u[3])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function SO(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Key ID"),s=E(),l=y("input"),h(e,"for",i=n[23]),h(l,"type","text"),h(l,"id",o=n[23]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[4]),r||(a=J(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&h(e,"for",i),f&8388608&&o!==(o=u[23])&&h(l,"id",o),f&16&&l.value!==u[4]&&ue(l,u[4])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function $O(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("span"),t.textContent="Duration (in seconds)",i=E(),s=y("i"),o=E(),r=y("input"),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[23]),h(r,"type","text"),h(r,"id",a=n[23]),h(r,"max",mo),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[6]),u||(f=[Ee(Ue.call(null,s,{text:`Max ${mo} seconds (~${mo/(60*60*24*30)<<0} months).`,position:"top"})),J(r,"input",n[15])],u=!0)},p(d,p){p&8388608&&l!==(l=d[23])&&h(e,"for",l),p&8388608&&a!==(a=d[23])&&h(r,"id",a),p&64&&r.value!==d[6]&&ue(r,d[6])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,De(f)}}}function TO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Private key"),s=E(),l=y("textarea"),r=E(),a=y("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",h(e,"for",i=n[23]),h(l,"id",o=n[23]),l.required=!0,h(l,"rows","8"),h(l,"placeholder",`-----BEGIN PRIVATE KEY----- ... ------END PRIVATE KEY-----`),h(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[5]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[16]),u=!0)},p(d,p){p&8388608&&i!==(i=d[23])&&h(e,"for",i),p&8388608&&o!==(o=d[23])&&h(l,"id",o),p&32&&ue(l,d[5])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function TO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$;return s=new de({props:{class:"form-field required",name:"clientId",$$slots:{default:[yO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"teamId",$$slots:{default:[kO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"keyId",$$slots:{default:[wO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new de({props:{class:"form-field required",name:"duration",$$slots:{default:[SO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"privateKey",$$slots:{default:[$O,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),a=E(),u=y("div"),z(f.$$.fragment),d=E(),p=y("div"),z(m.$$.fragment),_=E(),z(g.$$.fragment),h(i,"class","col-lg-6"),h(o,"class","col-lg-6"),h(u,"class","col-lg-6"),h(p,"class","col-lg-6"),h(t,"class","grid"),h(e,"id",n[9]),h(e,"autocomplete","off")},m(T,C){S(T,e,C),v(e,t),v(t,i),V(s,i,null),v(t,l),v(t,o),V(r,o,null),v(t,a),v(t,u),V(f,u,null),v(t,d),v(t,p),V(m,p,null),v(t,_),V(g,t,null),b=!0,k||($=J(e,"submit",ft(n[17])),k=!0)},p(T,C){const D={};C&25165828&&(D.$$scope={dirty:C,ctx:T}),s.$set(D);const M={};C&25165832&&(M.$$scope={dirty:C,ctx:T}),r.$set(M);const O={};C&25165840&&(O.$$scope={dirty:C,ctx:T}),f.$set(O);const I={};C&25165888&&(I.$$scope={dirty:C,ctx:T}),m.$set(I);const L={};C&25165856&&(L.$$scope={dirty:C,ctx:T}),g.$set(L)},i(T){b||(A(s.$$.fragment,T),A(r.$$.fragment,T),A(f.$$.fragment,T),A(m.$$.fragment,T),A(g.$$.fragment,T),b=!0)},o(T){P(s.$$.fragment,T),P(r.$$.fragment,T),P(f.$$.fragment,T),P(m.$$.fragment,T),P(g.$$.fragment,T),b=!1},d(T){T&&w(e),H(s),H(r),H(f),H(m),H(g),k=!1,$()}}}function CO(n){let e;return{c(){e=y("h4"),e.textContent="Generate Apple client secret",h(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function MO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("i"),o=E(),r=y("span"),r.textContent="Generate and set secret",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[7],h(l,"class","ri-key-line"),h(r,"class","txt"),h(s,"type","submit"),h(s,"form",n[9]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&128&&(e.disabled=d[7]),p&384&&a!==(a=!d[8]||d[7])&&(s.disabled=a),p&128&&x(s,"btn-loading",d[7])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function OO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[MO],header:[CO],default:[TO]},$$scope:{ctx:n}};return e=new pn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}const mo=15777e3;function DO(n,e,t){let i;const s=kt(),l="apple_secret_"+j.randomString(5);let o,r,a,u,f,d,p=!1;function m(F={}){t(2,r=F.clientId||""),t(3,a=F.teamId||""),t(4,u=F.keyId||""),t(5,f=F.privateKey||""),t(6,d=F.duration||mo),dn({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function g(){t(7,p=!0);try{const F=await me.settings.generateAppleClientSecret(r,a,u,f.trim(),d);t(7,p=!1),Jt("Successfully generated client secret."),s("submit",F),o==null||o.hide()}catch(F){me.errorResponseHandler(F)}t(7,p=!1)}function b(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function $(){u=this.value,t(4,u)}function T(){d=this.value,t(6,d)}function C(){f=this.value,t(5,f)}const D=()=>g(),M=()=>!p;function O(F){se[F?"unshift":"push"](()=>{o=F,t(1,o)})}function I(F){pe.call(this,n,F)}function L(F){pe.call(this,n,F)}return t(8,i=!0),[_,o,r,a,u,f,d,p,i,l,g,m,b,k,$,T,C,D,M,O,I,L]}class EO extends ve{constructor(e){super(),be(this,e,DO,OO,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function AO(n){let e,t,i,s,l,o,r,a,u,f,d={};return r=new EO({props:d}),n[4](r),r.$on("submit",n[5]),{c(){e=y("button"),t=y("i"),i=E(),s=y("span"),s.textContent="Generate secret",o=E(),z(r.$$.fragment),h(t,"class","ri-key-line"),h(s,"class","txt"),h(e,"type","button"),h(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(p,m){S(p,e,m),v(e,t),v(e,i),v(e,s),S(p,o,m),V(r,p,m),a=!0,u||(f=J(e,"click",n[3]),u=!0)},p(p,[m]){(!a||m&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+p[1]))&&h(e,"class",l);const _={};r.$set(_)},i(p){a||(A(r.$$.fragment,p),a=!0)},o(p){P(r.$$.fragment,p),a=!1},d(p){p&&w(e),p&&w(o),n[4](null),H(r,p),u=!1,f()}}}function IO(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){se[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class PO extends ve{constructor(e){super(),be(this,e,IO,AO,_e,{key:1,config:0})}}const fl=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:PO},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:mO},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:lm},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:lm},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Nr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Nr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Nr}];function om(n,e,t){const i=n.slice();return i[9]=e[t],i}function LO(n){let e;return{c(){e=y("h6"),e.textContent="No linked OAuth2 providers.",h(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function NO(n){let e,t=n[1],i=[];for(let s=0;s',h(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function rm(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,d=n[9].providerId+"",p,m,_,g,b,k;function $(){return n[6](n[9])}return{c(){e=y("div"),t=y("i"),s=E(),l=y("span"),r=U(o),a=E(),u=y("div"),f=U("ID: "),p=U(d),m=E(),_=y("button"),_.innerHTML='',g=E(),h(t,"class",i=n[4](n[9].provider)),h(l,"class","txt"),h(u,"class","txt-hint"),h(_,"type","button"),h(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),h(e,"class","list-item")},m(T,C){S(T,e,C),v(e,t),v(e,s),v(e,l),v(l,r),v(e,a),v(e,u),v(u,f),v(u,p),v(e,m),v(e,_),v(e,g),b||(k=J(_,"click",$),b=!0)},p(T,C){n=T,C&2&&i!==(i=n[4](n[9].provider))&&h(t,"class",i),C&2&&o!==(o=n[3](n[9].provider)+"")&&le(r,o),C&2&&d!==(d=n[9].providerId+"")&&le(p,d)},d(T){T&&w(e),b=!1,k()}}}function RO(n){let e;function t(l,o){var r;return l[2]?FO:(r=l[0])!=null&&r.id&&l[1].length?NO:LO}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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:Q,o:Q,d(l){s.d(l),l&&w(e)}}}function qO(n,e,t){const i=kt();let{record:s}=e,l=[],o=!1;function r(p){var m;return((m=fl[p+"Auth"])==null?void 0:m.title)||j.sentenize(p,!1)}function a(p){var m;return((m=fl[p+"Auth"])==null?void 0:m.icon)||`ri-${p}-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 me.collection(s.collectionId).listExternalAuths(s.id))}catch(p){me.errorResponseHandler(p)}t(2,o=!1)}function f(p){!(s!=null&&s.id)||!p||vn(`Do you really want to unlink the ${r(p)} provider?`,()=>me.collection(s.collectionId).unlinkExternalAuth(s.id,p).then(()=>{Jt(`Successfully unlinked the ${r(p)} provider.`),i("unlink",p),u()}).catch(m=>{me.errorResponseHandler(m)}))}u();const d=p=>f(p.provider);return n.$$set=p=>{"record"in p&&t(0,s=p.record)},[s,l,o,r,a,f,d]}class jO extends ve{constructor(e){super(),be(this,e,qO,RO,_e,{record:0})}}function am(n,e,t){const i=n.slice();return i[56]=e[t],i[57]=e,i[58]=t,i}function um(n){let e,t,i,s,l;return{c(){e=y("div"),t=y("i"),h(t,"class","ri-calendar-event-line txt-disabled"),h(e,"class","form-field-addon")},m(o,r){S(o,e,r),v(e,t),s||(l=Ee(i=Ue.call(null,t,{text:`Created: ${n[3].created} +-----END PRIVATE KEY-----`),h(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ue(l,n[5]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[16]),u=!0)},p(d,p){p&8388608&&i!==(i=d[23])&&h(e,"for",i),p&8388608&&o!==(o=d[23])&&h(l,"id",o),p&32&&ue(l,d[5])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function CO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$;return s=new de({props:{class:"form-field required",name:"clientId",$$slots:{default:[kO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"teamId",$$slots:{default:[wO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"keyId",$$slots:{default:[SO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new de({props:{class:"form-field required",name:"duration",$$slots:{default:[$O,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"privateKey",$$slots:{default:[TO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),a=E(),u=y("div"),z(f.$$.fragment),d=E(),p=y("div"),z(m.$$.fragment),_=E(),z(g.$$.fragment),h(i,"class","col-lg-6"),h(o,"class","col-lg-6"),h(u,"class","col-lg-6"),h(p,"class","col-lg-6"),h(t,"class","grid"),h(e,"id",n[9]),h(e,"autocomplete","off")},m(T,C){S(T,e,C),v(e,t),v(t,i),V(s,i,null),v(t,l),v(t,o),V(r,o,null),v(t,a),v(t,u),V(f,u,null),v(t,d),v(t,p),V(m,p,null),v(t,_),V(g,t,null),b=!0,k||($=J(e,"submit",ft(n[17])),k=!0)},p(T,C){const D={};C&25165828&&(D.$$scope={dirty:C,ctx:T}),s.$set(D);const M={};C&25165832&&(M.$$scope={dirty:C,ctx:T}),r.$set(M);const O={};C&25165840&&(O.$$scope={dirty:C,ctx:T}),f.$set(O);const I={};C&25165888&&(I.$$scope={dirty:C,ctx:T}),m.$set(I);const L={};C&25165856&&(L.$$scope={dirty:C,ctx:T}),g.$set(L)},i(T){b||(A(s.$$.fragment,T),A(r.$$.fragment,T),A(f.$$.fragment,T),A(m.$$.fragment,T),A(g.$$.fragment,T),b=!0)},o(T){P(s.$$.fragment,T),P(r.$$.fragment,T),P(f.$$.fragment,T),P(m.$$.fragment,T),P(g.$$.fragment,T),b=!1},d(T){T&&w(e),H(s),H(r),H(f),H(m),H(g),k=!1,$()}}}function MO(n){let e;return{c(){e=y("h4"),e.textContent="Generate Apple client secret",h(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function OO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("i"),o=E(),r=y("span"),r.textContent="Generate and set secret",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[7],h(l,"class","ri-key-line"),h(r,"class","txt"),h(s,"type","submit"),h(s,"form",n[9]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&128&&(e.disabled=d[7]),p&384&&a!==(a=!d[8]||d[7])&&(s.disabled=a),p&128&&x(s,"btn-loading",d[7])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function DO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[OO],header:[MO],default:[CO]},$$scope:{ctx:n}};return e=new pn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}const mo=15777e3;function EO(n,e,t){let i;const s=kt(),l="apple_secret_"+j.randomString(5);let o,r,a,u,f,d,p=!1;function m(F={}){t(2,r=F.clientId||""),t(3,a=F.teamId||""),t(4,u=F.keyId||""),t(5,f=F.privateKey||""),t(6,d=F.duration||mo),dn({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function g(){t(7,p=!0);try{const F=await me.settings.generateAppleClientSecret(r,a,u,f.trim(),d);t(7,p=!1),Jt("Successfully generated client secret."),s("submit",F),o==null||o.hide()}catch(F){me.errorResponseHandler(F)}t(7,p=!1)}function b(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function $(){u=this.value,t(4,u)}function T(){d=this.value,t(6,d)}function C(){f=this.value,t(5,f)}const D=()=>g(),M=()=>!p;function O(F){se[F?"unshift":"push"](()=>{o=F,t(1,o)})}function I(F){pe.call(this,n,F)}function L(F){pe.call(this,n,F)}return t(8,i=!0),[_,o,r,a,u,f,d,p,i,l,g,m,b,k,$,T,C,D,M,O,I,L]}class AO extends ve{constructor(e){super(),be(this,e,EO,DO,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function IO(n){let e,t,i,s,l,o,r,a,u,f,d={};return r=new AO({props:d}),n[4](r),r.$on("submit",n[5]),{c(){e=y("button"),t=y("i"),i=E(),s=y("span"),s.textContent="Generate secret",o=E(),z(r.$$.fragment),h(t,"class","ri-key-line"),h(s,"class","txt"),h(e,"type","button"),h(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(p,m){S(p,e,m),v(e,t),v(e,i),v(e,s),S(p,o,m),V(r,p,m),a=!0,u||(f=J(e,"click",n[3]),u=!0)},p(p,[m]){(!a||m&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+p[1]))&&h(e,"class",l);const _={};r.$set(_)},i(p){a||(A(r.$$.fragment,p),a=!0)},o(p){P(r.$$.fragment,p),a=!1},d(p){p&&w(e),p&&w(o),n[4](null),H(r,p),u=!1,f()}}}function PO(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){se[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class LO extends ve{constructor(e){super(),be(this,e,PO,IO,_e,{key:1,config:0})}}const fl=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:LO},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:hO},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:lm},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:lm},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Nr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Nr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Nr}];function om(n,e,t){const i=n.slice();return i[9]=e[t],i}function NO(n){let e;return{c(){e=y("h6"),e.textContent="No linked OAuth2 providers.",h(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function FO(n){let e,t=n[1],i=[];for(let s=0;s',h(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function rm(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,d=n[9].providerId+"",p,m,_,g,b,k;function $(){return n[6](n[9])}return{c(){e=y("div"),t=y("i"),s=E(),l=y("span"),r=U(o),a=E(),u=y("div"),f=U("ID: "),p=U(d),m=E(),_=y("button"),_.innerHTML='',g=E(),h(t,"class",i=n[4](n[9].provider)),h(l,"class","txt"),h(u,"class","txt-hint"),h(_,"type","button"),h(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),h(e,"class","list-item")},m(T,C){S(T,e,C),v(e,t),v(e,s),v(e,l),v(l,r),v(e,a),v(e,u),v(u,f),v(u,p),v(e,m),v(e,_),v(e,g),b||(k=J(_,"click",$),b=!0)},p(T,C){n=T,C&2&&i!==(i=n[4](n[9].provider))&&h(t,"class",i),C&2&&o!==(o=n[3](n[9].provider)+"")&&le(r,o),C&2&&d!==(d=n[9].providerId+"")&&le(p,d)},d(T){T&&w(e),b=!1,k()}}}function qO(n){let e;function t(l,o){var r;return l[2]?RO:(r=l[0])!=null&&r.id&&l[1].length?FO:NO}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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:Q,o:Q,d(l){s.d(l),l&&w(e)}}}function jO(n,e,t){const i=kt();let{record:s}=e,l=[],o=!1;function r(p){var m;return((m=fl[p+"Auth"])==null?void 0:m.title)||j.sentenize(p,!1)}function a(p){var m;return((m=fl[p+"Auth"])==null?void 0:m.icon)||`ri-${p}-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 me.collection(s.collectionId).listExternalAuths(s.id))}catch(p){me.errorResponseHandler(p)}t(2,o=!1)}function f(p){!(s!=null&&s.id)||!p||vn(`Do you really want to unlink the ${r(p)} provider?`,()=>me.collection(s.collectionId).unlinkExternalAuth(s.id,p).then(()=>{Jt(`Successfully unlinked the ${r(p)} provider.`),i("unlink",p),u()}).catch(m=>{me.errorResponseHandler(m)}))}u();const d=p=>f(p.provider);return n.$$set=p=>{"record"in p&&t(0,s=p.record)},[s,l,o,r,a,f,d]}class VO extends ve{constructor(e){super(),be(this,e,jO,qO,_e,{record:0})}}function am(n,e,t){const i=n.slice();return i[56]=e[t],i[57]=e,i[58]=t,i}function um(n){let e,t,i,s,l;return{c(){e=y("div"),t=y("i"),h(t,"class","ri-calendar-event-line txt-disabled"),h(e,"class","form-field-addon")},m(o,r){S(o,e,r),v(e,t),s||(l=Ee(i=Ue.call(null,t,{text:`Created: ${n[3].created} Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&Ut(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created} -Updated: ${o[3].updated}`,position:"left"})},d(o){o&&w(e),s=!1,l()}}}function VO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g=!n[6]&&um(n);return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="id",l=E(),o=y("span"),a=E(),g&&g.c(),u=E(),f=y("input"),h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(o,"class","flex-fill"),h(e,"for",r=n[59]),h(f,"type","text"),h(f,"id",d=n[59]),h(f,"placeholder","Leave empty to auto generate..."),h(f,"minlength","15"),f.readOnly=p=!n[6]},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),S(b,a,k),g&&g.m(b,k),S(b,u,k),S(b,f,k),ue(f,n[3].id),m||(_=J(f,"input",n[31]),m=!0)},p(b,k){k[1]&268435456&&r!==(r=b[59])&&h(e,"for",r),b[6]?g&&(g.d(1),g=null):g?g.p(b,k):(g=um(b),g.c(),g.m(u.parentNode,u)),k[1]&268435456&&d!==(d=b[59])&&h(f,"id",d),k[0]&64&&p!==(p=!b[6])&&(f.readOnly=p),k[0]&8&&f.value!==b[3].id&&ue(f,b[3].id)},d(b){b&&w(e),b&&w(a),g&&g.d(b),b&&w(u),b&&w(f),m=!1,_()}}}function fm(n){var u,f;let e,t,i,s,l;function o(d){n[32](d)}let r={collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new h5({props:r}),se.push(()=>he(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&cm();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=Se()},m(d,p){V(e,d,p),S(d,i,p),a&&a.m(d,p),S(d,s,p),l=!0},p(d,p){var _,g;const m={};p[0]&1&&(m.collection=d[0]),!t&&p[0]&8&&(t=!0,m.record=d[3],ke(()=>t=!1)),e.$set(m),(g=(_=d[0])==null?void 0:_.schema)!=null&&g.length?a||(a=cm(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(d){l||(A(e.$$.fragment,d),l=!0)},o(d){P(e.$$.fragment,d),l=!1},d(d){H(e,d),d&&w(i),a&&a.d(d),d&&w(s)}}}function cm(n){let e;return{c(){e=y("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function HO(n){let e,t,i;function s(o){n[45](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new YM({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function zO(n){let e,t,i,s,l;function o(f){n[42](f,n[56])}function r(f){n[43](f,n[56])}function a(f){n[44](f,n[56])}let u={field:n[56],record:n[3]};return n[3][n[56].name]!==void 0&&(u.value=n[3][n[56].name]),n[4][n[56].name]!==void 0&&(u.uploadedFiles=n[4][n[56].name]),n[5][n[56].name]!==void 0&&(u.deletedFileIndexes=n[5][n[56].name]),e=new wM({props:u}),se.push(()=>he(e,"value",o)),se.push(()=>he(e,"uploadedFiles",r)),se.push(()=>he(e,"deletedFileIndexes",a)),{c(){z(e.$$.fragment)},m(f,d){V(e,f,d),l=!0},p(f,d){n=f;const p={};d[0]&1&&(p.field=n[56]),d[0]&8&&(p.record=n[3]),!t&&d[0]&9&&(t=!0,p.value=n[3][n[56].name],ke(()=>t=!1)),!i&&d[0]&17&&(i=!0,p.uploadedFiles=n[4][n[56].name],ke(()=>i=!1)),!s&&d[0]&33&&(s=!0,p.deletedFileIndexes=n[5][n[56].name],ke(()=>s=!1)),e.$set(p)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){H(e,f)}}}function BO(n){let e,t,i;function s(o){n[41](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new G5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function UO(n){let e,t,i;function s(o){n[40](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new Y5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function WO(n){let e,t,i;function s(o){n[39](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new z5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function YO(n){let e,t,i;function s(o){n[38](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new sO({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function KO(n){let e,t,i;function s(o){n[37](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new q5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function JO(n){let e,t,i;function s(o){n[36](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new L5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ZO(n){let e,t,i;function s(o){n[35](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new E5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function GO(n){let e,t,i;function s(o){n[34](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new C5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function XO(n){let e,t,i;function s(o){n[33](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new w5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function dm(n,e){let t,i,s,l,o;const r=[XO,GO,ZO,JO,KO,YO,WO,UO,BO,zO,HO],a=[];function u(f,d){return f[56].type==="text"?0:f[56].type==="number"?1:f[56].type==="bool"?2:f[56].type==="email"?3:f[56].type==="url"?4:f[56].type==="editor"?5:f[56].type==="date"?6:f[56].type==="select"?7:f[56].type==="json"?8:f[56].type==="file"?9:f[56].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=Se(),s&&s.c(),l=Se(),this.first=t},m(f,d){S(f,t,d),~i&&a[i].m(f,d),S(f,l,d),o=!0},p(f,d){e=f;let p=i;i=u(e),i===p?~i&&a[i].p(e,d):(s&&(re(),P(a[p],1,1,()=>{a[p]=null}),ae()),~i?(s=a[i],s?s.p(e,d):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){P(s),o=!1},d(f){f&&w(t),~i&&a[i].d(f),f&&w(l)}}}function pm(n){let e,t,i;return t=new jO({props:{record:n[3]}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[12]===Sl)},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&4096)&&x(e,"active",s[12]===Sl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function QO(n){var b,k;let e,t,i,s,l,o=[],r=new Map,a,u,f,d;i=new de({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[VO,({uniqueId:$})=>({59:$}),({uniqueId:$})=>[0,$?268435456:0]]},$$scope:{ctx:n}}});let p=((b=n[0])==null?void 0:b.isAuth)&&fm(n),m=((k=n[0])==null?void 0:k.schema)||[];const _=$=>$[56].name;for(let $=0;${p=null}),ae()),T[0]&57&&(m=((M=$[0])==null?void 0:M.schema)||[],re(),o=yt(o,T,_,1,$,m,r,t,Zt,dm,null,am),ae()),(!u||T[0]&4096)&&x(t,"active",$[12]===ns),$[0].$isAuth&&!$[6]?g?(g.p($,T),T[0]&65&&A(g,1)):(g=pm($),g.c(),A(g,1),g.m(e,null)):g&&(re(),P(g,1,1,()=>{g=null}),ae())},i($){if(!u){A(i.$$.fragment,$),A(p);for(let T=0;T +Updated: ${o[3].updated}`,position:"left"})},d(o){o&&w(e),s=!1,l()}}}function HO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g=!n[6]&&um(n);return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="id",l=E(),o=y("span"),a=E(),g&&g.c(),u=E(),f=y("input"),h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(o,"class","flex-fill"),h(e,"for",r=n[59]),h(f,"type","text"),h(f,"id",d=n[59]),h(f,"placeholder","Leave empty to auto generate..."),h(f,"minlength","15"),f.readOnly=p=!n[6]},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),S(b,a,k),g&&g.m(b,k),S(b,u,k),S(b,f,k),ue(f,n[3].id),m||(_=J(f,"input",n[31]),m=!0)},p(b,k){k[1]&268435456&&r!==(r=b[59])&&h(e,"for",r),b[6]?g&&(g.d(1),g=null):g?g.p(b,k):(g=um(b),g.c(),g.m(u.parentNode,u)),k[1]&268435456&&d!==(d=b[59])&&h(f,"id",d),k[0]&64&&p!==(p=!b[6])&&(f.readOnly=p),k[0]&8&&f.value!==b[3].id&&ue(f,b[3].id)},d(b){b&&w(e),b&&w(a),g&&g.d(b),b&&w(u),b&&w(f),m=!1,_()}}}function fm(n){var u,f;let e,t,i,s,l;function o(d){n[32](d)}let r={collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new _5({props:r}),se.push(()=>he(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&cm();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=Se()},m(d,p){V(e,d,p),S(d,i,p),a&&a.m(d,p),S(d,s,p),l=!0},p(d,p){var _,g;const m={};p[0]&1&&(m.collection=d[0]),!t&&p[0]&8&&(t=!0,m.record=d[3],ke(()=>t=!1)),e.$set(m),(g=(_=d[0])==null?void 0:_.schema)!=null&&g.length?a||(a=cm(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(d){l||(A(e.$$.fragment,d),l=!0)},o(d){P(e.$$.fragment,d),l=!1},d(d){H(e,d),d&&w(i),a&&a.d(d),d&&w(s)}}}function cm(n){let e;return{c(){e=y("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function zO(n){let e,t,i;function s(o){n[45](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new KM({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function BO(n){let e,t,i,s,l;function o(f){n[42](f,n[56])}function r(f){n[43](f,n[56])}function a(f){n[44](f,n[56])}let u={field:n[56],record:n[3]};return n[3][n[56].name]!==void 0&&(u.value=n[3][n[56].name]),n[4][n[56].name]!==void 0&&(u.uploadedFiles=n[4][n[56].name]),n[5][n[56].name]!==void 0&&(u.deletedFileIndexes=n[5][n[56].name]),e=new SM({props:u}),se.push(()=>he(e,"value",o)),se.push(()=>he(e,"uploadedFiles",r)),se.push(()=>he(e,"deletedFileIndexes",a)),{c(){z(e.$$.fragment)},m(f,d){V(e,f,d),l=!0},p(f,d){n=f;const p={};d[0]&1&&(p.field=n[56]),d[0]&8&&(p.record=n[3]),!t&&d[0]&9&&(t=!0,p.value=n[3][n[56].name],ke(()=>t=!1)),!i&&d[0]&17&&(i=!0,p.uploadedFiles=n[4][n[56].name],ke(()=>i=!1)),!s&&d[0]&33&&(s=!0,p.deletedFileIndexes=n[5][n[56].name],ke(()=>s=!1)),e.$set(p)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){H(e,f)}}}function UO(n){let e,t,i;function s(o){n[41](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new X5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function WO(n){let e,t,i;function s(o){n[40](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new K5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function YO(n){let e,t,i;function s(o){n[39](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new B5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function KO(n){let e,t,i;function s(o){n[38](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new lO({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function JO(n){let e,t,i;function s(o){n[37](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new j5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ZO(n){let e,t,i;function s(o){n[36](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new N5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function GO(n){let e,t,i;function s(o){n[35](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new A5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function XO(n){let e,t,i;function s(o){n[34](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new M5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function QO(n){let e,t,i;function s(o){n[33](o,n[56])}let l={field:n[56]};return n[3][n[56].name]!==void 0&&(l.value=n[3][n[56].name]),e=new S5({props:l}),se.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[56]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[56].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function dm(n,e){let t,i,s,l,o;const r=[QO,XO,GO,ZO,JO,KO,YO,WO,UO,BO,zO],a=[];function u(f,d){return f[56].type==="text"?0:f[56].type==="number"?1:f[56].type==="bool"?2:f[56].type==="email"?3:f[56].type==="url"?4:f[56].type==="editor"?5:f[56].type==="date"?6:f[56].type==="select"?7:f[56].type==="json"?8:f[56].type==="file"?9:f[56].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=Se(),s&&s.c(),l=Se(),this.first=t},m(f,d){S(f,t,d),~i&&a[i].m(f,d),S(f,l,d),o=!0},p(f,d){e=f;let p=i;i=u(e),i===p?~i&&a[i].p(e,d):(s&&(re(),P(a[p],1,1,()=>{a[p]=null}),ae()),~i?(s=a[i],s?s.p(e,d):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){P(s),o=!1},d(f){f&&w(t),~i&&a[i].d(f),f&&w(l)}}}function pm(n){let e,t,i;return t=new VO({props:{record:n[3]}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[12]===Sl)},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&4096)&&x(e,"active",s[12]===Sl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function xO(n){var b,k;let e,t,i,s,l,o=[],r=new Map,a,u,f,d;i=new de({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[HO,({uniqueId:$})=>({59:$}),({uniqueId:$})=>[0,$?268435456:0]]},$$scope:{ctx:n}}});let p=((b=n[0])==null?void 0:b.isAuth)&&fm(n),m=((k=n[0])==null?void 0:k.schema)||[];const _=$=>$[56].name;for(let $=0;${p=null}),ae()),T[0]&57&&(m=((M=$[0])==null?void 0:M.schema)||[],re(),o=yt(o,T,_,1,$,m,r,t,Zt,dm,null,am),ae()),(!u||T[0]&4096)&&x(t,"active",$[12]===ns),$[0].$isAuth&&!$[6]?g?(g.p($,T),T[0]&65&&A(g,1)):(g=pm($),g.c(),A(g,1),g.m(e,null)):g&&(re(),P(g,1,1,()=>{g=null}),ae())},i($){if(!u){A(i.$$.fragment,$),A(p);for(let T=0;T Send verification email`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function _m(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` - Send password reset email`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[26]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function xO(n){let e,t,i,s,l,o,r,a=n[0].$isAuth&&!n[2].verified&&n[2].email&&hm(n),u=n[0].$isAuth&&n[2].email&&_m(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=y("button"),i.innerHTML=` + Send password reset email`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[26]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function eD(n){let e,t,i,s,l,o,r,a=n[0].$isAuth&&!n[2].verified&&n[2].email&&hm(n),u=n[0].$isAuth&&n[2].email&&_m(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=y("button"),i.innerHTML=` Duplicate`,s=E(),l=y("button"),l.innerHTML=` - Delete`,h(i,"type","button"),h(i,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item txt-danger closable")},m(f,d){a&&a.m(f,d),S(f,e,d),u&&u.m(f,d),S(f,t,d),S(f,i,d),S(f,s,d),S(f,l,d),o||(r=[J(i,"click",n[27]),J(l,"click",En(ft(n[28])))],o=!0)},p(f,d){f[0].$isAuth&&!f[2].verified&&f[2].email?a?a.p(f,d):(a=hm(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].$isAuth&&f[2].email?u?u.p(f,d):(u=_m(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,De(r)}}}function gm(n){let e,t,i,s,l,o;return{c(){e=y("div"),t=y("button"),t.textContent="Account",i=E(),s=y("button"),s.textContent="Authorized providers",h(t,"type","button"),h(t,"class","tab-item"),x(t,"active",n[12]===ns),h(s,"type","button"),h(s,"class","tab-item"),x(s,"active",n[12]===Sl),h(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=[J(t,"click",n[29]),J(s,"click",n[30])],l=!0)},p(r,a){a[0]&4096&&x(t,"active",r[12]===ns),a[0]&4096&&x(s,"active",r[12]===Sl)},d(r){r&&w(e),l=!1,De(o)}}}function eD(n){var g;let e,t=n[6]?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,d,p,m=!n[6]&&mm(n),_=n[0].$isAuth&&!n[6]&&gm(n);return{c(){e=y("h4"),i=U(t),s=E(),l=y("strong"),r=U(o),a=U(" record"),u=E(),m&&m.c(),f=E(),_&&_.c(),d=Se()},m(b,k){S(b,e,k),v(e,i),v(e,s),v(e,l),v(l,r),v(e,a),S(b,u,k),m&&m.m(b,k),S(b,f,k),_&&_.m(b,k),S(b,d,k),p=!0},p(b,k){var $;(!p||k[0]&64)&&t!==(t=b[6]?"New":"Edit")&&le(i,t),(!p||k[0]&1)&&o!==(o=(($=b[0])==null?void 0:$.name)+"")&&le(r,o),b[6]?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(b,k),k[0]&64&&A(m,1)):(m=mm(b),m.c(),A(m,1),m.m(f.parentNode,f)),b[0].$isAuth&&!b[6]?_?_.p(b,k):(_=gm(b),_.c(),_.m(d.parentNode,d)):_&&(_.d(1),_=null)},i(b){p||(A(m),p=!0)},o(b){P(m),p=!1},d(b){b&&w(e),b&&w(u),m&&m.d(b),b&&w(f),_&&_.d(b),b&&w(d)}}}function tD(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),r=U(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[10],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[15]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[13]||n[10],x(s,"btn-loading",n[10])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(l,r),u||(f=J(e,"click",n[24]),u=!0)},p(d,p){p[0]&1024&&(e.disabled=d[10]),p[0]&64&&o!==(o=d[6]?"Create":"Save changes")&&le(r,o),p[0]&9216&&a!==(a=!d[13]||d[10])&&(s.disabled=a),p[0]&1024&&x(s,"btn-loading",d[10])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function nD(n){var s;let e,t,i={class:` + Delete`,h(i,"type","button"),h(i,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item txt-danger closable")},m(f,d){a&&a.m(f,d),S(f,e,d),u&&u.m(f,d),S(f,t,d),S(f,i,d),S(f,s,d),S(f,l,d),o||(r=[J(i,"click",n[27]),J(l,"click",En(ft(n[28])))],o=!0)},p(f,d){f[0].$isAuth&&!f[2].verified&&f[2].email?a?a.p(f,d):(a=hm(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].$isAuth&&f[2].email?u?u.p(f,d):(u=_m(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,De(r)}}}function gm(n){let e,t,i,s,l,o;return{c(){e=y("div"),t=y("button"),t.textContent="Account",i=E(),s=y("button"),s.textContent="Authorized providers",h(t,"type","button"),h(t,"class","tab-item"),x(t,"active",n[12]===ns),h(s,"type","button"),h(s,"class","tab-item"),x(s,"active",n[12]===Sl),h(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=[J(t,"click",n[29]),J(s,"click",n[30])],l=!0)},p(r,a){a[0]&4096&&x(t,"active",r[12]===ns),a[0]&4096&&x(s,"active",r[12]===Sl)},d(r){r&&w(e),l=!1,De(o)}}}function tD(n){var g;let e,t=n[6]?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,d,p,m=!n[6]&&mm(n),_=n[0].$isAuth&&!n[6]&&gm(n);return{c(){e=y("h4"),i=U(t),s=E(),l=y("strong"),r=U(o),a=U(" record"),u=E(),m&&m.c(),f=E(),_&&_.c(),d=Se()},m(b,k){S(b,e,k),v(e,i),v(e,s),v(e,l),v(l,r),v(e,a),S(b,u,k),m&&m.m(b,k),S(b,f,k),_&&_.m(b,k),S(b,d,k),p=!0},p(b,k){var $;(!p||k[0]&64)&&t!==(t=b[6]?"New":"Edit")&&le(i,t),(!p||k[0]&1)&&o!==(o=(($=b[0])==null?void 0:$.name)+"")&&le(r,o),b[6]?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(b,k),k[0]&64&&A(m,1)):(m=mm(b),m.c(),A(m,1),m.m(f.parentNode,f)),b[0].$isAuth&&!b[6]?_?_.p(b,k):(_=gm(b),_.c(),_.m(d.parentNode,d)):_&&(_.d(1),_=null)},i(b){p||(A(m),p=!0)},o(b){P(m),p=!1},d(b){b&&w(e),b&&w(u),m&&m.d(b),b&&w(f),_&&_.d(b),b&&w(d)}}}function nD(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),r=U(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[10],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[15]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[13]||n[10],x(s,"btn-loading",n[10])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(l,r),u||(f=J(e,"click",n[24]),u=!0)},p(d,p){p[0]&1024&&(e.disabled=d[10]),p[0]&64&&o!==(o=d[6]?"Create":"Save changes")&&le(r,o),p[0]&9216&&a!==(a=!d[13]||d[10])&&(s.disabled=a),p[0]&1024&&x(s,"btn-loading",d[10])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function iD(n){var s;let e,t,i={class:` record-panel `+(n[14]?"overlay-panel-xl":"overlay-panel-lg")+` `+((s=n[0])!=null&&s.$isAuth&&!n[6]?"colored-header":"")+` - `,beforeHide:n[47],$$slots:{footer:[tD],header:[eD],default:[QO]},$$scope:{ctx:n}};return e=new pn({props:i}),n[48](e),e.$on("hide",n[49]),e.$on("show",n[50]),{c(){z(e.$$.fragment)},m(l,o){V(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&16449&&(r.class=` + `,beforeHide:n[47],$$slots:{footer:[nD],header:[tD],default:[xO]},$$scope:{ctx:n}};return e=new pn({props:i}),n[48](e),e.$on("hide",n[49]),e.$on("show",n[50]),{c(){z(e.$$.fragment)},m(l,o){V(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&16449&&(r.class=` record-panel `+(l[14]?"overlay-panel-xl":"overlay-panel-lg")+` `+((a=l[0])!=null&&a.$isAuth&&!l[6]?"colored-header":"")+` - `),o[0]&2176&&(r.beforeHide=l[47]),o[0]&13949|o[1]&536870912&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[48](null),H(e,l)}}}const ns="form",Sl="providers";function bm(n){return JSON.stringify(n)}function iD(n,e,t){let i,s,l,o;const r=kt(),a="record_"+j.randomString(5);let{collection:u}=e,f,d,p=null,m=new pi,_=!1,g=!1,b={},k={},$="",T=ns,C=!0;function D(ye){O(ye),t(11,g=!0),t(12,T=ns),f==null||f.show(),B()}function M(){f==null||f.hide()}async function O(ye){dn({}),t(2,p=ye||new pi),ye!=null&&ye.$clone?t(3,m=ye.$clone()):t(3,m=new pi),t(4,b={}),t(5,k={}),await ln(),t(22,$=bm(m))}function I(){if(_||!o||!(u!=null&&u.id))return;t(10,_=!0);const ye=F();let je;C?je=me.collection(u.id).create(ye):je=me.collection(u.id).update(m.id,ye),je.then(gt=>{Jt(C?"Successfully created record.":"Successfully updated record."),t(11,g=!1),M(),r("save",gt)}).catch(gt=>{me.errorResponseHandler(gt)}).finally(()=>{t(10,_=!1)})}function L(){p!=null&&p.id&&vn("Do you really want to delete the selected record?",()=>me.collection(p.collectionId).delete(p.id).then(()=>{M(),Jt("Successfully deleted record."),r("delete",p)}).catch(ye=>{me.errorResponseHandler(ye)}))}function F(){const ye=(m==null?void 0:m.$export())||{},je=new FormData,gt={id:ye.id};for(const Ge of(u==null?void 0:u.schema)||[])gt[Ge.name]=!0;u!=null&&u.isAuth&&(gt.username=!0,gt.email=!0,gt.emailVisibility=!0,gt.password=!0,gt.passwordConfirm=!0,gt.verified=!0);for(const Ge in ye)gt[Ge]&&(typeof ye[Ge]>"u"&&(ye[Ge]=null),j.addValueToFormData(je,Ge,ye[Ge]));for(const Ge in b){const mn=j.toArray(b[Ge]);for(const vi of mn)je.append(Ge,vi)}for(const Ge in k){const mn=j.toArray(k[Ge]);for(const vi of mn)je.append(Ge+"."+vi,"")}return je}function R(){!(u!=null&&u.id)||!(p!=null&&p.email)||vn(`Do you really want to sent verification email to ${p.email}?`,()=>me.collection(u.id).requestVerification(p.email).then(()=>{Jt(`Successfully sent verification email to ${p.email}.`)}).catch(ye=>{me.errorResponseHandler(ye)}))}function N(){!(u!=null&&u.id)||!(p!=null&&p.email)||vn(`Do you really want to sent password reset email to ${p.email}?`,()=>me.collection(u.id).requestPasswordReset(p.email).then(()=>{Jt(`Successfully sent password reset email to ${p.email}.`)}).catch(ye=>{me.errorResponseHandler(ye)}))}function q(){l?vn("You have unsaved changes. Do you really want to discard them?",()=>{Y()}):Y()}async function Y(){const ye=p==null?void 0:p.$clone();if(ye){ye.id="",ye.created="",ye.updated="";const je=(u==null?void 0:u.schema)||[];for(const gt of je)gt.type==="file"&&delete ye[gt.name]}D(ye),await ln(),t(22,$="")}async function B(){var ye;await ln(),C&&(d.querySelector("[autofocus]")||(ye=d==null?void 0:d.querySelector(".form-field:not(.noautofocus) input, .form-field:not(.noautofocus) textarea, .form-field:not(.noautofocus) select"))==null||ye.focus())}const Z=()=>M(),ee=()=>R(),ie=()=>N(),X=()=>q(),fe=()=>L(),G=()=>t(12,T=ns),ce=()=>t(12,T=Sl);function ge(){m.id=this.value,t(3,m)}function Me(ye){m=ye,t(3,m)}function qe(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function He(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function we(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function Ce(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function Je(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function mt(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function Ze(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function We(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function te(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function Fe(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function Qe(ye,je){n.$$.not_equal(b[je.name],ye)&&(b[je.name]=ye,t(4,b))}function Gt(ye,je){n.$$.not_equal(k[je.name],ye)&&(k[je.name]=ye,t(5,k))}function Le(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function $e(ye){se[ye?"unshift":"push"](()=>{d=ye,t(9,d)})}const et=()=>l&&g?(vn("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,g=!1),M()}),!1):(dn({}),!0);function Dt(ye){se[ye?"unshift":"push"](()=>{f=ye,t(8,f)})}function Ft(ye){pe.call(this,n,ye)}function jt(ye){pe.call(this,n,ye)}return n.$$set=ye=>{"collection"in ye&&t(0,u=ye.collection)},n.$$.update=()=>{var ye;n.$$.dirty[0]&1&&t(14,i=!!((ye=u==null?void 0:u.schema)!=null&&ye.find(je=>je.type==="editor"))),n.$$.dirty[0]&48&&t(23,s=j.hasNonEmptyProps(b)||j.hasNonEmptyProps(k)),n.$$.dirty[0]&12582920&&t(7,l=s||$!=bm(m)),n.$$.dirty[0]&4&&t(6,C=!p||p.isNew),n.$$.dirty[0]&192&&t(13,o=C||l)},[u,M,p,m,b,k,C,l,f,d,_,g,T,o,i,a,I,L,R,N,q,D,$,s,Z,ee,ie,X,fe,G,ce,ge,Me,qe,He,we,Ce,Je,mt,Ze,We,te,Fe,Qe,Gt,Le,$e,et,Dt,Ft,jt]}class rb extends ve{constructor(e){super(),be(this,e,iD,nD,_e,{collection:0,show:21,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}}function sD(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class",t=n[2]?n[1]:n[0])},m(o,r){S(o,e,r),s||(l=[Ee(i=Ue.call(null,e,n[2]?"":"Copy")),J(e,"click",En(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&h(e,"class",t),i&&Ut(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:Q,o:Q,d(o){o&&w(e),s=!1,De(l)}}}function lD(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&&(j.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return xt(()=>()=>{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 tr extends ve{constructor(e){super(),be(this,e,lD,sD,_e,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function vm(n,e,t){const i=n.slice();return i[16]=e[t],i[8]=t,i}function ym(n,e,t){const i=n.slice();return i[13]=e[t],i}function km(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function wm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function oD(n){const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray(e[0].expand[e[1].name]);e[10]=i;const s=e[2]?20:200;return e[11]=s,e}function rD(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function aD(n){let e,t;return{c(){e=y("div"),t=U(n[3]),h(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){S(i,e,s),v(e,t)},p(i,s){s&8&&le(t,i[3])},i:Q,o:Q,d(i){i&&w(e)}}}function uD(n){let e,t=j.truncate(n[3])+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=j.truncate(n[3]))},m(l,o){S(l,e,o),v(e,i)},p(l,o){o&8&&t!==(t=j.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=j.truncate(l[3]))&&h(e,"title",s)},i:Q,o:Q,d(l){l&&w(e)}}}function fD(n){let e,t=[],i=new Map,s,l=j.toArray(n[3]);const o=r=>r[8]+r[16];for(let r=0;rn[11]&&Cm();return{c(){e=y("div"),i.c(),s=E(),u&&u.c(),h(e,"class","inline-flex")},m(f,d){S(f,e,d),r[t].m(e,null),v(e,s),u&&u.m(e,null),l=!0},p(f,d){let p=t;t=a(f),t===p?r[t].p(f,d):(re(),P(r[p],1,1,()=>{r[p]=null}),ae(),i=r[t],i?i.p(f,d):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=Cm(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(A(i),l=!0)},o(f){P(i),l=!1},d(f){f&&w(e),r[t].d(),u&&u.d()}}}function dD(n){let e,t=[],i=new Map,s=j.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()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function hD(n){let e,t=j.truncate(n[3])+"",i,s,l;return{c(){e=y("a"),i=U(t),h(e,"class","txt-ellipsis"),h(e,"href",n[3]),h(e,"target","_blank"),h(e,"rel","noopener noreferrer")},m(o,r){S(o,e,r),v(e,i),s||(l=[Ee(Ue.call(null,e,"Open in new tab")),J(e,"click",En(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&le(i,t),r&8&&h(e,"href",o[3])},i:Q,o:Q,d(o){o&&w(e),s=!1,De(l)}}}function _D(n){let e,t;return{c(){e=y("span"),t=U(n[3]),h(e,"class","txt")},m(i,s){S(i,e,s),v(e,t)},p(i,s){s&8&&le(t,i[3])},i:Q,o:Q,d(i){i&&w(e)}}}function gD(n){let e,t=n[3]?"True":"False",i;return{c(){e=y("span"),i=U(t),h(e,"class","txt")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:Q,o:Q,d(s){s&&w(e)}}}function bD(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function vD(n){let e,t,i,s;const l=[TD,$D],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},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()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(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 au({props:{record:e[0],filename:e[16],size:"sm"}}),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),V(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||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),H(i,l)}}}function yD(n){let e,t=n[9].slice(0,n[11]),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&Om(n);return{c(){e=y("span"),i=U(t),s=E(),r&&r.c(),l=Se(),h(e,"class","txt")},m(a,u){S(a,e,u),v(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=j.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=Om(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){o||(A(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 TD(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=j.truncate(s[5])+"")&&le(i,t)},i:Q,o:Q,d(s){s&&w(e)}}}function Om(n){let e,t;return e=new tr({props:{value:JSON.stringify(n[3],null,2)}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function CD(n){let e,t,i,s,l;const o=[vD,bD,gD,_D,hD,mD,pD,dD,cD,fD,uD,aD],r=[];function a(f,d){return d&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!j.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,d){return d===0?rD(f):d===8?oD(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=Se()},m(f,d){r[t].m(f,d),S(f,s,d),l=!0},p(f,[d]){let p=t;t=a(f,d),t===p?r[t].p(u(f,t),d):(re(),P(r[p],1,1,()=>{r[p]=null}),ae(),i=r[t],i?i.p(u(f,t),d):(i=r[t]=o[t](u(f,t)),i.c()),A(i,1),i.m(s.parentNode,s))},i(f){l||(A(i),l=!0)},o(f){P(i),l=!1},d(f){r[t].d(f),f&&w(s)}}}function MD(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){pe.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 ab extends ve{constructor(e){super(),be(this,e,MD,CD,_e,{record:0,field:1,short:2})}}function Dm(n,e,t){const i=n.slice();return i[10]=e[t],i}function Em(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new ab({props:{field:n[10],record:n[3]}}),{c(){e=y("tr"),t=y("td"),s=U(i),l=E(),o=y("td"),z(r.$$.fragment),h(t,"class","min-width txt-hint txt-bold"),h(o,"class","col-field svelte-1nt58f7")},m(u,f){S(u,e,f),v(e,t),v(t,s),v(e,l),v(e,o),V(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&le(s,i);const d={};f&1&&(d.field=u[10]),f&8&&(d.record=u[3]),r.$set(d)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){P(r.$$.fragment,u),a=!1},d(u){u&&w(e),H(r)}}}function Am(n){let e,t,i,s,l,o;return l=new hi({props:{date:n[3].created}}),{c(){e=y("tr"),t=y("td"),t.textContent="created",i=E(),s=y("td"),z(l.$$.fragment),h(t,"class","min-width txt-hint txt-bold"),h(s,"class","col-field svelte-1nt58f7")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),V(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),H(l)}}}function Im(n){let e,t,i,s,l,o;return l=new hi({props:{date:n[3].updated}}),{c(){e=y("tr"),t=y("td"),t.textContent="updated",i=E(),s=y("td"),z(l.$$.fragment),h(t,"class","min-width txt-hint txt-bold"),h(s,"class","col-field svelte-1nt58f7")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),V(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),H(l)}}}function OD(n){var M;let e,t,i,s,l,o,r,a,u,f,d=n[3].id+"",p,m,_,g,b;a=new tr({props:{value:n[3].id}});let k=(M=n[0])==null?void 0:M.schema,$=[];for(let O=0;OP($[O],1,1,()=>{$[O]=null});let C=n[3].created&&Am(n),D=n[3].updated&&Im(n);return{c(){e=y("table"),t=y("tbody"),i=y("tr"),s=y("td"),s.textContent="id",l=E(),o=y("td"),r=y("div"),z(a.$$.fragment),u=E(),f=y("span"),p=U(d),m=E();for(let O=0;O<$.length;O+=1)$[O].c();_=E(),C&&C.c(),g=E(),D&&D.c(),h(s,"class","min-width txt-hint txt-bold"),h(f,"class","txt"),h(r,"class","label"),h(o,"class","col-field svelte-1nt58f7"),h(e,"class","table-border preview-table")},m(O,I){S(O,e,I),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(o,r),V(a,r,null),v(r,u),v(r,f),v(f,p),v(t,m);for(let L=0;L<$.length;L+=1)$[L]&&$[L].m(t,null);v(t,_),C&&C.m(t,null),v(t,g),D&&D.m(t,null),b=!0},p(O,I){var F;const L={};if(I&8&&(L.value=O[3].id),a.$set(L),(!b||I&8)&&d!==(d=O[3].id+"")&&le(p,d),I&9){k=(F=O[0])==null?void 0:F.schema;let R;for(R=0;R{C=null}),ae()),O[3].updated?D?(D.p(O,I),I&8&&A(D,1)):(D=Im(O),D.c(),A(D,1),D.m(t,null)):D&&(re(),P(D,1,1,()=>{D=null}),ae())},i(O){if(!b){A(a.$$.fragment,O);for(let I=0;IClose',h(e,"type","button"),h(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[6]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function AD(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[ED],header:[DD],default:[OD]},$$scope:{ctx:n}};return e=new pn({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){z(e.$$.fragment)},m(s,l){V(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||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function ID(n,e,t){let i,{collection:s}=e,l,o=new pi;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 d(m){pe.call(this,n,m)}function p(m){pe.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(_=>_.type==="editor")))},[s,a,l,o,i,r,u,f,d,p]}class PD extends ve{constructor(e){super(),be(this,e,ID,AD,_e,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function Pm(n,e,t){const i=n.slice();return i[55]=e[t],i}function Lm(n,e,t){const i=n.slice();return i[58]=e[t],i}function Nm(n,e,t){const i=n.slice();return i[58]=e[t],i}function Fm(n,e,t){const i=n.slice();return i[51]=e[t],i}function Rm(n){let e;function t(l,o){return l[12]?ND:LD}let i=t(n),s=i(n);return{c(){e=y("th"),s.c(),h(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 LD(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("input"),s=E(),l=y("label"),h(t,"type","checkbox"),h(t,"id","checkbox_0"),t.disabled=i=!n[4].length,t.checked=n[16],h(l,"for","checkbox_0"),h(e,"class","form-field")},m(a,u){S(a,e,u),v(e,t),v(e,s),v(e,l),o||(r=J(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 ND(n){let e;return{c(){e=y("span"),h(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function qm(n){let e,t,i;function s(o){n[29](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[FD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new tn({props:l}),se.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function FD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="id",h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function jm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l,o=e&&Vm(n),r=i&&Hm(n);return{c(){o&&o.c(),t=E(),r&&r.c(),s=Se()},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&&A(o,1)):(o=Vm(a),o.c(),A(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&&A(r,1)):(r=Hm(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){l||(A(o),A(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 Vm(n){let e,t,i;function s(o){n[30](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[RD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new tn({props:l}),se.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function RD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="username",h(t,"class",j.getFieldTypeIcon("user")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Hm(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[qD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new tn({props:l}),se.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function qD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="email",h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function jD(n){let e,t,i,s,l,o=n[58].name+"",r;return{c(){e=y("div"),t=y("i"),s=E(),l=y("span"),r=U(o),h(t,"class",i=j.getFieldTypeIcon(n[58].type)),h(l,"class","txt"),h(e,"class","col-header-content")},m(a,u){S(a,e,u),v(e,t),v(e,s),v(e,l),v(l,r)},p(a,u){u[0]&262144&&i!==(i=j.getFieldTypeIcon(a[58].type))&&h(t,"class",i),u[0]&262144&&o!==(o=a[58].name+"")&&le(r,o)},d(a){a&&w(e)}}}function zm(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:[jD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new tn({props:r}),se.push(()=>he(i,"sort",o)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),V(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||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(t),H(i,a)}}}function Bm(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[VD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new tn({props:l}),se.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function VD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="created",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Um(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[HD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new tn({props:l}),se.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function HD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="updated",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Wm(n){let e;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"aria-label","Toggle columns"),h(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){S(t,e,i),n[35](e)},p:Q,d(t){t&&w(e),n[35](null)}}}function Ym(n){let e;function t(l,o){return l[12]?BD:zD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 zD(n){let e,t,i,s,l;function o(u,f){var d,p;if((d=u[1])!=null&&d.length)return WD;if(!((p=u[2])!=null&&p.$isView))return UD}let r=o(n),a=r&&r(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No records found.",s=E(),a&&a.c(),l=E(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(u,f){S(u,e,f),v(e,t),v(t,i),v(t,s),a&&a.m(t,null),v(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 BD(n){let e;return{c(){e=y("tr"),e.innerHTML=` - `},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function UD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` - New record`,h(e,"type","button"),h(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[40]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function WD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[39]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Km(n){let e,t,i,s,l,o,r,a,u,f;function d(){return n[36](n[55])}return{c(){e=y("td"),t=y("div"),i=y("input"),o=E(),r=y("label"),h(i,"type","checkbox"),h(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],h(r,"for",a="checkbox_"+n[55].id),h(t,"class","form-field"),h(e,"class","bulk-select-col min-width")},m(p,m){S(p,e,m),v(e,t),v(t,i),v(t,o),v(t,r),u||(f=[J(i,"change",d),J(t,"click",En(n[26]))],u=!0)},p(p,m){n=p,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&h(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)&&h(r,"for",a)},d(p){p&&w(e),u=!1,De(f)}}}function Jm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new tr({props:{value:n[55].id}});let d=n[2].$isAuth&&Zm(n);return{c(){e=y("td"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),a=U(r),u=E(),d&&d.c(),h(o,"class","txt"),h(i,"class","label"),h(t,"class","flex flex-gap-5"),h(e,"class","col-type-text col-field-id")},m(p,m){S(p,e,m),v(e,t),v(t,i),V(s,i,null),v(i,l),v(i,o),v(o,a),v(t,u),d&&d.m(t,null),f=!0},p(p,m){const _={};m[0]&16&&(_.value=p[55].id),s.$set(_),(!f||m[0]&16)&&r!==(r=p[55].id+"")&&le(a,r),p[2].$isAuth?d?d.p(p,m):(d=Zm(p),d.c(),d.m(t,null)):d&&(d.d(1),d=null)},i(p){f||(A(s.$$.fragment,p),f=!0)},o(p){P(s.$$.fragment,p),f=!1},d(p){p&&w(e),H(s),d&&d.d()}}}function Zm(n){let e;function t(l,o){return l[55].verified?KD:YD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 YD(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ee(Ue.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function KD(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ee(Ue.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Gm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Xm(n),o=i&&Qm(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=Se()},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=Xm(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=Qm(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 Xm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!j.isEmpty(o[55].username)),t?ZD:JD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(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 JD(n){let e,t=n[55].username+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].username)},m(l,o){S(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&h(e,"title",s)},d(l){l&&w(e)}}}function ZD(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Qm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!j.isEmpty(o[55].email)),t?XD:GD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(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 GD(n){let e,t=n[55].email+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].email)},m(l,o){S(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&h(e,"title",s)},d(l){l&&w(e)}}}function XD(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function xm(n,e){let t,i,s,l;return i=new ab({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=y("td"),z(i.$$.fragment),h(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){S(o,t,r),V(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))&&h(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&w(t),H(i)}}}function eh(n){let e,t,i;return t=new hi({props:{date:n[55].created}}),{c(){e=y("td"),z(t.$$.fragment),h(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].created),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function th(n){let e,t,i;return t=new hi({props:{date:n[55].updated}}),{c(){e=y("td"),z(t.$$.fragment),h(e,"class","col-type-date col-field-updated")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].updated),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function nh(n,e){let t,i,s=!e[7].includes("@id"),l,o,r=[],a=new Map,u,f=e[10]&&!e[7].includes("@created"),d,p=e[9]&&!e[7].includes("@updated"),m,_,g,b,k,$,T=!e[2].$isView&&Km(e),C=s&&Jm(e),D=e[2].$isAuth&&Gm(e),M=e[18];const O=N=>N[58].name;for(let N=0;N',g=E(),h(_,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(N,q){S(N,t,q),T&&T.m(t,null),v(t,i),C&&C.m(t,null),v(t,l),D&&D.m(t,null),v(t,o);for(let Y=0;Y{C=null}),ae()),e[2].$isAuth?D?D.p(e,q):(D=Gm(e),D.c(),D.m(t,o)):D&&(D.d(1),D=null),q[0]&262160&&(M=e[18],re(),r=yt(r,q,O,1,e,M,a,t,Zt,xm,u,Lm),ae()),q[0]&1152&&(f=e[10]&&!e[7].includes("@created")),f?I?(I.p(e,q),q[0]&1152&&A(I,1)):(I=eh(e),I.c(),A(I,1),I.m(t,d)):I&&(re(),P(I,1,1,()=>{I=null}),ae()),q[0]&640&&(p=e[9]&&!e[7].includes("@updated")),p?L?(L.p(e,q),q[0]&640&&A(L,1)):(L=th(e),L.c(),A(L,1),L.m(t,m)):L&&(re(),P(L,1,1,()=>{L=null}),ae())},i(N){if(!b){A(C);for(let q=0;qZ[58].name;for(let Z=0;ZZ[2].$isView?Z[55]:Z[55].id;for(let Z=0;Z{M=null}),ae()),Z[2].$isAuth?O?(O.p(Z,ee),ee[0]&4&&A(O,1)):(O=jm(Z),O.c(),A(O,1),O.m(i,r)):O&&(re(),P(O,1,1,()=>{O=null}),ae()),ee[0]&262145&&(I=Z[18],re(),a=yt(a,ee,L,1,Z,I,u,i,Zt,zm,f,Nm),ae()),ee[0]&1152&&(d=Z[10]&&!Z[7].includes("@created")),d?F?(F.p(Z,ee),ee[0]&1152&&A(F,1)):(F=Bm(Z),F.c(),A(F,1),F.m(i,p)):F&&(re(),P(F,1,1,()=>{F=null}),ae()),ee[0]&640&&(m=Z[9]&&!Z[7].includes("@updated")),m?R?(R.p(Z,ee),ee[0]&640&&A(R,1)):(R=Um(Z),R.c(),A(R,1),R.m(i,_)):R&&(re(),P(R,1,1,()=>{R=null}),ae()),Z[15].length?N?N.p(Z,ee):(N=Wm(Z),N.c(),N.m(g,null)):N&&(N.d(1),N=null),ee[0]&4986582&&(q=Z[4],re(),$=yt($,ee,Y,1,Z,q,T,k,Zt,nh,null,Pm),ae(),!q.length&&B?B.p(Z,ee):q.length?B&&(B.d(1),B=null):(B=Ym(Z),B.c(),B.m(k,null))),(!C||ee[0]&4096)&&x(e,"table-loading",Z[12])},i(Z){if(!C){A(M),A(O);for(let ee=0;ee({54:l}),({uniqueId:l})=>[0,l?8388608:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),V(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||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),H(i,l)}}}function eE(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||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function lh(n){let e,t,i=n[4].length+"",s,l,o;return{c(){e=y("small"),t=U("Showing "),s=U(i),l=U(" of "),o=U(n[5]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),v(e,t),v(e,s),v(e,l),v(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 oh(n){let e,t,i,s,l=n[5]-n[4].length+"",o,r,a,u;return{c(){e=y("div"),t=y("button"),i=y("span"),s=U("Load more ("),o=U(l),r=U(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[12]),x(t,"btn-disabled",n[12]),h(e,"class","block txt-center m-t-xs")},m(f,d){S(f,e,d),v(e,t),v(t,i),v(i,s),v(i,o),v(i,r),a||(u=J(t,"click",n[41]),a=!0)},p(f,d){d[0]&48&&l!==(l=f[5]-f[4].length+"")&&le(o,l),d[0]&4096&&x(t,"btn-loading",f[12]),d[0]&4096&&x(t,"btn-disabled",f[12])},d(f){f&&w(e),a=!1,u()}}}function rh(n){let e,t,i,s,l,o,r=n[8]===1?"record":"records",a,u,f,d,p,m,_,g,b,k,$;return{c(){e=y("div"),t=y("div"),i=U("Selected "),s=y("strong"),l=U(n[8]),o=E(),a=U(r),u=E(),f=y("button"),f.innerHTML='Reset',d=E(),p=y("div"),m=E(),_=y("button"),_.innerHTML='Delete selected',h(t,"class","txt"),h(f,"type","button"),h(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[13]),h(p,"class","flex-fill"),h(_,"type","button"),h(_,"class","btn btn-sm btn-transparent btn-danger"),x(_,"btn-loading",n[13]),x(_,"btn-disabled",n[13]),h(e,"class","bulkbar")},m(T,C){S(T,e,C),v(e,t),v(t,i),v(t,s),v(s,l),v(t,o),v(t,a),v(e,u),v(e,f),v(e,d),v(e,p),v(e,m),v(e,_),b=!0,k||($=[J(f,"click",n[42]),J(_,"click",n[43])],k=!0)},p(T,C){(!b||C[0]&256)&&le(l,T[8]),(!b||C[0]&256)&&r!==(r=T[8]===1?"record":"records")&&le(a,r),(!b||C[0]&8192)&&x(f,"btn-disabled",T[13]),(!b||C[0]&8192)&&x(_,"btn-loading",T[13]),(!b||C[0]&8192)&&x(_,"btn-disabled",T[13])},i(T){b||(T&&nt(()=>{b&&(g||(g=Ve(e,ii,{duration:150,y:5},!0)),g.run(1))}),b=!0)},o(T){T&&(g||(g=Ve(e,ii,{duration:150,y:5},!1)),g.run(0)),b=!1},d(T){T&&w(e),T&&g&&g.end(),k=!1,De($)}}}function nE(n){let e,t,i,s,l,o;e=new La({props:{class:"table-wrapper",$$slots:{before:[tE],default:[QD]},$$scope:{ctx:n}}});let r=n[4].length&&lh(n),a=n[4].length&&n[17]&&oh(n),u=n[8]&&rh(n);return{c(){z(e.$$.fragment),t=E(),r&&r.c(),i=E(),a&&a.c(),s=E(),u&&u.c(),l=Se()},m(f,d){V(e,f,d),S(f,t,d),r&&r.m(f,d),S(f,i,d),a&&a.m(f,d),S(f,s,d),u&&u.m(f,d),S(f,l,d),o=!0},p(f,d){const p={};d[0]&382679|d[2]&2&&(p.$$scope={dirty:d,ctx:f}),e.$set(p),f[4].length?r?r.p(f,d):(r=lh(f),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),f[4].length&&f[17]?a?a.p(f,d):(a=oh(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[8]?u?(u.p(f,d),d[0]&256&&A(u,1)):(u=rh(f),u.c(),A(u,1),u.m(l.parentNode,l)):u&&(re(),P(u,1,1,()=>{u=null}),ae())},i(f){o||(A(e.$$.fragment,f),A(u),o=!0)},o(f){P(e.$$.fragment,f),P(u),o=!1},d(f){H(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 iE=/^([\+\-])?(\w+)$/;function sE(n,e,t){let i,s,l,o,r,a,u,f;const d=kt();let{collection:p}=e,{sort:m=""}=e,{filter:_=""}=e,g=[],b=1,k=0,$={},T=!0,C=!1,D=0,M,O=[],I=[];function L(){p!=null&&p.id&&localStorage.setItem((p==null?void 0:p.id)+"@hiddenCollumns",JSON.stringify(O))}function F(){if(t(7,O=[]),!!(p!=null&&p.id))try{const $e=localStorage.getItem(p.id+"@hiddenCollumns");$e&&t(7,O=JSON.parse($e)||[])}catch{}}async function R(){const $e=b;for(let et=1;et<=$e;et++)(et===1||o)&&await N(et,!1)}async function N($e=1,et=!0){var je,gt;if(!(p!=null&&p.id))return;t(12,T=!0);let Dt=m;const Ft=Dt.match(iE),jt=Ft?s.find(Ge=>Ge.name===Ft[2]):null;if(Ft&&((gt=(je=jt==null?void 0:jt.options)==null?void 0:je.displayFields)==null?void 0:gt.length)>0){const Ge=[];for(const mn of jt.options.displayFields)Ge.push((Ft[1]||"")+Ft[2]+"."+mn);Dt=Ge.join(",")}const ye=j.getAllCollectionIdentifiers(p);return me.collection(p.id).getList($e,30,{sort:Dt,filter:j.normalizeSearchFilter(_,ye),expand:s.map(Ge=>Ge.name).join(","),$cancelKey:"records_list"}).then(async Ge=>{if($e<=1&&q(),t(12,T=!1),t(11,b=Ge.page),t(5,k=Ge.totalItems),d("load",g.concat(Ge.items)),et){const mn=++D;for(;Ge.items.length&&D==mn;)t(4,g=g.concat(Ge.items.splice(0,15))),await j.yieldToMain()}else t(4,g=g.concat(Ge.items))}).catch(Ge=>{Ge!=null&&Ge.isAbort||(t(12,T=!1),console.warn(Ge),q(),me.errorResponseHandler(Ge,!1))})}function q(){t(4,g=[]),t(11,b=1),t(5,k=0),t(6,$={})}function Y(){a?B():Z()}function B(){t(6,$={})}function Z(){for(const $e of g)t(6,$[$e.id]=$e,$);t(6,$)}function ee($e){$[$e.id]?delete $[$e.id]:t(6,$[$e.id]=$e,$),t(6,$)}function ie(){vn(`Do you really want to delete the selected ${r===1?"record":"records"}?`,X)}async function X(){if(C||!r||!(p!=null&&p.id))return;let $e=[];for(const et of Object.keys($))$e.push(me.collection(p.id).delete(et));return t(13,C=!0),Promise.all($e).then(()=>{Jt(`Successfully deleted the selected ${r===1?"record":"records"}.`),B()}).catch(et=>{me.errorResponseHandler(et)}).finally(()=>(t(13,C=!1),R()))}function fe($e){pe.call(this,n,$e)}const G=($e,et)=>{et.target.checked?j.removeByValue(O,$e.id):j.pushUnique(O,$e.id),t(7,O)},ce=()=>Y();function ge($e){m=$e,t(0,m)}function Me($e){m=$e,t(0,m)}function qe($e){m=$e,t(0,m)}function He($e){m=$e,t(0,m)}function we($e){m=$e,t(0,m)}function Ce($e){m=$e,t(0,m)}function Je($e){se[$e?"unshift":"push"](()=>{M=$e,t(14,M)})}const mt=$e=>ee($e),Ze=$e=>d("select",$e),We=($e,et)=>{et.code==="Enter"&&(et.preventDefault(),d("select",$e))},te=()=>t(1,_=""),Fe=()=>d("new"),Qe=()=>N(b+1),Gt=()=>B(),Le=()=>ie();return n.$$set=$e=>{"collection"in $e&&t(2,p=$e.collection),"sort"in $e&&t(0,m=$e.sort),"filter"in $e&&t(1,_=$e.filter)},n.$$.update=()=>{n.$$.dirty[0]&4&&p!=null&&p.id&&(F(),q()),n.$$.dirty[0]&4&&t(25,i=(p==null?void 0:p.schema)||[]),n.$$.dirty[0]&33554432&&(s=i.filter($e=>$e.type==="relation")),n.$$.dirty[0]&33554560&&t(18,l=i.filter($e=>!O.includes($e.id))),n.$$.dirty[0]&7&&p!=null&&p.id&&m!==-1&&_!==-1&&N(1),n.$$.dirty[0]&48&&t(17,o=k>g.length),n.$$.dirty[0]&64&&t(8,r=Object.keys($).length),n.$$.dirty[0]&272&&t(16,a=g.length&&r===g.length),n.$$.dirty[0]&128&&O!==-1&&L(),n.$$.dirty[0]&20&&t(10,u=!(p!=null&&p.$isView)||g.length>0&&g[0].created!=""),n.$$.dirty[0]&20&&t(9,f=!(p!=null&&p.$isView)||g.length>0&&g[0].updated!=""),n.$$.dirty[0]&33555972&&t(15,I=[].concat(p.$isAuth?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],i.map($e=>({id:$e.id,name:$e.name})),u?{id:"@created",name:"created"}:[],f?{id:"@updated",name:"updated"}:[]))},[m,_,p,N,g,k,$,O,r,f,u,b,T,C,M,I,a,o,l,d,Y,B,ee,ie,R,i,fe,G,ce,ge,Me,qe,He,we,Ce,Je,mt,Ze,We,te,Fe,Qe,Gt,Le]}class lE extends ve{constructor(e){super(),be(this,e,sE,nE,_e,{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 oE(n){let e,t,i,s;return e=new Q4({}),i=new In({props:{$$slots:{default:[uE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(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||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function rE(n){let e,t;return e=new In({props:{center:!0,$$slots:{default:[dE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function aE(n){let e,t;return e=new In({props:{center:!0,$$slots:{default:[pE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ah(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"aria-label","Edit collection"),h(e,"class","btn btn-transparent btn-circle")},m(s,l){S(s,e,l),t||(i=[Ee(Ue.call(null,e,{text:"Edit collection",position:"right"})),J(e,"click",n[15])],t=!0)},p:Q,d(s){s&&w(e),t=!1,De(i)}}}function uh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` - New record`,h(e,"type","button"),h(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function uE(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L,F,R=!n[10]&&ah(n);d=new Pa({}),d.$on("refresh",n[16]);let N=!n[2].$isView&&uh(n);k=new Ko({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function q(Z){n[21](Z)}function Y(Z){n[22](Z)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),D=new lE({props:B}),n[20](D),se.push(()=>he(D,"filter",q)),se.push(()=>he(D,"sort",Y)),D.$on("select",n[23]),D.$on("new",n[24]),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Collections",s=E(),l=y("div"),r=U(o),a=E(),u=y("div"),R&&R.c(),f=E(),z(d.$$.fragment),p=E(),m=y("div"),_=y("button"),_.innerHTML=` - API Preview`,g=E(),N&&N.c(),b=E(),z(k.$$.fragment),$=E(),T=y("div"),C=E(),z(D.$$.fragment),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(u,"class","inline-flex gap-5"),h(_,"type","button"),h(_,"class","btn btn-outline"),h(m,"class","btns-group"),h(e,"class","page-header"),h(T,"class","clearfix m-b-base")},m(Z,ee){S(Z,e,ee),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),v(e,u),R&&R.m(u,null),v(u,f),V(d,u,null),v(e,p),v(e,m),v(m,_),v(m,g),N&&N.m(m,null),S(Z,b,ee),V(k,Z,ee),S(Z,$,ee),S(Z,T,ee),S(Z,C,ee),V(D,Z,ee),I=!0,L||(F=J(_,"click",n[17]),L=!0)},p(Z,ee){(!I||ee[0]&4)&&o!==(o=Z[2].name+"")&&le(r,o),Z[10]?R&&(R.d(1),R=null):R?R.p(Z,ee):(R=ah(Z),R.c(),R.m(u,f)),Z[2].$isView?N&&(N.d(1),N=null):N?N.p(Z,ee):(N=uh(Z),N.c(),N.m(m,null));const ie={};ee[0]&1&&(ie.value=Z[0]),ee[0]&4&&(ie.autocompleteCollection=Z[2]),k.$set(ie);const X={};ee[0]&4&&(X.collection=Z[2]),!M&&ee[0]&1&&(M=!0,X.filter=Z[0],ke(()=>M=!1)),!O&&ee[0]&2&&(O=!0,X.sort=Z[1],ke(()=>O=!1)),D.$set(X)},i(Z){I||(A(d.$$.fragment,Z),A(k.$$.fragment,Z),A(D.$$.fragment,Z),I=!0)},o(Z){P(d.$$.fragment,Z),P(k.$$.fragment,Z),P(D.$$.fragment,Z),I=!1},d(Z){Z&&w(e),R&&R.d(),H(d),N&&N.d(),Z&&w(b),H(k,Z),Z&&w($),Z&&w(T),Z&&w(C),n[20](null),H(D,Z),L=!1,F()}}}function fE(n){let e,t,i,s,l;return{c(){e=y("h1"),e.textContent="Create your first collection to add records!",t=E(),i=y("button"),i.innerHTML=` - Create new collection`,h(e,"class","m-b-10"),h(i,"type","button"),h(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=J(i,"click",n[14]),s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function cE(n){let e;return{c(){e=y("h1"),e.textContent="You don't have any collections yet.",h(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function dE(n){let e,t,i;function s(r,a){return r[10]?cE:fE}let l=s(n),o=l(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='',i=E(),o.c(),h(t,"class","icon"),h(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),v(e,t),v(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 pE(n){let e;return{c(){e=y("div"),e.innerHTML=` -

    Loading collections...

    `,h(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function mE(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[aE,rE,oE],m=[];function _(T,C){return T[3]&&!T[9].length?0:T[9].length?2:1}e=_(n),t=m[e]=p[e](n);let g={};s=new ru({props:g}),n[25](s);let b={};o=new o5({props:b}),n[26](o);let k={collection:n[2]};a=new rb({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let $={collection:n[2]};return f=new PD({props:$}),n[30](f),{c(){t.c(),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment)},m(T,C){m[e].m(T,C),S(T,i,C),V(s,T,C),S(T,l,C),V(o,T,C),S(T,r,C),V(a,T,C),S(T,u,C),V(f,T,C),d=!0},p(T,C){let D=e;e=_(T),e===D?m[e].p(T,C):(re(),P(m[D],1,1,()=>{m[D]=null}),ae(),t=m[e],t?t.p(T,C):(t=m[e]=p[e](T),t.c()),A(t,1),t.m(i.parentNode,i));const M={};s.$set(M);const O={};o.$set(O);const I={};C[0]&4&&(I.collection=T[2]),a.$set(I);const L={};C[0]&4&&(L.collection=T[2]),f.$set(L)},i(T){d||(A(t),A(s.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(f.$$.fragment,T),d=!0)},o(T){P(t),P(s.$$.fragment,T),P(o.$$.fragment,T),P(a.$$.fragment,T),P(f.$$.fragment,T),d=!1},d(T){m[e].d(T),T&&w(i),n[25](null),H(s,T),T&&w(l),n[26](null),H(o,T),T&&w(r),n[27](null),H(a,T),T&&w(u),n[30](null),H(f,T)}}}function hE(n,e,t){let i,s,l,o,r,a,u;Ke(n,_i,G=>t(2,s=G)),Ke(n,Lt,G=>t(31,l=G)),Ke(n,No,G=>t(3,o=G)),Ke(n,ya,G=>t(13,r=G)),Ke(n,si,G=>t(9,a=G)),Ke(n,Os,G=>t(10,u=G));const f=new URLSearchParams(r);let d,p,m,_,g,b=f.get("filter")||"",k=f.get("sort")||"",$=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,$=s==null?void 0:s.id),t(0,b=""),t(1,k="-created"),s!=null&&s.$isView&&!j.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}p$($);const C=()=>d==null?void 0:d.show(),D=()=>d==null?void 0:d.show(s),M=()=>g==null?void 0:g.load(),O=()=>p==null?void 0:p.show(s),I=()=>m==null?void 0:m.show(),L=G=>t(0,b=G.detail);function F(G){se[G?"unshift":"push"](()=>{g=G,t(8,g)})}function R(G){b=G,t(0,b)}function N(G){k=G,t(1,k)}const q=G=>{s.$isView?_.show(G==null?void 0:G.detail):m==null||m.show(G==null?void 0:G.detail)},Y=()=>m==null?void 0:m.show();function B(G){se[G?"unshift":"push"](()=>{d=G,t(4,d)})}function Z(G){se[G?"unshift":"push"](()=>{p=G,t(5,p)})}function ee(G){se[G?"unshift":"push"](()=>{m=G,t(6,m)})}const ie=()=>g==null?void 0:g.reloadLoadedPages(),X=()=>g==null?void 0:g.reloadLoadedPages();function fe(G){se[G?"unshift":"push"](()=>{_=G,t(7,_)})}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")!=$&&f$(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&$!=s.id&&T(),n.$$.dirty[0]&7&&(k||b||s!=null&&s.id)){const G=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:b,sort:k}).toString();Li("/collections?"+G)}n.$$.dirty[0]&4&&sn(Lt,l=(s==null?void 0:s.name)||"Collections",l)},[b,k,s,o,d,p,m,_,g,a,u,$,i,r,C,D,M,O,I,L,F,R,N,q,Y,B,Z,ee,ie,X,fe]}class _E extends ve{constructor(e){super(),be(this,e,hE,mE,_e,{},null,[-1,-1])}}function gE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L;return{c(){e=y("aside"),t=y("div"),i=y("div"),i.textContent="System",s=E(),l=y("a"),l.innerHTML=` + `),o[0]&2176&&(r.beforeHide=l[47]),o[0]&13949|o[1]&536870912&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[48](null),H(e,l)}}}const ns="form",Sl="providers";function bm(n){return JSON.stringify(n)}function sD(n,e,t){let i,s,l,o;const r=kt(),a="record_"+j.randomString(5);let{collection:u}=e,f,d,p=null,m=new pi,_=!1,g=!1,b={},k={},$="",T=ns,C=!0;function D(ye){O(ye),t(11,g=!0),t(12,T=ns),f==null||f.show(),B()}function M(){f==null||f.hide()}async function O(ye){dn({}),t(2,p=ye||new pi),ye!=null&&ye.$clone?t(3,m=ye.$clone()):t(3,m=new pi),t(4,b={}),t(5,k={}),await ln(),t(22,$=bm(m))}function I(){if(_||!o||!(u!=null&&u.id))return;t(10,_=!0);const ye=F();let je;C?je=me.collection(u.id).create(ye):je=me.collection(u.id).update(m.id,ye),je.then(gt=>{Jt(C?"Successfully created record.":"Successfully updated record."),t(11,g=!1),M(),r("save",gt)}).catch(gt=>{me.errorResponseHandler(gt)}).finally(()=>{t(10,_=!1)})}function L(){p!=null&&p.id&&vn("Do you really want to delete the selected record?",()=>me.collection(p.collectionId).delete(p.id).then(()=>{M(),Jt("Successfully deleted record."),r("delete",p)}).catch(ye=>{me.errorResponseHandler(ye)}))}function F(){const ye=(m==null?void 0:m.$export())||{},je=new FormData,gt={id:ye.id};for(const Ge of(u==null?void 0:u.schema)||[])gt[Ge.name]=!0;u!=null&&u.isAuth&&(gt.username=!0,gt.email=!0,gt.emailVisibility=!0,gt.password=!0,gt.passwordConfirm=!0,gt.verified=!0);for(const Ge in ye)gt[Ge]&&(typeof ye[Ge]>"u"&&(ye[Ge]=null),j.addValueToFormData(je,Ge,ye[Ge]));for(const Ge in b){const mn=j.toArray(b[Ge]);for(const vi of mn)je.append(Ge,vi)}for(const Ge in k){const mn=j.toArray(k[Ge]);for(const vi of mn)je.append(Ge+"."+vi,"")}return je}function R(){!(u!=null&&u.id)||!(p!=null&&p.email)||vn(`Do you really want to sent verification email to ${p.email}?`,()=>me.collection(u.id).requestVerification(p.email).then(()=>{Jt(`Successfully sent verification email to ${p.email}.`)}).catch(ye=>{me.errorResponseHandler(ye)}))}function N(){!(u!=null&&u.id)||!(p!=null&&p.email)||vn(`Do you really want to sent password reset email to ${p.email}?`,()=>me.collection(u.id).requestPasswordReset(p.email).then(()=>{Jt(`Successfully sent password reset email to ${p.email}.`)}).catch(ye=>{me.errorResponseHandler(ye)}))}function q(){l?vn("You have unsaved changes. Do you really want to discard them?",()=>{Y()}):Y()}async function Y(){const ye=p==null?void 0:p.$clone();if(ye){ye.id="",ye.created="",ye.updated="";const je=(u==null?void 0:u.schema)||[];for(const gt of je)gt.type==="file"&&delete ye[gt.name]}D(ye),await ln(),t(22,$="")}async function B(){var ye;await ln(),C&&(d.querySelector("[autofocus]")||(ye=d==null?void 0:d.querySelector(".form-field:not(.noautofocus) input, .form-field:not(.noautofocus) textarea, .form-field:not(.noautofocus) select"))==null||ye.focus())}const Z=()=>M(),ee=()=>R(),ie=()=>N(),X=()=>q(),fe=()=>L(),G=()=>t(12,T=ns),ce=()=>t(12,T=Sl);function ge(){m.id=this.value,t(3,m)}function Me(ye){m=ye,t(3,m)}function qe(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function He(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function we(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function Ce(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function Je(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function mt(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function Ze(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function We(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function te(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function Fe(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function Qe(ye,je){n.$$.not_equal(b[je.name],ye)&&(b[je.name]=ye,t(4,b))}function Gt(ye,je){n.$$.not_equal(k[je.name],ye)&&(k[je.name]=ye,t(5,k))}function Le(ye,je){n.$$.not_equal(m[je.name],ye)&&(m[je.name]=ye,t(3,m))}function $e(ye){se[ye?"unshift":"push"](()=>{d=ye,t(9,d)})}const et=()=>l&&g?(vn("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,g=!1),M()}),!1):(dn({}),!0);function Dt(ye){se[ye?"unshift":"push"](()=>{f=ye,t(8,f)})}function Ft(ye){pe.call(this,n,ye)}function jt(ye){pe.call(this,n,ye)}return n.$$set=ye=>{"collection"in ye&&t(0,u=ye.collection)},n.$$.update=()=>{var ye;n.$$.dirty[0]&1&&t(14,i=!!((ye=u==null?void 0:u.schema)!=null&&ye.find(je=>je.type==="editor"))),n.$$.dirty[0]&48&&t(23,s=j.hasNonEmptyProps(b)||j.hasNonEmptyProps(k)),n.$$.dirty[0]&12582920&&t(7,l=s||$!=bm(m)),n.$$.dirty[0]&4&&t(6,C=!p||p.isNew),n.$$.dirty[0]&192&&t(13,o=C||l)},[u,M,p,m,b,k,C,l,f,d,_,g,T,o,i,a,I,L,R,N,q,D,$,s,Z,ee,ie,X,fe,G,ce,ge,Me,qe,He,we,Ce,Je,mt,Ze,We,te,Fe,Qe,Gt,Le,$e,et,Dt,Ft,jt]}class ab extends ve{constructor(e){super(),be(this,e,sD,iD,_e,{collection:0,show:21,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}}function lD(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class",t=n[2]?n[1]:n[0])},m(o,r){S(o,e,r),s||(l=[Ee(i=Ue.call(null,e,n[2]?"":"Copy")),J(e,"click",En(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&h(e,"class",t),i&&Ut(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:Q,o:Q,d(o){o&&w(e),s=!1,De(l)}}}function oD(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&&(j.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return xt(()=>()=>{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 tr extends ve{constructor(e){super(),be(this,e,oD,lD,_e,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function vm(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function ym(n,e,t){const i=n.slice();return i[13]=e[t],i}function km(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function wm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function rD(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:200;return e[17]=i,e}function aD(n){const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray(e[0].expand[e[1].name]);e[10]=i;const s=e[2]?20:200;return e[11]=s,e}function uD(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function fD(n){let e,t;return{c(){e=y("div"),t=U(n[3]),h(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){S(i,e,s),v(e,t)},p(i,s){s&8&&le(t,i[3])},i:Q,o:Q,d(i){i&&w(e)}}}function cD(n){let e,t=j.truncate(n[3])+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=j.truncate(n[3]))},m(l,o){S(l,e,o),v(e,i)},p(l,o){o&8&&t!==(t=j.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=j.truncate(l[3]))&&h(e,"title",s)},i:Q,o:Q,d(l){l&&w(e)}}}function dD(n){let e,t=[],i=new Map,s,l,o=n[16].slice(0,n[17]);const r=u=>u[8]+u[18];for(let u=0;un[17]&&$m();return{c(){e=y("div");for(let u=0;uu[17]?a||(a=$m(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i(u){if(!l){for(let f=0;fn[11]&&Mm();return{c(){e=y("div"),i.c(),s=E(),u&&u.c(),h(e,"class","inline-flex")},m(f,d){S(f,e,d),r[t].m(e,null),v(e,s),u&&u.m(e,null),l=!0},p(f,d){let p=t;t=a(f),t===p?r[t].p(f,d):(re(),P(r[p],1,1,()=>{r[p]=null}),ae(),i=r[t],i?i.p(f,d):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=Mm(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(A(i),l=!0)},o(f){P(i),l=!1},d(f){f&&w(e),r[t].d(),u&&u.d()}}}function mD(n){let e,t=[],i=new Map,s=j.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()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function gD(n){let e,t=j.truncate(n[3])+"",i,s,l;return{c(){e=y("a"),i=U(t),h(e,"class","txt-ellipsis"),h(e,"href",n[3]),h(e,"target","_blank"),h(e,"rel","noopener noreferrer")},m(o,r){S(o,e,r),v(e,i),s||(l=[Ee(Ue.call(null,e,"Open in new tab")),J(e,"click",En(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&le(i,t),r&8&&h(e,"href",o[3])},i:Q,o:Q,d(o){o&&w(e),s=!1,De(l)}}}function bD(n){let e,t;return{c(){e=y("span"),t=U(n[3]),h(e,"class","txt")},m(i,s){S(i,e,s),v(e,t)},p(i,s){s&8&&le(t,i[3])},i:Q,o:Q,d(i){i&&w(e)}}}function vD(n){let e,t=n[3]?"True":"False",i;return{c(){e=y("span"),i=U(t),h(e,"class","txt")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:Q,o:Q,d(s){s&&w(e)}}}function yD(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function kD(n){let e,t,i,s;const l=[MD,CD],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},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()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(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 au({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),V(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),H(i,l)}}}function $m(n){let e;return{c(){e=U("...")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function wD(n){let e,t=n[9].slice(0,n[11]),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&Dm(n);return{c(){e=y("span"),i=U(t),s=E(),r&&r.c(),l=Se(),h(e,"class","txt")},m(a,u){S(a,e,u),v(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=j.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=Dm(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){o||(A(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 MD(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=j.truncate(s[5])+"")&&le(i,t)},i:Q,o:Q,d(s){s&&w(e)}}}function Dm(n){let e,t;return e=new tr({props:{value:JSON.stringify(n[3],null,2)}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function OD(n){let e,t,i,s,l;const o=[kD,yD,vD,bD,gD,_D,hD,mD,pD,dD,cD,fD],r=[];function a(f,d){return d&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!j.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,d){return d===0?uD(f):d===8?aD(f):d===9?rD(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=Se()},m(f,d){r[t].m(f,d),S(f,s,d),l=!0},p(f,[d]){let p=t;t=a(f,d),t===p?r[t].p(u(f,t),d):(re(),P(r[p],1,1,()=>{r[p]=null}),ae(),i=r[t],i?i.p(u(f,t),d):(i=r[t]=o[t](u(f,t)),i.c()),A(i,1),i.m(s.parentNode,s))},i(f){l||(A(i),l=!0)},o(f){P(i),l=!1},d(f){r[t].d(f),f&&w(s)}}}function DD(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){pe.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 ub extends ve{constructor(e){super(),be(this,e,DD,OD,_e,{record:0,field:1,short:2})}}function Em(n,e,t){const i=n.slice();return i[10]=e[t],i}function Am(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new ub({props:{field:n[10],record:n[3]}}),{c(){e=y("tr"),t=y("td"),s=U(i),l=E(),o=y("td"),z(r.$$.fragment),h(t,"class","min-width txt-hint txt-bold"),h(o,"class","col-field svelte-1nt58f7")},m(u,f){S(u,e,f),v(e,t),v(t,s),v(e,l),v(e,o),V(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&le(s,i);const d={};f&1&&(d.field=u[10]),f&8&&(d.record=u[3]),r.$set(d)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){P(r.$$.fragment,u),a=!1},d(u){u&&w(e),H(r)}}}function Im(n){let e,t,i,s,l,o;return l=new hi({props:{date:n[3].created}}),{c(){e=y("tr"),t=y("td"),t.textContent="created",i=E(),s=y("td"),z(l.$$.fragment),h(t,"class","min-width txt-hint txt-bold"),h(s,"class","col-field svelte-1nt58f7")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),V(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),H(l)}}}function Pm(n){let e,t,i,s,l,o;return l=new hi({props:{date:n[3].updated}}),{c(){e=y("tr"),t=y("td"),t.textContent="updated",i=E(),s=y("td"),z(l.$$.fragment),h(t,"class","min-width txt-hint txt-bold"),h(s,"class","col-field svelte-1nt58f7")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),V(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),H(l)}}}function ED(n){var M;let e,t,i,s,l,o,r,a,u,f,d=n[3].id+"",p,m,_,g,b;a=new tr({props:{value:n[3].id}});let k=(M=n[0])==null?void 0:M.schema,$=[];for(let O=0;OP($[O],1,1,()=>{$[O]=null});let C=n[3].created&&Im(n),D=n[3].updated&&Pm(n);return{c(){e=y("table"),t=y("tbody"),i=y("tr"),s=y("td"),s.textContent="id",l=E(),o=y("td"),r=y("div"),z(a.$$.fragment),u=E(),f=y("span"),p=U(d),m=E();for(let O=0;O<$.length;O+=1)$[O].c();_=E(),C&&C.c(),g=E(),D&&D.c(),h(s,"class","min-width txt-hint txt-bold"),h(f,"class","txt"),h(r,"class","label"),h(o,"class","col-field svelte-1nt58f7"),h(e,"class","table-border preview-table")},m(O,I){S(O,e,I),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(o,r),V(a,r,null),v(r,u),v(r,f),v(f,p),v(t,m);for(let L=0;L<$.length;L+=1)$[L]&&$[L].m(t,null);v(t,_),C&&C.m(t,null),v(t,g),D&&D.m(t,null),b=!0},p(O,I){var F;const L={};if(I&8&&(L.value=O[3].id),a.$set(L),(!b||I&8)&&d!==(d=O[3].id+"")&&le(p,d),I&9){k=(F=O[0])==null?void 0:F.schema;let R;for(R=0;R{C=null}),ae()),O[3].updated?D?(D.p(O,I),I&8&&A(D,1)):(D=Pm(O),D.c(),A(D,1),D.m(t,null)):D&&(re(),P(D,1,1,()=>{D=null}),ae())},i(O){if(!b){A(a.$$.fragment,O);for(let I=0;IClose',h(e,"type","button"),h(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[6]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function PD(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[ID],header:[AD],default:[ED]},$$scope:{ctx:n}};return e=new pn({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){z(e.$$.fragment)},m(s,l){V(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||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function LD(n,e,t){let i,{collection:s}=e,l,o=new pi;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 d(m){pe.call(this,n,m)}function p(m){pe.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(_=>_.type==="editor")))},[s,a,l,o,i,r,u,f,d,p]}class ND extends ve{constructor(e){super(),be(this,e,LD,PD,_e,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function Lm(n,e,t){const i=n.slice();return i[55]=e[t],i}function Nm(n,e,t){const i=n.slice();return i[58]=e[t],i}function Fm(n,e,t){const i=n.slice();return i[58]=e[t],i}function Rm(n,e,t){const i=n.slice();return i[51]=e[t],i}function qm(n){let e;function t(l,o){return l[12]?RD:FD}let i=t(n),s=i(n);return{c(){e=y("th"),s.c(),h(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 FD(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("input"),s=E(),l=y("label"),h(t,"type","checkbox"),h(t,"id","checkbox_0"),t.disabled=i=!n[4].length,t.checked=n[16],h(l,"for","checkbox_0"),h(e,"class","form-field")},m(a,u){S(a,e,u),v(e,t),v(e,s),v(e,l),o||(r=J(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 RD(n){let e;return{c(){e=y("span"),h(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function jm(n){let e,t,i;function s(o){n[29](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[qD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new tn({props:l}),se.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function qD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="id",h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Vm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l,o=e&&Hm(n),r=i&&zm(n);return{c(){o&&o.c(),t=E(),r&&r.c(),s=Se()},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&&A(o,1)):(o=Hm(a),o.c(),A(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&&A(r,1)):(r=zm(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(re(),P(r,1,1,()=>{r=null}),ae())},i(a){l||(A(o),A(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 Hm(n){let e,t,i;function s(o){n[30](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[jD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new tn({props:l}),se.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function jD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="username",h(t,"class",j.getFieldTypeIcon("user")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function zm(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[VD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new tn({props:l}),se.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function VD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="email",h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function HD(n){let e,t,i,s,l,o=n[58].name+"",r;return{c(){e=y("div"),t=y("i"),s=E(),l=y("span"),r=U(o),h(t,"class",i=j.getFieldTypeIcon(n[58].type)),h(l,"class","txt"),h(e,"class","col-header-content")},m(a,u){S(a,e,u),v(e,t),v(e,s),v(e,l),v(l,r)},p(a,u){u[0]&262144&&i!==(i=j.getFieldTypeIcon(a[58].type))&&h(t,"class",i),u[0]&262144&&o!==(o=a[58].name+"")&&le(r,o)},d(a){a&&w(e)}}}function Bm(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:[HD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new tn({props:r}),se.push(()=>he(i,"sort",o)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),V(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||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(t),H(i,a)}}}function Um(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[zD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new tn({props:l}),se.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function zD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="created",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Wm(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[BD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new tn({props:l}),se.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){V(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||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function BD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="updated",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function Ym(n){let e;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"aria-label","Toggle columns"),h(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){S(t,e,i),n[35](e)},p:Q,d(t){t&&w(e),n[35](null)}}}function Km(n){let e;function t(l,o){return l[12]?WD:UD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 UD(n){let e,t,i,s,l;function o(u,f){var d,p;if((d=u[1])!=null&&d.length)return KD;if(!((p=u[2])!=null&&p.$isView))return YD}let r=o(n),a=r&&r(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No records found.",s=E(),a&&a.c(),l=E(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(u,f){S(u,e,f),v(e,t),v(t,i),v(t,s),a&&a.m(t,null),v(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 WD(n){let e;return{c(){e=y("tr"),e.innerHTML=` + `},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function YD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` + New record`,h(e,"type","button"),h(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[40]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function KD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[39]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function Jm(n){let e,t,i,s,l,o,r,a,u,f;function d(){return n[36](n[55])}return{c(){e=y("td"),t=y("div"),i=y("input"),o=E(),r=y("label"),h(i,"type","checkbox"),h(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],h(r,"for",a="checkbox_"+n[55].id),h(t,"class","form-field"),h(e,"class","bulk-select-col min-width")},m(p,m){S(p,e,m),v(e,t),v(t,i),v(t,o),v(t,r),u||(f=[J(i,"change",d),J(t,"click",En(n[26]))],u=!0)},p(p,m){n=p,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&h(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)&&h(r,"for",a)},d(p){p&&w(e),u=!1,De(f)}}}function Zm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new tr({props:{value:n[55].id}});let d=n[2].$isAuth&&Gm(n);return{c(){e=y("td"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),a=U(r),u=E(),d&&d.c(),h(o,"class","txt"),h(i,"class","label"),h(t,"class","flex flex-gap-5"),h(e,"class","col-type-text col-field-id")},m(p,m){S(p,e,m),v(e,t),v(t,i),V(s,i,null),v(i,l),v(i,o),v(o,a),v(t,u),d&&d.m(t,null),f=!0},p(p,m){const _={};m[0]&16&&(_.value=p[55].id),s.$set(_),(!f||m[0]&16)&&r!==(r=p[55].id+"")&&le(a,r),p[2].$isAuth?d?d.p(p,m):(d=Gm(p),d.c(),d.m(t,null)):d&&(d.d(1),d=null)},i(p){f||(A(s.$$.fragment,p),f=!0)},o(p){P(s.$$.fragment,p),f=!1},d(p){p&&w(e),H(s),d&&d.d()}}}function Gm(n){let e;function t(l,o){return l[55].verified?ZD:JD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 JD(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ee(Ue.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function ZD(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ee(Ue.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Xm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Qm(n),o=i&&xm(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=Se()},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=Qm(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=xm(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 Qm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!j.isEmpty(o[55].username)),t?XD:GD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(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 GD(n){let e,t=n[55].username+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].username)},m(l,o){S(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&h(e,"title",s)},d(l){l&&w(e)}}}function XD(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function xm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!j.isEmpty(o[55].email)),t?xD:QD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(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 QD(n){let e,t=n[55].email+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].email)},m(l,o){S(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&h(e,"title",s)},d(l){l&&w(e)}}}function xD(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function eh(n,e){let t,i,s,l;return i=new ub({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=y("td"),z(i.$$.fragment),h(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){S(o,t,r),V(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))&&h(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&w(t),H(i)}}}function th(n){let e,t,i;return t=new hi({props:{date:n[55].created}}),{c(){e=y("td"),z(t.$$.fragment),h(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].created),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function nh(n){let e,t,i;return t=new hi({props:{date:n[55].updated}}),{c(){e=y("td"),z(t.$$.fragment),h(e,"class","col-type-date col-field-updated")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].updated),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function ih(n,e){let t,i,s=!e[7].includes("@id"),l,o,r=[],a=new Map,u,f=e[10]&&!e[7].includes("@created"),d,p=e[9]&&!e[7].includes("@updated"),m,_,g,b,k,$,T=!e[2].$isView&&Jm(e),C=s&&Zm(e),D=e[2].$isAuth&&Xm(e),M=e[18];const O=N=>N[58].name;for(let N=0;N',g=E(),h(_,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(N,q){S(N,t,q),T&&T.m(t,null),v(t,i),C&&C.m(t,null),v(t,l),D&&D.m(t,null),v(t,o);for(let Y=0;Y{C=null}),ae()),e[2].$isAuth?D?D.p(e,q):(D=Xm(e),D.c(),D.m(t,o)):D&&(D.d(1),D=null),q[0]&262160&&(M=e[18],re(),r=yt(r,q,O,1,e,M,a,t,Zt,eh,u,Nm),ae()),q[0]&1152&&(f=e[10]&&!e[7].includes("@created")),f?I?(I.p(e,q),q[0]&1152&&A(I,1)):(I=th(e),I.c(),A(I,1),I.m(t,d)):I&&(re(),P(I,1,1,()=>{I=null}),ae()),q[0]&640&&(p=e[9]&&!e[7].includes("@updated")),p?L?(L.p(e,q),q[0]&640&&A(L,1)):(L=nh(e),L.c(),A(L,1),L.m(t,m)):L&&(re(),P(L,1,1,()=>{L=null}),ae())},i(N){if(!b){A(C);for(let q=0;qZ[58].name;for(let Z=0;ZZ[2].$isView?Z[55]:Z[55].id;for(let Z=0;Z{M=null}),ae()),Z[2].$isAuth?O?(O.p(Z,ee),ee[0]&4&&A(O,1)):(O=Vm(Z),O.c(),A(O,1),O.m(i,r)):O&&(re(),P(O,1,1,()=>{O=null}),ae()),ee[0]&262145&&(I=Z[18],re(),a=yt(a,ee,L,1,Z,I,u,i,Zt,Bm,f,Fm),ae()),ee[0]&1152&&(d=Z[10]&&!Z[7].includes("@created")),d?F?(F.p(Z,ee),ee[0]&1152&&A(F,1)):(F=Um(Z),F.c(),A(F,1),F.m(i,p)):F&&(re(),P(F,1,1,()=>{F=null}),ae()),ee[0]&640&&(m=Z[9]&&!Z[7].includes("@updated")),m?R?(R.p(Z,ee),ee[0]&640&&A(R,1)):(R=Wm(Z),R.c(),A(R,1),R.m(i,_)):R&&(re(),P(R,1,1,()=>{R=null}),ae()),Z[15].length?N?N.p(Z,ee):(N=Ym(Z),N.c(),N.m(g,null)):N&&(N.d(1),N=null),ee[0]&4986582&&(q=Z[4],re(),$=yt($,ee,Y,1,Z,q,T,k,Zt,ih,null,Lm),ae(),!q.length&&B?B.p(Z,ee):q.length?B&&(B.d(1),B=null):(B=Km(Z),B.c(),B.m(k,null))),(!C||ee[0]&4096)&&x(e,"table-loading",Z[12])},i(Z){if(!C){A(M),A(O);for(let ee=0;ee({54:l}),({uniqueId:l})=>[0,l?8388608:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),V(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||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),H(i,l)}}}function nE(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||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function oh(n){let e,t,i=n[4].length+"",s,l,o;return{c(){e=y("small"),t=U("Showing "),s=U(i),l=U(" of "),o=U(n[5]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),v(e,t),v(e,s),v(e,l),v(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 rh(n){let e,t,i,s,l=n[5]-n[4].length+"",o,r,a,u;return{c(){e=y("div"),t=y("button"),i=y("span"),s=U("Load more ("),o=U(l),r=U(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[12]),x(t,"btn-disabled",n[12]),h(e,"class","block txt-center m-t-xs")},m(f,d){S(f,e,d),v(e,t),v(t,i),v(i,s),v(i,o),v(i,r),a||(u=J(t,"click",n[41]),a=!0)},p(f,d){d[0]&48&&l!==(l=f[5]-f[4].length+"")&&le(o,l),d[0]&4096&&x(t,"btn-loading",f[12]),d[0]&4096&&x(t,"btn-disabled",f[12])},d(f){f&&w(e),a=!1,u()}}}function ah(n){let e,t,i,s,l,o,r=n[8]===1?"record":"records",a,u,f,d,p,m,_,g,b,k,$;return{c(){e=y("div"),t=y("div"),i=U("Selected "),s=y("strong"),l=U(n[8]),o=E(),a=U(r),u=E(),f=y("button"),f.innerHTML='Reset',d=E(),p=y("div"),m=E(),_=y("button"),_.innerHTML='Delete selected',h(t,"class","txt"),h(f,"type","button"),h(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[13]),h(p,"class","flex-fill"),h(_,"type","button"),h(_,"class","btn btn-sm btn-transparent btn-danger"),x(_,"btn-loading",n[13]),x(_,"btn-disabled",n[13]),h(e,"class","bulkbar")},m(T,C){S(T,e,C),v(e,t),v(t,i),v(t,s),v(s,l),v(t,o),v(t,a),v(e,u),v(e,f),v(e,d),v(e,p),v(e,m),v(e,_),b=!0,k||($=[J(f,"click",n[42]),J(_,"click",n[43])],k=!0)},p(T,C){(!b||C[0]&256)&&le(l,T[8]),(!b||C[0]&256)&&r!==(r=T[8]===1?"record":"records")&&le(a,r),(!b||C[0]&8192)&&x(f,"btn-disabled",T[13]),(!b||C[0]&8192)&&x(_,"btn-loading",T[13]),(!b||C[0]&8192)&&x(_,"btn-disabled",T[13])},i(T){b||(T&&nt(()=>{b&&(g||(g=Ve(e,ii,{duration:150,y:5},!0)),g.run(1))}),b=!0)},o(T){T&&(g||(g=Ve(e,ii,{duration:150,y:5},!1)),g.run(0)),b=!1},d(T){T&&w(e),T&&g&&g.end(),k=!1,De($)}}}function sE(n){let e,t,i,s,l,o;e=new La({props:{class:"table-wrapper",$$slots:{before:[iE],default:[eE]},$$scope:{ctx:n}}});let r=n[4].length&&oh(n),a=n[4].length&&n[17]&&rh(n),u=n[8]&&ah(n);return{c(){z(e.$$.fragment),t=E(),r&&r.c(),i=E(),a&&a.c(),s=E(),u&&u.c(),l=Se()},m(f,d){V(e,f,d),S(f,t,d),r&&r.m(f,d),S(f,i,d),a&&a.m(f,d),S(f,s,d),u&&u.m(f,d),S(f,l,d),o=!0},p(f,d){const p={};d[0]&382679|d[2]&2&&(p.$$scope={dirty:d,ctx:f}),e.$set(p),f[4].length?r?r.p(f,d):(r=oh(f),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),f[4].length&&f[17]?a?a.p(f,d):(a=rh(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[8]?u?(u.p(f,d),d[0]&256&&A(u,1)):(u=ah(f),u.c(),A(u,1),u.m(l.parentNode,l)):u&&(re(),P(u,1,1,()=>{u=null}),ae())},i(f){o||(A(e.$$.fragment,f),A(u),o=!0)},o(f){P(e.$$.fragment,f),P(u),o=!1},d(f){H(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 lE=/^([\+\-])?(\w+)$/;function oE(n,e,t){let i,s,l,o,r,a,u,f;const d=kt();let{collection:p}=e,{sort:m=""}=e,{filter:_=""}=e,g=[],b=1,k=0,$={},T=!0,C=!1,D=0,M,O=[],I=[];function L(){p!=null&&p.id&&localStorage.setItem((p==null?void 0:p.id)+"@hiddenCollumns",JSON.stringify(O))}function F(){if(t(7,O=[]),!!(p!=null&&p.id))try{const $e=localStorage.getItem(p.id+"@hiddenCollumns");$e&&t(7,O=JSON.parse($e)||[])}catch{}}async function R(){const $e=b;for(let et=1;et<=$e;et++)(et===1||o)&&await N(et,!1)}async function N($e=1,et=!0){var je,gt;if(!(p!=null&&p.id))return;t(12,T=!0);let Dt=m;const Ft=Dt.match(lE),jt=Ft?s.find(Ge=>Ge.name===Ft[2]):null;if(Ft&&((gt=(je=jt==null?void 0:jt.options)==null?void 0:je.displayFields)==null?void 0:gt.length)>0){const Ge=[];for(const mn of jt.options.displayFields)Ge.push((Ft[1]||"")+Ft[2]+"."+mn);Dt=Ge.join(",")}const ye=j.getAllCollectionIdentifiers(p);return me.collection(p.id).getList($e,30,{sort:Dt,filter:j.normalizeSearchFilter(_,ye),expand:s.map(Ge=>Ge.name).join(","),$cancelKey:"records_list"}).then(async Ge=>{if($e<=1&&q(),t(12,T=!1),t(11,b=Ge.page),t(5,k=Ge.totalItems),d("load",g.concat(Ge.items)),et){const mn=++D;for(;Ge.items.length&&D==mn;)t(4,g=g.concat(Ge.items.splice(0,15))),await j.yieldToMain()}else t(4,g=g.concat(Ge.items))}).catch(Ge=>{Ge!=null&&Ge.isAbort||(t(12,T=!1),console.warn(Ge),q(),me.errorResponseHandler(Ge,!1))})}function q(){t(4,g=[]),t(11,b=1),t(5,k=0),t(6,$={})}function Y(){a?B():Z()}function B(){t(6,$={})}function Z(){for(const $e of g)t(6,$[$e.id]=$e,$);t(6,$)}function ee($e){$[$e.id]?delete $[$e.id]:t(6,$[$e.id]=$e,$),t(6,$)}function ie(){vn(`Do you really want to delete the selected ${r===1?"record":"records"}?`,X)}async function X(){if(C||!r||!(p!=null&&p.id))return;let $e=[];for(const et of Object.keys($))$e.push(me.collection(p.id).delete(et));return t(13,C=!0),Promise.all($e).then(()=>{Jt(`Successfully deleted the selected ${r===1?"record":"records"}.`),B()}).catch(et=>{me.errorResponseHandler(et)}).finally(()=>(t(13,C=!1),R()))}function fe($e){pe.call(this,n,$e)}const G=($e,et)=>{et.target.checked?j.removeByValue(O,$e.id):j.pushUnique(O,$e.id),t(7,O)},ce=()=>Y();function ge($e){m=$e,t(0,m)}function Me($e){m=$e,t(0,m)}function qe($e){m=$e,t(0,m)}function He($e){m=$e,t(0,m)}function we($e){m=$e,t(0,m)}function Ce($e){m=$e,t(0,m)}function Je($e){se[$e?"unshift":"push"](()=>{M=$e,t(14,M)})}const mt=$e=>ee($e),Ze=$e=>d("select",$e),We=($e,et)=>{et.code==="Enter"&&(et.preventDefault(),d("select",$e))},te=()=>t(1,_=""),Fe=()=>d("new"),Qe=()=>N(b+1),Gt=()=>B(),Le=()=>ie();return n.$$set=$e=>{"collection"in $e&&t(2,p=$e.collection),"sort"in $e&&t(0,m=$e.sort),"filter"in $e&&t(1,_=$e.filter)},n.$$.update=()=>{n.$$.dirty[0]&4&&p!=null&&p.id&&(F(),q()),n.$$.dirty[0]&4&&t(25,i=(p==null?void 0:p.schema)||[]),n.$$.dirty[0]&33554432&&(s=i.filter($e=>$e.type==="relation")),n.$$.dirty[0]&33554560&&t(18,l=i.filter($e=>!O.includes($e.id))),n.$$.dirty[0]&7&&p!=null&&p.id&&m!==-1&&_!==-1&&N(1),n.$$.dirty[0]&48&&t(17,o=k>g.length),n.$$.dirty[0]&64&&t(8,r=Object.keys($).length),n.$$.dirty[0]&272&&t(16,a=g.length&&r===g.length),n.$$.dirty[0]&128&&O!==-1&&L(),n.$$.dirty[0]&20&&t(10,u=!(p!=null&&p.$isView)||g.length>0&&g[0].created!=""),n.$$.dirty[0]&20&&t(9,f=!(p!=null&&p.$isView)||g.length>0&&g[0].updated!=""),n.$$.dirty[0]&33555972&&t(15,I=[].concat(p.$isAuth?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],i.map($e=>({id:$e.id,name:$e.name})),u?{id:"@created",name:"created"}:[],f?{id:"@updated",name:"updated"}:[]))},[m,_,p,N,g,k,$,O,r,f,u,b,T,C,M,I,a,o,l,d,Y,B,ee,ie,R,i,fe,G,ce,ge,Me,qe,He,we,Ce,Je,mt,Ze,We,te,Fe,Qe,Gt,Le]}class rE extends ve{constructor(e){super(),be(this,e,oE,sE,_e,{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 aE(n){let e,t,i,s;return e=new x4({}),i=new In({props:{$$slots:{default:[cE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(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||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function uE(n){let e,t;return e=new In({props:{center:!0,$$slots:{default:[mE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function fE(n){let e,t;return e=new In({props:{center:!0,$$slots:{default:[hE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function uh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='',h(e,"type","button"),h(e,"aria-label","Edit collection"),h(e,"class","btn btn-transparent btn-circle")},m(s,l){S(s,e,l),t||(i=[Ee(Ue.call(null,e,{text:"Edit collection",position:"right"})),J(e,"click",n[15])],t=!0)},p:Q,d(s){s&&w(e),t=!1,De(i)}}}function fh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` + New record`,h(e,"type","button"),h(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function cE(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L,F,R=!n[10]&&uh(n);d=new Pa({}),d.$on("refresh",n[16]);let N=!n[2].$isView&&fh(n);k=new Ko({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function q(Z){n[21](Z)}function Y(Z){n[22](Z)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),D=new rE({props:B}),n[20](D),se.push(()=>he(D,"filter",q)),se.push(()=>he(D,"sort",Y)),D.$on("select",n[23]),D.$on("new",n[24]),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Collections",s=E(),l=y("div"),r=U(o),a=E(),u=y("div"),R&&R.c(),f=E(),z(d.$$.fragment),p=E(),m=y("div"),_=y("button"),_.innerHTML=` + API Preview`,g=E(),N&&N.c(),b=E(),z(k.$$.fragment),$=E(),T=y("div"),C=E(),z(D.$$.fragment),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(u,"class","inline-flex gap-5"),h(_,"type","button"),h(_,"class","btn btn-outline"),h(m,"class","btns-group"),h(e,"class","page-header"),h(T,"class","clearfix m-b-base")},m(Z,ee){S(Z,e,ee),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),v(e,u),R&&R.m(u,null),v(u,f),V(d,u,null),v(e,p),v(e,m),v(m,_),v(m,g),N&&N.m(m,null),S(Z,b,ee),V(k,Z,ee),S(Z,$,ee),S(Z,T,ee),S(Z,C,ee),V(D,Z,ee),I=!0,L||(F=J(_,"click",n[17]),L=!0)},p(Z,ee){(!I||ee[0]&4)&&o!==(o=Z[2].name+"")&&le(r,o),Z[10]?R&&(R.d(1),R=null):R?R.p(Z,ee):(R=uh(Z),R.c(),R.m(u,f)),Z[2].$isView?N&&(N.d(1),N=null):N?N.p(Z,ee):(N=fh(Z),N.c(),N.m(m,null));const ie={};ee[0]&1&&(ie.value=Z[0]),ee[0]&4&&(ie.autocompleteCollection=Z[2]),k.$set(ie);const X={};ee[0]&4&&(X.collection=Z[2]),!M&&ee[0]&1&&(M=!0,X.filter=Z[0],ke(()=>M=!1)),!O&&ee[0]&2&&(O=!0,X.sort=Z[1],ke(()=>O=!1)),D.$set(X)},i(Z){I||(A(d.$$.fragment,Z),A(k.$$.fragment,Z),A(D.$$.fragment,Z),I=!0)},o(Z){P(d.$$.fragment,Z),P(k.$$.fragment,Z),P(D.$$.fragment,Z),I=!1},d(Z){Z&&w(e),R&&R.d(),H(d),N&&N.d(),Z&&w(b),H(k,Z),Z&&w($),Z&&w(T),Z&&w(C),n[20](null),H(D,Z),L=!1,F()}}}function dE(n){let e,t,i,s,l;return{c(){e=y("h1"),e.textContent="Create your first collection to add records!",t=E(),i=y("button"),i.innerHTML=` + Create new collection`,h(e,"class","m-b-10"),h(i,"type","button"),h(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=J(i,"click",n[14]),s=!0)},p:Q,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function pE(n){let e;return{c(){e=y("h1"),e.textContent="You don't have any collections yet.",h(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function mE(n){let e,t,i;function s(r,a){return r[10]?pE:dE}let l=s(n),o=l(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='',i=E(),o.c(),h(t,"class","icon"),h(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),v(e,t),v(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 hE(n){let e;return{c(){e=y("div"),e.innerHTML=` +

    Loading collections...

    `,h(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function _E(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[fE,uE,aE],m=[];function _(T,C){return T[3]&&!T[9].length?0:T[9].length?2:1}e=_(n),t=m[e]=p[e](n);let g={};s=new ru({props:g}),n[25](s);let b={};o=new r5({props:b}),n[26](o);let k={collection:n[2]};a=new ab({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let $={collection:n[2]};return f=new ND({props:$}),n[30](f),{c(){t.c(),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment)},m(T,C){m[e].m(T,C),S(T,i,C),V(s,T,C),S(T,l,C),V(o,T,C),S(T,r,C),V(a,T,C),S(T,u,C),V(f,T,C),d=!0},p(T,C){let D=e;e=_(T),e===D?m[e].p(T,C):(re(),P(m[D],1,1,()=>{m[D]=null}),ae(),t=m[e],t?t.p(T,C):(t=m[e]=p[e](T),t.c()),A(t,1),t.m(i.parentNode,i));const M={};s.$set(M);const O={};o.$set(O);const I={};C[0]&4&&(I.collection=T[2]),a.$set(I);const L={};C[0]&4&&(L.collection=T[2]),f.$set(L)},i(T){d||(A(t),A(s.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(f.$$.fragment,T),d=!0)},o(T){P(t),P(s.$$.fragment,T),P(o.$$.fragment,T),P(a.$$.fragment,T),P(f.$$.fragment,T),d=!1},d(T){m[e].d(T),T&&w(i),n[25](null),H(s,T),T&&w(l),n[26](null),H(o,T),T&&w(r),n[27](null),H(a,T),T&&w(u),n[30](null),H(f,T)}}}function gE(n,e,t){let i,s,l,o,r,a,u;Ke(n,_i,G=>t(2,s=G)),Ke(n,Lt,G=>t(31,l=G)),Ke(n,No,G=>t(3,o=G)),Ke(n,ya,G=>t(13,r=G)),Ke(n,si,G=>t(9,a=G)),Ke(n,Os,G=>t(10,u=G));const f=new URLSearchParams(r);let d,p,m,_,g,b=f.get("filter")||"",k=f.get("sort")||"",$=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,$=s==null?void 0:s.id),t(0,b=""),t(1,k="-created"),s!=null&&s.$isView&&!j.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}m$($);const C=()=>d==null?void 0:d.show(),D=()=>d==null?void 0:d.show(s),M=()=>g==null?void 0:g.load(),O=()=>p==null?void 0:p.show(s),I=()=>m==null?void 0:m.show(),L=G=>t(0,b=G.detail);function F(G){se[G?"unshift":"push"](()=>{g=G,t(8,g)})}function R(G){b=G,t(0,b)}function N(G){k=G,t(1,k)}const q=G=>{s.$isView?_.show(G==null?void 0:G.detail):m==null||m.show(G==null?void 0:G.detail)},Y=()=>m==null?void 0:m.show();function B(G){se[G?"unshift":"push"](()=>{d=G,t(4,d)})}function Z(G){se[G?"unshift":"push"](()=>{p=G,t(5,p)})}function ee(G){se[G?"unshift":"push"](()=>{m=G,t(6,m)})}const ie=()=>g==null?void 0:g.reloadLoadedPages(),X=()=>g==null?void 0:g.reloadLoadedPages();function fe(G){se[G?"unshift":"push"](()=>{_=G,t(7,_)})}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")!=$&&c$(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&$!=s.id&&T(),n.$$.dirty[0]&7&&(k||b||s!=null&&s.id)){const G=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:b,sort:k}).toString();Li("/collections?"+G)}n.$$.dirty[0]&4&&sn(Lt,l=(s==null?void 0:s.name)||"Collections",l)},[b,k,s,o,d,p,m,_,g,a,u,$,i,r,C,D,M,O,I,L,F,R,N,q,Y,B,Z,ee,ie,X,fe]}class bE extends ve{constructor(e){super(),be(this,e,gE,_E,_e,{},null,[-1,-1])}}function vE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L;return{c(){e=y("aside"),t=y("div"),i=y("div"),i.textContent="System",s=E(),l=y("a"),l.innerHTML=` Application`,o=E(),r=y("a"),r.innerHTML=` Mail settings`,a=E(),u=y("a"),u.innerHTML=` Files storage`,f=E(),d=y("div"),d.innerHTML='Sync',p=E(),m=y("a"),m.innerHTML=` @@ -157,24 +157,24 @@ Updated: ${o[3].updated}`,position:"left"})},d(o){o&&w(e),s=!1,l()}}}function VO Import collections`,b=E(),k=y("div"),k.textContent="Authentication",$=E(),T=y("a"),T.innerHTML=` Auth providers`,C=E(),D=y("a"),D.innerHTML=` Token options`,M=E(),O=y("a"),O.innerHTML=` - Admins`,h(i,"class","sidebar-title"),h(l,"href","/settings"),h(l,"class","sidebar-list-item"),h(r,"href","/settings/mail"),h(r,"class","sidebar-list-item"),h(u,"href","/settings/storage"),h(u,"class","sidebar-list-item"),h(d,"class","sidebar-title"),h(m,"href","/settings/export-collections"),h(m,"class","sidebar-list-item"),h(g,"href","/settings/import-collections"),h(g,"class","sidebar-list-item"),h(k,"class","sidebar-title"),h(T,"href","/settings/auth-providers"),h(T,"class","sidebar-list-item"),h(D,"href","/settings/tokens"),h(D,"class","sidebar-list-item"),h(O,"href","/settings/admins"),h(O,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(F,R){S(F,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),v(t,f),v(t,d),v(t,p),v(t,m),v(t,_),v(t,g),v(t,b),v(t,k),v(t,$),v(t,T),v(t,C),v(t,D),v(t,M),v(t,O),I||(L=[Ee(Yn.call(null,l,{path:"/settings"})),Ee(an.call(null,l)),Ee(Yn.call(null,r,{path:"/settings/mail/?.*"})),Ee(an.call(null,r)),Ee(Yn.call(null,u,{path:"/settings/storage/?.*"})),Ee(an.call(null,u)),Ee(Yn.call(null,m,{path:"/settings/export-collections/?.*"})),Ee(an.call(null,m)),Ee(Yn.call(null,g,{path:"/settings/import-collections/?.*"})),Ee(an.call(null,g)),Ee(Yn.call(null,T,{path:"/settings/auth-providers/?.*"})),Ee(an.call(null,T)),Ee(Yn.call(null,D,{path:"/settings/tokens/?.*"})),Ee(an.call(null,D)),Ee(Yn.call(null,O,{path:"/settings/admins/?.*"})),Ee(an.call(null,O))],I=!0)},p:Q,i:Q,o:Q,d(F){F&&w(e),I=!1,De(L)}}}class qi extends ve{constructor(e){super(),be(this,e,null,gE,_e,{})}}function fh(n,e,t){const i=n.slice();return i[30]=e[t],i}function ch(n){let e,t;return e=new de({props:{class:"form-field readonly",name:"id",$$slots:{default:[bE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="id",o=E(),r=y("div"),a=y("i"),f=E(),d=y("input"),h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[29]),h(a,"class","ri-calendar-event-line txt-disabled"),h(r,"class","form-field-addon"),h(d,"type","text"),h(d,"id",p=n[29]),d.value=m=n[1].id,d.readOnly=!0},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),S(b,r,k),v(r,a),S(b,f,k),S(b,d,k),_||(g=Ee(u=Ue.call(null,a,{text:`Created: ${n[1].created} + Admins`,h(i,"class","sidebar-title"),h(l,"href","/settings"),h(l,"class","sidebar-list-item"),h(r,"href","/settings/mail"),h(r,"class","sidebar-list-item"),h(u,"href","/settings/storage"),h(u,"class","sidebar-list-item"),h(d,"class","sidebar-title"),h(m,"href","/settings/export-collections"),h(m,"class","sidebar-list-item"),h(g,"href","/settings/import-collections"),h(g,"class","sidebar-list-item"),h(k,"class","sidebar-title"),h(T,"href","/settings/auth-providers"),h(T,"class","sidebar-list-item"),h(D,"href","/settings/tokens"),h(D,"class","sidebar-list-item"),h(O,"href","/settings/admins"),h(O,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(F,R){S(F,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),v(t,f),v(t,d),v(t,p),v(t,m),v(t,_),v(t,g),v(t,b),v(t,k),v(t,$),v(t,T),v(t,C),v(t,D),v(t,M),v(t,O),I||(L=[Ee(Yn.call(null,l,{path:"/settings"})),Ee(an.call(null,l)),Ee(Yn.call(null,r,{path:"/settings/mail/?.*"})),Ee(an.call(null,r)),Ee(Yn.call(null,u,{path:"/settings/storage/?.*"})),Ee(an.call(null,u)),Ee(Yn.call(null,m,{path:"/settings/export-collections/?.*"})),Ee(an.call(null,m)),Ee(Yn.call(null,g,{path:"/settings/import-collections/?.*"})),Ee(an.call(null,g)),Ee(Yn.call(null,T,{path:"/settings/auth-providers/?.*"})),Ee(an.call(null,T)),Ee(Yn.call(null,D,{path:"/settings/tokens/?.*"})),Ee(an.call(null,D)),Ee(Yn.call(null,O,{path:"/settings/admins/?.*"})),Ee(an.call(null,O))],I=!0)},p:Q,i:Q,o:Q,d(F){F&&w(e),I=!1,De(L)}}}class qi extends ve{constructor(e){super(),be(this,e,null,vE,_e,{})}}function ch(n,e,t){const i=n.slice();return i[30]=e[t],i}function dh(n){let e,t;return e=new de({props:{class:"form-field readonly",name:"id",$$slots:{default:[yE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function yE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="id",o=E(),r=y("div"),a=y("i"),f=E(),d=y("input"),h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[29]),h(a,"class","ri-calendar-event-line txt-disabled"),h(r,"class","form-field-addon"),h(d,"type","text"),h(d,"id",p=n[29]),d.value=m=n[1].id,d.readOnly=!0},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),S(b,r,k),v(r,a),S(b,f,k),S(b,d,k),_||(g=Ee(u=Ue.call(null,a,{text:`Created: ${n[1].created} Updated: ${n[1].updated}`,position:"left"})),_=!0)},p(b,k){k[0]&536870912&&l!==(l=b[29])&&h(e,"for",l),u&&Ut(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${b[1].created} -Updated: ${b[1].updated}`,position:"left"}),k[0]&536870912&&p!==(p=b[29])&&h(d,"id",p),k[0]&2&&m!==(m=b[1].id)&&d.value!==m&&(d.value=m)},d(b){b&&w(e),b&&w(o),b&&w(r),b&&w(f),b&&w(d),_=!1,g()}}}function dh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=y("button"),t=y("img"),s=E(),Dn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||h(t,"src",i),h(t,"alt","Avatar "+n[30]),h(e,"type","button"),h(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),v(e,t),v(e,s),o||(r=J(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&h(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function vE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Email",o=E(),r=y("input"),h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","email"),h(r,"autocomplete","off"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[3]),u||(f=J(r,"input",n[18]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&8&&r.value!==d[3]&&ue(r,d[3])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function ph(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[yE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function yE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[29]),h(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function mh(n){let e,t,i,s,l,o,r,a,u;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[kE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[wE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),h(e,"class","col-12")},m(f,d){S(f,e,d),v(e,t),v(t,i),V(s,i,null),v(t,l),v(t,o),V(r,o,null),u=!0},p(f,d){const p={};d[0]&536871168|d[1]&4&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d[0]&536871424|d[1]&4&&(m.$$scope={dirty:d,ctx:f}),r.$set(m)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&nt(()=>{u&&(a||(a=Ve(t,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Ve(t,wt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),H(s),H(r),f&&a&&a.end()}}}function kE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[8]),u||(f=J(r,"input",n[20]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&256&&r.value!==d[8]&&ue(r,d[8])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function wE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password confirm",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[9]),u||(f=J(r,"input",n[21]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&512&&r.value!==d[9]&&ue(r,d[9])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function SE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_=!n[1].$isNew&&ch(n),g=[0,1,2,3,4,5,6,7,8,9],b=[];for(let T=0;T<10;T+=1)b[T]=dh(fh(n,g,T));a=new de({props:{class:"form-field required",name:"email",$$slots:{default:[vE,({uniqueId:T})=>({29:T}),({uniqueId:T})=>[T?536870912:0]]},$$scope:{ctx:n}}});let k=!n[1].$isNew&&ph(n),$=(n[1].$isNew||n[4])&&mh(n);return{c(){e=y("form"),_&&_.c(),t=E(),i=y("div"),s=y("p"),s.textContent="Avatar",l=E(),o=y("div");for(let T=0;T<10;T+=1)b[T].c();r=E(),z(a.$$.fragment),u=E(),k&&k.c(),f=E(),$&&$.c(),h(s,"class","section-title"),h(o,"class","flex flex-gap-xs flex-wrap"),h(i,"class","content"),h(e,"id",n[11]),h(e,"class","grid"),h(e,"autocomplete","off")},m(T,C){S(T,e,C),_&&_.m(e,null),v(e,t),v(e,i),v(i,s),v(i,l),v(i,o);for(let D=0;D<10;D+=1)b[D]&&b[D].m(o,null);v(e,r),V(a,e,null),v(e,u),k&&k.m(e,null),v(e,f),$&&$.m(e,null),d=!0,p||(m=J(e,"submit",ft(n[12])),p=!0)},p(T,C){if(T[1].$isNew?_&&(re(),P(_,1,1,()=>{_=null}),ae()):_?(_.p(T,C),C[0]&2&&A(_,1)):(_=ch(T),_.c(),A(_,1),_.m(e,t)),C[0]&4){g=[0,1,2,3,4,5,6,7,8,9];let M;for(M=0;M<10;M+=1){const O=fh(T,g,M);b[M]?b[M].p(O,C):(b[M]=dh(O),b[M].c(),b[M].m(o,null))}for(;M<10;M+=1)b[M].d(1)}const D={};C[0]&536870920|C[1]&4&&(D.$$scope={dirty:C,ctx:T}),a.$set(D),T[1].$isNew?k&&(re(),P(k,1,1,()=>{k=null}),ae()):k?(k.p(T,C),C[0]&2&&A(k,1)):(k=ph(T),k.c(),A(k,1),k.m(e,f)),T[1].$isNew||T[4]?$?($.p(T,C),C[0]&18&&A($,1)):($=mh(T),$.c(),A($,1),$.m(e,null)):$&&(re(),P($,1,1,()=>{$=null}),ae())},i(T){d||(A(_),A(a.$$.fragment,T),A(k),A($),d=!0)},o(T){P(_),P(a.$$.fragment,T),P(k),P($),d=!1},d(T){T&&w(e),_&&_.d(),dt(b,T),H(a),k&&k.d(),$&&$.d(),p=!1,m()}}}function $E(n){let e,t=n[1].$isNew?"New admin":"Edit admin",i;return{c(){e=y("h4"),i=U(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].$isNew?"New admin":"Edit admin")&&le(i,t)},d(s){s&&w(e)}}}function hh(n){let e,t,i,s,l,o,r,a,u;return o=new Bn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[TE]},$$scope:{ctx:n}}}),{c(){e=y("button"),t=y("span"),i=E(),s=y("i"),l=E(),z(o.$$.fragment),r=E(),a=y("div"),h(s,"class","ri-more-line"),h(e,"type","button"),h(e,"aria-label","More"),h(e,"class","btn btn-sm btn-circle btn-transparent"),h(a,"class","flex-fill")},m(f,d){S(f,e,d),v(e,t),v(e,i),v(e,s),v(e,l),V(o,e,null),S(f,r,d),S(f,a,d),u=!0},p(f,d){const p={};d[1]&4&&(p.$$scope={dirty:d,ctx:f}),o.$set(p)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&w(e),H(o),f&&w(r),f&&w(a)}}}function TE(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` - Delete`,h(e,"type","button"),h(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function CE(n){let e,t,i,s,l,o,r=n[1].$isNew?"Create":"Save changes",a,u,f,d,p,m=!n[1].$isNew&&hh(n);return{c(){m&&m.c(),e=E(),t=y("button"),i=y("span"),i.textContent="Cancel",s=E(),l=y("button"),o=y("span"),a=U(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-transparent"),t.disabled=n[6],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],x(l,"btn-loading",n[6])},m(_,g){m&&m.m(_,g),S(_,e,g),S(_,t,g),v(t,i),S(_,s,g),S(_,l,g),v(l,o),v(o,a),f=!0,d||(p=J(t,"click",n[16]),d=!0)},p(_,g){_[1].$isNew?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(_,g),g[0]&2&&A(m,1)):(m=hh(_),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=_[6]),(!f||g[0]&2)&&r!==(r=_[1].$isNew?"Create":"Save changes")&&le(a,r),(!f||g[0]&1088&&u!==(u=!_[10]||_[6]))&&(l.disabled=u),(!f||g[0]&64)&&x(l,"btn-loading",_[6])},i(_){f||(A(m),f=!0)},o(_){P(m),f=!1},d(_){m&&m.d(_),_&&w(e),_&&w(t),_&&w(s),_&&w(l),d=!1,p()}}}function ME(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[CE],header:[$E],default:[SE]},$$scope:{ctx:n}};return e=new pn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),H(e,s)}}}function OE(n,e,t){let i;const s=kt(),l="admin_"+j.randomString(5);let o,r=new is,a=!1,u=!1,f=0,d="",p="",m="",_=!1;function g(Z){return k(Z),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function k(Z){t(1,r=Z!=null&&Z.$clone?Z.$clone():new is),$()}function $(){t(4,_=!1),t(3,d=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,p=""),t(9,m=""),dn({})}function T(){if(a||!i)return;t(6,a=!0);const Z={email:d,avatar:f};(r.$isNew||_)&&(Z.password=p,Z.passwordConfirm=m);let ee;r.$isNew?ee=me.admins.create(Z):ee=me.admins.update(r.id,Z),ee.then(async ie=>{var X;t(7,u=!1),b(),Jt(r.$isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ie),((X=me.authStore.model)==null?void 0:X.id)===ie.id&&me.authStore.save(me.authStore.token,ie)}).catch(ie=>{me.errorResponseHandler(ie)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&vn("Do you really want to delete the selected admin?",()=>me.admins.delete(r.id).then(()=>{t(7,u=!1),b(),Jt("Successfully deleted admin."),s("delete",r)}).catch(Z=>{me.errorResponseHandler(Z)}))}const D=()=>C(),M=()=>b(),O=Z=>t(2,f=Z);function I(){d=this.value,t(3,d)}function L(){_=this.checked,t(4,_)}function F(){p=this.value,t(8,p)}function R(){m=this.value,t(9,m)}const N=()=>i&&u?(vn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function q(Z){se[Z?"unshift":"push"](()=>{o=Z,t(5,o)})}function Y(Z){pe.call(this,n,Z)}function B(Z){pe.call(this,n,Z)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.$isNew&&d!=""||_||d!==r.email||f!==r.avatar)},[b,r,f,d,_,o,a,u,p,m,i,l,T,C,g,D,M,O,I,L,F,R,N,q,Y,B]}class DE extends ve{constructor(e){super(),be(this,e,OE,ME,_e,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function _h(n,e,t){const i=n.slice();return i[24]=e[t],i}function EE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="id",h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function AE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="email",h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function IE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="created",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function PE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="updated",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function gh(n){let e;function t(l,o){return l[5]?NE:LE}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 LE(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&bh(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No admins found.",s=E(),o&&o.c(),l=E(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=bh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function NE(n){let e;return{c(){e=y("tr"),e.innerHTML=` - `},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function bh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[17]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function vh(n){let e;return{c(){e=y("span"),e.textContent="You",h(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function yh(n,e){let t,i,s,l,o,r,a,u,f,d,p,m=e[24].id+"",_,g,b,k,$,T=e[24].email+"",C,D,M,O,I,L,F,R,N,q,Y,B,Z,ee;f=new tr({props:{value:e[24].id}});let ie=e[24].id===e[7].id&&vh();I=new hi({props:{date:e[24].created}}),R=new hi({props:{date:e[24].updated}});function X(){return e[15](e[24])}function fe(...G){return e[16](e[24],...G)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("figure"),l=y("img"),r=E(),a=y("td"),u=y("div"),z(f.$$.fragment),d=E(),p=y("span"),_=U(m),g=E(),ie&&ie.c(),b=E(),k=y("td"),$=y("span"),C=U(T),M=E(),O=y("td"),z(I.$$.fragment),L=E(),F=y("td"),z(R.$$.fragment),N=E(),q=y("td"),q.innerHTML='',Y=E(),Dn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||h(l,"src",o),h(l,"alt","Admin avatar"),h(s,"class","thumb thumb-sm thumb-circle"),h(i,"class","min-width"),h(p,"class","txt"),h(u,"class","label"),h(a,"class","col-type-text col-field-id"),h($,"class","txt txt-ellipsis"),h($,"title",D=e[24].email),h(k,"class","col-type-email col-field-email"),h(O,"class","col-type-date col-field-created"),h(F,"class","col-type-date col-field-updated"),h(q,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(G,ce){S(G,t,ce),v(t,i),v(i,s),v(s,l),v(t,r),v(t,a),v(a,u),V(f,u,null),v(u,d),v(u,p),v(p,_),v(a,g),ie&&ie.m(a,null),v(t,b),v(t,k),v(k,$),v($,C),v(t,M),v(t,O),V(I,O,null),v(t,L),v(t,F),V(R,F,null),v(t,N),v(t,q),v(t,Y),B=!0,Z||(ee=[J(t,"click",X),J(t,"keydown",fe)],Z=!0)},p(G,ce){e=G,(!B||ce&16&&!Dn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&h(l,"src",o);const ge={};ce&16&&(ge.value=e[24].id),f.$set(ge),(!B||ce&16)&&m!==(m=e[24].id+"")&&le(_,m),e[24].id===e[7].id?ie||(ie=vh(),ie.c(),ie.m(a,null)):ie&&(ie.d(1),ie=null),(!B||ce&16)&&T!==(T=e[24].email+"")&&le(C,T),(!B||ce&16&&D!==(D=e[24].email))&&h($,"title",D);const Me={};ce&16&&(Me.date=e[24].created),I.$set(Me);const qe={};ce&16&&(qe.date=e[24].updated),R.$set(qe)},i(G){B||(A(f.$$.fragment,G),A(I.$$.fragment,G),A(R.$$.fragment,G),B=!0)},o(G){P(f.$$.fragment,G),P(I.$$.fragment,G),P(R.$$.fragment,G),B=!1},d(G){G&&w(t),H(f),ie&&ie.d(),H(I),H(R),Z=!1,De(ee)}}}function FE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D=[],M=new Map,O;function I(X){n[11](X)}let L={class:"col-type-text",name:"id",$$slots:{default:[EE]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new tn({props:L}),se.push(()=>he(o,"sort",I));function F(X){n[12](X)}let R={class:"col-type-email col-field-email",name:"email",$$slots:{default:[AE]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),u=new tn({props:R}),se.push(()=>he(u,"sort",F));function N(X){n[13](X)}let q={class:"col-type-date col-field-created",name:"created",$$slots:{default:[IE]},$$scope:{ctx:n}};n[2]!==void 0&&(q.sort=n[2]),p=new tn({props:q}),se.push(()=>he(p,"sort",N));function Y(X){n[14](X)}let B={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[PE]},$$scope:{ctx:n}};n[2]!==void 0&&(B.sort=n[2]),g=new tn({props:B}),se.push(()=>he(g,"sort",Y));let Z=n[4];const ee=X=>X[24].id;for(let X=0;Xr=!1)),o.$set(G);const ce={};fe&134217728&&(ce.$$scope={dirty:fe,ctx:X}),!f&&fe&4&&(f=!0,ce.sort=X[2],ke(()=>f=!1)),u.$set(ce);const ge={};fe&134217728&&(ge.$$scope={dirty:fe,ctx:X}),!m&&fe&4&&(m=!0,ge.sort=X[2],ke(()=>m=!1)),p.$set(ge);const Me={};fe&134217728&&(Me.$$scope={dirty:fe,ctx:X}),!b&&fe&4&&(b=!0,Me.sort=X[2],ke(()=>b=!1)),g.$set(Me),fe&186&&(Z=X[4],re(),D=yt(D,fe,ee,1,X,Z,M,C,Zt,yh,null,_h),ae(),!Z.length&&ie?ie.p(X,fe):Z.length?ie&&(ie.d(1),ie=null):(ie=gh(X),ie.c(),ie.m(C,null))),(!O||fe&32)&&x(e,"table-loading",X[5])},i(X){if(!O){A(o.$$.fragment,X),A(u.$$.fragment,X),A(p.$$.fragment,X),A(g.$$.fragment,X);for(let fe=0;fe - New admin`,m=E(),z(_.$$.fragment),g=E(),b=y("div"),k=E(),z($.$$.fragment),T=E(),I&&I.c(),C=Se(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(f,"class","flex-fill"),h(p,"type","button"),h(p,"class","btn btn-expanded"),h(e,"class","page-header"),h(b,"class","clearfix m-b-base")},m(L,F){S(L,e,F),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(e,r),V(a,e,null),v(e,u),v(e,f),v(e,d),v(e,p),S(L,m,F),V(_,L,F),S(L,g,F),S(L,b,F),S(L,k,F),V($,L,F),S(L,T,F),I&&I.m(L,F),S(L,C,F),D=!0,M||(O=J(p,"click",n[9]),M=!0)},p(L,F){(!D||F&64)&&le(o,L[6]);const R={};F&2&&(R.value=L[1]),_.$set(R);const N={};F&134217918&&(N.$$scope={dirty:F,ctx:L}),$.$set(N),L[4].length?I?I.p(L,F):(I=kh(L),I.c(),I.m(C.parentNode,C)):I&&(I.d(1),I=null)},i(L){D||(A(a.$$.fragment,L),A(_.$$.fragment,L),A($.$$.fragment,L),D=!0)},o(L){P(a.$$.fragment,L),P(_.$$.fragment,L),P($.$$.fragment,L),D=!1},d(L){L&&w(e),H(a),L&&w(m),H(_,L),L&&w(g),L&&w(b),L&&w(k),H($,L),L&&w(T),I&&I.d(L),L&&w(C),M=!1,O()}}}function qE(n){let e,t,i,s,l,o;e=new qi({}),i=new In({props:{$$slots:{default:[RE]},$$scope:{ctx:n}}});let r={};return l=new DE({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[18](null),H(l,a)}}}function jE(n,e,t){let i,s,l;Ke(n,ya,R=>t(21,i=R)),Ke(n,Lt,R=>t(6,s=R)),Ke(n,Ia,R=>t(7,l=R)),sn(Lt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",d=o.get("sort")||"-created";function p(){t(5,u=!0),t(4,a=[]);const R=j.normalizeSearchFilter(f,["id","email","created","updated"]);return me.admins.getFullList(100,{sort:d||"-created",filter:R}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),m(),me.errorResponseHandler(N,!1))})}function m(){t(4,a=[])}const _=()=>p(),g=()=>r==null?void 0:r.show(),b=R=>t(1,f=R.detail);function k(R){d=R,t(2,d)}function $(R){d=R,t(2,d)}function T(R){d=R,t(2,d)}function C(R){d=R,t(2,d)}const D=R=>r==null?void 0:r.show(R),M=(R,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(R))},O=()=>t(1,f="");function I(R){se[R?"unshift":"push"](()=>{r=R,t(3,r)})}const L=()=>p(),F=()=>p();return n.$$.update=()=>{if(n.$$.dirty&6&&d!==-1&&f!==-1){const R=new URLSearchParams({filter:f,sort:d}).toString();Li("/settings/admins?"+R),p()}},[p,f,d,r,a,u,s,l,_,g,b,k,$,T,C,D,M,O,I,L,F]}class VE extends ve{constructor(e){super(),be(this,e,jE,qE,_e,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function HE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=E(),l=y("input"),h(e,"for",i=n[8]),h(l,"type","email"),h(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&h(e,"for",i),f&256&&o!==(o=u[8])&&h(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function zE(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Password"),s=E(),l=y("input"),r=E(),a=y("div"),u=y("a"),u.textContent="Forgotten password?",h(e,"for",i=n[8]),h(l,"type","password"),h(l,"id",o=n[8]),l.required=!0,h(u,"href","/request-password-reset"),h(u,"class","link-hint"),h(a,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[1]),S(p,r,m),S(p,a,m),v(a,u),f||(d=[J(l,"input",n[5]),Ee(an.call(null,u))],f=!0)},p(p,m){m&256&&i!==(i=p[8])&&h(e,"for",i),m&256&&o!==(o=p[8])&&h(l,"id",o),m&2&&l.value!==p[1]&&ue(l,p[1])},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),p&&w(a),f=!1,De(d)}}}function BE(n){let e,t,i,s,l,o,r,a,u,f,d;return s=new de({props:{class:"form-field required",name:"identity",$$slots:{default:[HE,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[zE,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),t.innerHTML="

    Admin sign in

    ",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),a=y("button"),a.innerHTML=`Login - `,h(t,"class","content txt-center m-b-base"),h(a,"type","submit"),h(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),h(e,"class","block")},m(p,m){S(p,e,m),v(e,t),v(e,i),V(s,e,null),v(e,l),V(o,e,null),v(e,r),v(e,a),u=!0,f||(d=J(e,"submit",ft(n[3])),f=!0)},p(p,m){const _={};m&769&&(_.$$scope={dirty:m,ctx:p}),s.$set(_);const g={};m&770&&(g.$$scope={dirty:m,ctx:p}),o.$set(g),(!u||m&4)&&x(a,"btn-disabled",p[2]),(!u||m&4)&&x(a,"btn-loading",p[2])},i(p){u||(A(s.$$.fragment,p),A(o.$$.fragment,p),u=!0)},o(p){P(s.$$.fragment,p),P(o.$$.fragment,p),u=!1},d(p){p&&w(e),H(s),H(o),f=!1,d()}}}function UE(n){let e,t;return e=new e1({props:{$$slots:{default:[BE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function WE(n,e,t){let i;Ke(n,ya,d=>t(6,i=d));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),me.admins.authWithPassword(l,o).then(()=>{Ea(),Li("/")}).catch(()=>{hl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class YE extends ve{constructor(e){super(),be(this,e,WE,UE,_e,{})}}function KE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D;i=new de({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[ZE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[GE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[XE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[QE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&wh(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),d=E(),p=y("div"),m=y("div"),_=E(),M&&M.c(),g=E(),b=y("button"),k=y("span"),k.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(m,"class","flex-fill"),h(k,"class","txt"),h(b,"type","submit"),h(b,"class","btn btn-expanded"),b.disabled=$=!n[3]||n[2],x(b,"btn-loading",n[2]),h(p,"class","col-lg-12 flex"),h(e,"class","grid")},m(O,I){S(O,e,I),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),V(a,e,null),v(e,u),V(f,e,null),v(e,d),v(e,p),v(p,m),v(p,_),M&&M.m(p,null),v(p,g),v(p,b),v(b,k),T=!0,C||(D=J(b,"click",n[13]),C=!0)},p(O,I){const L={};I&1572865&&(L.$$scope={dirty:I,ctx:O}),i.$set(L);const F={};I&1572865&&(F.$$scope={dirty:I,ctx:O}),o.$set(F);const R={};I&1572865&&(R.$$scope={dirty:I,ctx:O}),a.$set(R);const N={};I&1572865&&(N.$$scope={dirty:I,ctx:O}),f.$set(N),O[3]?M?M.p(O,I):(M=wh(O),M.c(),M.m(p,g)):M&&(M.d(1),M=null),(!T||I&12&&$!==($=!O[3]||O[2]))&&(b.disabled=$),(!T||I&4)&&x(b,"btn-loading",O[2])},i(O){T||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),T=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(a.$$.fragment,O),P(f.$$.fragment,O),T=!1},d(O){O&&w(e),H(i),H(o),H(a),H(f),M&&M.d(),C=!1,D()}}}function JE(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function ZE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application name"),s=E(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.appName),r||(a=J(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&ue(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function GE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application url"),s=E(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.appUrl),r||(a=J(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&ue(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function XE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Logs max days retention"),s=E(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","number"),h(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].logs.maxDays),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].logs.maxDays&&ue(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function QE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Hide collection create and edit controls",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[19]),h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[19])},m(d,p){S(d,e,p),e.checked=n[0].meta.hideControls,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[11]),Ee(Ue.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(d,p){p&524288&&t!==(t=d[19])&&h(e,"id",t),p&1&&(e.checked=d[0].meta.hideControls),p&524288&&a!==(a=d[19])&&h(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function wh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),v(e,t),i||(s=J(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function xE(n){let e,t,i,s,l,o,r,a,u;const f=[JE,KE],d=[];function p(m,_){return m[1]?0:1}return l=p(n),o=d[l]=f[l](n),{c(){e=y("header"),e.innerHTML=``,t=E(),i=y("div"),s=y("form"),o.c(),h(e,"class","page-header"),h(s,"class","panel"),h(s,"autocomplete","off"),h(i,"class","wrapper")},m(m,_){S(m,e,_),S(m,t,_),S(m,i,_),v(i,s),d[l].m(s,null),r=!0,a||(u=J(s,"submit",ft(n[4])),a=!0)},p(m,_){let g=l;l=p(m),l===g?d[l].p(m,_):(re(),P(d[g],1,1,()=>{d[g]=null}),ae(),o=d[l],o?o.p(m,_):(o=d[l]=f[l](m),o.c()),A(o,1),o.m(s,null))},i(m){r||(A(o),r=!0)},o(m){P(o),r=!1},d(m){m&&w(e),m&&w(t),m&&w(i),d[l].d(),a=!1,u()}}}function e6(n){let e,t,i,s;return e=new qi({}),i=new In({props:{$$slots:{default:[xE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function t6(n,e,t){let i,s,l,o;Ke(n,Os,M=>t(14,s=M)),Ke(n,wo,M=>t(15,l=M)),Ke(n,Lt,M=>t(16,o=M)),sn(Lt,o="Application settings",o);let r={},a={},u=!1,f=!1,d="";p();async function p(){t(1,u=!0);try{const M=await me.settings.getAll()||{};_(M)}catch(M){me.errorResponseHandler(M)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const M=await me.settings.update(j.filterRedactedProps(a));_(M),Jt("Successfully saved application settings.")}catch(M){me.errorResponseHandler(M)}t(2,f=!1)}}function _(M={}){var O,I;sn(wo,l=(O=M==null?void 0:M.meta)==null?void 0:O.appName,l),sn(Os,s=!!((I=M==null?void 0:M.meta)!=null&&I.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function $(){a.logs.maxDays=_t(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>g(),D=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,d=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=d!=JSON.stringify(a))},[a,u,f,i,m,g,r,d,b,k,$,T,C,D]}class n6 extends ve{constructor(e){super(),be(this,e,t6,e6,_e,{})}}function i6(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o',i=E(),s=y("input"),h(t,"type","button"),h(t,"class","btn btn-transparent btn-circle"),h(e,"class","form-field-addon"),ni(s,a)},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ee(Ue.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){ni(s,a=St(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,De(o)}}}function l6(n){let e;function t(l,o){return l[3]?s6:i6}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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:Q,o:Q,d(l){s.d(l),l&&w(e)}}}function o6(n,e,t){const i=["value","mask"];let s=Xe(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ln(),r==null||r.focus()}const f=()=>u();function d(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function p(){l=this.value,t(0,l)}return n.$$set=m=>{e=Re(Re({},e),Yt(m)),t(5,s=Xe(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,d,p]}class fu extends ve{constructor(e){super(),be(this,e,o6,l6,_e,{value:0,mask:1})}}function r6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;return{c(){e=y("label"),t=U("Subject"),s=E(),l=y("input"),r=E(),a=y("div"),u=U(`Available placeholder parameters: +Updated: ${b[1].updated}`,position:"left"}),k[0]&536870912&&p!==(p=b[29])&&h(d,"id",p),k[0]&2&&m!==(m=b[1].id)&&d.value!==m&&(d.value=m)},d(b){b&&w(e),b&&w(o),b&&w(r),b&&w(f),b&&w(d),_=!1,g()}}}function ph(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=y("button"),t=y("img"),s=E(),Dn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||h(t,"src",i),h(t,"alt","Avatar "+n[30]),h(e,"type","button"),h(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),v(e,t),v(e,s),o||(r=J(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&h(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function kE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Email",o=E(),r=y("input"),h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","email"),h(r,"autocomplete","off"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[3]),u||(f=J(r,"input",n[18]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&8&&r.value!==d[3]&&ue(r,d[3])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function mh(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[wE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function wE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[29]),h(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function hh(n){let e,t,i,s,l,o,r,a,u;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[SE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[$E,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),h(e,"class","col-12")},m(f,d){S(f,e,d),v(e,t),v(t,i),V(s,i,null),v(t,l),v(t,o),V(r,o,null),u=!0},p(f,d){const p={};d[0]&536871168|d[1]&4&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d[0]&536871424|d[1]&4&&(m.$$scope={dirty:d,ctx:f}),r.$set(m)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&nt(()=>{u&&(a||(a=Ve(t,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Ve(t,wt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),H(s),H(r),f&&a&&a.end()}}}function SE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[8]),u||(f=J(r,"input",n[20]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&256&&r.value!==d[8]&&ue(r,d[8])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function $E(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password confirm",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ue(r,n[9]),u||(f=J(r,"input",n[21]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&512&&r.value!==d[9]&&ue(r,d[9])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function TE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_=!n[1].$isNew&&dh(n),g=[0,1,2,3,4,5,6,7,8,9],b=[];for(let T=0;T<10;T+=1)b[T]=ph(ch(n,g,T));a=new de({props:{class:"form-field required",name:"email",$$slots:{default:[kE,({uniqueId:T})=>({29:T}),({uniqueId:T})=>[T?536870912:0]]},$$scope:{ctx:n}}});let k=!n[1].$isNew&&mh(n),$=(n[1].$isNew||n[4])&&hh(n);return{c(){e=y("form"),_&&_.c(),t=E(),i=y("div"),s=y("p"),s.textContent="Avatar",l=E(),o=y("div");for(let T=0;T<10;T+=1)b[T].c();r=E(),z(a.$$.fragment),u=E(),k&&k.c(),f=E(),$&&$.c(),h(s,"class","section-title"),h(o,"class","flex flex-gap-xs flex-wrap"),h(i,"class","content"),h(e,"id",n[11]),h(e,"class","grid"),h(e,"autocomplete","off")},m(T,C){S(T,e,C),_&&_.m(e,null),v(e,t),v(e,i),v(i,s),v(i,l),v(i,o);for(let D=0;D<10;D+=1)b[D]&&b[D].m(o,null);v(e,r),V(a,e,null),v(e,u),k&&k.m(e,null),v(e,f),$&&$.m(e,null),d=!0,p||(m=J(e,"submit",ft(n[12])),p=!0)},p(T,C){if(T[1].$isNew?_&&(re(),P(_,1,1,()=>{_=null}),ae()):_?(_.p(T,C),C[0]&2&&A(_,1)):(_=dh(T),_.c(),A(_,1),_.m(e,t)),C[0]&4){g=[0,1,2,3,4,5,6,7,8,9];let M;for(M=0;M<10;M+=1){const O=ch(T,g,M);b[M]?b[M].p(O,C):(b[M]=ph(O),b[M].c(),b[M].m(o,null))}for(;M<10;M+=1)b[M].d(1)}const D={};C[0]&536870920|C[1]&4&&(D.$$scope={dirty:C,ctx:T}),a.$set(D),T[1].$isNew?k&&(re(),P(k,1,1,()=>{k=null}),ae()):k?(k.p(T,C),C[0]&2&&A(k,1)):(k=mh(T),k.c(),A(k,1),k.m(e,f)),T[1].$isNew||T[4]?$?($.p(T,C),C[0]&18&&A($,1)):($=hh(T),$.c(),A($,1),$.m(e,null)):$&&(re(),P($,1,1,()=>{$=null}),ae())},i(T){d||(A(_),A(a.$$.fragment,T),A(k),A($),d=!0)},o(T){P(_),P(a.$$.fragment,T),P(k),P($),d=!1},d(T){T&&w(e),_&&_.d(),dt(b,T),H(a),k&&k.d(),$&&$.d(),p=!1,m()}}}function CE(n){let e,t=n[1].$isNew?"New admin":"Edit admin",i;return{c(){e=y("h4"),i=U(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].$isNew?"New admin":"Edit admin")&&le(i,t)},d(s){s&&w(e)}}}function _h(n){let e,t,i,s,l,o,r,a,u;return o=new Bn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[ME]},$$scope:{ctx:n}}}),{c(){e=y("button"),t=y("span"),i=E(),s=y("i"),l=E(),z(o.$$.fragment),r=E(),a=y("div"),h(s,"class","ri-more-line"),h(e,"type","button"),h(e,"aria-label","More"),h(e,"class","btn btn-sm btn-circle btn-transparent"),h(a,"class","flex-fill")},m(f,d){S(f,e,d),v(e,t),v(e,i),v(e,s),v(e,l),V(o,e,null),S(f,r,d),S(f,a,d),u=!0},p(f,d){const p={};d[1]&4&&(p.$$scope={dirty:d,ctx:f}),o.$set(p)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&w(e),H(o),f&&w(r),f&&w(a)}}}function ME(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` + Delete`,h(e,"type","button"),h(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function OE(n){let e,t,i,s,l,o,r=n[1].$isNew?"Create":"Save changes",a,u,f,d,p,m=!n[1].$isNew&&_h(n);return{c(){m&&m.c(),e=E(),t=y("button"),i=y("span"),i.textContent="Cancel",s=E(),l=y("button"),o=y("span"),a=U(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-transparent"),t.disabled=n[6],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],x(l,"btn-loading",n[6])},m(_,g){m&&m.m(_,g),S(_,e,g),S(_,t,g),v(t,i),S(_,s,g),S(_,l,g),v(l,o),v(o,a),f=!0,d||(p=J(t,"click",n[16]),d=!0)},p(_,g){_[1].$isNew?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(_,g),g[0]&2&&A(m,1)):(m=_h(_),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=_[6]),(!f||g[0]&2)&&r!==(r=_[1].$isNew?"Create":"Save changes")&&le(a,r),(!f||g[0]&1088&&u!==(u=!_[10]||_[6]))&&(l.disabled=u),(!f||g[0]&64)&&x(l,"btn-loading",_[6])},i(_){f||(A(m),f=!0)},o(_){P(m),f=!1},d(_){m&&m.d(_),_&&w(e),_&&w(t),_&&w(s),_&&w(l),d=!1,p()}}}function DE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[OE],header:[CE],default:[TE]},$$scope:{ctx:n}};return e=new pn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),H(e,s)}}}function EE(n,e,t){let i;const s=kt(),l="admin_"+j.randomString(5);let o,r=new is,a=!1,u=!1,f=0,d="",p="",m="",_=!1;function g(Z){return k(Z),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function k(Z){t(1,r=Z!=null&&Z.$clone?Z.$clone():new is),$()}function $(){t(4,_=!1),t(3,d=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,p=""),t(9,m=""),dn({})}function T(){if(a||!i)return;t(6,a=!0);const Z={email:d,avatar:f};(r.$isNew||_)&&(Z.password=p,Z.passwordConfirm=m);let ee;r.$isNew?ee=me.admins.create(Z):ee=me.admins.update(r.id,Z),ee.then(async ie=>{var X;t(7,u=!1),b(),Jt(r.$isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ie),((X=me.authStore.model)==null?void 0:X.id)===ie.id&&me.authStore.save(me.authStore.token,ie)}).catch(ie=>{me.errorResponseHandler(ie)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&vn("Do you really want to delete the selected admin?",()=>me.admins.delete(r.id).then(()=>{t(7,u=!1),b(),Jt("Successfully deleted admin."),s("delete",r)}).catch(Z=>{me.errorResponseHandler(Z)}))}const D=()=>C(),M=()=>b(),O=Z=>t(2,f=Z);function I(){d=this.value,t(3,d)}function L(){_=this.checked,t(4,_)}function F(){p=this.value,t(8,p)}function R(){m=this.value,t(9,m)}const N=()=>i&&u?(vn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function q(Z){se[Z?"unshift":"push"](()=>{o=Z,t(5,o)})}function Y(Z){pe.call(this,n,Z)}function B(Z){pe.call(this,n,Z)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.$isNew&&d!=""||_||d!==r.email||f!==r.avatar)},[b,r,f,d,_,o,a,u,p,m,i,l,T,C,g,D,M,O,I,L,F,R,N,q,Y,B]}class AE extends ve{constructor(e){super(),be(this,e,EE,DE,_e,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function gh(n,e,t){const i=n.slice();return i[24]=e[t],i}function IE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="id",h(t,"class",j.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function PE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="email",h(t,"class",j.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function LE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="created",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function NE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="updated",h(t,"class",j.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&w(e)}}}function bh(n){let e;function t(l,o){return l[5]?RE:FE}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 FE(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&vh(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No admins found.",s=E(),o&&o.c(),l=E(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=vh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function RE(n){let e;return{c(){e=y("tr"),e.innerHTML=` + `},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function vh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear filters',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[17]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function yh(n){let e;return{c(){e=y("span"),e.textContent="You",h(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function kh(n,e){let t,i,s,l,o,r,a,u,f,d,p,m=e[24].id+"",_,g,b,k,$,T=e[24].email+"",C,D,M,O,I,L,F,R,N,q,Y,B,Z,ee;f=new tr({props:{value:e[24].id}});let ie=e[24].id===e[7].id&&yh();I=new hi({props:{date:e[24].created}}),R=new hi({props:{date:e[24].updated}});function X(){return e[15](e[24])}function fe(...G){return e[16](e[24],...G)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("figure"),l=y("img"),r=E(),a=y("td"),u=y("div"),z(f.$$.fragment),d=E(),p=y("span"),_=U(m),g=E(),ie&&ie.c(),b=E(),k=y("td"),$=y("span"),C=U(T),M=E(),O=y("td"),z(I.$$.fragment),L=E(),F=y("td"),z(R.$$.fragment),N=E(),q=y("td"),q.innerHTML='',Y=E(),Dn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||h(l,"src",o),h(l,"alt","Admin avatar"),h(s,"class","thumb thumb-sm thumb-circle"),h(i,"class","min-width"),h(p,"class","txt"),h(u,"class","label"),h(a,"class","col-type-text col-field-id"),h($,"class","txt txt-ellipsis"),h($,"title",D=e[24].email),h(k,"class","col-type-email col-field-email"),h(O,"class","col-type-date col-field-created"),h(F,"class","col-type-date col-field-updated"),h(q,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(G,ce){S(G,t,ce),v(t,i),v(i,s),v(s,l),v(t,r),v(t,a),v(a,u),V(f,u,null),v(u,d),v(u,p),v(p,_),v(a,g),ie&&ie.m(a,null),v(t,b),v(t,k),v(k,$),v($,C),v(t,M),v(t,O),V(I,O,null),v(t,L),v(t,F),V(R,F,null),v(t,N),v(t,q),v(t,Y),B=!0,Z||(ee=[J(t,"click",X),J(t,"keydown",fe)],Z=!0)},p(G,ce){e=G,(!B||ce&16&&!Dn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&h(l,"src",o);const ge={};ce&16&&(ge.value=e[24].id),f.$set(ge),(!B||ce&16)&&m!==(m=e[24].id+"")&&le(_,m),e[24].id===e[7].id?ie||(ie=yh(),ie.c(),ie.m(a,null)):ie&&(ie.d(1),ie=null),(!B||ce&16)&&T!==(T=e[24].email+"")&&le(C,T),(!B||ce&16&&D!==(D=e[24].email))&&h($,"title",D);const Me={};ce&16&&(Me.date=e[24].created),I.$set(Me);const qe={};ce&16&&(qe.date=e[24].updated),R.$set(qe)},i(G){B||(A(f.$$.fragment,G),A(I.$$.fragment,G),A(R.$$.fragment,G),B=!0)},o(G){P(f.$$.fragment,G),P(I.$$.fragment,G),P(R.$$.fragment,G),B=!1},d(G){G&&w(t),H(f),ie&&ie.d(),H(I),H(R),Z=!1,De(ee)}}}function qE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D=[],M=new Map,O;function I(X){n[11](X)}let L={class:"col-type-text",name:"id",$$slots:{default:[IE]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new tn({props:L}),se.push(()=>he(o,"sort",I));function F(X){n[12](X)}let R={class:"col-type-email col-field-email",name:"email",$$slots:{default:[PE]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),u=new tn({props:R}),se.push(()=>he(u,"sort",F));function N(X){n[13](X)}let q={class:"col-type-date col-field-created",name:"created",$$slots:{default:[LE]},$$scope:{ctx:n}};n[2]!==void 0&&(q.sort=n[2]),p=new tn({props:q}),se.push(()=>he(p,"sort",N));function Y(X){n[14](X)}let B={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[NE]},$$scope:{ctx:n}};n[2]!==void 0&&(B.sort=n[2]),g=new tn({props:B}),se.push(()=>he(g,"sort",Y));let Z=n[4];const ee=X=>X[24].id;for(let X=0;Xr=!1)),o.$set(G);const ce={};fe&134217728&&(ce.$$scope={dirty:fe,ctx:X}),!f&&fe&4&&(f=!0,ce.sort=X[2],ke(()=>f=!1)),u.$set(ce);const ge={};fe&134217728&&(ge.$$scope={dirty:fe,ctx:X}),!m&&fe&4&&(m=!0,ge.sort=X[2],ke(()=>m=!1)),p.$set(ge);const Me={};fe&134217728&&(Me.$$scope={dirty:fe,ctx:X}),!b&&fe&4&&(b=!0,Me.sort=X[2],ke(()=>b=!1)),g.$set(Me),fe&186&&(Z=X[4],re(),D=yt(D,fe,ee,1,X,Z,M,C,Zt,kh,null,gh),ae(),!Z.length&&ie?ie.p(X,fe):Z.length?ie&&(ie.d(1),ie=null):(ie=bh(X),ie.c(),ie.m(C,null))),(!O||fe&32)&&x(e,"table-loading",X[5])},i(X){if(!O){A(o.$$.fragment,X),A(u.$$.fragment,X),A(p.$$.fragment,X),A(g.$$.fragment,X);for(let fe=0;fe + New admin`,m=E(),z(_.$$.fragment),g=E(),b=y("div"),k=E(),z($.$$.fragment),T=E(),I&&I.c(),C=Se(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(f,"class","flex-fill"),h(p,"type","button"),h(p,"class","btn btn-expanded"),h(e,"class","page-header"),h(b,"class","clearfix m-b-base")},m(L,F){S(L,e,F),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(e,r),V(a,e,null),v(e,u),v(e,f),v(e,d),v(e,p),S(L,m,F),V(_,L,F),S(L,g,F),S(L,b,F),S(L,k,F),V($,L,F),S(L,T,F),I&&I.m(L,F),S(L,C,F),D=!0,M||(O=J(p,"click",n[9]),M=!0)},p(L,F){(!D||F&64)&&le(o,L[6]);const R={};F&2&&(R.value=L[1]),_.$set(R);const N={};F&134217918&&(N.$$scope={dirty:F,ctx:L}),$.$set(N),L[4].length?I?I.p(L,F):(I=wh(L),I.c(),I.m(C.parentNode,C)):I&&(I.d(1),I=null)},i(L){D||(A(a.$$.fragment,L),A(_.$$.fragment,L),A($.$$.fragment,L),D=!0)},o(L){P(a.$$.fragment,L),P(_.$$.fragment,L),P($.$$.fragment,L),D=!1},d(L){L&&w(e),H(a),L&&w(m),H(_,L),L&&w(g),L&&w(b),L&&w(k),H($,L),L&&w(T),I&&I.d(L),L&&w(C),M=!1,O()}}}function VE(n){let e,t,i,s,l,o;e=new qi({}),i=new In({props:{$$slots:{default:[jE]},$$scope:{ctx:n}}});let r={};return l=new AE({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[18](null),H(l,a)}}}function HE(n,e,t){let i,s,l;Ke(n,ya,R=>t(21,i=R)),Ke(n,Lt,R=>t(6,s=R)),Ke(n,Ia,R=>t(7,l=R)),sn(Lt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",d=o.get("sort")||"-created";function p(){t(5,u=!0),t(4,a=[]);const R=j.normalizeSearchFilter(f,["id","email","created","updated"]);return me.admins.getFullList(100,{sort:d||"-created",filter:R}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),m(),me.errorResponseHandler(N,!1))})}function m(){t(4,a=[])}const _=()=>p(),g=()=>r==null?void 0:r.show(),b=R=>t(1,f=R.detail);function k(R){d=R,t(2,d)}function $(R){d=R,t(2,d)}function T(R){d=R,t(2,d)}function C(R){d=R,t(2,d)}const D=R=>r==null?void 0:r.show(R),M=(R,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(R))},O=()=>t(1,f="");function I(R){se[R?"unshift":"push"](()=>{r=R,t(3,r)})}const L=()=>p(),F=()=>p();return n.$$.update=()=>{if(n.$$.dirty&6&&d!==-1&&f!==-1){const R=new URLSearchParams({filter:f,sort:d}).toString();Li("/settings/admins?"+R),p()}},[p,f,d,r,a,u,s,l,_,g,b,k,$,T,C,D,M,O,I,L,F]}class zE extends ve{constructor(e){super(),be(this,e,HE,VE,_e,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function BE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=E(),l=y("input"),h(e,"for",i=n[8]),h(l,"type","email"),h(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&h(e,"for",i),f&256&&o!==(o=u[8])&&h(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function UE(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Password"),s=E(),l=y("input"),r=E(),a=y("div"),u=y("a"),u.textContent="Forgotten password?",h(e,"for",i=n[8]),h(l,"type","password"),h(l,"id",o=n[8]),l.required=!0,h(u,"href","/request-password-reset"),h(u,"class","link-hint"),h(a,"class","help-block")},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[1]),S(p,r,m),S(p,a,m),v(a,u),f||(d=[J(l,"input",n[5]),Ee(an.call(null,u))],f=!0)},p(p,m){m&256&&i!==(i=p[8])&&h(e,"for",i),m&256&&o!==(o=p[8])&&h(l,"id",o),m&2&&l.value!==p[1]&&ue(l,p[1])},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),p&&w(a),f=!1,De(d)}}}function WE(n){let e,t,i,s,l,o,r,a,u,f,d;return s=new de({props:{class:"form-field required",name:"identity",$$slots:{default:[BE,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[UE,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),t.innerHTML="

    Admin sign in

    ",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),a=y("button"),a.innerHTML=`Login + `,h(t,"class","content txt-center m-b-base"),h(a,"type","submit"),h(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),h(e,"class","block")},m(p,m){S(p,e,m),v(e,t),v(e,i),V(s,e,null),v(e,l),V(o,e,null),v(e,r),v(e,a),u=!0,f||(d=J(e,"submit",ft(n[3])),f=!0)},p(p,m){const _={};m&769&&(_.$$scope={dirty:m,ctx:p}),s.$set(_);const g={};m&770&&(g.$$scope={dirty:m,ctx:p}),o.$set(g),(!u||m&4)&&x(a,"btn-disabled",p[2]),(!u||m&4)&&x(a,"btn-loading",p[2])},i(p){u||(A(s.$$.fragment,p),A(o.$$.fragment,p),u=!0)},o(p){P(s.$$.fragment,p),P(o.$$.fragment,p),u=!1},d(p){p&&w(e),H(s),H(o),f=!1,d()}}}function YE(n){let e,t;return e=new t1({props:{$$slots:{default:[WE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function KE(n,e,t){let i;Ke(n,ya,d=>t(6,i=d));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),me.admins.authWithPassword(l,o).then(()=>{Ea(),Li("/")}).catch(()=>{hl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class JE extends ve{constructor(e){super(),be(this,e,KE,YE,_e,{})}}function ZE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D;i=new de({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[XE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[QE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[xE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[e6,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Sh(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),d=E(),p=y("div"),m=y("div"),_=E(),M&&M.c(),g=E(),b=y("button"),k=y("span"),k.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(m,"class","flex-fill"),h(k,"class","txt"),h(b,"type","submit"),h(b,"class","btn btn-expanded"),b.disabled=$=!n[3]||n[2],x(b,"btn-loading",n[2]),h(p,"class","col-lg-12 flex"),h(e,"class","grid")},m(O,I){S(O,e,I),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),V(a,e,null),v(e,u),V(f,e,null),v(e,d),v(e,p),v(p,m),v(p,_),M&&M.m(p,null),v(p,g),v(p,b),v(b,k),T=!0,C||(D=J(b,"click",n[13]),C=!0)},p(O,I){const L={};I&1572865&&(L.$$scope={dirty:I,ctx:O}),i.$set(L);const F={};I&1572865&&(F.$$scope={dirty:I,ctx:O}),o.$set(F);const R={};I&1572865&&(R.$$scope={dirty:I,ctx:O}),a.$set(R);const N={};I&1572865&&(N.$$scope={dirty:I,ctx:O}),f.$set(N),O[3]?M?M.p(O,I):(M=Sh(O),M.c(),M.m(p,g)):M&&(M.d(1),M=null),(!T||I&12&&$!==($=!O[3]||O[2]))&&(b.disabled=$),(!T||I&4)&&x(b,"btn-loading",O[2])},i(O){T||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),T=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(a.$$.fragment,O),P(f.$$.fragment,O),T=!1},d(O){O&&w(e),H(i),H(o),H(a),H(f),M&&M.d(),C=!1,D()}}}function GE(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function XE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application name"),s=E(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.appName),r||(a=J(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&ue(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function QE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application url"),s=E(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.appUrl),r||(a=J(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&ue(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function xE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Logs max days retention"),s=E(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","number"),h(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].logs.maxDays),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&_t(l.value)!==u[0].logs.maxDays&&ue(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function e6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Hide collection create and edit controls",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[19]),h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[19])},m(d,p){S(d,e,p),e.checked=n[0].meta.hideControls,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[11]),Ee(Ue.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(d,p){p&524288&&t!==(t=d[19])&&h(e,"id",t),p&1&&(e.checked=d[0].meta.hideControls),p&524288&&a!==(a=d[19])&&h(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function Sh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),v(e,t),i||(s=J(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function t6(n){let e,t,i,s,l,o,r,a,u;const f=[GE,ZE],d=[];function p(m,_){return m[1]?0:1}return l=p(n),o=d[l]=f[l](n),{c(){e=y("header"),e.innerHTML=``,t=E(),i=y("div"),s=y("form"),o.c(),h(e,"class","page-header"),h(s,"class","panel"),h(s,"autocomplete","off"),h(i,"class","wrapper")},m(m,_){S(m,e,_),S(m,t,_),S(m,i,_),v(i,s),d[l].m(s,null),r=!0,a||(u=J(s,"submit",ft(n[4])),a=!0)},p(m,_){let g=l;l=p(m),l===g?d[l].p(m,_):(re(),P(d[g],1,1,()=>{d[g]=null}),ae(),o=d[l],o?o.p(m,_):(o=d[l]=f[l](m),o.c()),A(o,1),o.m(s,null))},i(m){r||(A(o),r=!0)},o(m){P(o),r=!1},d(m){m&&w(e),m&&w(t),m&&w(i),d[l].d(),a=!1,u()}}}function n6(n){let e,t,i,s;return e=new qi({}),i=new In({props:{$$slots:{default:[t6]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function i6(n,e,t){let i,s,l,o;Ke(n,Os,M=>t(14,s=M)),Ke(n,wo,M=>t(15,l=M)),Ke(n,Lt,M=>t(16,o=M)),sn(Lt,o="Application settings",o);let r={},a={},u=!1,f=!1,d="";p();async function p(){t(1,u=!0);try{const M=await me.settings.getAll()||{};_(M)}catch(M){me.errorResponseHandler(M)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const M=await me.settings.update(j.filterRedactedProps(a));_(M),Jt("Successfully saved application settings.")}catch(M){me.errorResponseHandler(M)}t(2,f=!1)}}function _(M={}){var O,I;sn(wo,l=(O=M==null?void 0:M.meta)==null?void 0:O.appName,l),sn(Os,s=!!((I=M==null?void 0:M.meta)!=null&&I.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function $(){a.logs.maxDays=_t(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>g(),D=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,d=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=d!=JSON.stringify(a))},[a,u,f,i,m,g,r,d,b,k,$,T,C,D]}class s6 extends ve{constructor(e){super(),be(this,e,i6,n6,_e,{})}}function l6(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o',i=E(),s=y("input"),h(t,"type","button"),h(t,"class","btn btn-transparent btn-circle"),h(e,"class","form-field-addon"),ni(s,a)},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ee(Ue.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){ni(s,a=St(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,De(o)}}}function r6(n){let e;function t(l,o){return l[3]?o6:l6}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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:Q,o:Q,d(l){s.d(l),l&&w(e)}}}function a6(n,e,t){const i=["value","mask"];let s=Xe(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ln(),r==null||r.focus()}const f=()=>u();function d(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function p(){l=this.value,t(0,l)}return n.$$set=m=>{e=Re(Re({},e),Yt(m)),t(5,s=Xe(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,d,p]}class fu extends ve{constructor(e){super(),be(this,e,a6,r6,_e,{value:0,mask:1})}}function u6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;return{c(){e=y("label"),t=U("Subject"),s=E(),l=y("input"),r=E(),a=y("div"),u=U(`Available placeholder parameters: `),f=y("button"),f.textContent=`{APP_NAME} `,d=U(`, `),p=y("button"),p.textContent=`{APP_URL} - `,m=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(a,"class","help-block")},m(b,k){S(b,e,k),v(e,t),S(b,s,k),S(b,l,k),ue(l,n[0].subject),S(b,r,k),S(b,a,k),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),_||(g=[J(l,"input",n[13]),J(f,"click",n[14]),J(p,"click",n[15])],_=!0)},p(b,k){k[1]&1&&i!==(i=b[31])&&h(e,"for",i),k[1]&1&&o!==(o=b[31])&&h(l,"id",o),k[0]&1&&l.value!==b[0].subject&&ue(l,b[0].subject)},d(b){b&&w(e),b&&w(s),b&&w(l),b&&w(r),b&&w(a),_=!1,De(g)}}}function a6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;return{c(){e=y("label"),t=U("Action URL"),s=E(),l=y("input"),r=E(),a=y("div"),u=U(`Available placeholder parameters: + `,m=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(a,"class","help-block")},m(b,k){S(b,e,k),v(e,t),S(b,s,k),S(b,l,k),ue(l,n[0].subject),S(b,r,k),S(b,a,k),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),_||(g=[J(l,"input",n[13]),J(f,"click",n[14]),J(p,"click",n[15])],_=!0)},p(b,k){k[1]&1&&i!==(i=b[31])&&h(e,"for",i),k[1]&1&&o!==(o=b[31])&&h(l,"id",o),k[0]&1&&l.value!==b[0].subject&&ue(l,b[0].subject)},d(b){b&&w(e),b&&w(s),b&&w(l),b&&w(r),b&&w(a),_=!1,De(g)}}}function f6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k;return{c(){e=y("label"),t=U("Action URL"),s=E(),l=y("input"),r=E(),a=y("div"),u=U(`Available placeholder parameters: `),f=y("button"),f.textContent=`{APP_NAME} `,d=U(`, `),p=y("button"),p.textContent=`{APP_URL} `,m=U(`, `),_=y("button"),_.textContent=`{TOKEN} - `,g=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(_,"title","Required parameter"),h(a,"class","help-block")},m($,T){S($,e,T),v(e,t),S($,s,T),S($,l,T),ue(l,n[0].actionUrl),S($,r,T),S($,a,T),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),b||(k=[J(l,"input",n[16]),J(f,"click",n[17]),J(p,"click",n[18]),J(_,"click",n[19])],b=!0)},p($,T){T[1]&1&&i!==(i=$[31])&&h(e,"for",i),T[1]&1&&o!==(o=$[31])&&h(l,"id",o),T[0]&1&&l.value!==$[0].actionUrl&&ue(l,$[0].actionUrl)},d($){$&&w(e),$&&w(s),$&&w(l),$&&w(r),$&&w(a),b=!1,De(k)}}}function u6(n){let e,t,i,s;return{c(){e=y("textarea"),h(e,"id",t=n[31]),h(e,"class","txt-mono"),h(e,"spellcheck","false"),h(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),ue(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&h(e,"id",t),o[0]&1&&ue(e,l[0].body)},i:Q,o:Q,d(l){l&&w(e),i=!1,s()}}}function f6(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function c6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C;const D=[f6,u6],M=[];function O(I,L){return I[4]&&!I[5]?0:1}return l=O(n),o=M[l]=D[l](n),{c(){e=y("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=y("div"),u=U(`Available placeholder parameters: + `,g=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(_,"title","Required parameter"),h(a,"class","help-block")},m($,T){S($,e,T),v(e,t),S($,s,T),S($,l,T),ue(l,n[0].actionUrl),S($,r,T),S($,a,T),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),b||(k=[J(l,"input",n[16]),J(f,"click",n[17]),J(p,"click",n[18]),J(_,"click",n[19])],b=!0)},p($,T){T[1]&1&&i!==(i=$[31])&&h(e,"for",i),T[1]&1&&o!==(o=$[31])&&h(l,"id",o),T[0]&1&&l.value!==$[0].actionUrl&&ue(l,$[0].actionUrl)},d($){$&&w(e),$&&w(s),$&&w(l),$&&w(r),$&&w(a),b=!1,De(k)}}}function c6(n){let e,t,i,s;return{c(){e=y("textarea"),h(e,"id",t=n[31]),h(e,"class","txt-mono"),h(e,"spellcheck","false"),h(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),ue(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&h(e,"id",t),o[0]&1&&ue(e,l[0].body)},i:Q,o:Q,d(l){l&&w(e),i=!1,s()}}}function d6(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Pt(o,r(n)),se.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function p6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C;const D=[d6,c6],M=[];function O(I,L){return I[4]&&!I[5]?0:1}return l=O(n),o=M[l]=D[l](n),{c(){e=y("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=y("div"),u=U(`Available placeholder parameters: `),f=y("button"),f.textContent=`{APP_NAME} `,d=U(`, `),p=y("button"),p.textContent=`{APP_URL} @@ -182,8 +182,8 @@ Updated: ${b[1].updated}`,position:"left"}),k[0]&536870912&&p!==(p=b[29])&&h(d," `),_=y("button"),_.textContent=`{TOKEN} `,g=U(`, `),b=y("button"),b.textContent=`{ACTION_URL} - `,k=U("."),h(e,"for",i=n[31]),h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(b,"type","button"),h(b,"class","label label-sm link-primary txt-mono"),h(b,"title","Required parameter"),h(a,"class","help-block")},m(I,L){S(I,e,L),v(e,t),S(I,s,L),M[l].m(I,L),S(I,r,L),S(I,a,L),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),v(a,b),v(a,k),$=!0,T||(C=[J(f,"click",n[22]),J(p,"click",n[23]),J(_,"click",n[24]),J(b,"click",n[25])],T=!0)},p(I,L){(!$||L[1]&1&&i!==(i=I[31]))&&h(e,"for",i);let F=l;l=O(I),l===F?M[l].p(I,L):(re(),P(M[F],1,1,()=>{M[F]=null}),ae(),o=M[l],o?o.p(I,L):(o=M[l]=D[l](I),o.c()),A(o,1),o.m(r.parentNode,r))},i(I){$||(A(o),$=!0)},o(I){P(o),$=!1},d(I){I&&w(e),I&&w(s),M[l].d(I),I&&w(r),I&&w(a),T=!1,De(C)}}}function d6(n){let e,t,i,s,l,o;return e=new de({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[r6,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[a6,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[c6,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){V(e,r,a),S(r,t,a),V(i,r,a),S(r,s,a),V(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 d={};a[0]&2&&(d.name=r[1]+".body"),a[0]&49|a[1]&3&&(d.$$scope={dirty:a,ctx:r}),l.$set(d)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){H(e,r),r&&w(t),H(i,r),r&&w(s),H(l,r)}}}function Sh(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function p6(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Sh();return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),l=U(n[2]),o=E(),r=y("div"),a=E(),f&&f.c(),u=Se(),h(t,"class","ri-draft-line"),h(s,"class","txt"),h(e,"class","inline-flex"),h(r,"class","flex-fill")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),S(d,o,p),S(d,r,p),S(d,a,p),f&&f.m(d,p),S(d,u,p)},p(d,p){p[0]&4&&le(l,d[2]),d[6]?f?p[0]&64&&A(f,1):(f=Sh(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),P(f,1,1,()=>{f=null}),ae())},d(d){d&&w(e),d&&w(o),d&&w(r),d&&w(a),f&&f.d(d),d&&w(u)}}}function m6(n){let e,t;const i=[n[8]];let s={$$slots:{header:[p6],default:[d6]},$$scope:{ctx:n}};for(let l=0;lt(12,o=X));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,d=$h,p=!1;function m(){f==null||f.expand()}function _(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function b(){d||p||(t(5,p=!0),t(4,d=(await rt(()=>import("./CodeEditor-55647829.js"),["./CodeEditor-55647829.js","./index-6f704b4c.js"],import.meta.url)).default),$h=d,t(5,p=!1))}function k(X){j.copyToClipboard(X),Qg(`Copied ${X} to clipboard`,2e3)}b();function $(){u.subject=this.value,t(0,u)}const T=()=>k("{APP_NAME}"),C=()=>k("{APP_URL}");function D(){u.actionUrl=this.value,t(0,u)}const M=()=>k("{APP_NAME}"),O=()=>k("{APP_URL}"),I=()=>k("{TOKEN}");function L(X){n.$$.not_equal(u.body,X)&&(u.body=X,t(0,u))}function F(){u.body=this.value,t(0,u)}const R=()=>k("{APP_NAME}"),N=()=>k("{APP_URL}"),q=()=>k("{TOKEN}"),Y=()=>k("{ACTION_URL}");function B(X){se[X?"unshift":"push"](()=>{f=X,t(3,f)})}function Z(X){pe.call(this,n,X)}function ee(X){pe.call(this,n,X)}function ie(X){pe.call(this,n,X)}return n.$$set=X=>{e=Re(Re({},e),Yt(X)),t(8,l=Xe(e,s)),"key"in X&&t(1,r=X.key),"title"in X&&t(2,a=X.title),"config"in X&&t(0,u=X.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Ai(r))},[u,r,a,f,d,p,i,k,l,m,_,g,o,$,T,C,D,M,O,I,L,F,R,N,q,Y,B,Z,ee,ie]}class Fr extends ve{constructor(e){super(),be(this,e,h6,m6,_e,{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 Th(n,e,t){const i=n.slice();return i[21]=e[t],i}function Ch(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,d,p,m;return d=$b(e[11][0]),{key:n,first:null,c(){t=y("div"),i=y("input"),l=E(),o=y("label"),a=U(r),f=E(),h(i,"type","radio"),h(i,"name","template"),h(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,i.value=i.__value,h(o,"for",u=e[20]+e[21].value),h(t,"class","form-field-block"),d.p(i),this.first=t},m(_,g){S(_,t,g),v(t,i),i.checked=i.__value===e[2],v(t,l),v(t,o),v(o,a),v(t,f),p||(m=J(i,"change",e[10]),p=!0)},p(_,g){e=_,g&1048576&&s!==(s=e[20]+e[21].value)&&h(i,"id",s),g&4&&(i.checked=i.__value===e[2]),g&1048576&&u!==(u=e[20]+e[21].value)&&h(o,"for",u)},d(_){_&&w(t),d.r(),p=!1,m()}}}function _6(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new de({props:{class:"form-field required m-0",name:"email",$$slots:{default:[g6,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),z(t.$$.fragment),i=E(),z(s.$$.fragment),h(e,"id",n[6]),h(e,"autocomplete","off")},m(a,u){S(a,e,u),V(t,e,null),v(e,i),V(s,e,null),l=!0,o||(r=J(e,"submit",ft(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const d={};u&17825794&&(d.$$scope={dirty:u,ctx:a}),s.$set(d)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){P(t.$$.fragment,a),P(s.$$.fragment,a),l=!1},d(a){a&&w(e),H(t),H(s),o=!1,r()}}}function v6(n){let e;return{c(){e=y("h4"),e.textContent="Send test email",h(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function y6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("i"),o=E(),r=y("span"),r.textContent="Send",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[4],h(l,"class","ri-mail-send-line"),h(r,"class","txt"),h(s,"type","submit"),h(s,"form",n[6]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],x(s,"btn-loading",n[4])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&16&&(e.disabled=d[4]),p&48&&a!==(a=!d[5]||d[4])&&(s.disabled=a),p&16&&x(s,"btn-loading",d[4])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function k6(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[y6],header:[v6],default:[b6]},$$scope:{ctx:n}};return e=new pn({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){z(e.$$.fragment)},m(s,l){V(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[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[15](null),H(e,s)}}}const Rr="last_email_test",Mh="email_test_request";function w6(n,e,t){let i;const s=kt(),l="email_test_"+j.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(Rr),u=o[0].value,f=!1,d=null;function p(O="",I=""){t(1,a=O||localStorage.getItem(Rr)),t(2,u=I||o[0].value),dn({}),r==null||r.show()}function m(){return clearTimeout(d),r==null?void 0:r.hide()}async function _(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Rr,a),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest(Mh),hl("Test email send timeout.")},3e4);try{await me.settings.testEmail(a,u,{$cancelKey:Mh}),Jt("Successfully sent test email."),s("submit"),t(4,f=!1),await ln(),m()}catch(O){t(4,f=!1),me.errorResponseHandler(O)}clearTimeout(d)}}const g=[[]];function b(){u=this.__value,t(2,u)}function k(){a=this.value,t(1,a)}const $=()=>_(),T=()=>!f;function C(O){se[O?"unshift":"push"](()=>{r=O,t(3,r)})}function D(O){pe.call(this,n,O)}function M(O){pe.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,l,o,_,p,b,g,k,$,T,C,D,M]}class S6 extends ve{constructor(e){super(),be(this,e,w6,k6,_e,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function $6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L,F;i=new de({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[C6,({uniqueId:G})=>({31:G}),({uniqueId:G})=>[0,G?1:0]]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[M6,({uniqueId:G})=>({31:G}),({uniqueId:G})=>[0,G?1:0]]},$$scope:{ctx:n}}});function R(G){n[14](G)}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 Fr({props:N}),se.push(()=>he(u,"config",R));function q(G){n[15](G)}let Y={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(Y.config=n[0].meta.resetPasswordTemplate),p=new Fr({props:Y}),se.push(()=>he(p,"config",q));function B(G){n[16](G)}let Z={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(Z.config=n[0].meta.confirmEmailChangeTemplate),g=new Fr({props:Z}),se.push(()=>he(g,"config",B)),C=new de({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[O6,({uniqueId:G})=>({31:G}),({uniqueId:G})=>[0,G?1:0]]},$$scope:{ctx:n}}});let ee=n[0].smtp.enabled&&Oh(n);function ie(G,ce){return G[4]?F6:N6}let X=ie(n),fe=X(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),d=E(),z(p.$$.fragment),_=E(),z(g.$$.fragment),k=E(),$=y("hr"),T=E(),z(C.$$.fragment),D=E(),ee&&ee.c(),M=E(),O=y("div"),I=y("div"),L=E(),fe.c(),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid m-b-base"),h(a,"class","accordions"),h(I,"class","flex-fill"),h(O,"class","flex")},m(G,ce){S(G,e,ce),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),S(G,r,ce),S(G,a,ce),V(u,a,null),v(a,d),V(p,a,null),v(a,_),V(g,a,null),S(G,k,ce),S(G,$,ce),S(G,T,ce),V(C,G,ce),S(G,D,ce),ee&&ee.m(G,ce),S(G,M,ce),S(G,O,ce),v(O,I),v(O,L),fe.m(O,null),F=!0},p(G,ce){const ge={};ce[0]&1|ce[1]&3&&(ge.$$scope={dirty:ce,ctx:G}),i.$set(ge);const Me={};ce[0]&1|ce[1]&3&&(Me.$$scope={dirty:ce,ctx:G}),o.$set(Me);const qe={};!f&&ce[0]&1&&(f=!0,qe.config=G[0].meta.verificationTemplate,ke(()=>f=!1)),u.$set(qe);const He={};!m&&ce[0]&1&&(m=!0,He.config=G[0].meta.resetPasswordTemplate,ke(()=>m=!1)),p.$set(He);const we={};!b&&ce[0]&1&&(b=!0,we.config=G[0].meta.confirmEmailChangeTemplate,ke(()=>b=!1)),g.$set(we);const Ce={};ce[0]&1|ce[1]&3&&(Ce.$$scope={dirty:ce,ctx:G}),C.$set(Ce),G[0].smtp.enabled?ee?(ee.p(G,ce),ce[0]&1&&A(ee,1)):(ee=Oh(G),ee.c(),A(ee,1),ee.m(M.parentNode,M)):ee&&(re(),P(ee,1,1,()=>{ee=null}),ae()),X===(X=ie(G))&&fe?fe.p(G,ce):(fe.d(1),fe=X(G),fe&&(fe.c(),fe.m(O,null)))},i(G){F||(A(i.$$.fragment,G),A(o.$$.fragment,G),A(u.$$.fragment,G),A(p.$$.fragment,G),A(g.$$.fragment,G),A(C.$$.fragment,G),A(ee),F=!0)},o(G){P(i.$$.fragment,G),P(o.$$.fragment,G),P(u.$$.fragment,G),P(p.$$.fragment,G),P(g.$$.fragment,G),P(C.$$.fragment,G),P(ee),F=!1},d(G){G&&w(e),H(i),H(o),G&&w(r),G&&w(a),H(u),H(p),H(g),G&&w(k),G&&w($),G&&w(T),H(C,G),G&&w(D),ee&&ee.d(G),G&&w(M),G&&w(O),fe.d()}}}function T6(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function C6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Sender name"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.senderName),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&ue(l,u[0].meta.senderName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function M6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Sender address"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","email"),h(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.senderAddress),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&ue(l,u[0].meta.senderAddress)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function O6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.innerHTML="Use SMTP mail server (recommended)",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[31]),e.required=!0,h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[31])},m(d,p){S(d,e,p),e.checked=n[0].smtp.enabled,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[17]),Ee(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(d,p){p[1]&1&&t!==(t=d[31])&&h(e,"id",t),p[0]&1&&(e.checked=d[0].smtp.enabled),p[1]&1&&a!==(a=d[31])&&h(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function Oh(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M;return i=new de({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[D6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[E6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[A6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),p=new de({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[I6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field",name:"smtp.username",$$slots:{default:[P6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),$=new de({props:{class:"form-field",name:"smtp.password",$$slots:{default:[L6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),f=E(),d=y("div"),z(p.$$.fragment),m=E(),_=y("div"),z(g.$$.fragment),b=E(),k=y("div"),z($.$$.fragment),T=E(),C=y("div"),h(t,"class","col-lg-4"),h(l,"class","col-lg-2"),h(a,"class","col-lg-3"),h(d,"class","col-lg-3"),h(_,"class","col-lg-6"),h(k,"class","col-lg-6"),h(C,"class","col-lg-12"),h(e,"class","grid")},m(O,I){S(O,e,I),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),V(u,a,null),v(e,f),v(e,d),V(p,d,null),v(e,m),v(e,_),V(g,_,null),v(e,b),v(e,k),V($,k,null),v(e,T),v(e,C),M=!0},p(O,I){const L={};I[0]&1|I[1]&3&&(L.$$scope={dirty:I,ctx:O}),i.$set(L);const F={};I[0]&1|I[1]&3&&(F.$$scope={dirty:I,ctx:O}),o.$set(F);const R={};I[0]&1|I[1]&3&&(R.$$scope={dirty:I,ctx:O}),u.$set(R);const N={};I[0]&1|I[1]&3&&(N.$$scope={dirty:I,ctx:O}),p.$set(N);const q={};I[0]&1|I[1]&3&&(q.$$scope={dirty:I,ctx:O}),g.$set(q);const Y={};I[0]&1|I[1]&3&&(Y.$$scope={dirty:I,ctx:O}),$.$set(Y)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(p.$$.fragment,O),A(g.$$.fragment,O),A($.$$.fragment,O),O&&nt(()=>{M&&(D||(D=Ve(e,wt,{duration:150},!0)),D.run(1))}),M=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(u.$$.fragment,O),P(p.$$.fragment,O),P(g.$$.fragment,O),P($.$$.fragment,O),O&&(D||(D=Ve(e,wt,{duration:150},!1)),D.run(0)),M=!1},d(O){O&&w(e),H(i),H(o),H(u),H(p),H(g),H($),O&&D&&D.end()}}}function D6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("SMTP server host"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].smtp.host),r||(a=J(l,"input",n[18]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&ue(l,u[0].smtp.host)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function E6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Port"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","number"),h(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].smtp.port),r||(a=J(l,"input",n[19]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&_t(l.value)!==u[0].smtp.port&&ue(l,u[0].smtp.port)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function A6(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 Ri({props:u}),se.push(()=>he(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("TLS encryption"),s=E(),z(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&h(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.keyOfSelected=f[0].smtp.tls,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function I6(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 Ri({props:u}),se.push(()=>he(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("AUTH method"),s=E(),z(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&h(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.keyOfSelected=f[0].smtp.authMethod,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function P6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Username"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].smtp.username),r||(a=J(l,"input",n[22]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&ue(l,u[0].smtp.username)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function L6(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 fu({props:u}),se.push(()=>he(l,"value",a)),{c(){e=y("label"),t=U("Password"),s=E(),z(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&h(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.value=f[0].smtp.password,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function N6(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` - Send test email`,h(e,"type","button"),h(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[26]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function F6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),l.textContent="Save changes",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],h(l,"class","txt"),h(s,"type","submit"),h(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),v(e,t),S(u,i,f),S(u,s,f),v(s,l),r||(a=[J(e,"click",n[24]),J(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,De(a)}}}function R6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[T6,$6],$=[];function T(C,D){return C[2]?0:1}return p=T(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[5]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,D){S(C,e,D),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,D),S(C,a,D),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",ft(n[27])),g=!0)},p(C,D){(!_||D[0]&32)&&le(o,C[5]);let M=p;p=T(C),p===M?$[p].p(C,D):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(C,D):(m=$[p]=k[p](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){P(m),_=!1},d(C){C&&w(e),C&&w(r),C&&w(a),$[p].d(),g=!1,b()}}}function q6(n){let e,t,i,s,l,o;e=new qi({}),i=new In({props:{$$slots:{default:[R6]},$$scope:{ctx:n}}});let r={};return l=new S6({props:r}),n[28](l),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(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 d={};l.$set(d)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[28](null),H(l,a)}}}function j6(n,e,t){let i,s,l;Ke(n,Lt,ie=>t(5,l=ie));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];sn(Lt,l="Mail settings",l);let a,u={},f={},d=!1,p=!1;m();async function m(){t(2,d=!0);try{const ie=await me.settings.getAll()||{};g(ie)}catch(ie){me.errorResponseHandler(ie)}t(2,d=!1)}async function _(){if(!(p||!s)){t(3,p=!0);try{const ie=await me.settings.update(j.filterRedactedProps(f));g(ie),dn({}),Jt("Successfully saved mail settings.")}catch(ie){me.errorResponseHandler(ie)}t(3,p=!1)}}function g(ie={}){t(0,f={meta:(ie==null?void 0:ie.meta)||{},smtp:(ie==null?void 0:ie.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function b(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function $(){f.meta.senderAddress=this.value,t(0,f)}function T(ie){n.$$.not_equal(f.meta.verificationTemplate,ie)&&(f.meta.verificationTemplate=ie,t(0,f))}function C(ie){n.$$.not_equal(f.meta.resetPasswordTemplate,ie)&&(f.meta.resetPasswordTemplate=ie,t(0,f))}function D(ie){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ie)&&(f.meta.confirmEmailChangeTemplate=ie,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function I(){f.smtp.port=_t(this.value),t(0,f)}function L(ie){n.$$.not_equal(f.smtp.tls,ie)&&(f.smtp.tls=ie,t(0,f))}function F(ie){n.$$.not_equal(f.smtp.authMethod,ie)&&(f.smtp.authMethod=ie,t(0,f))}function R(){f.smtp.username=this.value,t(0,f)}function N(ie){n.$$.not_equal(f.smtp.password,ie)&&(f.smtp.password=ie,t(0,f))}const q=()=>b(),Y=()=>_(),B=()=>a==null?void 0:a.show(),Z=()=>_();function ee(ie){se[ie?"unshift":"push"](()=>{a=ie,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,d,p,s,l,o,r,_,b,u,i,k,$,T,C,D,M,O,I,L,F,R,N,q,Y,B,Z,ee]}class V6 extends ve{constructor(e){super(),be(this,e,j6,q6,_e,{},null,[-1,-1])}}function H6(n){var C,D;let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[B6,({uniqueId:M})=>({25:M}),({uniqueId:M})=>M?33554432:0]},$$scope:{ctx:n}}});let b=((C=n[0].s3)==null?void 0:C.enabled)!=n[1].s3.enabled&&Dh(n),k=n[1].s3.enabled&&Eh(n),$=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&Ah(n),T=n[6]&&Ih(n);return{c(){z(e.$$.fragment),t=E(),b&&b.c(),i=E(),k&&k.c(),s=E(),l=y("div"),o=y("div"),r=E(),$&&$.c(),a=E(),T&&T.c(),u=E(),f=y("button"),d=y("span"),d.textContent="Save changes",h(o,"class","flex-fill"),h(d,"class","txt"),h(f,"type","submit"),h(f,"class","btn btn-expanded"),f.disabled=p=!n[6]||n[3],x(f,"btn-loading",n[3]),h(l,"class","flex")},m(M,O){V(e,M,O),S(M,t,O),b&&b.m(M,O),S(M,i,O),k&&k.m(M,O),S(M,s,O),S(M,l,O),v(l,o),v(l,r),$&&$.m(l,null),v(l,a),T&&T.m(l,null),v(l,u),v(l,f),v(f,d),m=!0,_||(g=J(f,"click",n[19]),_=!0)},p(M,O){var L,F;const I={};O&100663298&&(I.$$scope={dirty:O,ctx:M}),e.$set(I),((L=M[0].s3)==null?void 0:L.enabled)!=M[1].s3.enabled?b?(b.p(M,O),O&3&&A(b,1)):(b=Dh(M),b.c(),A(b,1),b.m(i.parentNode,i)):b&&(re(),P(b,1,1,()=>{b=null}),ae()),M[1].s3.enabled?k?(k.p(M,O),O&2&&A(k,1)):(k=Eh(M),k.c(),A(k,1),k.m(s.parentNode,s)):k&&(re(),P(k,1,1,()=>{k=null}),ae()),(F=M[1].s3)!=null&&F.enabled&&!M[6]&&!M[3]?$?$.p(M,O):($=Ah(M),$.c(),$.m(l,a)):$&&($.d(1),$=null),M[6]?T?T.p(M,O):(T=Ih(M),T.c(),T.m(l,u)):T&&(T.d(1),T=null),(!m||O&72&&p!==(p=!M[6]||M[3]))&&(f.disabled=p),(!m||O&8)&&x(f,"btn-loading",M[3])},i(M){m||(A(e.$$.fragment,M),A(b),A(k),m=!0)},o(M){P(e.$$.fragment,M),P(b),P(k),m=!1},d(M){H(e,M),M&&w(t),b&&b.d(M),M&&w(i),k&&k.d(M),M&&w(s),M&&w(l),$&&$.d(),T&&T.d(),_=!1,g()}}}function z6(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function B6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Use S3 storage"),h(e,"type","checkbox"),h(e,"id",t=n[25]),e.required=!0,h(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),v(s,l),r||(a=J(e,"change",n[11]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&h(e,"id",t),f&2&&(e.checked=u[1].s3.enabled),f&33554432&&o!==(o=u[25])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Dh(n){var L;let e,t,i,s,l,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",u,f,d,p=n[1].s3.enabled?"S3 storage":"local file system",m,_,g,b,k,$,T,C,D,M,O,I;return{c(){e=y("div"),t=y("div"),i=y("div"),i.innerHTML='',s=E(),l=y("div"),o=U(`If you have existing uploaded files, you'll have to migrate them manually from + `,k=U("."),h(e,"for",i=n[31]),h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(b,"type","button"),h(b,"class","label label-sm link-primary txt-mono"),h(b,"title","Required parameter"),h(a,"class","help-block")},m(I,L){S(I,e,L),v(e,t),S(I,s,L),M[l].m(I,L),S(I,r,L),S(I,a,L),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,g),v(a,b),v(a,k),$=!0,T||(C=[J(f,"click",n[22]),J(p,"click",n[23]),J(_,"click",n[24]),J(b,"click",n[25])],T=!0)},p(I,L){(!$||L[1]&1&&i!==(i=I[31]))&&h(e,"for",i);let F=l;l=O(I),l===F?M[l].p(I,L):(re(),P(M[F],1,1,()=>{M[F]=null}),ae(),o=M[l],o?o.p(I,L):(o=M[l]=D[l](I),o.c()),A(o,1),o.m(r.parentNode,r))},i(I){$||(A(o),$=!0)},o(I){P(o),$=!1},d(I){I&&w(e),I&&w(s),M[l].d(I),I&&w(r),I&&w(a),T=!1,De(C)}}}function m6(n){let e,t,i,s,l,o;return e=new de({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[u6,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[f6,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[p6,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){V(e,r,a),S(r,t,a),V(i,r,a),S(r,s,a),V(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 d={};a[0]&2&&(d.name=r[1]+".body"),a[0]&49|a[1]&3&&(d.$$scope={dirty:a,ctx:r}),l.$set(d)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){H(e,r),r&&w(t),H(i,r),r&&w(s),H(l,r)}}}function $h(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&nt(()=>{i&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Bt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function h6(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&$h();return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),l=U(n[2]),o=E(),r=y("div"),a=E(),f&&f.c(),u=Se(),h(t,"class","ri-draft-line"),h(s,"class","txt"),h(e,"class","inline-flex"),h(r,"class","flex-fill")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),S(d,o,p),S(d,r,p),S(d,a,p),f&&f.m(d,p),S(d,u,p)},p(d,p){p[0]&4&&le(l,d[2]),d[6]?f?p[0]&64&&A(f,1):(f=$h(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),P(f,1,1,()=>{f=null}),ae())},d(d){d&&w(e),d&&w(o),d&&w(r),d&&w(a),f&&f.d(d),d&&w(u)}}}function _6(n){let e,t;const i=[n[8]];let s={$$slots:{header:[h6],default:[m6]},$$scope:{ctx:n}};for(let l=0;lt(12,o=X));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,d=Th,p=!1;function m(){f==null||f.expand()}function _(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function b(){d||p||(t(5,p=!0),t(4,d=(await rt(()=>import("./CodeEditor-c5150b8e.js"),["./CodeEditor-c5150b8e.js","./index-c4d2d831.js"],import.meta.url)).default),Th=d,t(5,p=!1))}function k(X){j.copyToClipboard(X),xg(`Copied ${X} to clipboard`,2e3)}b();function $(){u.subject=this.value,t(0,u)}const T=()=>k("{APP_NAME}"),C=()=>k("{APP_URL}");function D(){u.actionUrl=this.value,t(0,u)}const M=()=>k("{APP_NAME}"),O=()=>k("{APP_URL}"),I=()=>k("{TOKEN}");function L(X){n.$$.not_equal(u.body,X)&&(u.body=X,t(0,u))}function F(){u.body=this.value,t(0,u)}const R=()=>k("{APP_NAME}"),N=()=>k("{APP_URL}"),q=()=>k("{TOKEN}"),Y=()=>k("{ACTION_URL}");function B(X){se[X?"unshift":"push"](()=>{f=X,t(3,f)})}function Z(X){pe.call(this,n,X)}function ee(X){pe.call(this,n,X)}function ie(X){pe.call(this,n,X)}return n.$$set=X=>{e=Re(Re({},e),Yt(X)),t(8,l=Xe(e,s)),"key"in X&&t(1,r=X.key),"title"in X&&t(2,a=X.title),"config"in X&&t(0,u=X.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Ai(r))},[u,r,a,f,d,p,i,k,l,m,_,g,o,$,T,C,D,M,O,I,L,F,R,N,q,Y,B,Z,ee,ie]}class Fr extends ve{constructor(e){super(),be(this,e,g6,_6,_e,{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 Ch(n,e,t){const i=n.slice();return i[21]=e[t],i}function Mh(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,d,p,m;return d=Tb(e[11][0]),{key:n,first:null,c(){t=y("div"),i=y("input"),l=E(),o=y("label"),a=U(r),f=E(),h(i,"type","radio"),h(i,"name","template"),h(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,i.value=i.__value,h(o,"for",u=e[20]+e[21].value),h(t,"class","form-field-block"),d.p(i),this.first=t},m(_,g){S(_,t,g),v(t,i),i.checked=i.__value===e[2],v(t,l),v(t,o),v(o,a),v(t,f),p||(m=J(i,"change",e[10]),p=!0)},p(_,g){e=_,g&1048576&&s!==(s=e[20]+e[21].value)&&h(i,"id",s),g&4&&(i.checked=i.__value===e[2]),g&1048576&&u!==(u=e[20]+e[21].value)&&h(o,"for",u)},d(_){_&&w(t),d.r(),p=!1,m()}}}function b6(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new de({props:{class:"form-field required m-0",name:"email",$$slots:{default:[v6,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),z(t.$$.fragment),i=E(),z(s.$$.fragment),h(e,"id",n[6]),h(e,"autocomplete","off")},m(a,u){S(a,e,u),V(t,e,null),v(e,i),V(s,e,null),l=!0,o||(r=J(e,"submit",ft(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const d={};u&17825794&&(d.$$scope={dirty:u,ctx:a}),s.$set(d)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){P(t.$$.fragment,a),P(s.$$.fragment,a),l=!1},d(a){a&&w(e),H(t),H(s),o=!1,r()}}}function k6(n){let e;return{c(){e=y("h4"),e.textContent="Send test email",h(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function w6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("i"),o=E(),r=y("span"),r.textContent="Send",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[4],h(l,"class","ri-mail-send-line"),h(r,"class","txt"),h(s,"type","submit"),h(s,"form",n[6]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],x(s,"btn-loading",n[4])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&16&&(e.disabled=d[4]),p&48&&a!==(a=!d[5]||d[4])&&(s.disabled=a),p&16&&x(s,"btn-loading",d[4])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function S6(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[w6],header:[k6],default:[y6]},$$scope:{ctx:n}};return e=new pn({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){z(e.$$.fragment)},m(s,l){V(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[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[15](null),H(e,s)}}}const Rr="last_email_test",Oh="email_test_request";function $6(n,e,t){let i;const s=kt(),l="email_test_"+j.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(Rr),u=o[0].value,f=!1,d=null;function p(O="",I=""){t(1,a=O||localStorage.getItem(Rr)),t(2,u=I||o[0].value),dn({}),r==null||r.show()}function m(){return clearTimeout(d),r==null?void 0:r.hide()}async function _(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Rr,a),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest(Oh),hl("Test email send timeout.")},3e4);try{await me.settings.testEmail(a,u,{$cancelKey:Oh}),Jt("Successfully sent test email."),s("submit"),t(4,f=!1),await ln(),m()}catch(O){t(4,f=!1),me.errorResponseHandler(O)}clearTimeout(d)}}const g=[[]];function b(){u=this.__value,t(2,u)}function k(){a=this.value,t(1,a)}const $=()=>_(),T=()=>!f;function C(O){se[O?"unshift":"push"](()=>{r=O,t(3,r)})}function D(O){pe.call(this,n,O)}function M(O){pe.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,l,o,_,p,b,g,k,$,T,C,D,M]}class T6 extends ve{constructor(e){super(),be(this,e,$6,S6,_e,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function C6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O,I,L,F;i=new de({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[O6,({uniqueId:G})=>({31:G}),({uniqueId:G})=>[0,G?1:0]]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[D6,({uniqueId:G})=>({31:G}),({uniqueId:G})=>[0,G?1:0]]},$$scope:{ctx:n}}});function R(G){n[14](G)}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 Fr({props:N}),se.push(()=>he(u,"config",R));function q(G){n[15](G)}let Y={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(Y.config=n[0].meta.resetPasswordTemplate),p=new Fr({props:Y}),se.push(()=>he(p,"config",q));function B(G){n[16](G)}let Z={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(Z.config=n[0].meta.confirmEmailChangeTemplate),g=new Fr({props:Z}),se.push(()=>he(g,"config",B)),C=new de({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[E6,({uniqueId:G})=>({31:G}),({uniqueId:G})=>[0,G?1:0]]},$$scope:{ctx:n}}});let ee=n[0].smtp.enabled&&Dh(n);function ie(G,ce){return G[4]?q6:R6}let X=ie(n),fe=X(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),d=E(),z(p.$$.fragment),_=E(),z(g.$$.fragment),k=E(),$=y("hr"),T=E(),z(C.$$.fragment),D=E(),ee&&ee.c(),M=E(),O=y("div"),I=y("div"),L=E(),fe.c(),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid m-b-base"),h(a,"class","accordions"),h(I,"class","flex-fill"),h(O,"class","flex")},m(G,ce){S(G,e,ce),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),S(G,r,ce),S(G,a,ce),V(u,a,null),v(a,d),V(p,a,null),v(a,_),V(g,a,null),S(G,k,ce),S(G,$,ce),S(G,T,ce),V(C,G,ce),S(G,D,ce),ee&&ee.m(G,ce),S(G,M,ce),S(G,O,ce),v(O,I),v(O,L),fe.m(O,null),F=!0},p(G,ce){const ge={};ce[0]&1|ce[1]&3&&(ge.$$scope={dirty:ce,ctx:G}),i.$set(ge);const Me={};ce[0]&1|ce[1]&3&&(Me.$$scope={dirty:ce,ctx:G}),o.$set(Me);const qe={};!f&&ce[0]&1&&(f=!0,qe.config=G[0].meta.verificationTemplate,ke(()=>f=!1)),u.$set(qe);const He={};!m&&ce[0]&1&&(m=!0,He.config=G[0].meta.resetPasswordTemplate,ke(()=>m=!1)),p.$set(He);const we={};!b&&ce[0]&1&&(b=!0,we.config=G[0].meta.confirmEmailChangeTemplate,ke(()=>b=!1)),g.$set(we);const Ce={};ce[0]&1|ce[1]&3&&(Ce.$$scope={dirty:ce,ctx:G}),C.$set(Ce),G[0].smtp.enabled?ee?(ee.p(G,ce),ce[0]&1&&A(ee,1)):(ee=Dh(G),ee.c(),A(ee,1),ee.m(M.parentNode,M)):ee&&(re(),P(ee,1,1,()=>{ee=null}),ae()),X===(X=ie(G))&&fe?fe.p(G,ce):(fe.d(1),fe=X(G),fe&&(fe.c(),fe.m(O,null)))},i(G){F||(A(i.$$.fragment,G),A(o.$$.fragment,G),A(u.$$.fragment,G),A(p.$$.fragment,G),A(g.$$.fragment,G),A(C.$$.fragment,G),A(ee),F=!0)},o(G){P(i.$$.fragment,G),P(o.$$.fragment,G),P(u.$$.fragment,G),P(p.$$.fragment,G),P(g.$$.fragment,G),P(C.$$.fragment,G),P(ee),F=!1},d(G){G&&w(e),H(i),H(o),G&&w(r),G&&w(a),H(u),H(p),H(g),G&&w(k),G&&w($),G&&w(T),H(C,G),G&&w(D),ee&&ee.d(G),G&&w(M),G&&w(O),fe.d()}}}function M6(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function O6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Sender name"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.senderName),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&ue(l,u[0].meta.senderName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function D6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Sender address"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","email"),h(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.senderAddress),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&ue(l,u[0].meta.senderAddress)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function E6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.innerHTML="Use SMTP mail server (recommended)",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[31]),e.required=!0,h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[31])},m(d,p){S(d,e,p),e.checked=n[0].smtp.enabled,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[17]),Ee(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(d,p){p[1]&1&&t!==(t=d[31])&&h(e,"id",t),p[0]&1&&(e.checked=d[0].smtp.enabled),p[1]&1&&a!==(a=d[31])&&h(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function Dh(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M;return i=new de({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[A6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[I6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[P6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),p=new de({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[L6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field",name:"smtp.username",$$slots:{default:[N6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),$=new de({props:{class:"form-field",name:"smtp.password",$$slots:{default:[F6,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),f=E(),d=y("div"),z(p.$$.fragment),m=E(),_=y("div"),z(g.$$.fragment),b=E(),k=y("div"),z($.$$.fragment),T=E(),C=y("div"),h(t,"class","col-lg-4"),h(l,"class","col-lg-2"),h(a,"class","col-lg-3"),h(d,"class","col-lg-3"),h(_,"class","col-lg-6"),h(k,"class","col-lg-6"),h(C,"class","col-lg-12"),h(e,"class","grid")},m(O,I){S(O,e,I),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),V(u,a,null),v(e,f),v(e,d),V(p,d,null),v(e,m),v(e,_),V(g,_,null),v(e,b),v(e,k),V($,k,null),v(e,T),v(e,C),M=!0},p(O,I){const L={};I[0]&1|I[1]&3&&(L.$$scope={dirty:I,ctx:O}),i.$set(L);const F={};I[0]&1|I[1]&3&&(F.$$scope={dirty:I,ctx:O}),o.$set(F);const R={};I[0]&1|I[1]&3&&(R.$$scope={dirty:I,ctx:O}),u.$set(R);const N={};I[0]&1|I[1]&3&&(N.$$scope={dirty:I,ctx:O}),p.$set(N);const q={};I[0]&1|I[1]&3&&(q.$$scope={dirty:I,ctx:O}),g.$set(q);const Y={};I[0]&1|I[1]&3&&(Y.$$scope={dirty:I,ctx:O}),$.$set(Y)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(p.$$.fragment,O),A(g.$$.fragment,O),A($.$$.fragment,O),O&&nt(()=>{M&&(D||(D=Ve(e,wt,{duration:150},!0)),D.run(1))}),M=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(u.$$.fragment,O),P(p.$$.fragment,O),P(g.$$.fragment,O),P($.$$.fragment,O),O&&(D||(D=Ve(e,wt,{duration:150},!1)),D.run(0)),M=!1},d(O){O&&w(e),H(i),H(o),H(u),H(p),H(g),H($),O&&D&&D.end()}}}function A6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("SMTP server host"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].smtp.host),r||(a=J(l,"input",n[18]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&ue(l,u[0].smtp.host)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function I6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Port"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","number"),h(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].smtp.port),r||(a=J(l,"input",n[19]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&_t(l.value)!==u[0].smtp.port&&ue(l,u[0].smtp.port)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function P6(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 Ri({props:u}),se.push(()=>he(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("TLS encryption"),s=E(),z(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&h(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.keyOfSelected=f[0].smtp.tls,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function L6(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 Ri({props:u}),se.push(()=>he(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("AUTH method"),s=E(),z(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&h(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.keyOfSelected=f[0].smtp.authMethod,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function N6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Username"),s=E(),l=y("input"),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].smtp.username),r||(a=J(l,"input",n[22]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&h(e,"for",i),f[1]&1&&o!==(o=u[31])&&h(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&ue(l,u[0].smtp.username)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function F6(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 fu({props:u}),se.push(()=>he(l,"value",a)),{c(){e=y("label"),t=U("Password"),s=E(),z(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&h(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.value=f[0].smtp.password,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function R6(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=` + Send test email`,h(e,"type","button"),h(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[26]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function q6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),l.textContent="Save changes",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],h(l,"class","txt"),h(s,"type","submit"),h(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),v(e,t),S(u,i,f),S(u,s,f),v(s,l),r||(a=[J(e,"click",n[24]),J(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,De(a)}}}function j6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[M6,C6],$=[];function T(C,D){return C[2]?0:1}return p=T(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[5]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,D){S(C,e,D),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,D),S(C,a,D),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",ft(n[27])),g=!0)},p(C,D){(!_||D[0]&32)&&le(o,C[5]);let M=p;p=T(C),p===M?$[p].p(C,D):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(C,D):(m=$[p]=k[p](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){P(m),_=!1},d(C){C&&w(e),C&&w(r),C&&w(a),$[p].d(),g=!1,b()}}}function V6(n){let e,t,i,s,l,o;e=new qi({}),i=new In({props:{$$slots:{default:[j6]},$$scope:{ctx:n}}});let r={};return l=new T6({props:r}),n[28](l),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(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 d={};l.$set(d)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[28](null),H(l,a)}}}function H6(n,e,t){let i,s,l;Ke(n,Lt,ie=>t(5,l=ie));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];sn(Lt,l="Mail settings",l);let a,u={},f={},d=!1,p=!1;m();async function m(){t(2,d=!0);try{const ie=await me.settings.getAll()||{};g(ie)}catch(ie){me.errorResponseHandler(ie)}t(2,d=!1)}async function _(){if(!(p||!s)){t(3,p=!0);try{const ie=await me.settings.update(j.filterRedactedProps(f));g(ie),dn({}),Jt("Successfully saved mail settings.")}catch(ie){me.errorResponseHandler(ie)}t(3,p=!1)}}function g(ie={}){t(0,f={meta:(ie==null?void 0:ie.meta)||{},smtp:(ie==null?void 0:ie.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function b(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function $(){f.meta.senderAddress=this.value,t(0,f)}function T(ie){n.$$.not_equal(f.meta.verificationTemplate,ie)&&(f.meta.verificationTemplate=ie,t(0,f))}function C(ie){n.$$.not_equal(f.meta.resetPasswordTemplate,ie)&&(f.meta.resetPasswordTemplate=ie,t(0,f))}function D(ie){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ie)&&(f.meta.confirmEmailChangeTemplate=ie,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function I(){f.smtp.port=_t(this.value),t(0,f)}function L(ie){n.$$.not_equal(f.smtp.tls,ie)&&(f.smtp.tls=ie,t(0,f))}function F(ie){n.$$.not_equal(f.smtp.authMethod,ie)&&(f.smtp.authMethod=ie,t(0,f))}function R(){f.smtp.username=this.value,t(0,f)}function N(ie){n.$$.not_equal(f.smtp.password,ie)&&(f.smtp.password=ie,t(0,f))}const q=()=>b(),Y=()=>_(),B=()=>a==null?void 0:a.show(),Z=()=>_();function ee(ie){se[ie?"unshift":"push"](()=>{a=ie,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,d,p,s,l,o,r,_,b,u,i,k,$,T,C,D,M,O,I,L,F,R,N,q,Y,B,Z,ee]}class z6 extends ve{constructor(e){super(),be(this,e,H6,V6,_e,{},null,[-1,-1])}}function B6(n){var C,D;let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g;e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[W6,({uniqueId:M})=>({25:M}),({uniqueId:M})=>M?33554432:0]},$$scope:{ctx:n}}});let b=((C=n[0].s3)==null?void 0:C.enabled)!=n[1].s3.enabled&&Eh(n),k=n[1].s3.enabled&&Ah(n),$=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&Ih(n),T=n[6]&&Ph(n);return{c(){z(e.$$.fragment),t=E(),b&&b.c(),i=E(),k&&k.c(),s=E(),l=y("div"),o=y("div"),r=E(),$&&$.c(),a=E(),T&&T.c(),u=E(),f=y("button"),d=y("span"),d.textContent="Save changes",h(o,"class","flex-fill"),h(d,"class","txt"),h(f,"type","submit"),h(f,"class","btn btn-expanded"),f.disabled=p=!n[6]||n[3],x(f,"btn-loading",n[3]),h(l,"class","flex")},m(M,O){V(e,M,O),S(M,t,O),b&&b.m(M,O),S(M,i,O),k&&k.m(M,O),S(M,s,O),S(M,l,O),v(l,o),v(l,r),$&&$.m(l,null),v(l,a),T&&T.m(l,null),v(l,u),v(l,f),v(f,d),m=!0,_||(g=J(f,"click",n[19]),_=!0)},p(M,O){var L,F;const I={};O&100663298&&(I.$$scope={dirty:O,ctx:M}),e.$set(I),((L=M[0].s3)==null?void 0:L.enabled)!=M[1].s3.enabled?b?(b.p(M,O),O&3&&A(b,1)):(b=Eh(M),b.c(),A(b,1),b.m(i.parentNode,i)):b&&(re(),P(b,1,1,()=>{b=null}),ae()),M[1].s3.enabled?k?(k.p(M,O),O&2&&A(k,1)):(k=Ah(M),k.c(),A(k,1),k.m(s.parentNode,s)):k&&(re(),P(k,1,1,()=>{k=null}),ae()),(F=M[1].s3)!=null&&F.enabled&&!M[6]&&!M[3]?$?$.p(M,O):($=Ih(M),$.c(),$.m(l,a)):$&&($.d(1),$=null),M[6]?T?T.p(M,O):(T=Ph(M),T.c(),T.m(l,u)):T&&(T.d(1),T=null),(!m||O&72&&p!==(p=!M[6]||M[3]))&&(f.disabled=p),(!m||O&8)&&x(f,"btn-loading",M[3])},i(M){m||(A(e.$$.fragment,M),A(b),A(k),m=!0)},o(M){P(e.$$.fragment,M),P(b),P(k),m=!1},d(M){H(e,M),M&&w(t),b&&b.d(M),M&&w(i),k&&k.d(M),M&&w(s),M&&w(l),$&&$.d(),T&&T.d(),_=!1,g()}}}function U6(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function W6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Use S3 storage"),h(e,"type","checkbox"),h(e,"id",t=n[25]),e.required=!0,h(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),v(s,l),r||(a=J(e,"change",n[11]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&h(e,"id",t),f&2&&(e.checked=u[1].s3.enabled),f&33554432&&o!==(o=u[25])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Eh(n){var L;let e,t,i,s,l,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",u,f,d,p=n[1].s3.enabled?"S3 storage":"local file system",m,_,g,b,k,$,T,C,D,M,O,I;return{c(){e=y("div"),t=y("div"),i=y("div"),i.innerHTML='',s=E(),l=y("div"),o=U(`If you have existing uploaded files, you'll have to migrate them manually from the `),r=y("strong"),u=U(a),f=U(` to the @@ -193,19 +193,19 @@ Updated: ${b[1].updated}`,position:"left"}),k[0]&536870912&&p!==(p=b[29])&&h(d," `),k=y("a"),k.textContent=`rclone `,$=U(`, `),T=y("a"),T.textContent=`s5cmd - `,C=U(", etc."),D=E(),M=y("div"),h(i,"class","icon"),h(k,"href","https://github.com/rclone/rclone"),h(k,"target","_blank"),h(k,"rel","noopener noreferrer"),h(k,"class","txt-bold"),h(T,"href","https://github.com/peak/s5cmd"),h(T,"target","_blank"),h(T,"rel","noopener noreferrer"),h(T,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(M,"class","clearfix m-t-base")},m(F,R){S(F,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(r,u),v(l,f),v(l,d),v(d,m),v(l,_),v(l,g),v(l,b),v(l,k),v(l,$),v(l,T),v(l,C),v(e,D),v(e,M),I=!0},p(F,R){var N;(!I||R&1)&&a!==(a=(N=F[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&le(u,a),(!I||R&2)&&p!==(p=F[1].s3.enabled?"S3 storage":"local file system")&&le(m,p)},i(F){I||(F&&nt(()=>{I&&(O||(O=Ve(e,wt,{duration:150},!0)),O.run(1))}),I=!0)},o(F){F&&(O||(O=Ve(e,wt,{duration:150},!1)),O.run(0)),I=!1},d(F){F&&w(e),F&&O&&O.end()}}}function Eh(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M;return i=new de({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[U6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[W6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"s3.region",$$slots:{default:[Y6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),p=new de({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[K6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[J6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),$=new de({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[Z6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),f=E(),d=y("div"),z(p.$$.fragment),m=E(),_=y("div"),z(g.$$.fragment),b=E(),k=y("div"),z($.$$.fragment),T=E(),C=y("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(d,"class","col-lg-6"),h(_,"class","col-lg-6"),h(k,"class","col-lg-12"),h(C,"class","col-lg-12"),h(e,"class","grid")},m(O,I){S(O,e,I),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),V(u,a,null),v(e,f),v(e,d),V(p,d,null),v(e,m),v(e,_),V(g,_,null),v(e,b),v(e,k),V($,k,null),v(e,T),v(e,C),M=!0},p(O,I){const L={};I&100663298&&(L.$$scope={dirty:I,ctx:O}),i.$set(L);const F={};I&100663298&&(F.$$scope={dirty:I,ctx:O}),o.$set(F);const R={};I&100663298&&(R.$$scope={dirty:I,ctx:O}),u.$set(R);const N={};I&100663298&&(N.$$scope={dirty:I,ctx:O}),p.$set(N);const q={};I&100663298&&(q.$$scope={dirty:I,ctx:O}),g.$set(q);const Y={};I&100663298&&(Y.$$scope={dirty:I,ctx:O}),$.$set(Y)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(p.$$.fragment,O),A(g.$$.fragment,O),A($.$$.fragment,O),O&&nt(()=>{M&&(D||(D=Ve(e,wt,{duration:150},!0)),D.run(1))}),M=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(u.$$.fragment,O),P(p.$$.fragment,O),P(g.$$.fragment,O),P($.$$.fragment,O),O&&(D||(D=Ve(e,wt,{duration:150},!1)),D.run(0)),M=!1},d(O){O&&w(e),H(i),H(o),H(u),H(p),H(g),H($),O&&D&&D.end()}}}function U6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Endpoint"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.endpoint),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&ue(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function W6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Bucket"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.bucket),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&ue(l,u[1].s3.bucket)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Y6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Region"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.region),r||(a=J(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.region&&ue(l,u[1].s3.region)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function K6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Access key"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.accessKey),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.accessKey&&ue(l,u[1].s3.accessKey)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function J6(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[25],required:!0};return n[1].s3.secret!==void 0&&(u.value=n[1].s3.secret),l=new fu({props:u}),se.push(()=>he(l,"value",a)),{c(){e=y("label"),t=U("Secret"),s=E(),z(l.$$.fragment),h(e,"for",i=n[25])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d&33554432&&i!==(i=f[25]))&&h(e,"for",i);const p={};d&33554432&&(p.id=f[25]),!o&&d&2&&(o=!0,p.value=f[1].s3.secret,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function Z6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Force path-style addressing",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[25]),h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[25])},m(d,p){S(d,e,p),e.checked=n[1].s3.forcePathStyle,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[17]),Ee(Ue.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(d,p){p&33554432&&t!==(t=d[25])&&h(e,"id",t),p&2&&(e.checked=d[1].s3.forcePathStyle),p&33554432&&a!==(a=d[25])&&h(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function Ah(n){let e;function t(l,o){return l[4]?Q6:l[5]?X6:G6}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 G6(n){let e;return{c(){e=y("div"),e.innerHTML=` - S3 connected successfully`,h(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function X6(n){let e,t,i,s;return{c(){e=y("div"),e.innerHTML=` - Failed to establish S3 connection`,h(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ee(t=Ue.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Ut(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 Q6(n){let e;return{c(){e=y("span"),h(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Ih(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),v(e,t),i||(s=J(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function x6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[z6,H6],$=[];function T(C,D){return C[2]?0:1}return p=T(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[7]),r=E(),a=y("div"),u=y("form"),f=y("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.

    `,d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,D){S(C,e,D),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,D),S(C,a,D),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",ft(n[20])),g=!0)},p(C,D){(!_||D&128)&&le(o,C[7]);let M=p;p=T(C),p===M?$[p].p(C,D):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(C,D):(m=$[p]=k[p](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){P(m),_=!1},d(C){C&&w(e),C&&w(r),C&&w(a),$[p].d(),g=!1,b()}}}function eA(n){let e,t,i,s;return e=new qi({}),i=new In({props:{$$slots:{default:[x6]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}const oo="s3_test_request";function tA(n,e,t){let i,s,l;Ke(n,Lt,N=>t(7,l=N)),sn(Lt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,d=null,p=null;m();async function m(){t(2,a=!0);try{const N=await me.settings.getAll()||{};g(N)}catch(N){me.errorResponseHandler(N)}t(2,a=!1)}async function _(){if(!(u||!s)){t(3,u=!0);try{me.cancelRequest(oo);const N=await me.settings.update(j.filterRedactedProps(r));dn({}),await g(N),Ea(),d?uy("Successfully saved but failed to establish S3 connection."):Jt("Successfully saved files storage settings.")}catch(N){me.errorResponseHandler(N)}t(3,u=!1)}}async function g(N={}){t(1,r={s3:(N==null?void 0:N.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function b(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,d=null),!!r.s3.enabled){me.cancelRequest(oo),clearTimeout(p),p=setTimeout(()=>{me.cancelRequest(oo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await me.settings.testS3({$cancelKey:oo})}catch(N){t(5,d=N)}t(4,f=!1),clearTimeout(p)}}xt(()=>()=>{clearTimeout(p)});function $(){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 D(){r.s3.region=this.value,t(1,r)}function M(){r.s3.accessKey=this.value,t(1,r)}function O(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function I(){r.s3.forcePathStyle=this.checked,t(1,r)}const L=()=>b(),F=()=>_(),R=()=>_();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,d,s,l,_,b,i,$,T,C,D,M,O,I,L,F,R]}class nA extends ve{constructor(e){super(),be(this,e,tA,eA,_e,{})}}function iA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[20]),h(s,"for",o=n[20])},m(u,f){S(u,e,f),e.checked=n[1].enabled,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&h(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function sA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Client ID"),s=E(),l=y("input"),h(e,"for",i=n[20]),h(l,"type","text"),h(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ue(l,n[1].clientId),a||(u=J(l,"input",n[12]),a=!0)},p(f,d){d&1048576&&i!==(i=f[20])&&h(e,"for",i),d&1048576&&o!==(o=f[20])&&h(l,"id",o),d&2&&r!==(r=f[1].enabled)&&(l.required=r),d&2&&l.value!==f[1].clientId&&ue(l,f[1].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function lA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new fu({props:u}),se.push(()=>he(l,"value",a)),{c(){e=y("label"),t=U("Client secret"),s=E(),z(l.$$.fragment),h(e,"for",i=n[20])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d&1048576&&i!==(i=f[20]))&&h(e,"for",i);const p={};d&1048576&&(p.id=f[20]),d&2&&(p.required=f[1].enabled),!o&&d&2&&(o=!0,p.value=f[1].clientSecret,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function Ph(n){let e,t,i,s;function l(a){n[14](a)}var o=n[3].optionsComponent;function r(a){let u={key:a[3].key};return a[1]!==void 0&&(u.config=a[1]),{props:u}}return o&&(t=Pt(o,r(n)),se.push(()=>he(t,"config",l))),{c(){e=y("div"),t&&z(t.$$.fragment),h(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&V(t,e,null),s=!0},p(a,u){const f={};if(u&8&&(f.key=a[3].key),!i&&u&2&&(i=!0,f.config=a[1],ke(()=>i=!1)),u&8&&o!==(o=a[3].optionsComponent)){if(t){re();const d=t;P(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(t=Pt(o,r(a)),se.push(()=>he(t,"config",l)),z(t.$$.fragment),A(t.$$.fragment,1),V(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&P(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&H(t)}}}function oA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;i=new de({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[iA,({uniqueId:g})=>({20:g}),({uniqueId:g})=>g?1048576:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[sA,({uniqueId:g})=>({20:g}),({uniqueId:g})=>g?1048576:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[lA,({uniqueId:g})=>({20:g}),({uniqueId:g})=>g?1048576:0]},$$scope:{ctx:n}}});let _=n[3].optionsComponent&&Ph(n);return{c(){e=y("form"),t=y("div"),z(i.$$.fragment),s=E(),l=y("button"),l.innerHTML='Clear all fields',o=E(),z(r.$$.fragment),a=E(),z(u.$$.fragment),f=E(),_&&_.c(),h(l,"type","button"),h(l,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),h(t,"class","flex m-b-base"),h(e,"id",n[6]),h(e,"autocomplete","off")},m(g,b){S(g,e,b),v(e,t),V(i,t,null),v(t,s),v(t,l),v(e,o),V(r,e,null),v(e,a),V(u,e,null),v(e,f),_&&_.m(e,null),d=!0,p||(m=[J(l,"click",n[8]),J(e,"submit",ft(n[15]))],p=!0)},p(g,b){const k={};b&8&&(k.name=g[3].key+".enabled"),b&3145730&&(k.$$scope={dirty:b,ctx:g}),i.$set(k);const $={};b&2&&($.class="form-field "+(g[1].enabled?"required":"")),b&8&&($.name=g[3].key+".clientId"),b&3145730&&($.$$scope={dirty:b,ctx:g}),r.$set($);const T={};b&2&&(T.class="form-field "+(g[1].enabled?"required":"")),b&8&&(T.name=g[3].key+".clientSecret"),b&3145730&&(T.$$scope={dirty:b,ctx:g}),u.$set(T),g[3].optionsComponent?_?(_.p(g,b),b&8&&A(_,1)):(_=Ph(g),_.c(),A(_,1),_.m(e,null)):_&&(re(),P(_,1,1,()=>{_=null}),ae())},i(g){d||(A(i.$$.fragment,g),A(r.$$.fragment,g),A(u.$$.fragment,g),A(_),d=!0)},o(g){P(i.$$.fragment,g),P(r.$$.fragment,g),P(u.$$.fragment,g),P(_),d=!1},d(g){g&&w(e),H(i),H(r),H(u),_&&_.d(),p=!1,De(m)}}}function rA(n){let e,t=(n[3].title||n[3].key)+"",i,s;return{c(){e=y("h4"),i=U(t),s=U(" provider"),h(e,"class","center txt-break")},m(l,o){S(l,e,o),v(e,i),v(e,s)},p(l,o){o&8&&t!==(t=(l[3].title||l[3].key)+"")&&le(i,t)},d(l){l&&w(e)}}}function aA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("span"),l.textContent="Save changes",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[4],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[6]),h(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],x(s,"btn-loading",n[4])},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&x(s,"btn-loading",u[4])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function uA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[aA],header:[rA],default:[oA]},$$scope:{ctx:n}};return e=new pn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&2097210&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[16](null),H(e,s)}}}function fA(n,e,t){let i;const s=kt(),l="provider_popup_"+j.randomString(5);let o,r={},a={},u=!1,f="";function d(O,I){dn({}),t(3,r=Object.assign({},O)),t(1,a=Object.assign({enabled:!0},I)),t(10,f=JSON.stringify(a)),o==null||o.show()}function p(){return o==null?void 0:o.hide()}async function m(){t(4,u=!0);try{const O={};O[r.key]=j.filterRedactedProps(a);const I=await me.settings.update(O);dn({}),Jt("Successfully updated provider settings."),s("submit",I),p()}catch(O){me.errorResponseHandler(O)}t(4,u=!1)}function _(){for(let O in a)t(1,a[O]="",a);t(1,a.enabled=!1,a)}function g(){a.enabled=this.checked,t(1,a)}function b(){a.clientId=this.value,t(1,a)}function k(O){n.$$.not_equal(a.clientSecret,O)&&(a.clientSecret=O,t(1,a))}function $(O){a=O,t(1,a)}const T=()=>m();function C(O){se[O?"unshift":"push"](()=>{o=O,t(2,o)})}function D(O){pe.call(this,n,O)}function M(O){pe.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[p,a,o,r,u,i,l,m,_,d,f,g,b,k,$,T,C,D,M]}class cA extends ve{constructor(e){super(),be(this,e,fA,uA,_e,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Lh(n){let e,t,i;return{c(){e=y("img"),Dn(e.src,t="./images/oauth2/"+n[1].logo)||h(e,"src",t),h(e,"alt",i=n[1].title+" logo"),h(e,"class","svelte-1jz4aqj")},m(s,l){S(s,e,l)},p(s,l){l&2&&!Dn(e.src,t="./images/oauth2/"+s[1].logo)&&h(e,"src",t),l&2&&i!==(i=s[1].title+" logo")&&h(e,"alt",i)},d(s){s&&w(e)}}}function Nh(n){let e;return{c(){e=y("div"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function dA(n){let e,t,i,s,l=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",d,p,m,_,g,b,k,$,T,C,D=n[1].logo&&Lh(n),M=n[0].enabled&&Nh(),O={};return k=new cA({props:O}),n[4](k),k.$on("submit",n[5]),{c(){e=y("div"),t=y("figure"),D&&D.c(),i=E(),s=y("div"),o=U(l),r=E(),a=y("em"),u=U("("),d=U(f),p=U(")"),m=E(),M&&M.c(),_=E(),g=y("button"),g.innerHTML='',b=E(),z(k.$$.fragment),h(t,"class","provider-logo svelte-1jz4aqj"),h(s,"class","title"),h(a,"class","txt-hint txt-sm m-r-auto"),h(g,"type","button"),h(g,"class","btn btn-circle btn-hint btn-transparent"),h(g,"aria-label","Provider settings"),h(e,"class","provider-card svelte-1jz4aqj")},m(I,L){S(I,e,L),v(e,t),D&&D.m(t,null),v(e,i),v(e,s),v(s,o),v(e,r),v(e,a),v(a,u),v(a,d),v(a,p),v(e,m),M&&M.m(e,null),v(e,_),v(e,g),S(I,b,L),V(k,I,L),$=!0,T||(C=J(g,"click",n[3]),T=!0)},p(I,[L]){I[1].logo?D?D.p(I,L):(D=Lh(I),D.c(),D.m(t,null)):D&&(D.d(1),D=null),(!$||L&2)&&l!==(l=I[1].title+"")&&le(o,l),(!$||L&2)&&f!==(f=I[1].key.slice(0,-4)+"")&&le(d,f),I[0].enabled?M||(M=Nh(),M.c(),M.m(e,_)):M&&(M.d(1),M=null);const F={};k.$set(F)},i(I){$||(A(k.$$.fragment,I),$=!0)},o(I){P(k.$$.fragment,I),$=!1},d(I){I&&w(e),D&&D.d(),M&&M.d(),I&&w(b),n[4](null),H(k,I),T=!1,C()}}}function pA(n,e,t){let{provider:i={}}=e,{config:s={}}=e,l;const o=()=>{l==null||l.show(i,Object.assign({},s,{enabled:s.clientId?s.enabled:!0}))};function r(u){se[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{u.detail[i.key]&&t(0,s=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class ub extends ve{constructor(e){super(),be(this,e,pA,dA,_e,{provider:1,config:0})}}function Fh(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Rh(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function mA(n){let e,t=[],i=new Map,s,l,o,r=[],a=new Map,u,f=n[3];const d=g=>g[9].key;for(let g=0;g0&&n[2].length>0&&jh(),m=n[2];const _=g=>g[9].key;for(let g=0;g0&&g[2].length>0?p||(p=jh(),p.c(),p.m(l.parentNode,l)):p&&(p.d(1),p=null),b&5&&(m=g[2],re(),r=yt(r,b,_,1,g,m,a,o,Zt,Vh,null,Fh),ae())},i(g){if(!u){for(let b=0;bhe(i,"config",r)),{key:n,first:null,c(){t=y("div"),z(i.$$.fragment),l=E(),h(t,"class","col-lg-6"),this.first=t},m(u,f){S(u,t,f),V(i,t,null),v(t,l),o=!0},p(u,f){e=u;const d={};f&8&&(d.provider=e[9]),!s&&f&9&&(s=!0,d.config=e[0][e[9].key],ke(()=>s=!1)),i.$set(d)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){P(i.$$.fragment,u),o=!1},d(u){u&&w(t),H(i)}}}function jh(n){let e;return{c(){e=y("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Vh(n,e){let t,i,s,l,o;function r(u){e[6](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new ub({props:a}),se.push(()=>he(i,"config",r)),{key:n,first:null,c(){t=y("div"),z(i.$$.fragment),l=E(),h(t,"class","col-lg-6"),this.first=t},m(u,f){S(u,t,f),V(i,t,null),v(t,l),o=!0},p(u,f){e=u;const d={};f&4&&(d.provider=e[9]),!s&&f&5&&(s=!0,d.config=e[0][e[9].key],ke(()=>s=!1)),i.$set(d)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){P(i.$$.fragment,u),o=!1},d(u){u&&w(t),H(i)}}}function _A(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_;const g=[hA,mA],b=[];function k($,T){return $[1]?0:1}return p=k(n),m=b[p]=g[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[4]),r=E(),a=y("div"),u=y("div"),f=y("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","m-b-base"),h(u,"class","panel"),h(a,"class","wrapper")},m($,T){S($,e,T),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S($,r,T),S($,a,T),v(a,u),v(u,f),v(u,d),b[p].m(u,null),_=!0},p($,T){(!_||T&16)&&le(o,$[4]);let C=p;p=k($),p===C?b[p].p($,T):(re(),P(b[C],1,1,()=>{b[C]=null}),ae(),m=b[p],m?m.p($,T):(m=b[p]=g[p]($),m.c()),A(m,1),m.m(u,null))},i($){_||(A(m),_=!0)},o($){P(m),_=!1},d($){$&&w(e),$&&w(r),$&&w(a),b[p].d()}}}function gA(n){let e,t,i,s;return e=new qi({}),i=new In({props:{$$slots:{default:[_A]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function bA(n,e,t){let i,s,l;Ke(n,Lt,p=>t(4,l=p)),sn(Lt,l="Auth providers",l);let o=!1,r={};a();async function a(){t(1,o=!0);try{const p=await me.settings.getAll()||{};u(p)}catch(p){me.errorResponseHandler(p)}t(1,o=!1)}function u(p){p=p||{},t(0,r={});for(const m of fl)t(0,r[m.key]=Object.assign({enabled:!1},p[m.key]),r)}function f(p,m){n.$$.not_equal(r[m.key],p)&&(r[m.key]=p,t(0,r))}function d(p,m){n.$$.not_equal(r[m.key],p)&&(r[m.key]=p,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=fl.filter(p=>{var m;return(m=r[p.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,s=fl.filter(p=>{var m;return!((m=r[p.key])!=null&&m.enabled)}))},[r,o,s,i,l,f,d]}class vA extends ve{constructor(e){super(),be(this,e,bA,gA,_e,{})}}function yA(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("label"),t=U(n[3]),i=U(" duration (in seconds)"),l=E(),o=y("input"),a=E(),u=y("div"),f=y("span"),f.textContent="Invalidate all previously issued tokens",h(e,"for",s=n[6]),h(o,"type","number"),h(o,"id",r=n[6]),o.required=!0,h(f,"class","link-primary"),x(f,"txt-success",!!n[1]),h(u,"class","help-block")},m(m,_){S(m,e,_),v(e,t),v(e,i),S(m,l,_),S(m,o,_),ue(o,n[0]),S(m,a,_),S(m,u,_),v(u,f),d||(p=[J(o,"input",n[4]),J(f,"click",n[5])],d=!0)},p(m,_){_&8&&le(t,m[3]),_&64&&s!==(s=m[6])&&h(e,"for",s),_&64&&r!==(r=m[6])&&h(o,"id",r),_&1&&_t(o.value)!==m[0]&&ue(o,m[0]),_&2&&x(f,"txt-success",!!m[1])},d(m){m&&w(e),m&&w(l),m&&w(o),m&&w(a),m&&w(u),d=!1,De(p)}}}function kA(n){let e,t;return e=new de({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[yA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function wA(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=_t(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomString(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class fb extends ve{constructor(e){super(),be(this,e,wA,kA,_e,{key:2,label:3,duration:0,secret:1})}}function Hh(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function zh(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function SA(n){let e,t,i=[],s=new Map,l,o,r,a,u,f=[],d=new Map,p,m,_,g,b,k,$,T,C,D,M,O=n[5];const I=N=>N[19].key;for(let N=0;NN[19].key;for(let N=0;Nhe(i,"duration",r)),se.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(f,d){S(f,t,d),V(i,f,d),o=!0},p(f,d){e=f;const p={};!s&&d&33&&(s=!0,p.duration=e[0][e[19].key].duration,ke(()=>s=!1)),!l&&d&33&&(l=!0,p.secret=e[0][e[19].key].secret,ke(()=>l=!1)),i.$set(p)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){P(i.$$.fragment,f),o=!1},d(f){f&&w(t),H(i,f)}}}function Uh(n,e){let t,i,s,l,o;function r(f){e[13](f,e[19])}function a(f){e[14](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new fb({props:u}),se.push(()=>he(i,"duration",r)),se.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(f,d){S(f,t,d),V(i,f,d),o=!0},p(f,d){e=f;const p={};!s&&d&65&&(s=!0,p.duration=e[0][e[19].key].duration,ke(()=>s=!1)),!l&&d&65&&(l=!0,p.secret=e[0][e[19].key].secret,ke(()=>l=!1)),i.$set(p)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){P(i.$$.fragment,f),o=!1},d(f){f&&w(t),H(i,f)}}}function Wh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),v(e,t),i||(s=J(e,"click",n[15]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function TA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[$A,SA],$=[];function T(C,D){return C[1]?0:1}return p=T(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[4]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="

    Adjust common token options.

    ",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content m-b-sm txt-xl"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,D){S(C,e,D),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,D),S(C,a,D),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",ft(n[7])),g=!0)},p(C,D){(!_||D&16)&&le(o,C[4]);let M=p;p=T(C),p===M?$[p].p(C,D):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(C,D):(m=$[p]=k[p](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){P(m),_=!1},d(C){C&&w(e),C&&w(r),C&&w(a),$[p].d(),g=!1,b()}}}function CA(n){let e,t,i,s;return e=new qi({}),i=new In({props:{$$slots:{default:[TA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function MA(n,e,t){let i,s,l;Ke(n,Lt,M=>t(4,l=M));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:"recordFileToken",label:"Records private file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins private file access token"}];sn(Lt,l="Token options",l);let a={},u={},f=!1,d=!1;p();async function p(){t(1,f=!0);try{const M=await me.settings.getAll()||{};_(M)}catch(M){me.errorResponseHandler(M)}t(1,f=!1)}async function m(){if(!(d||!s)){t(2,d=!0);try{const M=await me.settings.update(j.filterRedactedProps(u));_(M),Jt("Successfully saved tokens options.")}catch(M){me.errorResponseHandler(M)}t(2,d=!1)}}function _(M){var I;M=M||{},t(0,u={});const O=o.concat(r);for(const L of O)t(0,u[L.key]={duration:((I=M[L.key])==null?void 0:I.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function g(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function b(M,O){n.$$.not_equal(u[O.key].duration,M)&&(u[O.key].duration=M,t(0,u))}function k(M,O){n.$$.not_equal(u[O.key].secret,M)&&(u[O.key].secret=M,t(0,u))}function $(M,O){n.$$.not_equal(u[O.key].duration,M)&&(u[O.key].duration=M,t(0,u))}function T(M,O){n.$$.not_equal(u[O.key].secret,M)&&(u[O.key].secret=M,t(0,u))}const C=()=>g(),D=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,s=i!=JSON.stringify(u))},[u,f,d,s,l,o,r,m,g,a,i,b,k,$,T,C,D]}class OA extends ve{constructor(e){super(),be(this,e,MA,CA,_e,{})}}function DA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_;return o=new x1({props:{content:n[2]}}),{c(){e=y("div"),e.innerHTML=`

    Below you'll find your current collections configuration that you could import in + `,C=U(", etc."),D=E(),M=y("div"),h(i,"class","icon"),h(k,"href","https://github.com/rclone/rclone"),h(k,"target","_blank"),h(k,"rel","noopener noreferrer"),h(k,"class","txt-bold"),h(T,"href","https://github.com/peak/s5cmd"),h(T,"target","_blank"),h(T,"rel","noopener noreferrer"),h(T,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(M,"class","clearfix m-t-base")},m(F,R){S(F,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(r,u),v(l,f),v(l,d),v(d,m),v(l,_),v(l,g),v(l,b),v(l,k),v(l,$),v(l,T),v(l,C),v(e,D),v(e,M),I=!0},p(F,R){var N;(!I||R&1)&&a!==(a=(N=F[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&le(u,a),(!I||R&2)&&p!==(p=F[1].s3.enabled?"S3 storage":"local file system")&&le(m,p)},i(F){I||(F&&nt(()=>{I&&(O||(O=Ve(e,wt,{duration:150},!0)),O.run(1))}),I=!0)},o(F){F&&(O||(O=Ve(e,wt,{duration:150},!1)),O.run(0)),I=!1},d(F){F&&w(e),F&&O&&O.end()}}}function Ah(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M;return i=new de({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[Y6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[K6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"s3.region",$$slots:{default:[J6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),p=new de({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[Z6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[G6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),$=new de({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[X6,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),f=E(),d=y("div"),z(p.$$.fragment),m=E(),_=y("div"),z(g.$$.fragment),b=E(),k=y("div"),z($.$$.fragment),T=E(),C=y("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(d,"class","col-lg-6"),h(_,"class","col-lg-6"),h(k,"class","col-lg-12"),h(C,"class","col-lg-12"),h(e,"class","grid")},m(O,I){S(O,e,I),v(e,t),V(i,t,null),v(e,s),v(e,l),V(o,l,null),v(e,r),v(e,a),V(u,a,null),v(e,f),v(e,d),V(p,d,null),v(e,m),v(e,_),V(g,_,null),v(e,b),v(e,k),V($,k,null),v(e,T),v(e,C),M=!0},p(O,I){const L={};I&100663298&&(L.$$scope={dirty:I,ctx:O}),i.$set(L);const F={};I&100663298&&(F.$$scope={dirty:I,ctx:O}),o.$set(F);const R={};I&100663298&&(R.$$scope={dirty:I,ctx:O}),u.$set(R);const N={};I&100663298&&(N.$$scope={dirty:I,ctx:O}),p.$set(N);const q={};I&100663298&&(q.$$scope={dirty:I,ctx:O}),g.$set(q);const Y={};I&100663298&&(Y.$$scope={dirty:I,ctx:O}),$.$set(Y)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(p.$$.fragment,O),A(g.$$.fragment,O),A($.$$.fragment,O),O&&nt(()=>{M&&(D||(D=Ve(e,wt,{duration:150},!0)),D.run(1))}),M=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(u.$$.fragment,O),P(p.$$.fragment,O),P(g.$$.fragment,O),P($.$$.fragment,O),O&&(D||(D=Ve(e,wt,{duration:150},!1)),D.run(0)),M=!1},d(O){O&&w(e),H(i),H(o),H(u),H(p),H(g),H($),O&&D&&D.end()}}}function Y6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Endpoint"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.endpoint),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&ue(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function K6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Bucket"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.bucket),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&ue(l,u[1].s3.bucket)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function J6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Region"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.region),r||(a=J(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.region&&ue(l,u[1].s3.region)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Z6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Access key"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.accessKey),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.accessKey&&ue(l,u[1].s3.accessKey)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function G6(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[25],required:!0};return n[1].s3.secret!==void 0&&(u.value=n[1].s3.secret),l=new fu({props:u}),se.push(()=>he(l,"value",a)),{c(){e=y("label"),t=U("Secret"),s=E(),z(l.$$.fragment),h(e,"for",i=n[25])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d&33554432&&i!==(i=f[25]))&&h(e,"for",i);const p={};d&33554432&&(p.id=f[25]),!o&&d&2&&(o=!0,p.value=f[1].s3.secret,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function X6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Force path-style addressing",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[25]),h(l,"class","txt"),h(r,"class","ri-information-line link-hint"),h(s,"for",a=n[25])},m(d,p){S(d,e,p),e.checked=n[1].s3.forcePathStyle,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[17]),Ee(Ue.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(d,p){p&33554432&&t!==(t=d[25])&&h(e,"id",t),p&2&&(e.checked=d[1].s3.forcePathStyle),p&33554432&&a!==(a=d[25])&&h(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function Ih(n){let e;function t(l,o){return l[4]?eA:l[5]?x6:Q6}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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 Q6(n){let e;return{c(){e=y("div"),e.innerHTML=` + S3 connected successfully`,h(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function x6(n){let e,t,i,s;return{c(){e=y("div"),e.innerHTML=` + Failed to establish S3 connection`,h(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ee(t=Ue.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Ut(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 eA(n){let e;return{c(){e=y("span"),h(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function Ph(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),v(e,t),i||(s=J(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function tA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[U6,B6],$=[];function T(C,D){return C[2]?0:1}return p=T(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[7]),r=E(),a=y("div"),u=y("form"),f=y("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.

    `,d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,D){S(C,e,D),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,D),S(C,a,D),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",ft(n[20])),g=!0)},p(C,D){(!_||D&128)&&le(o,C[7]);let M=p;p=T(C),p===M?$[p].p(C,D):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(C,D):(m=$[p]=k[p](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){P(m),_=!1},d(C){C&&w(e),C&&w(r),C&&w(a),$[p].d(),g=!1,b()}}}function nA(n){let e,t,i,s;return e=new qi({}),i=new In({props:{$$slots:{default:[tA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}const oo="s3_test_request";function iA(n,e,t){let i,s,l;Ke(n,Lt,N=>t(7,l=N)),sn(Lt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,d=null,p=null;m();async function m(){t(2,a=!0);try{const N=await me.settings.getAll()||{};g(N)}catch(N){me.errorResponseHandler(N)}t(2,a=!1)}async function _(){if(!(u||!s)){t(3,u=!0);try{me.cancelRequest(oo);const N=await me.settings.update(j.filterRedactedProps(r));dn({}),await g(N),Ea(),d?fy("Successfully saved but failed to establish S3 connection."):Jt("Successfully saved files storage settings.")}catch(N){me.errorResponseHandler(N)}t(3,u=!1)}}async function g(N={}){t(1,r={s3:(N==null?void 0:N.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function b(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,d=null),!!r.s3.enabled){me.cancelRequest(oo),clearTimeout(p),p=setTimeout(()=>{me.cancelRequest(oo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await me.settings.testS3({$cancelKey:oo})}catch(N){t(5,d=N)}t(4,f=!1),clearTimeout(p)}}xt(()=>()=>{clearTimeout(p)});function $(){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 D(){r.s3.region=this.value,t(1,r)}function M(){r.s3.accessKey=this.value,t(1,r)}function O(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function I(){r.s3.forcePathStyle=this.checked,t(1,r)}const L=()=>b(),F=()=>_(),R=()=>_();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,d,s,l,_,b,i,$,T,C,D,M,O,I,L,F,R]}class sA extends ve{constructor(e){super(),be(this,e,iA,nA,_e,{})}}function lA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[20]),h(s,"for",o=n[20])},m(u,f){S(u,e,f),e.checked=n[1].enabled,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&h(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&h(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function oA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Client ID"),s=E(),l=y("input"),h(e,"for",i=n[20]),h(l,"type","text"),h(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ue(l,n[1].clientId),a||(u=J(l,"input",n[12]),a=!0)},p(f,d){d&1048576&&i!==(i=f[20])&&h(e,"for",i),d&1048576&&o!==(o=f[20])&&h(l,"id",o),d&2&&r!==(r=f[1].enabled)&&(l.required=r),d&2&&l.value!==f[1].clientId&&ue(l,f[1].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function rA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new fu({props:u}),se.push(()=>he(l,"value",a)),{c(){e=y("label"),t=U("Client secret"),s=E(),z(l.$$.fragment),h(e,"for",i=n[20])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d&1048576&&i!==(i=f[20]))&&h(e,"for",i);const p={};d&1048576&&(p.id=f[20]),d&2&&(p.required=f[1].enabled),!o&&d&2&&(o=!0,p.value=f[1].clientSecret,ke(()=>o=!1)),l.$set(p)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function Lh(n){let e,t,i,s;function l(a){n[14](a)}var o=n[3].optionsComponent;function r(a){let u={key:a[3].key};return a[1]!==void 0&&(u.config=a[1]),{props:u}}return o&&(t=Pt(o,r(n)),se.push(()=>he(t,"config",l))),{c(){e=y("div"),t&&z(t.$$.fragment),h(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&V(t,e,null),s=!0},p(a,u){const f={};if(u&8&&(f.key=a[3].key),!i&&u&2&&(i=!0,f.config=a[1],ke(()=>i=!1)),u&8&&o!==(o=a[3].optionsComponent)){if(t){re();const d=t;P(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}o?(t=Pt(o,r(a)),se.push(()=>he(t,"config",l)),z(t.$$.fragment),A(t.$$.fragment,1),V(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&P(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&H(t)}}}function aA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;i=new de({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[lA,({uniqueId:g})=>({20:g}),({uniqueId:g})=>g?1048576:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[oA,({uniqueId:g})=>({20:g}),({uniqueId:g})=>g?1048576:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[rA,({uniqueId:g})=>({20:g}),({uniqueId:g})=>g?1048576:0]},$$scope:{ctx:n}}});let _=n[3].optionsComponent&&Lh(n);return{c(){e=y("form"),t=y("div"),z(i.$$.fragment),s=E(),l=y("button"),l.innerHTML='Clear all fields',o=E(),z(r.$$.fragment),a=E(),z(u.$$.fragment),f=E(),_&&_.c(),h(l,"type","button"),h(l,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),h(t,"class","flex m-b-base"),h(e,"id",n[6]),h(e,"autocomplete","off")},m(g,b){S(g,e,b),v(e,t),V(i,t,null),v(t,s),v(t,l),v(e,o),V(r,e,null),v(e,a),V(u,e,null),v(e,f),_&&_.m(e,null),d=!0,p||(m=[J(l,"click",n[8]),J(e,"submit",ft(n[15]))],p=!0)},p(g,b){const k={};b&8&&(k.name=g[3].key+".enabled"),b&3145730&&(k.$$scope={dirty:b,ctx:g}),i.$set(k);const $={};b&2&&($.class="form-field "+(g[1].enabled?"required":"")),b&8&&($.name=g[3].key+".clientId"),b&3145730&&($.$$scope={dirty:b,ctx:g}),r.$set($);const T={};b&2&&(T.class="form-field "+(g[1].enabled?"required":"")),b&8&&(T.name=g[3].key+".clientSecret"),b&3145730&&(T.$$scope={dirty:b,ctx:g}),u.$set(T),g[3].optionsComponent?_?(_.p(g,b),b&8&&A(_,1)):(_=Lh(g),_.c(),A(_,1),_.m(e,null)):_&&(re(),P(_,1,1,()=>{_=null}),ae())},i(g){d||(A(i.$$.fragment,g),A(r.$$.fragment,g),A(u.$$.fragment,g),A(_),d=!0)},o(g){P(i.$$.fragment,g),P(r.$$.fragment,g),P(u.$$.fragment,g),P(_),d=!1},d(g){g&&w(e),H(i),H(r),H(u),_&&_.d(),p=!1,De(m)}}}function uA(n){let e,t=(n[3].title||n[3].key)+"",i,s;return{c(){e=y("h4"),i=U(t),s=U(" provider"),h(e,"class","center txt-break")},m(l,o){S(l,e,o),v(e,i),v(e,s)},p(l,o){o&8&&t!==(t=(l[3].title||l[3].key)+"")&&le(i,t)},d(l){l&&w(e)}}}function fA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("span"),l.textContent="Save changes",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[4],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[6]),h(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],x(s,"btn-loading",n[4])},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&x(s,"btn-loading",u[4])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function cA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[fA],header:[uA],default:[aA]},$$scope:{ctx:n}};return e=new pn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){z(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&2097210&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[16](null),H(e,s)}}}function dA(n,e,t){let i;const s=kt(),l="provider_popup_"+j.randomString(5);let o,r={},a={},u=!1,f="";function d(O,I){dn({}),t(3,r=Object.assign({},O)),t(1,a=Object.assign({enabled:!0},I)),t(10,f=JSON.stringify(a)),o==null||o.show()}function p(){return o==null?void 0:o.hide()}async function m(){t(4,u=!0);try{const O={};O[r.key]=j.filterRedactedProps(a);const I=await me.settings.update(O);dn({}),Jt("Successfully updated provider settings."),s("submit",I),p()}catch(O){me.errorResponseHandler(O)}t(4,u=!1)}function _(){for(let O in a)t(1,a[O]="",a);t(1,a.enabled=!1,a)}function g(){a.enabled=this.checked,t(1,a)}function b(){a.clientId=this.value,t(1,a)}function k(O){n.$$.not_equal(a.clientSecret,O)&&(a.clientSecret=O,t(1,a))}function $(O){a=O,t(1,a)}const T=()=>m();function C(O){se[O?"unshift":"push"](()=>{o=O,t(2,o)})}function D(O){pe.call(this,n,O)}function M(O){pe.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[p,a,o,r,u,i,l,m,_,d,f,g,b,k,$,T,C,D,M]}class pA extends ve{constructor(e){super(),be(this,e,dA,cA,_e,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Nh(n){let e,t,i;return{c(){e=y("img"),Dn(e.src,t="./images/oauth2/"+n[1].logo)||h(e,"src",t),h(e,"alt",i=n[1].title+" logo"),h(e,"class","svelte-1jz4aqj")},m(s,l){S(s,e,l)},p(s,l){l&2&&!Dn(e.src,t="./images/oauth2/"+s[1].logo)&&h(e,"src",t),l&2&&i!==(i=s[1].title+" logo")&&h(e,"alt",i)},d(s){s&&w(e)}}}function Fh(n){let e;return{c(){e=y("div"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function mA(n){let e,t,i,s,l=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",d,p,m,_,g,b,k,$,T,C,D=n[1].logo&&Nh(n),M=n[0].enabled&&Fh(),O={};return k=new pA({props:O}),n[4](k),k.$on("submit",n[5]),{c(){e=y("div"),t=y("figure"),D&&D.c(),i=E(),s=y("div"),o=U(l),r=E(),a=y("em"),u=U("("),d=U(f),p=U(")"),m=E(),M&&M.c(),_=E(),g=y("button"),g.innerHTML='',b=E(),z(k.$$.fragment),h(t,"class","provider-logo svelte-1jz4aqj"),h(s,"class","title"),h(a,"class","txt-hint txt-sm m-r-auto"),h(g,"type","button"),h(g,"class","btn btn-circle btn-hint btn-transparent"),h(g,"aria-label","Provider settings"),h(e,"class","provider-card svelte-1jz4aqj")},m(I,L){S(I,e,L),v(e,t),D&&D.m(t,null),v(e,i),v(e,s),v(s,o),v(e,r),v(e,a),v(a,u),v(a,d),v(a,p),v(e,m),M&&M.m(e,null),v(e,_),v(e,g),S(I,b,L),V(k,I,L),$=!0,T||(C=J(g,"click",n[3]),T=!0)},p(I,[L]){I[1].logo?D?D.p(I,L):(D=Nh(I),D.c(),D.m(t,null)):D&&(D.d(1),D=null),(!$||L&2)&&l!==(l=I[1].title+"")&&le(o,l),(!$||L&2)&&f!==(f=I[1].key.slice(0,-4)+"")&&le(d,f),I[0].enabled?M||(M=Fh(),M.c(),M.m(e,_)):M&&(M.d(1),M=null);const F={};k.$set(F)},i(I){$||(A(k.$$.fragment,I),$=!0)},o(I){P(k.$$.fragment,I),$=!1},d(I){I&&w(e),D&&D.d(),M&&M.d(),I&&w(b),n[4](null),H(k,I),T=!1,C()}}}function hA(n,e,t){let{provider:i={}}=e,{config:s={}}=e,l;const o=()=>{l==null||l.show(i,Object.assign({},s,{enabled:s.clientId?s.enabled:!0}))};function r(u){se[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{u.detail[i.key]&&t(0,s=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class fb extends ve{constructor(e){super(),be(this,e,hA,mA,_e,{provider:1,config:0})}}function Rh(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function qh(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function _A(n){let e,t=[],i=new Map,s,l,o,r=[],a=new Map,u,f=n[3];const d=g=>g[9].key;for(let g=0;g0&&n[2].length>0&&Vh(),m=n[2];const _=g=>g[9].key;for(let g=0;g0&&g[2].length>0?p||(p=Vh(),p.c(),p.m(l.parentNode,l)):p&&(p.d(1),p=null),b&5&&(m=g[2],re(),r=yt(r,b,_,1,g,m,a,o,Zt,Hh,null,Rh),ae())},i(g){if(!u){for(let b=0;bhe(i,"config",r)),{key:n,first:null,c(){t=y("div"),z(i.$$.fragment),l=E(),h(t,"class","col-lg-6"),this.first=t},m(u,f){S(u,t,f),V(i,t,null),v(t,l),o=!0},p(u,f){e=u;const d={};f&8&&(d.provider=e[9]),!s&&f&9&&(s=!0,d.config=e[0][e[9].key],ke(()=>s=!1)),i.$set(d)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){P(i.$$.fragment,u),o=!1},d(u){u&&w(t),H(i)}}}function Vh(n){let e;return{c(){e=y("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Hh(n,e){let t,i,s,l,o;function r(u){e[6](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new fb({props:a}),se.push(()=>he(i,"config",r)),{key:n,first:null,c(){t=y("div"),z(i.$$.fragment),l=E(),h(t,"class","col-lg-6"),this.first=t},m(u,f){S(u,t,f),V(i,t,null),v(t,l),o=!0},p(u,f){e=u;const d={};f&4&&(d.provider=e[9]),!s&&f&5&&(s=!0,d.config=e[0][e[9].key],ke(()=>s=!1)),i.$set(d)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){P(i.$$.fragment,u),o=!1},d(u){u&&w(t),H(i)}}}function bA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_;const g=[gA,_A],b=[];function k($,T){return $[1]?0:1}return p=k(n),m=b[p]=g[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[4]),r=E(),a=y("div"),u=y("div"),f=y("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","m-b-base"),h(u,"class","panel"),h(a,"class","wrapper")},m($,T){S($,e,T),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S($,r,T),S($,a,T),v(a,u),v(u,f),v(u,d),b[p].m(u,null),_=!0},p($,T){(!_||T&16)&&le(o,$[4]);let C=p;p=k($),p===C?b[p].p($,T):(re(),P(b[C],1,1,()=>{b[C]=null}),ae(),m=b[p],m?m.p($,T):(m=b[p]=g[p]($),m.c()),A(m,1),m.m(u,null))},i($){_||(A(m),_=!0)},o($){P(m),_=!1},d($){$&&w(e),$&&w(r),$&&w(a),b[p].d()}}}function vA(n){let e,t,i,s;return e=new qi({}),i=new In({props:{$$slots:{default:[bA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function yA(n,e,t){let i,s,l;Ke(n,Lt,p=>t(4,l=p)),sn(Lt,l="Auth providers",l);let o=!1,r={};a();async function a(){t(1,o=!0);try{const p=await me.settings.getAll()||{};u(p)}catch(p){me.errorResponseHandler(p)}t(1,o=!1)}function u(p){p=p||{},t(0,r={});for(const m of fl)t(0,r[m.key]=Object.assign({enabled:!1},p[m.key]),r)}function f(p,m){n.$$.not_equal(r[m.key],p)&&(r[m.key]=p,t(0,r))}function d(p,m){n.$$.not_equal(r[m.key],p)&&(r[m.key]=p,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=fl.filter(p=>{var m;return(m=r[p.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,s=fl.filter(p=>{var m;return!((m=r[p.key])!=null&&m.enabled)}))},[r,o,s,i,l,f,d]}class kA extends ve{constructor(e){super(),be(this,e,yA,vA,_e,{})}}function wA(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("label"),t=U(n[3]),i=U(" duration (in seconds)"),l=E(),o=y("input"),a=E(),u=y("div"),f=y("span"),f.textContent="Invalidate all previously issued tokens",h(e,"for",s=n[6]),h(o,"type","number"),h(o,"id",r=n[6]),o.required=!0,h(f,"class","link-primary"),x(f,"txt-success",!!n[1]),h(u,"class","help-block")},m(m,_){S(m,e,_),v(e,t),v(e,i),S(m,l,_),S(m,o,_),ue(o,n[0]),S(m,a,_),S(m,u,_),v(u,f),d||(p=[J(o,"input",n[4]),J(f,"click",n[5])],d=!0)},p(m,_){_&8&&le(t,m[3]),_&64&&s!==(s=m[6])&&h(e,"for",s),_&64&&r!==(r=m[6])&&h(o,"id",r),_&1&&_t(o.value)!==m[0]&&ue(o,m[0]),_&2&&x(f,"txt-success",!!m[1])},d(m){m&&w(e),m&&w(l),m&&w(o),m&&w(a),m&&w(u),d=!1,De(p)}}}function SA(n){let e,t;return e=new de({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[wA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function $A(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=_t(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomString(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class cb extends ve{constructor(e){super(),be(this,e,$A,SA,_e,{key:2,label:3,duration:0,secret:1})}}function zh(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Bh(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function TA(n){let e,t,i=[],s=new Map,l,o,r,a,u,f=[],d=new Map,p,m,_,g,b,k,$,T,C,D,M,O=n[5];const I=N=>N[19].key;for(let N=0;NN[19].key;for(let N=0;Nhe(i,"duration",r)),se.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(f,d){S(f,t,d),V(i,f,d),o=!0},p(f,d){e=f;const p={};!s&&d&33&&(s=!0,p.duration=e[0][e[19].key].duration,ke(()=>s=!1)),!l&&d&33&&(l=!0,p.secret=e[0][e[19].key].secret,ke(()=>l=!1)),i.$set(p)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){P(i.$$.fragment,f),o=!1},d(f){f&&w(t),H(i,f)}}}function Wh(n,e){let t,i,s,l,o;function r(f){e[13](f,e[19])}function a(f){e[14](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new cb({props:u}),se.push(()=>he(i,"duration",r)),se.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(f,d){S(f,t,d),V(i,f,d),o=!0},p(f,d){e=f;const p={};!s&&d&65&&(s=!0,p.duration=e[0][e[19].key].duration,ke(()=>s=!1)),!l&&d&65&&(l=!0,p.secret=e[0][e[19].key].secret,ke(()=>l=!1)),i.$set(p)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){P(i.$$.fragment,f),o=!1},d(f){f&&w(t),H(i,f)}}}function Yh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),v(e,t),i||(s=J(e,"click",n[15]),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,d,p,m,_,g,b;const k=[CA,TA],$=[];function T(C,D){return C[1]?0:1}return p=T(n),m=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[4]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="

    Adjust common token options.

    ",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content m-b-sm txt-xl"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,D){S(C,e,D),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,D),S(C,a,D),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",ft(n[7])),g=!0)},p(C,D){(!_||D&16)&&le(o,C[4]);let M=p;p=T(C),p===M?$[p].p(C,D):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(C,D):(m=$[p]=k[p](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){P(m),_=!1},d(C){C&&w(e),C&&w(r),C&&w(a),$[p].d(),g=!1,b()}}}function OA(n){let e,t,i,s;return e=new qi({}),i=new In({props:{$$slots:{default:[MA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function DA(n,e,t){let i,s,l;Ke(n,Lt,M=>t(4,l=M));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:"recordFileToken",label:"Records private file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins private file access token"}];sn(Lt,l="Token options",l);let a={},u={},f=!1,d=!1;p();async function p(){t(1,f=!0);try{const M=await me.settings.getAll()||{};_(M)}catch(M){me.errorResponseHandler(M)}t(1,f=!1)}async function m(){if(!(d||!s)){t(2,d=!0);try{const M=await me.settings.update(j.filterRedactedProps(u));_(M),Jt("Successfully saved tokens options.")}catch(M){me.errorResponseHandler(M)}t(2,d=!1)}}function _(M){var I;M=M||{},t(0,u={});const O=o.concat(r);for(const L of O)t(0,u[L.key]={duration:((I=M[L.key])==null?void 0:I.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function g(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function b(M,O){n.$$.not_equal(u[O.key].duration,M)&&(u[O.key].duration=M,t(0,u))}function k(M,O){n.$$.not_equal(u[O.key].secret,M)&&(u[O.key].secret=M,t(0,u))}function $(M,O){n.$$.not_equal(u[O.key].duration,M)&&(u[O.key].duration=M,t(0,u))}function T(M,O){n.$$.not_equal(u[O.key].secret,M)&&(u[O.key].secret=M,t(0,u))}const C=()=>g(),D=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,s=i!=JSON.stringify(u))},[u,f,d,s,l,o,r,m,g,a,i,b,k,$,T,C,D]}class EA extends ve{constructor(e){super(),be(this,e,DA,OA,_e,{})}}function AA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_;return o=new eb({props:{content:n[2]}}),{c(){e=y("div"),e.innerHTML=`

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

    `,t=E(),i=y("div"),s=y("button"),s.innerHTML='Copy',l=E(),z(o.$$.fragment),r=E(),a=y("div"),u=y("div"),f=E(),d=y("button"),d.innerHTML=` - Download as JSON`,h(e,"class","content txt-xl m-b-base"),h(s,"type","button"),h(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),h(i,"tabindex","0"),h(i,"class","export-preview svelte-jm5c4z"),h(u,"class","flex-fill"),h(d,"type","button"),h(d,"class","btn btn-expanded"),h(a,"class","flex m-t-base")},m(g,b){S(g,e,b),S(g,t,b),S(g,i,b),v(i,s),v(i,l),V(o,i,null),n[8](i),S(g,r,b),S(g,a,b),v(a,u),v(a,f),v(a,d),p=!0,m||(_=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(d,"click",n[10])],m=!0)},p(g,b){const k={};b&4&&(k.content=g[2]),o.$set(k)},i(g){p||(A(o.$$.fragment,g),p=!0)},o(g){P(o.$$.fragment,g),p=!1},d(g){g&&w(e),g&&w(t),g&&w(i),H(o),n[8](null),g&&w(r),g&&w(a),m=!1,De(_)}}}function EA(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function AA(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[EA,DA],_=[];function g(b,k){return b[1]?0:1}return f=g(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[3]),r=E(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(b,r,k),S(b,a,k),v(a,u),_[f].m(u,null),p=!0},p(b,k){(!p||k&8)&&le(o,b[3]);let $=f;f=g(b),f===$?_[f].p(b,k):(re(),P(_[$],1,1,()=>{_[$]=null}),ae(),d=_[f],d?d.p(b,k):(d=_[f]=m[f](b),d.c()),A(d,1),d.m(u,null))},i(b){p||(A(d),p=!0)},o(b){P(d),p=!1},d(b){b&&w(e),b&&w(r),b&&w(a),_[f].d()}}}function IA(n){let e,t,i,s;return e=new qi({}),i=new In({props:{$$slots:{default:[AA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function PA(n,e,t){let i,s;Ke(n,Lt,b=>t(3,s=b)),sn(Lt,s="Export collections",s);const l="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await me.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let b of r)delete b.created,delete b.updated}catch(b){me.errorResponseHandler(b)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function d(){j.copyToClipboard(i),Qg("The configuration was copied to your clipboard!",3e3)}const p=()=>d();function m(b){se[b?"unshift":"push"](()=>{o=b,t(0,o)})}const _=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const k=window.getSelection(),$=document.createRange();$.selectNodeContents(o),k.removeAllRanges(),k.addRange($)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,d,r,p,m,_,g]}class LA extends ve{constructor(e){super(),be(this,e,PA,IA,_e,{})}}function Yh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Kh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Jh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Zh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Gh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Xh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Qh(n,e,t){const i=n.slice();return i[30]=e[t],i}function NA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&xh(),a=n[0].name!==n[1].name&&e_(n);return{c(){e=y("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=y("strong"),o=U(l),h(s,"class","txt"),h(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),v(e,t),a&&a.m(e,null),v(e,i),v(e,s),v(s,o)},p(u,f){u[9]?r||(r=xh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=e_(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 FA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Deleted",t=E(),i=y("strong"),l=U(s),h(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),v(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 RA(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Added",t=E(),i=y("strong"),l=U(s),h(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),v(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 xh(n){let e;return{c(){e=y("span"),e.textContent="Changed",h(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function e_(n){let e,t=n[0].name+"",i,s,l;return{c(){e=y("strong"),i=U(t),s=E(),l=y("i"),h(e,"class","txt-strikethrough txt-hint"),h(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),v(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 t_(n){var b,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((b=n[0])==null?void 0:b[n[30]])+"",f,d,p,m,_=n[12]((k=n[1])==null?void 0:k[n[30]])+"",g;return{c(){var $,T,C,D,M,O;e=y("tr"),t=y("td"),i=y("span"),l=U(s),o=E(),r=y("td"),a=y("pre"),f=U(u),d=E(),p=y("td"),m=y("pre"),g=U(_),h(t,"class","min-width svelte-lmkr38"),h(a,"class","txt"),h(r,"class","svelte-lmkr38"),x(r,"changed-old-col",!n[10]&&gn(($=n[0])==null?void 0:$[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(r,"changed-none-col",n[10]),h(m,"class","txt"),h(p,"class","svelte-lmkr38"),x(p,"changed-new-col",!n[5]&&gn((C=n[0])==null?void 0:C[n[30]],(D=n[1])==null?void 0:D[n[30]])),x(p,"changed-none-col",n[5]),h(e,"class","svelte-lmkr38"),x(e,"txt-primary",gn((M=n[0])==null?void 0:M[n[30]],(O=n[1])==null?void 0:O[n[30]]))},m($,T){S($,e,T),v(e,t),v(t,i),v(i,l),v(e,o),v(e,r),v(r,a),v(a,f),v(e,d),v(e,p),v(p,m),v(m,g)},p($,T){var C,D,M,O,I,L,F,R;T[0]&1&&u!==(u=$[12]((C=$[0])==null?void 0:C[$[30]])+"")&&le(f,u),T[0]&3075&&x(r,"changed-old-col",!$[10]&&gn((D=$[0])==null?void 0:D[$[30]],(M=$[1])==null?void 0:M[$[30]])),T[0]&1024&&x(r,"changed-none-col",$[10]),T[0]&2&&_!==(_=$[12]((O=$[1])==null?void 0:O[$[30]])+"")&&le(g,_),T[0]&2083&&x(p,"changed-new-col",!$[5]&&gn((I=$[0])==null?void 0:I[$[30]],(L=$[1])==null?void 0:L[$[30]])),T[0]&32&&x(p,"changed-none-col",$[5]),T[0]&2051&&x(e,"txt-primary",gn((F=$[0])==null?void 0:F[$[30]],(R=$[1])==null?void 0:R[$[30]]))},d($){$&&w(e)}}}function n_(n){let e,t=n[6],i=[];for(let s=0;sProps + Download as JSON`,h(e,"class","content txt-xl m-b-base"),h(s,"type","button"),h(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),h(i,"tabindex","0"),h(i,"class","export-preview svelte-jm5c4z"),h(u,"class","flex-fill"),h(d,"type","button"),h(d,"class","btn btn-expanded"),h(a,"class","flex m-t-base")},m(g,b){S(g,e,b),S(g,t,b),S(g,i,b),v(i,s),v(i,l),V(o,i,null),n[8](i),S(g,r,b),S(g,a,b),v(a,u),v(a,f),v(a,d),p=!0,m||(_=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(d,"click",n[10])],m=!0)},p(g,b){const k={};b&4&&(k.content=g[2]),o.$set(k)},i(g){p||(A(o.$$.fragment,g),p=!0)},o(g){P(o.$$.fragment,g),p=!1},d(g){g&&w(e),g&&w(t),g&&w(i),H(o),n[8](null),g&&w(r),g&&w(a),m=!1,De(_)}}}function IA(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function PA(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[IA,AA],_=[];function g(b,k){return b[1]?0:1}return f=g(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[3]),r=E(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(b,r,k),S(b,a,k),v(a,u),_[f].m(u,null),p=!0},p(b,k){(!p||k&8)&&le(o,b[3]);let $=f;f=g(b),f===$?_[f].p(b,k):(re(),P(_[$],1,1,()=>{_[$]=null}),ae(),d=_[f],d?d.p(b,k):(d=_[f]=m[f](b),d.c()),A(d,1),d.m(u,null))},i(b){p||(A(d),p=!0)},o(b){P(d),p=!1},d(b){b&&w(e),b&&w(r),b&&w(a),_[f].d()}}}function LA(n){let e,t,i,s;return e=new qi({}),i=new In({props:{$$slots:{default:[PA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function NA(n,e,t){let i,s;Ke(n,Lt,b=>t(3,s=b)),sn(Lt,s="Export collections",s);const l="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await me.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let b of r)delete b.created,delete b.updated}catch(b){me.errorResponseHandler(b)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function d(){j.copyToClipboard(i),xg("The configuration was copied to your clipboard!",3e3)}const p=()=>d();function m(b){se[b?"unshift":"push"](()=>{o=b,t(0,o)})}const _=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const k=window.getSelection(),$=document.createRange();$.selectNodeContents(o),k.removeAllRanges(),k.addRange($)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,d,r,p,m,_,g]}class FA extends ve{constructor(e){super(),be(this,e,NA,LA,_e,{})}}function Kh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Jh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Zh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Gh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Xh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Qh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function xh(n,e,t){const i=n.slice();return i[30]=e[t],i}function RA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&e_(),a=n[0].name!==n[1].name&&t_(n);return{c(){e=y("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=y("strong"),o=U(l),h(s,"class","txt"),h(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),v(e,t),a&&a.m(e,null),v(e,i),v(e,s),v(s,o)},p(u,f){u[9]?r||(r=e_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=t_(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 qA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Deleted",t=E(),i=y("strong"),l=U(s),h(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),v(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 jA(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Added",t=E(),i=y("strong"),l=U(s),h(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),v(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 e_(n){let e;return{c(){e=y("span"),e.textContent="Changed",h(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function t_(n){let e,t=n[0].name+"",i,s,l;return{c(){e=y("strong"),i=U(t),s=E(),l=y("i"),h(e,"class","txt-strikethrough txt-hint"),h(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),v(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 n_(n){var b,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((b=n[0])==null?void 0:b[n[30]])+"",f,d,p,m,_=n[12]((k=n[1])==null?void 0:k[n[30]])+"",g;return{c(){var $,T,C,D,M,O;e=y("tr"),t=y("td"),i=y("span"),l=U(s),o=E(),r=y("td"),a=y("pre"),f=U(u),d=E(),p=y("td"),m=y("pre"),g=U(_),h(t,"class","min-width svelte-lmkr38"),h(a,"class","txt"),h(r,"class","svelte-lmkr38"),x(r,"changed-old-col",!n[10]&&gn(($=n[0])==null?void 0:$[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(r,"changed-none-col",n[10]),h(m,"class","txt"),h(p,"class","svelte-lmkr38"),x(p,"changed-new-col",!n[5]&&gn((C=n[0])==null?void 0:C[n[30]],(D=n[1])==null?void 0:D[n[30]])),x(p,"changed-none-col",n[5]),h(e,"class","svelte-lmkr38"),x(e,"txt-primary",gn((M=n[0])==null?void 0:M[n[30]],(O=n[1])==null?void 0:O[n[30]]))},m($,T){S($,e,T),v(e,t),v(t,i),v(i,l),v(e,o),v(e,r),v(r,a),v(a,f),v(e,d),v(e,p),v(p,m),v(m,g)},p($,T){var C,D,M,O,I,L,F,R;T[0]&1&&u!==(u=$[12]((C=$[0])==null?void 0:C[$[30]])+"")&&le(f,u),T[0]&3075&&x(r,"changed-old-col",!$[10]&&gn((D=$[0])==null?void 0:D[$[30]],(M=$[1])==null?void 0:M[$[30]])),T[0]&1024&&x(r,"changed-none-col",$[10]),T[0]&2&&_!==(_=$[12]((O=$[1])==null?void 0:O[$[30]])+"")&&le(g,_),T[0]&2083&&x(p,"changed-new-col",!$[5]&&gn((I=$[0])==null?void 0:I[$[30]],(L=$[1])==null?void 0:L[$[30]])),T[0]&32&&x(p,"changed-none-col",$[5]),T[0]&2051&&x(e,"txt-primary",gn((F=$[0])==null?void 0:F[$[30]],(R=$[1])==null?void 0:R[$[30]]))},d($){$&&w(e)}}}function i_(n){let e,t=n[6],i=[];for(let s=0;sProps Old - New`,l=E(),o=y("tbody");for(let C=0;C<_.length;C+=1)_[C].c();r=E(),g&&g.c(),a=E();for(let C=0;C!["schema","created","updated"].includes(k));function g(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(k=>!f.find($=>k.id==$.id))))}function b(k){return typeof k>"u"?"":j.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&g(),n.$$.dirty[0]&24&&t(6,d=u.filter(k=>!f.find($=>k.id==$.id))),n.$$.dirty[0]&24&&t(7,p=f.filter(k=>u.find($=>$.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find($=>$.id==k.id))),n.$$.dirty[0]&7&&t(9,l=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,d,p,m,l,s,_,b]}class VA extends ve{constructor(e){super(),be(this,e,jA,qA,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function f_(n,e,t){const i=n.slice();return i[17]=e[t],i}function c_(n){let e,t;return e=new VA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function HA(n){let e,t,i=n[2],s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oNew`,l=E(),o=y("tbody");for(let C=0;C<_.length;C+=1)_[C].c();r=E(),g&&g.c(),a=E();for(let C=0;C!["schema","created","updated"].includes(k));function g(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(k=>!f.find($=>k.id==$.id))))}function b(k){return typeof k>"u"?"":j.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&g(),n.$$.dirty[0]&24&&t(6,d=u.filter(k=>!f.find($=>k.id==$.id))),n.$$.dirty[0]&24&&t(7,p=f.filter(k=>u.find($=>$.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find($=>$.id==k.id))),n.$$.dirty[0]&7&&t(9,l=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,d,p,m,l,s,_,b]}class zA extends ve{constructor(e){super(),be(this,e,HA,VA,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function c_(n,e,t){const i=n.slice();return i[17]=e[t],i}function d_(n){let e,t;return e=new zA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function BA(n){let e,t,i=n[2],s=[];for(let o=0;oP(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),Jt("Successfully imported collections configuration."),i("submit")}catch(C){me.errorResponseHandler(C)}t(4,u=!1),d()}}const g=()=>m(),b=()=>!u;function k(C){se[C?"unshift":"push"](()=>{s=C,t(1,s)})}function $(C){pe.call(this,n,C)}function T(C){pe.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&p()},[d,s,r,a,u,m,f,l,o,g,b,k,$,T]}class YA extends ve{constructor(e){super(),be(this,e,WA,UA,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function d_(n,e,t){const i=n.slice();return i[32]=e[t],i}function p_(n,e,t){const i=n.slice();return i[35]=e[t],i}function m_(n,e,t){const i=n.slice();return i[32]=e[t],i}function KA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O;a=new de({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[ZA,({uniqueId:q})=>({40:q}),({uniqueId:q})=>[0,q?512:0]]},$$scope:{ctx:n}}});let I=!1,L=n[6]&&n[1].length&&!n[7]&&__(),F=n[6]&&n[1].length&&n[7]&&g_(n),R=n[13].length&&O_(n),N=!!n[0]&&D_(n);return{c(){e=y("input"),t=E(),i=y("div"),s=y("p"),l=U(`Paste below the collections configuration you want to import or - `),o=y("button"),o.innerHTML='Load from JSON file',r=E(),z(a.$$.fragment),u=E(),f=E(),L&&L.c(),d=E(),F&&F.c(),p=E(),R&&R.c(),m=E(),_=y("div"),N&&N.c(),g=E(),b=y("div"),k=E(),$=y("button"),T=y("span"),T.textContent="Review",h(e,"type","file"),h(e,"class","hidden"),h(e,"accept",".json"),h(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),h(i,"class","content txt-xl m-b-base"),h(b,"class","flex-fill"),h(T,"class","txt"),h($,"type","button"),h($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=C=!n[14],h(_,"class","flex m-t-base")},m(q,Y){S(q,e,Y),n[19](e),S(q,t,Y),S(q,i,Y),v(i,s),v(s,l),v(s,o),S(q,r,Y),V(a,q,Y),S(q,u,Y),S(q,f,Y),L&&L.m(q,Y),S(q,d,Y),F&&F.m(q,Y),S(q,p,Y),R&&R.m(q,Y),S(q,m,Y),S(q,_,Y),N&&N.m(_,null),v(_,g),v(_,b),v(_,k),v(_,$),v($,T),D=!0,M||(O=[J(e,"change",n[20]),J(o,"click",n[21]),J($,"click",n[26])],M=!0)},p(q,Y){(!D||Y[0]&4096)&&x(o,"btn-loading",q[12]);const B={};Y[0]&64&&(B.class="form-field "+(q[6]?"":"field-error")),Y[0]&65|Y[1]&1536&&(B.$$scope={dirty:Y,ctx:q}),a.$set(B),q[6]&&q[1].length&&!q[7]?L||(L=__(),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),q[6]&&q[1].length&&q[7]?F?F.p(q,Y):(F=g_(q),F.c(),F.m(p.parentNode,p)):F&&(F.d(1),F=null),q[13].length?R?R.p(q,Y):(R=O_(q),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),q[0]?N?N.p(q,Y):(N=D_(q),N.c(),N.m(_,g)):N&&(N.d(1),N=null),(!D||Y[0]&16384&&C!==(C=!q[14]))&&($.disabled=C)},i(q){D||(A(a.$$.fragment,q),A(I),D=!0)},o(q){P(a.$$.fragment,q),P(I),D=!1},d(q){q&&w(e),n[19](null),q&&w(t),q&&w(i),q&&w(r),H(a,q),q&&w(u),q&&w(f),L&&L.d(q),q&&w(d),F&&F.d(q),q&&w(p),R&&R.d(q),q&&w(m),q&&w(_),N&&N.d(),M=!1,De(O)}}}function JA(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function h_(n){let e;return{c(){e=y("div"),e.textContent="Invalid collections configuration.",h(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ZA(n){let e,t,i,s,l,o,r,a,u,f,d=!!n[0]&&!n[6]&&h_();return{c(){e=y("label"),t=U("Collections"),s=E(),l=y("textarea"),r=E(),d&&d.c(),a=Se(),h(e,"for",i=n[40]),h(e,"class","p-b-10"),h(l,"id",o=n[40]),h(l,"class","code"),h(l,"spellcheck","false"),h(l,"rows","15"),l.required=!0},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0]),S(p,r,m),d&&d.m(p,m),S(p,a,m),u||(f=J(l,"input",n[22]),u=!0)},p(p,m){m[1]&512&&i!==(i=p[40])&&h(e,"for",i),m[1]&512&&o!==(o=p[40])&&h(l,"id",o),m[0]&1&&ue(l,p[0]),p[0]&&!p[6]?d||(d=h_(),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),d&&d.d(p),p&&w(a),u=!1,f()}}}function __(n){let e;return{c(){e=y("div"),e.innerHTML=`
    -
    Your collections configuration is already up-to-date!
    `,h(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function g_(n){let e,t,i,s,l,o=n[9].length&&b_(n),r=n[4].length&&k_(n),a=n[8].length&&T_(n);return{c(){e=y("h5"),e.textContent="Detected changes",t=E(),i=y("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),h(e,"class","section-title"),h(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),v(i,s),r&&r.m(i,null),v(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=b_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=k_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=T_(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 b_(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=E(),s=y("div"),s.innerHTML=`Some of the imported collections share the same name and/or fields but are +- `)}`,()=>{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),Jt("Successfully imported collections configuration."),i("submit")}catch(C){me.errorResponseHandler(C)}t(4,u=!1),d()}}const g=()=>m(),b=()=>!u;function k(C){se[C?"unshift":"push"](()=>{s=C,t(1,s)})}function $(C){pe.call(this,n,C)}function T(C){pe.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&p()},[d,s,r,a,u,m,f,l,o,g,b,k,$,T]}class JA extends ve{constructor(e){super(),be(this,e,KA,YA,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function p_(n,e,t){const i=n.slice();return i[32]=e[t],i}function m_(n,e,t){const i=n.slice();return i[35]=e[t],i}function h_(n,e,t){const i=n.slice();return i[32]=e[t],i}function ZA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,D,M,O;a=new de({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[XA,({uniqueId:q})=>({40:q}),({uniqueId:q})=>[0,q?512:0]]},$$scope:{ctx:n}}});let I=!1,L=n[6]&&n[1].length&&!n[7]&&g_(),F=n[6]&&n[1].length&&n[7]&&b_(n),R=n[13].length&&D_(n),N=!!n[0]&&E_(n);return{c(){e=y("input"),t=E(),i=y("div"),s=y("p"),l=U(`Paste below the collections configuration you want to import or + `),o=y("button"),o.innerHTML='Load from JSON file',r=E(),z(a.$$.fragment),u=E(),f=E(),L&&L.c(),d=E(),F&&F.c(),p=E(),R&&R.c(),m=E(),_=y("div"),N&&N.c(),g=E(),b=y("div"),k=E(),$=y("button"),T=y("span"),T.textContent="Review",h(e,"type","file"),h(e,"class","hidden"),h(e,"accept",".json"),h(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),h(i,"class","content txt-xl m-b-base"),h(b,"class","flex-fill"),h(T,"class","txt"),h($,"type","button"),h($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=C=!n[14],h(_,"class","flex m-t-base")},m(q,Y){S(q,e,Y),n[19](e),S(q,t,Y),S(q,i,Y),v(i,s),v(s,l),v(s,o),S(q,r,Y),V(a,q,Y),S(q,u,Y),S(q,f,Y),L&&L.m(q,Y),S(q,d,Y),F&&F.m(q,Y),S(q,p,Y),R&&R.m(q,Y),S(q,m,Y),S(q,_,Y),N&&N.m(_,null),v(_,g),v(_,b),v(_,k),v(_,$),v($,T),D=!0,M||(O=[J(e,"change",n[20]),J(o,"click",n[21]),J($,"click",n[26])],M=!0)},p(q,Y){(!D||Y[0]&4096)&&x(o,"btn-loading",q[12]);const B={};Y[0]&64&&(B.class="form-field "+(q[6]?"":"field-error")),Y[0]&65|Y[1]&1536&&(B.$$scope={dirty:Y,ctx:q}),a.$set(B),q[6]&&q[1].length&&!q[7]?L||(L=g_(),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),q[6]&&q[1].length&&q[7]?F?F.p(q,Y):(F=b_(q),F.c(),F.m(p.parentNode,p)):F&&(F.d(1),F=null),q[13].length?R?R.p(q,Y):(R=D_(q),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),q[0]?N?N.p(q,Y):(N=E_(q),N.c(),N.m(_,g)):N&&(N.d(1),N=null),(!D||Y[0]&16384&&C!==(C=!q[14]))&&($.disabled=C)},i(q){D||(A(a.$$.fragment,q),A(I),D=!0)},o(q){P(a.$$.fragment,q),P(I),D=!1},d(q){q&&w(e),n[19](null),q&&w(t),q&&w(i),q&&w(r),H(a,q),q&&w(u),q&&w(f),L&&L.d(q),q&&w(d),F&&F.d(q),q&&w(p),R&&R.d(q),q&&w(m),q&&w(_),N&&N.d(),M=!1,De(O)}}}function GA(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){S(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&w(e)}}}function __(n){let e;return{c(){e=y("div"),e.textContent="Invalid collections configuration.",h(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function XA(n){let e,t,i,s,l,o,r,a,u,f,d=!!n[0]&&!n[6]&&__();return{c(){e=y("label"),t=U("Collections"),s=E(),l=y("textarea"),r=E(),d&&d.c(),a=Se(),h(e,"for",i=n[40]),h(e,"class","p-b-10"),h(l,"id",o=n[40]),h(l,"class","code"),h(l,"spellcheck","false"),h(l,"rows","15"),l.required=!0},m(p,m){S(p,e,m),v(e,t),S(p,s,m),S(p,l,m),ue(l,n[0]),S(p,r,m),d&&d.m(p,m),S(p,a,m),u||(f=J(l,"input",n[22]),u=!0)},p(p,m){m[1]&512&&i!==(i=p[40])&&h(e,"for",i),m[1]&512&&o!==(o=p[40])&&h(l,"id",o),m[0]&1&&ue(l,p[0]),p[0]&&!p[6]?d||(d=__(),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),d&&d.d(p),p&&w(a),u=!1,f()}}}function g_(n){let e;return{c(){e=y("div"),e.innerHTML=`
    +
    Your collections configuration is already up-to-date!
    `,h(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function b_(n){let e,t,i,s,l,o=n[9].length&&v_(n),r=n[4].length&&w_(n),a=n[8].length&&C_(n);return{c(){e=y("h5"),e.textContent="Detected changes",t=E(),i=y("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),h(e,"class","section-title"),h(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),v(i,s),r&&r.m(i,null),v(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=v_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=w_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=C_(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 v_(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=E(),s=y("div"),s.innerHTML=`Some of the imported collections share the same name and/or fields but are imported with different IDs. You can replace them in the import if you want - to.`,l=E(),o=y("button"),o.innerHTML='Replace with original ids',h(t,"class","icon"),h(s,"class","content"),h(o,"type","button"),h(o,"class","btn btn-warning btn-sm btn-outline"),h(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),r||(a=J(o,"click",n[24]),r=!0)},p:Q,d(u){u&&w(e),r=!1,a()}}}function D_(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear',h(e,"type","button"),h(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function GA(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[JA,KA],_=[];function g(b,k){return b[5]?0:1}return f=g(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[15]),r=E(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(b,r,k),S(b,a,k),v(a,u),_[f].m(u,null),p=!0},p(b,k){(!p||k[0]&32768)&&le(o,b[15]);let $=f;f=g(b),f===$?_[f].p(b,k):(re(),P(_[$],1,1,()=>{_[$]=null}),ae(),d=_[f],d?d.p(b,k):(d=_[f]=m[f](b),d.c()),A(d,1),d.m(u,null))},i(b){p||(A(d),p=!0)},o(b){P(d),p=!1},d(b){b&&w(e),b&&w(r),b&&w(a),_[f].d()}}}function XA(n){let e,t,i,s,l,o;e=new qi({}),i=new In({props:{$$slots:{default:[GA]},$$scope:{ctx:n}}});let r={};return l=new YA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(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 d={};l.$set(d)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[27](null),H(l,a)}}}function QA(n,e,t){let i,s,l,o,r,a,u;Ke(n,Lt,X=>t(15,u=X)),sn(Lt,u="Import collections",u);let f,d,p="",m=!1,_=[],g=[],b=!0,k=[],$=!1;T();async function T(){t(5,$=!0);try{t(2,g=await me.collections.getFullList(200));for(let X of g)delete X.created,delete X.updated}catch(X){me.errorResponseHandler(X)}t(5,$=!1)}function C(){if(t(4,k=[]),!!i)for(let X of _){const fe=j.findByKey(g,"id",X.id);!(fe!=null&&fe.id)||!j.hasCollectionChanges(fe,X,b)||k.push({new:X,old:fe})}}function D(){t(1,_=[]);try{t(1,_=JSON.parse(p))}catch{}Array.isArray(_)?t(1,_=j.filterDuplicatesByKey(_)):t(1,_=[]);for(let X of _)delete X.created,delete X.updated,X.schema=j.filterDuplicatesByKey(X.schema)}function M(){var X,fe;for(let G of _){const ce=j.findByKey(g,"name",G.name)||j.findByKey(g,"id",G.id);if(!ce)continue;const ge=G.id,Me=ce.id;G.id=Me;const qe=Array.isArray(ce.schema)?ce.schema:[],He=Array.isArray(G.schema)?G.schema:[];for(const we of He){const Ce=j.findByKey(qe,"name",we.name);Ce&&Ce.id&&(we.id=Ce.id)}for(let we of _)if(Array.isArray(we.schema))for(let Ce of we.schema)(X=Ce.options)!=null&&X.collectionId&&((fe=Ce.options)==null?void 0:fe.collectionId)===ge&&(Ce.options.collectionId=Me)}t(0,p=JSON.stringify(_,null,4))}function O(X){t(12,m=!0);const fe=new FileReader;fe.onload=async G=>{t(12,m=!1),t(10,f.value="",f),t(0,p=G.target.result),await ln(),_.length||(hl("Invalid collections configuration."),I())},fe.onerror=G=>{console.warn(G),hl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},fe.readAsText(X)}function I(){t(0,p=""),t(10,f.value="",f),dn({})}function L(X){se[X?"unshift":"push"](()=>{f=X,t(10,f)})}const F=()=>{f.files.length&&O(f.files[0])},R=()=>{f.click()};function N(){p=this.value,t(0,p)}function q(){b=this.checked,t(3,b)}const Y=()=>M(),B=()=>I(),Z=()=>d==null?void 0:d.show(g,_,b);function ee(X){se[X?"unshift":"push"](()=>{d=X,t(11,d)})}const ie=()=>I();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof p<"u"&&D(),n.$$.dirty[0]&3&&t(6,i=!!p&&_.length&&_.length===_.filter(X=>!!X.id&&!!X.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(X=>i&&b&&!j.findByKey(_,"id",X.id))),n.$$.dirty[0]&70&&t(8,l=_.filter(X=>i&&!j.findByKey(g,"id",X.id))),n.$$.dirty[0]&10&&(typeof _<"u"||typeof b<"u")&&C(),n.$$.dirty[0]&785&&t(7,o=!!p&&(s.length||l.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!$&&i&&o),n.$$.dirty[0]&6&&t(13,a=_.filter(X=>{let fe=j.findByKey(g,"name",X.name)||j.findByKey(g,"id",X.id);if(!fe)return!1;if(fe.id!=X.id)return!0;const G=Array.isArray(fe.schema)?fe.schema:[],ce=Array.isArray(X.schema)?X.schema:[];for(const ge of ce){if(j.findByKey(G,"id",ge.id))continue;const qe=j.findByKey(G,"name",ge.name);if(qe&&ge.id!=qe.id)return!0}return!1}))},[p,_,g,b,k,$,i,o,l,s,f,d,m,a,r,u,M,O,I,L,F,R,N,q,Y,B,Z,ee,ie]}class xA extends ve{constructor(e){super(),be(this,e,QA,XA,_e,{},null,[-1,-1])}}const Vt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Li("/"):!0}],eI={"/login":Rt({component:YE,conditions:Vt.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Rt({asyncComponent:()=>rt(()=>import("./PageAdminRequestPasswordReset-874c1447.js"),[],import.meta.url),conditions:Vt.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Rt({asyncComponent:()=>rt(()=>import("./PageAdminConfirmPasswordReset-155951ba.js"),[],import.meta.url),conditions:Vt.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Rt({component:_E,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Rt({component:u$,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Rt({component:n6,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Rt({component:VE,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Rt({component:V6,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Rt({component:nA,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Rt({component:vA,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Rt({component:OA,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Rt({component:LA,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Rt({component:xA,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-a2b650c0.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-a2b650c0.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-5fcbd066.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-5fcbd066.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-3c9392e7.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-3c9392e7.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":Rt({asyncComponent:()=>rt(()=>import("./PageOAuth2Redirect-213658ff.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"*":Rt({component:Ay,userData:{showAppSidebar:!1}})};function tI(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:d=m=>Math.sqrt(m)*120,easing:p=Yo}=i;return{delay:f,duration:Ut(d)?d(Math.sqrt(a*a+u*u)):d,easing:p,css:(m,_)=>{const g=_*a,b=_*u,k=m+_*e.width/t.width,$=m+_*e.height/t.height;return`transform: ${l} translate(${g}px, ${b}px) scale(${k}, ${$});`}}}function E_(n,e,t){const i=n.slice();return i[2]=e[t],i}function nI(n){let e;return{c(){e=y("i"),h(e,"class","ri-alert-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function iI(n){let e;return{c(){e=y("i"),h(e,"class","ri-error-warning-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function sI(n){let e;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function lI(n){let e;return{c(){e=y("i"),h(e,"class","ri-information-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function A_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,d,p,m=Q,_,g,b;function k(D,M){return D[2].type==="info"?lI:D[2].type==="success"?sI:D[2].type==="warning"?iI:nI}let $=k(e),T=$(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=y("div"),i=y("div"),T.c(),s=E(),l=y("div"),r=U(o),a=E(),u=y("button"),u.innerHTML='',f=E(),h(i,"class","icon"),h(l,"class","content"),h(u,"type","button"),h(u,"class","close"),h(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(D,M){S(D,t,M),v(t,i),T.m(i,null),v(t,s),v(t,l),v(l,r),v(t,a),v(t,u),v(t,f),_=!0,g||(b=J(u,"click",ft(C)),g=!0)},p(D,M){e=D,$!==($=k(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!_||M&1)&&o!==(o=e[2].message+"")&&le(r,o),(!_||M&1)&&x(t,"alert-info",e[2].type=="info"),(!_||M&1)&&x(t,"alert-success",e[2].type=="success"),(!_||M&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||M&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){p=t.getBoundingClientRect()},f(){Eb(t),m(),H_(t,p)},a(){m(),m=Db(t,p,tI,{duration:150})},i(D){_||(nt(()=>{_&&(d||(d=Ve(t,yo,{duration:150},!0)),d.run(1))}),_=!0)},o(D){d||(d=Ve(t,yo,{duration:150},!1)),d.run(0),_=!1},d(D){D&&w(t),T.d(),D&&d&&d.end(),g=!1,b()}}}function oI(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=>xg(l)]}class aI extends ve{constructor(e){super(),be(this,e,rI,oI,_e,{})}}function uI(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=y("h4"),i=U(t),h(e,"class","block center txt-break"),h(e,"slot","header")},m(l,o){S(l,e,o),v(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 fI(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=y("span"),t.textContent="No",i=E(),s=y("button"),l=y("span"),l.textContent="Yes",h(t,"class","txt"),e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],x(s,"btn-loading",n[2])},m(a,u){S(a,e,u),v(e,t),S(a,i,u),S(a,s,u),v(s,l),e.focus(),o||(r=[J(e,"click",n[4]),J(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,De(r)}}}function cI(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:[fI],header:[uI]},$$scope:{ctx:n}};return e=new pn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){z(e.$$.fragment)},m(s,l){V(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||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),H(e,s)}}}function dI(n,e,t){let i;Ke(n,su,d=>t(1,i=d));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(d){se[d?"unshift":"push"](()=>{s=d,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await ln(),t(3,o=!1),nb()};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 pI extends ve{constructor(e){super(),be(this,e,dI,cI,_e,{})}}function I_(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$;return g=new Bn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[mI]},$$scope:{ctx:n}}}),{c(){var T;e=y("aside"),t=y("a"),t.innerHTML='PocketBase logo',i=E(),s=y("nav"),l=y("a"),l.innerHTML='',o=E(),r=y("a"),r.innerHTML='',a=E(),u=y("a"),u.innerHTML='',f=E(),d=y("figure"),p=y("img"),_=E(),z(g.$$.fragment),h(t,"href","/"),h(t,"class","logo logo-sm"),h(l,"href","/collections"),h(l,"class","menu-item"),h(l,"aria-label","Collections"),h(r,"href","/logs"),h(r,"class","menu-item"),h(r,"aria-label","Logs"),h(u,"href","/settings"),h(u,"class","menu-item"),h(u,"aria-label","Settings"),h(s,"class","main-menu"),Dn(p.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||h(p,"src",m),h(p,"alt","Avatar"),h(d,"class","thumb thumb-circle link-hint closable"),h(e,"class","app-sidebar")},m(T,C){S(T,e,C),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(e,f),v(e,d),v(d,p),v(d,_),V(g,d,null),b=!0,k||($=[Ee(an.call(null,t)),Ee(an.call(null,l)),Ee(Yn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ee(Ue.call(null,l,{text:"Collections",position:"right"})),Ee(an.call(null,r)),Ee(Yn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ee(Ue.call(null,r,{text:"Logs",position:"right"})),Ee(an.call(null,u)),Ee(Yn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ee(Ue.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p(T,C){var M;(!b||C&1&&!Dn(p.src,m="./images/avatars/avatar"+(((M=T[0])==null?void 0:M.avatar)||0)+".svg"))&&h(p,"src",m);const D={};C&4096&&(D.$$scope={dirty:C,ctx:T}),g.$set(D)},i(T){b||(A(g.$$.fragment,T),b=!0)},o(T){P(g.$$.fragment,T),b=!1},d(T){T&&w(e),H(g),k=!1,De($)}}}function mI(n){let e,t,i,s,l,o,r;return{c(){e=y("a"),e.innerHTML=` + to.
    `,l=E(),o=y("button"),o.innerHTML='Replace with original ids',h(t,"class","icon"),h(s,"class","content"),h(o,"type","button"),h(o,"class","btn btn-warning btn-sm btn-outline"),h(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),r||(a=J(o,"click",n[24]),r=!0)},p:Q,d(u){u&&w(e),r=!1,a()}}}function E_(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='Clear',h(e,"type","button"),h(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(s){s&&w(e),t=!1,i()}}}function QA(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[GA,ZA],_=[];function g(b,k){return b[5]?0:1}return f=g(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[15]),r=E(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(b,r,k),S(b,a,k),v(a,u),_[f].m(u,null),p=!0},p(b,k){(!p||k[0]&32768)&&le(o,b[15]);let $=f;f=g(b),f===$?_[f].p(b,k):(re(),P(_[$],1,1,()=>{_[$]=null}),ae(),d=_[f],d?d.p(b,k):(d=_[f]=m[f](b),d.c()),A(d,1),d.m(u,null))},i(b){p||(A(d),p=!0)},o(b){P(d),p=!1},d(b){b&&w(e),b&&w(r),b&&w(a),_[f].d()}}}function xA(n){let e,t,i,s,l,o;e=new qi({}),i=new In({props:{$$slots:{default:[QA]},$$scope:{ctx:n}}});let r={};return l=new JA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(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 d={};l.$set(d)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[27](null),H(l,a)}}}function eI(n,e,t){let i,s,l,o,r,a,u;Ke(n,Lt,X=>t(15,u=X)),sn(Lt,u="Import collections",u);let f,d,p="",m=!1,_=[],g=[],b=!0,k=[],$=!1;T();async function T(){t(5,$=!0);try{t(2,g=await me.collections.getFullList(200));for(let X of g)delete X.created,delete X.updated}catch(X){me.errorResponseHandler(X)}t(5,$=!1)}function C(){if(t(4,k=[]),!!i)for(let X of _){const fe=j.findByKey(g,"id",X.id);!(fe!=null&&fe.id)||!j.hasCollectionChanges(fe,X,b)||k.push({new:X,old:fe})}}function D(){t(1,_=[]);try{t(1,_=JSON.parse(p))}catch{}Array.isArray(_)?t(1,_=j.filterDuplicatesByKey(_)):t(1,_=[]);for(let X of _)delete X.created,delete X.updated,X.schema=j.filterDuplicatesByKey(X.schema)}function M(){var X,fe;for(let G of _){const ce=j.findByKey(g,"name",G.name)||j.findByKey(g,"id",G.id);if(!ce)continue;const ge=G.id,Me=ce.id;G.id=Me;const qe=Array.isArray(ce.schema)?ce.schema:[],He=Array.isArray(G.schema)?G.schema:[];for(const we of He){const Ce=j.findByKey(qe,"name",we.name);Ce&&Ce.id&&(we.id=Ce.id)}for(let we of _)if(Array.isArray(we.schema))for(let Ce of we.schema)(X=Ce.options)!=null&&X.collectionId&&((fe=Ce.options)==null?void 0:fe.collectionId)===ge&&(Ce.options.collectionId=Me)}t(0,p=JSON.stringify(_,null,4))}function O(X){t(12,m=!0);const fe=new FileReader;fe.onload=async G=>{t(12,m=!1),t(10,f.value="",f),t(0,p=G.target.result),await ln(),_.length||(hl("Invalid collections configuration."),I())},fe.onerror=G=>{console.warn(G),hl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},fe.readAsText(X)}function I(){t(0,p=""),t(10,f.value="",f),dn({})}function L(X){se[X?"unshift":"push"](()=>{f=X,t(10,f)})}const F=()=>{f.files.length&&O(f.files[0])},R=()=>{f.click()};function N(){p=this.value,t(0,p)}function q(){b=this.checked,t(3,b)}const Y=()=>M(),B=()=>I(),Z=()=>d==null?void 0:d.show(g,_,b);function ee(X){se[X?"unshift":"push"](()=>{d=X,t(11,d)})}const ie=()=>I();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof p<"u"&&D(),n.$$.dirty[0]&3&&t(6,i=!!p&&_.length&&_.length===_.filter(X=>!!X.id&&!!X.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(X=>i&&b&&!j.findByKey(_,"id",X.id))),n.$$.dirty[0]&70&&t(8,l=_.filter(X=>i&&!j.findByKey(g,"id",X.id))),n.$$.dirty[0]&10&&(typeof _<"u"||typeof b<"u")&&C(),n.$$.dirty[0]&785&&t(7,o=!!p&&(s.length||l.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!$&&i&&o),n.$$.dirty[0]&6&&t(13,a=_.filter(X=>{let fe=j.findByKey(g,"name",X.name)||j.findByKey(g,"id",X.id);if(!fe)return!1;if(fe.id!=X.id)return!0;const G=Array.isArray(fe.schema)?fe.schema:[],ce=Array.isArray(X.schema)?X.schema:[];for(const ge of ce){if(j.findByKey(G,"id",ge.id))continue;const qe=j.findByKey(G,"name",ge.name);if(qe&&ge.id!=qe.id)return!0}return!1}))},[p,_,g,b,k,$,i,o,l,s,f,d,m,a,r,u,M,O,I,L,F,R,N,q,Y,B,Z,ee,ie]}class tI extends ve{constructor(e){super(),be(this,e,eI,xA,_e,{},null,[-1,-1])}}const Vt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Li("/"):!0}],nI={"/login":Rt({component:JE,conditions:Vt.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Rt({asyncComponent:()=>rt(()=>import("./PageAdminRequestPasswordReset-15f3c583.js"),[],import.meta.url),conditions:Vt.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Rt({asyncComponent:()=>rt(()=>import("./PageAdminConfirmPasswordReset-a37f07c4.js"),[],import.meta.url),conditions:Vt.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Rt({component:bE,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Rt({component:f$,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Rt({component:s6,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Rt({component:zE,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Rt({component:z6,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Rt({component:sA,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Rt({component:kA,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Rt({component:EA,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Rt({component:FA,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Rt({component:tI,conditions:Vt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-bcc17010.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-bcc17010.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-71878ead.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-71878ead.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-39094301.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Rt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-39094301.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":Rt({asyncComponent:()=>rt(()=>import("./PageOAuth2Redirect-9cc021cb.js"),[],import.meta.url),conditions:Vt,userData:{showAppSidebar:!1}}),"*":Rt({component:Iy,userData:{showAppSidebar:!1}})};function iI(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:d=m=>Math.sqrt(m)*120,easing:p=Yo}=i;return{delay:f,duration:Ut(d)?d(Math.sqrt(a*a+u*u)):d,easing:p,css:(m,_)=>{const g=_*a,b=_*u,k=m+_*e.width/t.width,$=m+_*e.height/t.height;return`transform: ${l} translate(${g}px, ${b}px) scale(${k}, ${$});`}}}function A_(n,e,t){const i=n.slice();return i[2]=e[t],i}function sI(n){let e;return{c(){e=y("i"),h(e,"class","ri-alert-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function lI(n){let e;return{c(){e=y("i"),h(e,"class","ri-error-warning-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function oI(n){let e;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function rI(n){let e;return{c(){e=y("i"),h(e,"class","ri-information-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function I_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,d,p,m=Q,_,g,b;function k(D,M){return D[2].type==="info"?rI:D[2].type==="success"?oI:D[2].type==="warning"?lI:sI}let $=k(e),T=$(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=y("div"),i=y("div"),T.c(),s=E(),l=y("div"),r=U(o),a=E(),u=y("button"),u.innerHTML='',f=E(),h(i,"class","icon"),h(l,"class","content"),h(u,"type","button"),h(u,"class","close"),h(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(D,M){S(D,t,M),v(t,i),T.m(i,null),v(t,s),v(t,l),v(l,r),v(t,a),v(t,u),v(t,f),_=!0,g||(b=J(u,"click",ft(C)),g=!0)},p(D,M){e=D,$!==($=k(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!_||M&1)&&o!==(o=e[2].message+"")&&le(r,o),(!_||M&1)&&x(t,"alert-info",e[2].type=="info"),(!_||M&1)&&x(t,"alert-success",e[2].type=="success"),(!_||M&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||M&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){p=t.getBoundingClientRect()},f(){Ab(t),m(),z_(t,p)},a(){m(),m=Eb(t,p,iI,{duration:150})},i(D){_||(nt(()=>{_&&(d||(d=Ve(t,yo,{duration:150},!0)),d.run(1))}),_=!0)},o(D){d||(d=Ve(t,yo,{duration:150},!1)),d.run(0),_=!1},d(D){D&&w(t),T.d(),D&&d&&d.end(),g=!1,b()}}}function aI(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=>e1(l)]}class fI extends ve{constructor(e){super(),be(this,e,uI,aI,_e,{})}}function cI(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=y("h4"),i=U(t),h(e,"class","block center txt-break"),h(e,"slot","header")},m(l,o){S(l,e,o),v(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 dI(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=y("span"),t.textContent="No",i=E(),s=y("button"),l=y("span"),l.textContent="Yes",h(t,"class","txt"),e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],x(s,"btn-loading",n[2])},m(a,u){S(a,e,u),v(e,t),S(a,i,u),S(a,s,u),v(s,l),e.focus(),o||(r=[J(e,"click",n[4]),J(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,De(r)}}}function pI(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:[dI],header:[cI]},$$scope:{ctx:n}};return e=new pn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){z(e.$$.fragment)},m(s,l){V(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||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),H(e,s)}}}function mI(n,e,t){let i;Ke(n,su,d=>t(1,i=d));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(d){se[d?"unshift":"push"](()=>{s=d,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await ln(),t(3,o=!1),ib()};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 hI extends ve{constructor(e){super(),be(this,e,mI,pI,_e,{})}}function P_(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$;return g=new Bn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[_I]},$$scope:{ctx:n}}}),{c(){var T;e=y("aside"),t=y("a"),t.innerHTML='PocketBase logo',i=E(),s=y("nav"),l=y("a"),l.innerHTML='',o=E(),r=y("a"),r.innerHTML='',a=E(),u=y("a"),u.innerHTML='',f=E(),d=y("figure"),p=y("img"),_=E(),z(g.$$.fragment),h(t,"href","/"),h(t,"class","logo logo-sm"),h(l,"href","/collections"),h(l,"class","menu-item"),h(l,"aria-label","Collections"),h(r,"href","/logs"),h(r,"class","menu-item"),h(r,"aria-label","Logs"),h(u,"href","/settings"),h(u,"class","menu-item"),h(u,"aria-label","Settings"),h(s,"class","main-menu"),Dn(p.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||h(p,"src",m),h(p,"alt","Avatar"),h(d,"class","thumb thumb-circle link-hint closable"),h(e,"class","app-sidebar")},m(T,C){S(T,e,C),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(e,f),v(e,d),v(d,p),v(d,_),V(g,d,null),b=!0,k||($=[Ee(an.call(null,t)),Ee(an.call(null,l)),Ee(Yn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ee(Ue.call(null,l,{text:"Collections",position:"right"})),Ee(an.call(null,r)),Ee(Yn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ee(Ue.call(null,r,{text:"Logs",position:"right"})),Ee(an.call(null,u)),Ee(Yn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ee(Ue.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p(T,C){var M;(!b||C&1&&!Dn(p.src,m="./images/avatars/avatar"+(((M=T[0])==null?void 0:M.avatar)||0)+".svg"))&&h(p,"src",m);const D={};C&4096&&(D.$$scope={dirty:C,ctx:T}),g.$set(D)},i(T){b||(A(g.$$.fragment,T),b=!0)},o(T){P(g.$$.fragment,T),b=!1},d(T){T&&w(e),H(g),k=!1,De($)}}}function _I(n){let e,t,i,s,l,o,r;return{c(){e=y("a"),e.innerHTML=` Manage admins`,t=E(),i=y("hr"),s=E(),l=y("button"),l.innerHTML=` - Logout`,h(e,"href","/settings/admins"),h(e,"class","dropdown-item closable"),h(l,"type","button"),h(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=[Ee(an.call(null,e)),J(l,"click",n[7])],o=!0)},p:Q,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,De(r)}}}function P_(n){let e,t,i;return t=new uu({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tinymce-preloader hidden")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p:Q,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function hI(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=((b=n[0])==null?void 0:b.id)&&n[1]&&I_(n);o=new Wb({props:{routes:eI}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new aI({}),f=new pI({});let g=n[1]&&!n[2]&&P_(n);return{c(){t=E(),i=y("div"),_&&_.c(),s=E(),l=y("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),d=E(),g&&g.c(),p=Se(),h(l,"class","app-body"),h(i,"class","app-layout")},m(k,$){S(k,t,$),S(k,i,$),_&&_.m(i,null),v(i,s),v(i,l),V(o,l,null),v(l,r),V(a,l,null),S(k,u,$),V(f,k,$),S(k,d,$),g&&g.m(k,$),S(k,p,$),m=!0},p(k,[$]){var T;(!m||$&24)&&e!==(e=j.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),(T=k[0])!=null&&T.id&&k[1]?_?(_.p(k,$),$&3&&A(_,1)):(_=I_(k),_.c(),A(_,1),_.m(i,s)):_&&(re(),P(_,1,1,()=>{_=null}),ae()),k[1]&&!k[2]?g?(g.p(k,$),$&6&&A(g,1)):(g=P_(k),g.c(),A(g,1),g.m(p.parentNode,p)):g&&(re(),P(g,1,1,()=>{g=null}),ae())},i(k){m||(A(_),A(o.$$.fragment,k),A(a.$$.fragment,k),A(f.$$.fragment,k),A(g),m=!0)},o(k){P(_),P(o.$$.fragment,k),P(a.$$.fragment,k),P(f.$$.fragment,k),P(g),m=!1},d(k){k&&w(t),k&&w(i),_&&_.d(),H(o),H(a),k&&w(u),H(f,k),k&&w(d),g&&g.d(k),k&&w(p)}}}function _I(n,e,t){let i,s,l,o;Ke(n,Os,g=>t(10,i=g)),Ke(n,wo,g=>t(3,s=g)),Ke(n,Ia,g=>t(0,l=g)),Ke(n,Lt,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var b,k,$,T;((b=g==null?void 0:g.detail)==null?void 0:b.location)!==r&&(t(1,a=!!(($=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&$.showAppSidebar)),r=(T=g==null?void 0:g.detail)==null?void 0:T.location,sn(Lt,o="",o),dn({}),nb())}function d(){Li("/")}async function p(){var g,b;if(l!=null&&l.id)try{const k=await me.settings.getAll({$cancelKey:"initialAppSettings"});sn(wo,s=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",s),sn(Os,i=!!((b=k==null?void 0:k.meta)!=null&&b.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){me.logout()}const _=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&p()},[l,a,u,s,o,f,d,m,_]}class gI extends ve{constructor(e){super(),be(this,e,_I,hI,_e,{})}}new gI({target:document.getElementById("app")});export{De as A,Jt as B,j as C,Li as D,Se as E,e1 as F,X_ as G,xt as H,Ke as I,si as J,kt as K,se as L,x1 as M,yt as N,ls as O,Zt as P,dt as Q,kn as R,ve as S,qr as T,Vo as _,P as a,E as b,z as c,H as d,y as e,h as f,S as g,v as h,be as i,Ee as j,re as k,an as l,V as m,ae as n,w as o,me as p,de as q,x as r,_e as s,A as t,J as u,ft as v,U as w,le as x,Q as y,ue as z}; + Logout`,h(e,"href","/settings/admins"),h(e,"class","dropdown-item closable"),h(l,"type","button"),h(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=[Ee(an.call(null,e)),J(l,"click",n[7])],o=!0)},p:Q,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,De(r)}}}function L_(n){let e,t,i;return t=new uu({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tinymce-preloader hidden")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p:Q,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function gI(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=((b=n[0])==null?void 0:b.id)&&n[1]&&P_(n);o=new Yb({props:{routes:nI}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new fI({}),f=new hI({});let g=n[1]&&!n[2]&&L_(n);return{c(){t=E(),i=y("div"),_&&_.c(),s=E(),l=y("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),d=E(),g&&g.c(),p=Se(),h(l,"class","app-body"),h(i,"class","app-layout")},m(k,$){S(k,t,$),S(k,i,$),_&&_.m(i,null),v(i,s),v(i,l),V(o,l,null),v(l,r),V(a,l,null),S(k,u,$),V(f,k,$),S(k,d,$),g&&g.m(k,$),S(k,p,$),m=!0},p(k,[$]){var T;(!m||$&24)&&e!==(e=j.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),(T=k[0])!=null&&T.id&&k[1]?_?(_.p(k,$),$&3&&A(_,1)):(_=P_(k),_.c(),A(_,1),_.m(i,s)):_&&(re(),P(_,1,1,()=>{_=null}),ae()),k[1]&&!k[2]?g?(g.p(k,$),$&6&&A(g,1)):(g=L_(k),g.c(),A(g,1),g.m(p.parentNode,p)):g&&(re(),P(g,1,1,()=>{g=null}),ae())},i(k){m||(A(_),A(o.$$.fragment,k),A(a.$$.fragment,k),A(f.$$.fragment,k),A(g),m=!0)},o(k){P(_),P(o.$$.fragment,k),P(a.$$.fragment,k),P(f.$$.fragment,k),P(g),m=!1},d(k){k&&w(t),k&&w(i),_&&_.d(),H(o),H(a),k&&w(u),H(f,k),k&&w(d),g&&g.d(k),k&&w(p)}}}function bI(n,e,t){let i,s,l,o;Ke(n,Os,g=>t(10,i=g)),Ke(n,wo,g=>t(3,s=g)),Ke(n,Ia,g=>t(0,l=g)),Ke(n,Lt,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var b,k,$,T;((b=g==null?void 0:g.detail)==null?void 0:b.location)!==r&&(t(1,a=!!(($=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&$.showAppSidebar)),r=(T=g==null?void 0:g.detail)==null?void 0:T.location,sn(Lt,o="",o),dn({}),ib())}function d(){Li("/")}async function p(){var g,b;if(l!=null&&l.id)try{const k=await me.settings.getAll({$cancelKey:"initialAppSettings"});sn(wo,s=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",s),sn(Os,i=!!((b=k==null?void 0:k.meta)!=null&&b.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){me.logout()}const _=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&p()},[l,a,u,s,o,f,d,m,_]}class vI extends ve{constructor(e){super(),be(this,e,bI,gI,_e,{})}}new vI({target:document.getElementById("app")});export{De as A,Jt as B,j as C,Li as D,Se as E,t1 as F,Q_ as G,xt as H,Ke as I,si as J,kt as K,se as L,eb as M,yt as N,ls as O,Zt as P,dt as Q,kn as R,ve as S,qr as T,Vo as _,P as a,E as b,z as c,H as d,y as e,h as f,S as g,v as h,be as i,Ee as j,re as k,an as l,V as m,ae as n,w as o,me as p,de as q,x as r,_e as s,A as t,J as u,ft as v,U as w,le as x,Q as y,ue as z}; diff --git a/ui/dist/assets/index-6f704b4c.js b/ui/dist/assets/index-6f704b4c.js deleted file mode 100644 index 47f93e5b..00000000 --- a/ui/dist/assets/index-6f704b4c.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 ni(this),r=new ni(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 ni(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=Ga(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=Ki(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=Ki(this.text,Ki(i.text,vr(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=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 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,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 qe(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 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 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 qe)for(let m of d.children)f(m);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]:qe.from(c,a)),a=-1,h=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 Ga(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Ki(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 ni(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()},ni.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 ue(n,e,t=!0,i=!0){return(t?ll:Xa)(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=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 Xa(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 ne(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 js(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 es=/\r\n?|\n/;var ce=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(ce||(ce={}));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!=ce.Simple&&a>=e&&(i==ce.TrackDel&&se||i==ce.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 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 ts(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return is(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&&it(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||es)):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 a(e),h(!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++],h=n.sections[o++];e(s,a,r,c,f),s=a,r=c}}}function is(n,e,t,i=!1){let s=[],r=i?[]:null,o=new oi(n),l=new oi(e);for(let h=-1;;)if(o.ins==-1&&l.ins==-1){let a=Math.min(o.len,l.len);ae(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 oi{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 y.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return y.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 y.range(e.anchor,e.head)}static create(e,t,i){return new gt(e,t,i)}}class y{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:y.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 y(e.ranges.map(t=>gt.fromJSON(t)),e.main)}static single(e,t=e){return new y([y.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?y.range(h,l):y.range(l,h))}}return new y(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 Us=0;class D{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Us++,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:Gs),!!e.static,e.enables)}of(e){return new ji([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ji(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ji(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Gs(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class ji{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Us++}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)||ns(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=Qi(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[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 Jt(n){return e=>new ul(e,n)}const Ct={highest:Jt(pt.highest),high:Jt(pt.high),default:Jt(pt.default),low:Jt(pt.low),lowest:Jt(pt.lowest)};class ul{constructor(e,t){this.inner=e,this.prec=t}}class kn{of(e){return new ss(this,e)}reconfigure(e){return kn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ss{constructor(e,t){this.compartment=e,this.inner=t}}class Yi{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 Qa(e,t,o))u instanceof be?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,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=h.length<<1|1,Gs(m,d))h.push(i.facet(p));else{let g=p.combine(d.map(b=>b.value));h.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=h.length<<1|1,h.push(g.value)):(l[g.id]=a.length<<1,a.push(b=>g.dynamicSlot(b)));l[p.id]=a.length<<1,a.push(g=>Ya(g,p,d))}}let f=a.map(u=>u(l));return new Yi(e,o,f,l,h,r)}}function Qa(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 ss&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let a of o)r(a,l);else if(o instanceof ss){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 be)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof ji)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 si(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 Qi(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 Za}}class Za{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=Sl(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,rs(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 os;try{os=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function oc(n){if(os)return os.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(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=Yi.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:y.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:y.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Yi.resolve(e.extensions||[],new Map),i=e.doc instanceof I?e.doc:I.of((e.doc||"").split(t.staticFacet(N.lineSeparator)||es)),s=e.selection?e.selection instanceof y?e.selection:y.single(e.selection.anchor,e.selection.head):y.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 h=ue(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=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;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 ls.create(e,t,this)}}wt.prototype.startSide=wt.prototype.endSide=0;wt.prototype.point=!1;wt.prototype.mapMode=ce.TrackDel;let ls=class kl{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new kl(e,t,i)}};function hs(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Js{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 Js(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(hs)),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 li.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return li.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 _t(o,h,r),c=new _t(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 _t(r,l,0).goto(i),a=new _t(o,l,0).goto(i);for(;;){if(h.to!=a.to||!as(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 _t(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 ls?[e]:t?hc(e):e)i.add(s.from,s.to,s.value);return i.finish()}}j.empty=new j([],[],null,-1);function hc(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(hs);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 Js(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 li(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--)In(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--)In(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(),In(this.heap,0)}}}function In(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 _t{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=li.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){Ci(this.active,e),Ci(this.activeTo,e),Ci(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&&Ci(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))&&as(n.activeForPoint(n.to+h),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,a<=0&&n.next(),a>=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 fs="ͼ",Pr=typeof Symbol>"u"?"__"+fs:Symbol.for(fs),us=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,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(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),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,m=>"-"+m.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,fs+e.toString(36)}static mount(e,t){(e[us]||new ac(e)).mount(Array.isArray(t)?t:[t])}}let Mi=null;class ac{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(Mi)return e.adoptedStyleSheets=[Mi.sheet,...e.adoptedStyleSheets],e[us]=Mi;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Mi=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[us]=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),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++)ht[48+se]=ht[96+se]=String(se);for(var se=1;se<=24;se++)ht[se+111]="F"+se;for(var se=65;se<=90;se++)ht[se]=String.fromCharCode(se+32),hi[se]=String.fromCharCode(se);for(var Nn in ht)hi.hasOwnProperty(Nn)||(hi[Nn]=ht[Nn]);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?hi:ht)[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 Zi(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 Ui(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 en(n,e,t,i){return t?Er(n,e,t,i,-1)||Er(n,e,t,i,1):!1}function tn(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:ci(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=tn(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?ci(n):0}else return!1}}function ci(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const Cl={left:0,right:0,top:0,bottom:0};function _s(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 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=gc(a);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,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=Xs){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 M={mac:Wr||/Mac/.test(Ae.platform),windows:/Win/.test(Ae.platform),linux:/Linux|X11/.test(Ae.platform),ie:vn,ie_version:Bl?ds.documentMode||6:gs?+gs[1]:ps?+ps[1]:0,gecko:Fr,gecko_version:Fr?+(/Firefox\/(\d+)/.exec(Ae.userAgent)||[0,0])[1]:0,chrome:!!Fn,chrome_version:Fn?+Fn[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:ds.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Sc=256;class at 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 at)||this.length-(t-e)+i.length>Sc)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new at(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 re(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 ms(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=h,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 ms(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&&h.width==0&&(h=Array.prototype.find.call(l,a=>a.width)||h),o?_s(h,o<0):h||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:_s(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?ys(e,0,t,i,(s,r)=>s.domAtPos(r),s=>new re(i,Math.min(s,i.nodeValue.length))):new re(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?ys(e,t,i,s,(r,o,l)=>r.coordsAt(o,l),(r,o)=>ms(s,r,o)):ms(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 ys(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 h=Ft(o,i),a=l.length+(h?i.nodeValue.length:0);if(n0?re.before(this.dom):re.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){let t=this.dom.getBoundingClientRect(),i=kc(this,this.side>0?-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}}at.prototype.children=nt.prototype.children=Wt.prototype.children=Xs;function kc(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(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 St(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 St(e,i,s,t,e.widget||null,!0)}static line(e){return new wi(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 Cn 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 Cn&&this.tagName==e.tagName&&this.class==e.class&&Ys(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)}}Cn.prototype.point=!1;class wi extends B{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof wi&&this.spec.class==e.spec.class&&Ys(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)}}wi.prototype.mapMode=ce.TrackBefore;wi.prototype.point=!0;class St 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?ce.TrackBefore:ce.TrackAfter:ce.TrackDel}get type(){return this.startSide=5}eq(e){return e instanceof St&&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)}}St.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 xs(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){Ys(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=bs(t,this.attrs||{})),i&&(this.attrs=bs({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&&(ws(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 at))){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,t;for(let i of this.children){if(!(i instanceof at)||/[^ -~]/.test(i.text))return null;let s=ai(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=Nl(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=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(Di(new at(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 St){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 St)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=nt.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(Di(new Wt(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Di(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 Qs(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 Di(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(),Ss=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 nn{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 nn(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 An=D.define({combine:n=>n.length?n[0]:!0});let Ac=0;const Zt=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=[Zt.of(o)];return r&&l.push(fi.of(h=>{let a=h.plugin(o);return a?r(a):B.none})),s&&l.push(s(o)),l})}static fromClass(e,t){return ge.define(i=>new e(i),t)}}class Vn{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(),Zs=D.define(),fi=D.define(),Gl=D.define(),Jl=D.define(),ei=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(!h)return i;new Ge(h.fromA,h.toA,h.fromB,h.toB).addToSet(i),o=h.toA,l=h.toB}}}class sn{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,h)=>s.push(new Ge(r,o,l,h))),this.changedRanges=s}static create(e,t,i){return new sn(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,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==ks?1:2,s=e==ks?2:1;if(!n||i==1&&!Bc.test(n))return Xl(t);for(let o=0,l=i,h=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++]=a,Fe[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=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=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=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:h,toB:a}=r,{content:c,breakAtStart:f,openStart:u,openEnd:d}=Qs.build(this.view.state.doc,h,a,this.decorations,this.dynamicDecorationMap),{i:p,off:m}=i.findPos(l,1),{i:g,off:b}=i.findPos(o,-1);Ol(this,g,b,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 h=document.createTextNode("");this.view.observer.ignore(()=>r.node.insertBefore(h,r.node.childNodes[r.offset]||null)),r=o=new re(h,0),i=!0}let l=this.view.observer.selectionRange;(i||!l.focusNode||!en(r.node,r.offset,l.anchorNode,l.anchorOffset)||!en(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 h=Zi(this.view.root);if(h)if(s.empty){if(M.gecko){let a=Nc(r.node,r.offset);if(a&&a!=3){let c=eh(r.node,r.offset,a==1?1:-1);c&&(r=new re(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 re(l.anchorNode,l.anchorOffset),this.impreciseHead=o.precise?null:new re(l.focusNode,l.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let{view:e}=this,t=e.state.selection.main,i=Zi(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 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||Ui(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,m=p?ai(p):[];if(m.length){let g=m[m.length-1],b=h?g.right-d.left:d.right-g.left;b>l&&(l=b,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 r of this.children)if(r instanceof de){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;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 r=ai(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}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(fi).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};mc(this.view.scrollDOM,a,t.head0)i=i.childNodes[s-1],s=ci(i);else break}if(t>=0)for(let i=n,s=e;;){if(i.nodeType==3)return i;if(i.nodeType==1&&s=0)i=i.childNodes[s],s=0;else break}return null}function Nc(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e0;){let a=ue(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 qc(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Wn(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 Cs(n,e,t){let i,s,r,o,l=!1,h,a,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let m=ai(p);for(let g=0;gA||o==A&&r>k){i=p,s=b,r=k,o=A;let x=A?t0?g0)}k==0?t>b.bottom&&(!c||c.bottomb.top)&&(a=p,f=b):c&&Wn(c,b)?c=Gr(c,b.bottom):f&&Wn(f,b)&&(f=Ur(f,b.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 Cs(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 th(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,h,{docHeight:a}=n.viewState,{x:c,y:f}=e,u=f-l;if(u<0)return 0;if(u>a)return n.state.doc.length;for(let x=n.defaultLineHeight/2,S=!1;h=n.elementAtHeight(u),h.type!=z.Text;)for(;u=i>0?h.bottom+x:h.top-x,!(u>=0&&u<=a);){if(S)return t?null:0;S=!0,i=-i}f=l+u;let d=h.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:_r(n,o,h,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 b,k=-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:b,offset:k}=x)}else if(p.caretRangeFromPoint){let x=p.caretRangeFromPoint(c,f);x&&({startContainer:b,startOffset:k}=x,(!n.contentDOM.contains(b)||M.safari&&$c(b,k,c)||M.chrome&&Kc(b,k,c))&&(b=void 0))}}if(!b||!n.docView.dom.contains(b)){let x=de.find(n.docView,d);if(!x)return u>h.top+h.height/2?h.to:h.from;({node:b,offset:k}=Cs(x.dom,c,f))}let A=n.docView.nearest(b);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+cs(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 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 y.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 y.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=Rc(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=y.cursor(t?s.from:s.to)}if(h){if(!h(c))return l}else{if(!i)return a;h=i(c)}l=a}}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 y.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,m=th(n,{x:f,y:p},!1,r);if(ph.bottom||(r<0?ms))return y.cursor(m,e.assoc,void 0,o)}}function Hn(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?y.cursor(o,1):y.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)},As[i]),this.registeredEvents.push(i)}e.scrollDOM.addEventListener("mousedown",i=>{if(i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&(t(Z.mousedown,i),!i.defaultPrevented&&i.button==2)){let s=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=s,200)}}),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 ih=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],_c="dthko",nh=[16,17,18,20,91,92,224,225];function Oi(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)&&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=-Oi(r.left-e.clientX):e.clientX>=r.right&&(i=Oi(e.clientX-r.right)),e.clientY<=r.top?s=-Oi(r.top-e.clientY):e.clientY>=r.bottom&&(s=Oi(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=Zi(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),As=Object.create(null),sh=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(),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(Ms!=null&&t.selection.ranges.every(h=>h.empty)&&Ms==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:y.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:y.cursor(h.from+a.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():nh.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")};As.touchstart=As.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 y.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)=>oh(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&&oh(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 lh(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=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))?rf(s,a):l?s.addRange(a):y.create([a])}}}function rf(n,e){for(let t=0;;t++)if(n.ranges[t].eq(e))return y.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},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"})}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=sh?null:e.clipboardData;t?(rh(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 Ms=null;Z.copy=Z.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=lf(n.state);if(!t&&!s)return;Ms=s?t:null;let r=sh?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 hh=Qe.define();function ah(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:hh.of(!0)}):null}function ch(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=ah(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),ch(n)};Z.blur=n=>{n.observer.clearSelectionRange(),ch(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=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 hf{constructor(e){this.lineWrapping=e,this.doc=I.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,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,h=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,h){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)>Gi&&(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: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 Ce extends fh{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 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 Xe(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 Xe(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 Xe(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 Xe(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 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),h=-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++];h==-1?h=f:Math.abs(f-h)>=Gi&&(h=-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 a=pe.of(o);return(h<0||Math.abs(a.height-this.height)>=Gi||Math.abs(h-this.heightMetrics(e,t).perLine)>=Gi)&&(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 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 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?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,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 ie&&(i=n[e+1])instanceof ie&&n.splice(e-1,3,new ie(t.length+1+i.length))}const ff=5;class er{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),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 gf(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class zn{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 hf(t),this.stateDeco=e.facet(fi).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 Ti(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?ho: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:ti(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(fi).filter(a=>typeof a!="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 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?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&&(h=!0)),!this.inView&&!this.scrollTarget)return 0;let b=l.width;if((this.contentDOMWidth!=b||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,a|=8),h){let A=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(A)&&(o=!0),o||s.lineWrapping&&Math.abs(b-this.contentDOMWidth)>s.charWidth){let{lineHeight:x,charWidth:S,textHeight:v}=e.docView.measureTextSize();o=x>0&&s.refresh(r,x,S,v,b/S,A),o&&(e.docView.minWidth=0,a|=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 S=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 af(x.from,S))}s.heightChanged&&(a|=2)}let k=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return k&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(a&2||k)&&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 Ti(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&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-a)g.fromb));if(!m){if(cg.from<=c&&g.to>=c)){let g=t.moveToLineBoundary(y.cursor(c),!1,!0).head;g>a&&(c=g)}m=new zn(a,c,this.gapSize(f,a,c,u))}l.push(m)};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)||ti(this.heightMap.lineAt(e,H.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return ti(this.heightMap.lineAt(this.scaler.fromDOM(e),H.ByHeight,this.heightOracle,0,0),this.scaler)}elementAtHeight(e){return ti(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 Ti{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 Pi(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 ho={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: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=tti(s,e)):n.type)}const Ri=D.define({combine:n=>n.join(" ")}),Ds=D.define({combine:n=>n.indexOf(!0)>-1}),Os=lt.newName(),uh=lt.newName(),dh=lt.newName(),ph={"&light":"."+uh,"&dark":"."+dh};function Ts(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=Ts("."+Os,{"&":{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"}},ph);class Sf{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?[]:vf(e),h=new Ql(l,e.state);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=Cf(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=y.single(a,h)}}}function gh(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||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=y.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=y.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(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(m=>{if(m.from==s.from&&m.to==s.to)return{changes:a,range:c||m.map(a)};let g=m.to-d,b=g-f.length;if(m.to-m.from!=p||n.state.sliceDoc(b,g)!=f||u&&m.to>=u.from&&m.from<=u.to)return{range:m};let k=r.changes({from:b,to:g,insert:t.insert}),A=m.to-s.to;return{changes:k,range:c?y.range(Math.max(0,c.anchor+A),Math.max(0,c.head+A)):m.map(k)}})}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 kf(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 vf(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?y.single(t+e,i+e):null}const Af={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},qn=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()}),qn&&(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(An)?i.root.activeElement!=this.dom:!Ui(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&&en(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)||Zi(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=Ui(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&&Ui(this.dom,this.selectionRange);return e<0&&!s?null:(e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new Sf(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=gh(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 Df(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 en(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||wc(e.parent)||document,this.viewState=new lo(e.state||N.create(e)),this.plugins=this.state.facet(Zt).map(t=>new Vn(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,h=null;e.some(u=>u.annotation(hh))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,h=ah(r,o),h||(l=1));let a=this.observer.delayedAndroidKey,c=null;if(a?(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=sn.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 nn(d.empty?d:y.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=rn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ei)!=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(Ri)!=s.state.facet(Ri)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let u of this.state.facet(Ss))u(s);(h||c)&&Promise.resolve().then(()=>{h&&this.state==h.startState&&this.dispatch(h),c&&!gh(this,c)&&a.force&&Et(this.contentDOM,a.key,a.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(Zt).map(i=>new Vn(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(Zt),i=e.state.facet(Zt);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Vn(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 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(g=>{try{return g.read(this)}catch(b){return Ee(this.state,b),co}}),d=sn.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==h.from&&this.viewport.to==h.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(Ss))l(t)}get themeClasses(){return Os+" "+(this.state.facet(Ds)?dh:uh)+" "+this.state.facet(Ri)}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(An)?"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,Zs,t);let i=this.observer.ignore(()=>{let s=ws(this.contentDOM,this.contentAttrs,t),r=ws(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(ei),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 Hn(this,e,Xr(this,e,t,i))}moveByGroup(e,t){return Hn(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 Hn(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(),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 _s(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 rn(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 nn(typeof e=="number"?y.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=[Ri.of(i),ei.of(Ts(`.${i}`,e))];return t&&t.dark&&s.push(Ds.of(!0)),s}static baseTheme(e){return Ct.lowest(ei.of(Ts("."+Os,e,ph)))}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=ei;O.inputHandler=ql;O.focusChangeEffect=$l;O.perLineTextDirection=Kl;O.exceptionSink=zl;O.updateListener=Ss;O.editable=An;O.mouseSelectionStyle=Hl;O.dragMovesSelection=Wl;O.clickAddsSelectionRange=Vl;O.decorations=fi;O.atomicRanges=Gl;O.scrollMargins=Jl;O.darkTheme=Ds;O.contentAttributes=Zs;O.editorAttributes=Ul;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=E.define();const Of=4096,co={};class rn{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&&bs(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 h=0;hi.concat(s),[]))),t}function Rf(n,e,t){return yh(mh(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 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(g=>Bf(g,e));for(let g=1;g{let A=tt={view:k,prefix:b,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())||[]});h&&m.run.push(h),a&&(m.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 yh(n,e,t,i){let s=dc(e),r=ne(s,0),o=De(r)==s.length&&s!=" ",l="",h=!1;tt&&tt.view==t&&tt.scope==i&&(l=tt.prefix+" ",(h=nh.indexOf(e.keyCode)<0)&&(tt=null));let a=new Set,c=p=>{if(p){for(let m of p.run)if(!a.has(m)&&(a.add(m),m(t,e)))return!0;p.preventDefault&&(h=!0)}return!1},f=n[i],u,d;if(f){if(c(f[l+Li(s,e,!o)]))return!0;if(o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(M.windows&&e.ctrlKey&&e.altKey)&&(u=ht[e.keyCode])&&u!=s){if(c(f[l+Li(u,e,!0)]))return!0;if(e.shiftKey&&(d=hi[e.keyCode])!=s&&d!=u&&c(f[l+Li(d,e,!1)]))return!0}else if(o&&e.shiftKey&&c(f[l+Li(s,e,!0)]))return!0;if(c(f._any))return!0}return h}class xi{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=bh(e);return[new xi(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return If(e,t,i)}}function bh(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=y.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(),h=bh(n),a=o.querySelector(".cm-line"),c=a&&window.getComputedStyle(a),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 k(A(t.from,t.to,m));{let S=m?A(t.from,null,m):x(d,!1),v=g?A(null,t.to,g):x(p,!0),T=[];return(m||d).to<(g||p).from-1?T.push(b(f,S.bottom,u,v.top)):S.bottomX&&we.from=le)break;ee>te&&W(Math.max(_,te),S==null&&_<=X,Math.min(ee,le),v==null&&ee>=oe,xe.dir)}if(te=Ne.to+1,te>=le)break}return L.length==0&&W(X,S==null,oe,v==null,n.textDirection),{top:F,bottom:P,horizontal:L}}function x(S,v){let T=l.top+(v?S.top:S.bottom);return{top:T,bottom:T,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(Ji)!=e.state.facet(Ji)&&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(Ji);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 Ji=D.define();function wh(n){return[ge.define(e=>new Ff(e,n)),Ji.of(n)]}const xh=!M.ios,ui=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[ui.of(n),Vf,Wf,Hf,jl.of(!0)]}function Sh(n){return n.startState.facet(ui)!=n.state.facet(ui)}const Vf=wh({above:!0,markers(n){let{state:e}=n,t=e.facet(ui),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||xh:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:y.cursor(s.head,s.head>s.anchor?-1:1);for(let h of xi.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=Sh(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(ui).cursorBlinkRate+"ms"}const Wf=wh({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:xi.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Sh(n)},class:"cm-selectionLayer"}),kh={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};xh&&(kh[".cm-line"].caretColor="transparent !important");const Hf=Ct.highest(O.theme(kh)),vh=E.define({map(n,e){return n==null?null:e.mapPos(n)}}),ii=be.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(vh)?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(ii);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(ii)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let n=this.view.state.field(ii),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(ii)!=n&&this.view.dispatch({effects:vh.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[ii,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,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 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,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(b.range(m,g));if(h==a)for(this.regexp.lastIndex=c-h.from;(d=this.regexp.exec(h.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const Bs=/x/.unicode!=null?"gu":"g",Kf=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Bs),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 $n=null;function Uf(){var n;if($n==null&&typeof document<"u"&&document.body){let e=document.body.style;$n=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return $n||!1}const _i=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,Bs)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Bs)),e}});function Bg(n={}){return[_i.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(_i)),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,h=bi(o.text,l,i-o.from);return B.replace({widget:new Yf((l-h%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(_i);n.startState.facet(_i)!=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 Ps=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>Ps||t.off>Ps||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(y.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=cs(a.text,o,n.tabSize,!0);if(c<0)r.push(y.cursor(a.to));else{let f=cs(a.text,l,n.tabSize);r.push(y.range(a.from+c,a.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>Ps?-1:s==i.length?eu(n,e.clientX):bi(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 h=Zf(n.state,t,l);return h.length?o?y.create(h.concat(i.ranges)):y.create(h):i}}:null}function Rg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?tu(t,i):null)}const Ei="-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,Ch=ge.fromClass(class{constructor(n){this.view=n,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Kn);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,Ah,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(Kn);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=Ei,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(Kn).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=Ei;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,b=c.width>i.right-i.left?g?i.left:i.right-c.width:g?Math.min(a.left-(f?14:0)+m.x,i.right-d):Math.max(i.left,a.left-d+(f?14:0)-m.x),k=!!o.above;!o.strictSide&&(k?a.top-(c.bottom-c.top)-m.yi.bottom)&&k==i.bottom-a.bottom>a.top-i.top&&(k=!k);let A=(k?a.top-i.top:i.bottom-a.bottom)-u;if(Ab&&v.topx&&(x=k?v.top-p-2-u:v.bottom+u+2);this.position=="absolute"?(h.style.top=x-n.parent.top+"px",h.style.left=b-n.parent.left+"px"):(h.style.top=x+"px",h.style.left=b+"px"),f&&(f.style.left=`${a.left+(g?m.x:-m.x)-(b+14-7)}px`),l.overlap!==!0&&s.push({left:b,top:x,right:S,bottom:x+p}),h.classList.toggle("cm-tooltip-above",k),h.classList.toggle("cm-tooltip-below",!k),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=Ei}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),su=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:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px 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},Ah=D.define({enables:[Ch,su]});function ou(n,e){let t=n.plugin(Ch);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const So=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 on(n,e){let t=n.plugin(Mh),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Mh=ge.fromClass(class{constructor(n){this.input=n.state.facet(ln),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(So);this.top=new Ii(n,!0,e.topContainer),this.bottom=new Ii(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(So);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ii(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ii(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(ln);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 Ii{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=ko(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=ko(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 ko(n){let e=n.nextSibling;return n.remove(),e}const ln=D.define({enables:Mh});class kt extends wt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}kt.prototype.elementClass="";kt.prototype.toDOM=void 0;kt.prototype.mapMode=ce.TrackBefore;kt.prototype.startSide=kt.prototype.endSide=-1;kt.prototype.point=!0;const lu=D.define(),hu=new class extends kt{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},au=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(hu.range(s)))}return j.of(e)});function Lg(){return au}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 ir{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:rr(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 nr{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 nr(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));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 Oh(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(Dh(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||sr(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 di(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 Oh(this,e)}getChild(e,t=null,i=null){let s=hn(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return hn(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return an(this,e)}}function hn(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 di(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 Oh(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let s=hn(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return hn(this,e,t,i)}get node(){return this}matchContext(e){return an(this,e)}}class di{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||sr(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 sr(n){return n.children.some(e=>e instanceof Mt||!e.type.isAnonymous||sr(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 nr(t,t.length):t,h=i.types,a=0,c=0;function f(x,S,v,T,F){let{id:P,start:L,end:W,size:X}=l,oe=c;for(;X<0;)if(l.next(),X==-1){let xe=r[P];v.push(xe),T.push(L-x);return}else if(X==-3){a=P;return}else if(X==-4){c=P;return}else throw new RangeError(`Unrecognized record size: ${X}`);let we=h[P],te,le,Ne=L-x;if(W-L<=s&&(le=m(l.pos-S,F))){let xe=new Uint16Array(le.size-le.skip),_=l.pos-le.size,ee=xe.length;for(;l.pos>_;)ee=g(le.start,xe,ee);te=new Mt(xe,W-le.start,i),Ne=le.start-x}else{let xe=l.pos-X;l.next();let _=[],ee=[],ut=P>=o?P:-1,Dt=0,vi=W;for(;l.pos>xe;)ut>=0&&l.id==ut&&l.size>=0?(l.end<=vi-s&&(d(_,ee,L,Dt,l.end,vi,ut,oe),Dt=_.length,vi=l.end),l.next()):f(L,xe,_,ee,ut);if(ut>=0&&Dt>0&&Dt<_.length&&d(_,ee,L,Dt,L,vi,ut,oe),_.reverse(),ee.reverse(),ut>-1&&Dt>0){let kr=u(we);te=rr(we,_,ee,0,_.length,0,W-L,kr,kr)}else te=p(we,_,ee,W-L,oe-W)}v.push(te),T.push(Ne)}function u(x){return(S,v,T)=>{let F=0,P=S.length-1,L,W;if(P>=0&&(L=S[P])instanceof V){if(!P&&L.type==x&&L.length==T)return L;(W=L.prop(R.lookAhead))&&(F=v[P]+L.length+W)}return p(x,S,v,T,F)}}function d(x,S,v,T,F,P,L,W){let X=[],oe=[];for(;x.length>T;)X.push(x.pop()),oe.push(S.pop()+v-F);x.push(p(i.types[L],X,oe,P-F,W-P)),S.push(F-v)}function p(x,S,v,T,F=0,P){if(a){let L=[R.contextHash,a];P=P?[L].concat(P):[L]}if(F>25){let L=[R.lookAhead,F];P=P?[L].concat(P):[L]}return new V(x,S,v,T,P)}function m(x,S){let v=l.fork(),T=0,F=0,P=0,L=v.end-s,W={size:0,start:0,skip:0};e:for(let X=v.pos-x;v.pos>X;){let oe=v.size;if(v.id==S&&oe>=0){W.size=T,W.start=F,W.skip=P,P+=4,T+=4,v.next();continue}let we=v.pos-oe;if(oe<0||we=o?4:0,le=v.start;for(v.next();v.pos>we;){if(v.size<0)if(v.size==-3)te+=4;else break e;else v.id>=o&&(te+=4);v.next()}F=le,T+=oe,P+=te}return(S<0||T==x)&&(W.size=T,W.start=F,W.skip=P),W.size>4?W:void 0}function g(x,S,v){let{id:T,start:F,end:P,size:L}=l;if(l.next(),L>=0&&T4){let X=l.pos-(L-4);for(;l.pos>X;)v=g(x,S,v)}S[--v]=W,S[--v]=P-x,S[--v]=F-x,S[--v]=T}else L==-3?a=T:L==-4&&(c=T);return v}let b=[],k=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,b,k,-1);let A=(e=n.length)!==null&&e!==void 0?e:b.length?k[0]+b[0].length:0;return new V(h[n.topID],b.reverse(),k.reverse(),A)}const Co=new WeakMap;function Xi(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+=Xi(n,i)}Co.set(e,t)}return t}function rr(n,e,t,i,s,r,o,l,h){let a=0;for(let p=i;p=c)break;v+=T}if(A==x+1){if(v>c){let T=p[x];d(T.children,T.positions,0,T.children.length,m[x]+k);continue}f.push(p[x])}else{let T=m[A-1]+p[A-1].length-S;f.push(rr(n,p,m,x,A,S,T,null,h))}u.push(S+k-r)}}return d(e,t,i,s,0),(l||h)(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,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 Ye(d,p,u.tree,u.offset+a,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 Rs=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([[Rs,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(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=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&&(h=t.predicate(s))&&(h===!0&&(h=new Oe(s.from,s.to)),h.fromnew Oe(c.from-t.start,c.to-t.start)),t.target,a)),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 h(a,c,f,u,d){let p=a;for(;l[p+2]+r<=e.from;)p=l[p+3];let m=[],g=[];Mo(o,a,p,m,g,u);let b=l[p+1],k=l[p+2],A=b+r==e.from&&k+r==e.to&&l[p]==e.type.id;return m.push(A?e.toTree():h(p+4,l[p+3],o.set.types[l[p]],b,k-b)),g.push(b-u),Mo(o,l[p+3],c,m,g,u),new V(f,m,g,d)}s.children[i]=h(0,l.length,me.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 V)t=t.children[0];else break}return!1}}class Su{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(Rs))!==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(Rs))!==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;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 Oe(l,h.to))):h.to>l?t[r--]=new Oe(l,h.to):t.splice(r--,1))}}return i}function ku(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 Oe(u.from+i,u.to+i)),f=ku(e,c,h,a);for(let u=0,d=h;;u++){let p=u==f.length,m=p?a: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(h,a,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let vu=0;class ze{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=vu++}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 cn;return t=>t.modified.indexOf(e)>-1?t:cn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let Cu=0;class cn{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 h of o)s.push(cn.get(l,h));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 h=r.length-1,a=r[h];if(!a)throw new RangeError("Invalid path: "+s);let c=new fn(i,o,h>0?r.slice(0,h):null);e[a]=c.sort(e[a])}}return Bh.add(e)}const Bh=new R;class fn{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 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:h}=e;if(l>=i||h<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let a=s,c=Pu(e)||fn.empty,f=Ou(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(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,b=l;;g++){let k=g=A||!e.nextSibling())););if(!k||A>i)break;b=k.to+l,b>t&&(this.highlightRange(d.cursor(),Math.max(t,k.from+l),Math.min(i,b),s,p),this.startSpan(b,a))}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),a)}while(e.nextSibling());e.parent()}}}function Pu(n){let e=n.type.prop(Bh);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const w=ze.define,Fi=w(),Ze=w(),Bo=w(Ze),Po=w(Ze),et=w(),Vi=w(et),jn=w(et),He=w(),dt=w(He),Ve=w(),We=w(),Ls=w(),Xt=w(Ls),Wi=w(),C={comment:Fi,lineComment:w(Fi),blockComment:w(Fi),docComment:w(Fi),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:Vi,docString:w(Vi),character:w(Vi),attributeValue:w(Vi),number:jn,integer:w(jn),float:w(jn),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:Ls,separator:w(Ls),bracket:Xt,angleBracket:w(Xt),squareBracket:w(Xt),paren:w(Xt),brace:w(Xt),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:Wi,documentMeta:w(Wi),annotation:w(Wi),processingInstruction:w(Wi),definition:ze.defineModifier(),constant:ze.defineModifier(),function:ze.defineModifier(),standard:ze.defineModifier(),local:ze.defineModifier(),special:ze.defineModifier()};Ph([{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 Un;const mt=new R;function Rh(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 h=Ro(r,o,l),a=h.type.prop(mt);if(!a)return[];let c=r.facet(a),f=h.type.prop(Ru);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(R.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 Es(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 Yt=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,[],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=Yt;Yt=this;try{return e()}finally{Yt=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=Ye.applyChanges(i,h),s=V.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 Th{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let h=Yt;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 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 Yt}}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 Lh=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Lh=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Gn=typeof navigator<"u"&&(!((Un=navigator.scheduling)===null||Un===void 0)&&Un.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=Lh(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,h=r.context.work(()=>Gn&&Gn()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(h||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Te.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=>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,O.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 Eh=D.define(),Mn=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 vt(n){let e=n.facet(Mn);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function un(n,e){let t="",i=n.tabSize,s=n.facet(Mn)[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 bi(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 Nh(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=>Fh(o,!0,1,void 0,r&&!Fu(o)?s.from:void 0)}return n.parent==null?Wu:null}function Nh(n,e,t){for(;n;n=n.parent){let i=Vu(n);if(i)return i(or.create(t,e,n))}return null}function Wu(){return 0}class or extends Dn{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 or(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?Nh(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 h=e.childAfter(l);if(!h||h==i)return null;if(!h.type.isSkipped)return h.fromFh(i,e,t,n)}function Fh(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?zu(n):null;return h?l?n.column(h.from):n.column(h.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=Ph(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 On(e,t||{})}}const Is=D.define(),Vh=D.define({combine(n){return n.length?[n[0]]:null}});function Jn(n){let e=n.facet(Is);return e.length?e:n.facet(Vh)}function $g(n,e){let t=[$u],i;return n instanceof On&&(n.module&&t.push(O.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Vh.of(n)):i?t.push(Is.computeN([O.darkTheme],s=>s.facet(O.darkTheme)==(i=="dark")?[n]:[])):t.push(Is.of(n)),t}class qu{constructor(e){this.markCache=Object.create(null),this.tree=ye(e.state),this.decorations=this.buildDeco(e,Jn(e.state))}update(e){let t=ye(e.state),i=Jn(e.state),s=i!=Jn(e.startState);t.length{i.add(o,l,this.markCache[h]||(this.markCache[h]=B.mark({class:h})))},s,r);return i.finish()}}const $u=Ct.high(ge.fromClass(qu,{decorations:n=>n.decorations})),Kg=On.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=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Wh=1e4,Hh="()[]{}",zh=D.define({combine(n){return At(n,{afterCursor:!0,brackets:Hh,maxScanDistance:Wh,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(zh);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.headO.decorations.from(n)}),_u=[Ju,Ku];function jg(n={}){return[zh.of(n),_u]}const Xu=new R;function Ns(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 Fs(n){let e=n.type.prop(Xu);return e?e(n.node):n}function Ke(n,e,t,i={}){let s=i.maxScanDistance||Wh,r=i.brackets||Hh,o=ye(n),l=o.resolveInner(e,t);for(let h=l;h;h=h.parent){let a=Ns(h.type,t,r);if(a&&h.from0?e>=c.from&&ec.from&&e<=c.to))return Yu(n,e,t,h,c,a,r)}}return Qu(n,e,t,o,l.type,s,r)}function Yu(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 m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let b=o.indexOf(d[m]);if(!(b<0||i.resolveInner(p+m,1).type!=s))if(b%2==0==t>0)f++;else{if(f==1)return{start:a,end:{from:p+m,to:p+m+1},matched:b>>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 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||hr}}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 $h extends Te{constructor(e){let t=Rh(e.languageData),i=Zu(e),s,r=new class extends Th{createParse(o,l,h){return new id(s,o,l,h)}};super(t,r,[Eh.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 Gh(i.tokenTable):sd}static define(e){return new $h(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(;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 V&&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&&lr(n,s.tree,0-s.offset,t,o),h;if(l&&(h=Kh(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: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:h}=td(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 qh(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=jh(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 hr=Object.create(null),pi=[me.none],nd=new ir(pi),No=[],Uh=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"]])Uh[n]=Jh(hr,e);class Gh{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Uh)}resolve(e){return e?this.table[e]||(this.table[e]=Jh(this.extra,e)):0}}const sd=new Gh(hr);function _n(n,e){No.indexOf(n)>-1||(No.push(n),console.warn(e))}function Jh(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):_n(r,`Modifier ${r} used at start of tag`):t?_n(r,`Tag ${r} used as modifier`):t=o:_n(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=me.define({id:pi.length,name:i,props:[Du({[i]:t})]});return pi.push(s),s.id}function rd(n){let e=me.define({id:pi.length,name:"Document",props:[mt.add(()=>n)]});return pi.push(e),e}const od=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=cr(n.state,t.from);return i.line?ld(n):i.block?ad(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),hd=ar(_h,0),ad=ar((n,e)=>_h(n,e,fd(e)),0);function cr(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Qt=50;function cd(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Qt,i),o=n.sliceDoc(s,s+Qt),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*Qt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Qt),f=n.sliceDoc(s-Qt,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 _h(n,e,t=e.selection.ranges){let i=t.map(r=>cr(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>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+a.length)==a?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 Vs=Qe.define(),dd=Qe.define(),pd=D.define(),Xh=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 Yh=be.define({create(){return je.empty},update(n,e){let t=e.state.facet(Xh),i=e.annotation(Vs);if(i){let h=e.docChanged?y.single(gd(e.changes)):void 0,a=ke.fromTransaction(e,h),c=i.side,f=c==0?n.undone:n.done;return a?f=dn(f,f.length,t.minDepth,a):f=ea(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=ke.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(ke.fromJSON),n.undone.map(ke.fromJSON))}});function Ug(n={}){return[Yh,Xh.of(n),O.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Qh:e.inputType=="historyRedo"?Ws:null;return i?(e.preventDefault(),i(t)):!1}})]}function Tn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(Yh,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const Qh=Tn(0,!1),Ws=Tn(1,!1),md=Tn(0,!0),yd=Tn(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&&Y.fromJSON(e.changes),[],e.mapped&&Ue.fromJSON(e.mapped),e.startSelection&&y.fromJSON(e.startSelection),e.selectionsAfter.map(y.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 ke(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Be)}static selection(e){return new ke(void 0,Be,void 0,void 0,e)}}function dn(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 h=0;h=a&&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 Zh(n,e){return n.length?e.length?n.concat(e):n:e}const Be=[],xd=200;function ea(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),dn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[ke.selection([e])]}function Sd(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 Xn(n,e){if(!n.length)return n;let t=n.length,i=Be;for(;t;){let s=kd(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)]:Be}function kd(n,e,t){let i=Zh(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Be,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 vd=/^(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||vd.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Bn(t,e))}function fe(n){return n.textDirectionAt(n.state.selection.main.head)==J.LTR}const ia=n=>ta(n,!fe(n)),na=n=>ta(n,fe(n));function sa(n,e){return Ie(n,t=>t.empty?n.moveByGroup(t,e):Bn(t,e))}const Cd=n=>sa(n,!fe(n)),Ad=n=>sa(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 Pn(n,e,t){let i=ye(n).resolveInner(e.head),s=t?R.closedBy:R.openedBy;for(let h=e.head;;){let a=t?i.childAfter(h):i.childBefore(h);if(!a)break;Md(n,a,s)?i=a:h=t?a.to:a.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,y.cursor(l,t?-1:1)}const Dd=n=>Ie(n,e=>Pn(n.state,e,!fe(n))),Od=n=>Ie(n,e=>Pn(n.state,e,fe(n)));function ra(n,e){return Ie(n,t=>{if(!t.empty)return Bn(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const oa=n=>ra(n,!1),la=n=>ra(n,!0);function ha(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Bn(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.bottomaa(n,!1),Hs=n=>aa(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=y.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=>y.cursor(n.lineBlockAt(e.head).from,1)),Ed=n=>Ie(n,e=>y.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 y.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 ca(n,e){return Le(n,t=>n.moveByChar(t,e))}const fa=n=>ca(n,!fe(n)),ua=n=>ca(n,fe(n));function da(n,e){return Le(n,t=>n.moveByGroup(t,e))}const Fd=n=>da(n,!fe(n)),Vd=n=>da(n,fe(n)),Wd=n=>Le(n,e=>Pn(n.state,e,!fe(n))),Hd=n=>Le(n,e=>Pn(n.state,e,fe(n)));function pa(n,e){return Le(n,t=>n.moveVertically(t,e))}const ga=n=>pa(n,!1),ma=n=>pa(n,!0);function ya(n,e){return Le(n,t=>n.moveVertically(t,e,ha(n).height))}const Vo=n=>ya(n,!1),Wo=n=>ya(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=>y.cursor(n.lineBlockAt(e.head).from)),Ud=n=>Le(n,e=>y.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=Ln(n).map(({from:i,to:s})=>y.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:y.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 y.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=y.create([t.main]):t.main.empty||(i=y.create([y.cursor(t.main.head)])),i?(e(_e(n,i)),!0):!1};function Rn(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=Hi(n,h,!0)),o=Math.min(o,h),l=Math.max(l,h)}else o=Hi(n,o,!1),l=Hi(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:y.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 Hi(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 ba=(n,e)=>Rn(n,t=>{let{state:i}=n,s=i.doc.lineAt(t),r,o;if(!e&&t>s.from&&tba(n,!1),wa=n=>ba(n,!0),xa=(n,e)=>Rn(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=ue(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}),Sa=n=>xa(n,!1),Yd=n=>xa(n,!0),ka=n=>Rn(n,e=>{let t=n.lineBlockAt(e).to;return eRn(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:y.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:y.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Ln(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 va(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Ln(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(y.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(y.range(h.anchor-l,h.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:y.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const tp=({state:n,dispatch:e})=>va(n,e,!1),ip=({state:n,dispatch:e})=>va(n,e,!0);function Ca(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Ln(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})=>Ca(n,e,!1),sp=({state:n,dispatch:e})=>Ca(n,e,!0),rp=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Ln(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=Aa(!1),hp=Aa(!0);function Aa(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&&op(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let a=new Dn(e,{simulateBreak:r,simulateDoubleBreak:!!h}),c=Ih(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:y.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const ap=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Dn(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=fr(n,(r,o,l)=>{let h=Ih(i,r.from);if(h==null)return;/\S/.test(r.text)||(h=0);let a=/^\s*/.exec(r.text)[0],c=un(n,h);(a!=c||l.fromn.readOnly?!1:(e(n.update(fr(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Mn)})}),{userEvent:"input.indent"})),!0),fp=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(fr(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=bi(s,n.tabSize),o=0,l=un(n,Math.max(0,r-vt(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:hp},{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:ap},{key:"Shift-Mod-k",run:rp},{key:"Shift-Mod-\\",run:Nd},{key:"Mod-/",run:od},{key:"Alt-A",run:hd}].concat(dp);function he(){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=js(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),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=pn(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 Yn.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=pn(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"&&(Oa.prototype[Symbol.iterator]=Ta.prototype[Symbol.iterator]=function(){return this});function pp(n){try{return new RegExp(n,ur),!0}catch{return!1}}function pn(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function qs(n){let e=he("input",{class:"cm-textfield",name:"line"}),t=he("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:gn.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},he("label",n.state.phrase("Go to line"),": ",e)," ",he("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:gn.of(!1),selection:y.cursor(d.from+Math.max(0,Math.min(f,d.length))),scrollIntoView:!0}),n.focus()}return{dom:t}}const gn=E.define(),jo=be.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(gn)&&(n=t.value);return n},provide:n=>ln.from(n,e=>e?qs:null)}),gp=n=>{let e=on(n,qs);if(!e){let t=[gn.of(!0)];n.state.field(jo,!1)==null&&t.push(E.appendConfig.of([jo,mp])),n.dispatch({effects:t}),e=on(n,qs)}return e&&e.dom.querySelector("input").focus(),!0},mp=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),yp={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ba=D.define({combine(n){return At(n,yp,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function _g(n){let e=[kp,Sp];return n&&e.push(Ba.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 Sp=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(Ba),{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 h=t.wordAt(s.head);if(!h)return B.none;o=t.charCategorizer(s.head),r=t.sliceDoc(h.from,h.to)}else{let h=s.to-s.from;if(h200)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 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(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}),kp=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),vp=({state:n,dispatch:e})=>{let{selection:t}=n,i=y.create(t.ranges.map(s=>n.wordAt(s.head)||y.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(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 Ap=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return vp({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(y.range(s.from,s.to),!1),effects:O.scrollIntoView(s.to)})),!0):!1},Ut=D.define({combine(n){return At(n,{top:!1,caseSensitive:!1,literal:!1,wholeWord:!1,createPanel:e=>new Np(e),scrollToMatch:e=>O.scrollIntoView(e)})}});class Pa{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 Ra{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 Oa(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Op(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function mn(n,e){return n.slice(ue(n,e,!1),e)}function yn(n,e){return n.slice(e,ue(n,e))}function Op(n){return(e,t,i)=>!i[0].length||(n(mn(i.input,i.index))!=$.Word||n(yn(i.input,i.index))!=$.Word)&&(n(yn(i.input,i.index+i[0].length))!=$.Word||n(mn(i.input,i.index+i[0].length))!=$.Word)}class Tp extends Ra{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 gi=E.define(),dr=E.define(),rt=be.define({create(n){return new Qn($s(n).create(),null)},update(n,e){for(let t of e.effects)t.is(gi)?n=new Qn(t.value.create(),n.panel):t.is(dr)&&(n=new Qn(n.query,t.value?pr:null));return n},provide:n=>ln.from(n,e=>e.panel)});class Qn{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;)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?Pp:Bp)})}return i.finish()}},{decorations:n=>n.decorations});function Si(n){return e=>{let t=e.state.field(rt,!1);return t&&t.query.spec.valid?n(e,t):La(e)}}const bn=Si((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=y.single(i.from,i.to),r=n.state.facet(Ut);return n.dispatch({selection:s,effects:[gr(n,i),r.scrollToMatch(s.main)],userEvent:"select.search"}),!0}),wn=Si((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=y.single(s.from,s.to),o=n.state.facet(Ut);return n.dispatch({selection:r,effects:[gr(n,s),o.scrollToMatch(r.main)],userEvent:"select.search"}),!0}),Lp=Si((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:y.create(t.map(i=>y.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(y.range(l.value.from,l.value.to))}return e(n.update({selection:y.create(r,o),userEvent:"select.search.matches"})),!0},Go=Si((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=y.single(r.from-c,r.to-c),a.push(gr(n,r)),a.push(t.facet(Ut).scrollToMatch(l.main))}return n.dispatch({changes:o,selection:l,effects:a,userEvent:"input.replace"}),!0}),Ip=Si((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(Ut).createPanel(n)}function $s(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(Ut);return new Pa({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 La=n=>{let e=n.state.field(rt,!1);if(e&&e.panel){let t=on(n,pr);if(!t)return!1;let i=t.dom.querySelector("[main-field]");if(i&&i!=n.root.activeElement){let s=$s(n.state,e.query.spec);s.valid&&n.dispatch({effects:gi.of(s)}),i.focus(),i.select()}}else n.dispatch({effects:[dr.of(!0),e?gi.of($s(n.state,e.query.spec)):E.appendConfig.of(Vp)]});return!0},Ea=n=>{let e=n.state.field(rt,!1);if(!e||!e.panel)return!1;let t=on(n,pr);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:dr.of(!1)}),!0},Xg=[{key:"Mod-f",run:La,scope:"editor search-panel"},{key:"F3",run:bn,shift:wn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:bn,shift:wn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Ea,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=he("input",{value:t.search,placeholder:ve(e,"Find"),"aria-label":ve(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=he("input",{value:t.replace,placeholder:ve(e,"Replace"),"aria-label":ve(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=he("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=he("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=he("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return he("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=he("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>bn(e),[ve(e,"next")]),i("prev",()=>wn(e),[ve(e,"previous")]),i("select",()=>Lp(e),[ve(e,"all")]),he("label",null,[this.caseField,ve(e,"match case")]),he("label",null,[this.reField,ve(e,"regexp")]),he("label",null,[this.wordField,ve(e,"by word")]),...e.state.readOnly?[]:[he("br"),this.replaceField,i("replace",()=>Go(e),[ve(e,"replace")]),i("replaceAll",()=>Ip(e),[ve(e,"replace all")])],he("button",{name:"close",onclick:()=>Ea(e),"aria-label":ve(e,"close"),type:"button"},["×"])])}commit(){let e=new Pa({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:gi.of(e)}))}keydown(e){Rf(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?wn:bn)(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(gi)&&!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(Ut).top}}function ve(n,e){return n.state.phrase(e)}const zi=30,qi=/[\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-zi),o=Math.min(s,t+zi),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let h=0;hl.length-zi;h--)if(!qi.test(l[h-1])&&qi.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 Fp=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"}}),Vp=[rt,Ct.lowest(Rp),Fp];class Ia{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(Na(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 Na(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 Fa=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:y.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:y.cursor(s.from-r+e.length)}})),{userEvent:"input.complete"})}function Va(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:Fa.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&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(v=js(S))!=v.toLowerCase()?1:v!=v.toUpperCase()?2:0;(!k||T==1&&g||x==0&&T!=0)&&(t[f]==S||i[f]==S&&(u=!0)?o[f++]=k:o.length&&(b=!1)),x=T,k+=De(S)}return f==h&&o[0]==0&&b?this.result(-100+(u?-200:0),o,e):d==h&&p==0?[-200-e.length+(m==e.length?0:-100),0,m]:l>-1?[-700-e.length,l,l+this.pattern.length]:d==h?[-200+-700-e.length,p,m]:f==h?this.result(-100+(u?-200:0)+-700+(b?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 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 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 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(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: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 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 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 $p(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(Re).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=Jp(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(Re).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: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 xn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new xn(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(a=>a.source==l)||new Se(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))||!_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 Se(l.source,0):l));for(let l of e.effects)l.is(Ha)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new xn(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 Ks(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class Se{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Ks(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new Se(s.source,0));for(let r of e.effects)if(r.is(mr))s=new Se(s.source,1,r.value?ot(e.state):-1);else if(r.is(Sn))s=new Se(s.source,0);else if(r.is(Wa))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 Se(this.source,1)}handleChange(e){return e.changes.touchesRange(ot(e.startState))?new Se(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Se(this.source,this.state,e.mapPos(this.explicitPos))}}class ri extends Se{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 Se(this.source,t=="input"&&i.activateOnTyping?1:0);let h=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),a;return Qp(this.result.validFor,e.state,r,o)?new ri(this.source,h,this.result,r,o):this.result.update&&(a=this.result.update(this.result,r,o,new Ia(e.state,l,h>=0)))?new ri(this.source,h,a,a.from,(s=a.to)!==null&&s!==void 0?s:ot(e.state)):new Se(this.source,1,h)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Se(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new ri(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):Na(n,!0).test(s)}const mr=E.define(),Sn=E.define(),Wa=E.define({map(n,e){return n.map(t=>t.map(e))}}),Ha=E.define(),Me=be.define({create(){return xn.start()},update(n,e){return n.update(e)},provide:n=>[Ah.from(n,e=>e.tooltip),O.contentAttributes.from(n,e=>e.attrs)]});function $i(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:Ha.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:Sn.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)&&!Ks(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)Ks(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 Ia(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:Sn.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 Se(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:Wa.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:Sn.of(null)})},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:mr.of(!1)}),20),this.composing=0}}}),za=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:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class 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,ce.TrackDel),i=e.mapPos(this.to,1,ce.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 og(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 lg=B.widget({widget:new class extends ct{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),hg=B.mark({class:"cm-snippetField"});class Gt{constructor(e,t){this.ranges=e,this.active=t,this.deco=B.set(e.map(i=>(i.from==i.to?lg:hg).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 Gt(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)}}),ag=E.define(),mi=be.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(ki))return t.value;if(t.is(ag)&&n)return new Gt(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:B.none)});function wr(n,e){return y.create(n.filter(t=>t.field==e).map(t=>y.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),h={changes:{from:s,to:r,insert:I.of(o)},scrollIntoView:!0,annotations:Fa.of(i)};if(l.length&&(h.selection=wr(l,0)),l.length>1){let a=new Gt(l,0),c=h.effects=[ki.of(a)];t.state.field(mi,!1)===void 0&&c.push(E.appendConfig.of([mi,gg,mg,za]))}t.dispatch(t.state.update(h))}}function qa(n){return({state:e,dispatch:t})=>{let i=e.field(mi,!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 Gt(i.ranges,s))})),!0}}const fg=({state:n,dispatch:e})=>n.field(mi,!1)?(e(n.update({effects:ki.of(null)})),!0):!1,ug=qa(1),dg=qa(-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(tr.compute([il],n=>n.facet(il)));function Qg(n,e){return Object.assign(Object.assign({},e),{apply:cg(n)})}const mg=O.domEventHandlers({mousedown(n,e){let t=e.state.field(mi,!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 Gt(t.ranges,s.field):null)}),!0)}}),yi={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},yt=E.define({map(n,e){let t=e.mapPos(n,-1,ce.TrackAfter);return t??void 0}}),xr=E.define({map(n,e){return e.mapPos(n)}}),Sr=new class extends wt{};Sr.startSide=1;Sr.endSide=-1;const $a=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:[Sr.range(t.value,t.value+1)]}):t.is(xr)&&(n=n.update({filter:i=>i!=t.value}));return n}});function Zg(){return[bg,$a]}const Zn="()[]{}<>";function Ka(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=ja(n,n.selection.main.head).brackets||yi.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=Sg(n.doc,o.head);for(let h of i)if(h==l&&En(n.doc,o.head)==Ka(ne(h,0)))return{changes:{from:o.head-h.length,to:o.head+h.length},range:y.cursor(o.head-h.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=ja(n,n.selection.main.head),i=t.brackets||yi.brackets;for(let s of i){let r=Ka(ne(s,0));if(e==s)return r==s?Cg(n,s,i.indexOf(s+s+s)>-1,t):kg(n,s,r,t.before||yi.before);if(e==r&&Ua(n,n.selection.main.from))return vg(n,s,r)}return null}function Ua(n,e){let t=!1;return n.field($a).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function En(n,e){let t=n.sliceString(e,e+2);return t.slice(0,De(ne(t,0)))}function Sg(n,e){let t=n.sliceString(e-2,e);return De(ne(t,0))==t.length?t:t.slice(1)}function kg(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:y.range(o.anchor+e.length,o.head+e.length)};let l=En(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:y.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function vg(n,e,t){let i=null,s=n.selection.ranges.map(r=>r.empty&&En(n.doc,r.head)==t?y.cursor(r.head+t.length):i=r);return i?null:n.update({selection:y.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||yi.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:y.range(l.anchor+e.length,l.head+e.length)};let h=l.head,a=En(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:y.cursor(h+e.length)};if(Ua(n,h)){let f=t&&n.sliceDoc(h,h+e.length*3)==e+e+e;return{range:y.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:y.cursor(h+e.length)};if(n.charCategorizer(h)(a)!=$.Word&&sl(n,h,s)>-1&&!Ag(n,h,e,s))return{changes:{insert:e+e,from:h},effects:yt.of(h+e.length),range:y.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=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)),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 tm(n={}){return[Me,Re.of(n),rg,Dg,za]}const Mg=[{key:"Ctrl-Space",run:eg},{key:"Escape",run:tg},{key:"ArrowDown",run:$i(!0)},{key:"ArrowUp",run:$i(!1)},{key:"PageDown",run:$i(!0,"page")},{key:"PageUp",run:$i(!1,"page")},{key:"Enter",run:Zp}],Dg=Ct.highest(tr.computeN([Re],n=>n.facet(Re).defaultKeymap?[Mg]:[]));export{Hg as A,zg as B,kn as C,cu as D,O as E,qg as F,Fg as G,ye as H,U as I,Eg as J,Yg as K,Es as L,Hp as M,ir as N,y as O,Th as P,Wg as Q,Vg as R,$h as S,V as T,Ru as U,Qg as V,Rh 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,tr 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-c4d2d831.js b/ui/dist/assets/index-c4d2d831.js new file mode 100644 index 00000000..89042e59 --- /dev/null +++ b/ui/dist/assets/index-c4d2d831.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),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 ni(this),r=new ni(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 ni(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=Jh(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 _h(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=Ui(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=Ui(this.text,Ui(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 g of d.children)f(g);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 Jh(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Ui(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 ni(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()},ni.prototype[Symbol.iterator]=rl.prototype[Symbol.iterator]=ol.prototype[Symbol.iterator]=function(){return this});class _h{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 Lt="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 Lt[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:Yh)(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+=Oe(i);e=0&&Cr(ne(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Yh(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 Us(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Oe(n){return n<65536?1:2}const ts=/\r\n?|\n/;var ce=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(ce||(ce={}));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!=ce.Simple&&h>=e&&(i==ce.TrackDel&&se||i==ce.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 is(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return ns(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||ts)):d:I.empty,g=p.length;if(f==u&&g==0)return;fo&&he(s,f-o,-1),he(s,u-f,g),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 ns(n,e,t,i=!1){let s=[],r=i?[]:null,o=new oi(n),l=new oi(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);he(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 oi{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 Gs=0;class D{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Gs++,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:Js),!!e.static,e.enables)}of(e){return new Gi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Gi(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Js(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Gi{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Gs++}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)||ss(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=en(u,p);if(this.dependencies.every(m=>m instanceof D?u.facet(m)===f.facet(m):m instanceof be?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[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 Jt(n){return e=>new ul(e,n)}const At={highest:Jt(pt.highest),high:Jt(pt.high),default:Jt(pt.default),low:Jt(pt.low),lowest:Jt(pt.lowest)};class ul{constructor(e,t){this.inner=e,this.prec=t}}class kn{of(e){return new rs(this,e)}reconfigure(e){return kn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class rs{constructor(e,t){this.compartment=e,this.inner=t}}class Zi{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 Zh(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,g=c&&c[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,Js(g,d))a.push(i.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=h.length<<1,h.push(y=>m.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(m=>Qh(m,p,d))}}let f=h.map(u=>u(l));return new Zi(e,o,f,l,a,r)}}function Zh(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 rs&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof rs){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 Gi)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 si(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 en(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 ec}}class ec{of(e){return new Qe(this,e)}}class tc{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 tc(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 ic(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=Sl(e,Et(r),!1)}return n}function sc(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,os(e,r,n.changes.newLength),!0))}return i==n?n:Q.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const rc=[];function Et(n){return n==null?rc: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 oc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ls;try{ls=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function lc(n){if(ls)return ls.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||oc.test(t)))return!0}return!1}function ac(n){return e=>{if(!/\S/.test(e))return $.Space;if(lc(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=Et(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=Zi.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=Et(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=Zi.resolve(e.extensions||[],new Map),i=e.doc instanceof I?e.doc:I.of((e.doc||"").split(t.staticFacet(N.lineSeparator)||ts)),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 ac(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;kn.reconfigure=E.define();function Mt(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 as.create(e,t,this)}}wt.prototype.startSide=wt.prototype.endSide=0;wt.prototype.point=!1;wt.prototype.mapMode=ce.TrackDel;let as=class vl{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new vl(e,t,i)}};function hs(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class _s{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 _s(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(hs)),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 li.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return li.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 _t(o,a,r),c=new _t(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 _t(r,l,0).goto(i),h=new _t(o,l,0).goto(i);for(;;){if(a.to!=h.to||!cs(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 _t(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 as?[e]:t?hc(e):e)i.add(s.from,s.to,s.value);return i.finish()}}j.empty=new j([],[],null,-1);function hc(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(hs);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 _s(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 li(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--)Nn(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--)Nn(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(),Nn(this.heap,0)}}}function Nn(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 _t{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=li.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){Ai(this.active,e),Ai(this.activeTo,e),Ai(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&&Ai(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))&&cs(n.activeForPoint(n.to+a),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!cs(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 cs(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 us="ͼ",Pr=typeof Symbol>"u"?"__"+us:Symbol.for(us),ds=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(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),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,g=>"-"+g.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,us+e.toString(36)}static mount(e,t){(e[ds]||new cc(e)).mount(Array.isArray(t)?t:[t])}}let Di=null;class cc{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(Di)return e.adoptedStyleSheets=[Di.sheet,...e.adoptedStyleSheets],e[ds]=Di;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Di=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[ds]=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),fc=typeof navigator<"u"&&/Mac/.test(navigator.platform),uc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),dc=fc||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),ai[se]=String.fromCharCode(se);for(var Fn in at)ai.hasOwnProperty(Fn)||(ai[Fn]=at[Fn]);function pc(n){var e=dc&&(n.ctrlKey||n.altKey||n.metaKey)||uc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ai: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 tn(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Vt(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function gc(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 Vt(n,e.anchorNode)}catch{return!1}}function hi(n){return n.nodeType==3?Wt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function nn(n,e,t,i){return t?Er(n,e,t,i,-1)||Er(n,e,t,i,1):!1}function sn(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:ci(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=sn(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?ci(n):0}else return!1}}function ci(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const Cl={left:0,right:0,top:0,bottom:0};function Xs(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function mc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function yc(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=mc(h);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 wc{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 Tt=null;function Al(n){if(n.setActive)return n.setActive();if(Tt)return n.focus(Tt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Tt==null?{get preventScroll(){return Tt={preventScroll:!0},!0}}:void 0),!Tt){Tt=!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=Ys){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(Me.platform),windows:/Win/.test(Me.platform),linux:/Linux|X11/.test(Me.platform),ie:Cn,ie_version:Bl?ps.documentMode||6:ms?+ms[1]:gs?+gs[1]:0,gecko:Fr,gecko_version:Fr?+(/Firefox\/(\d+)/.exec(Me.userAgent)||[0,0])[1]:0,chrome:!!Vn,chrome_version:Vn?+Vn[1]:0,ios:Wr,android:/Android\b/.test(Me.userAgent),webkit:Vr,safari:Pl,webkit_version:Vr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:ps.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 re(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 ys(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 ys(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?Xs(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)?re.before(this.dom):re.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.dom.getClientRects(),s=null;if(!i.length)return Cl;for(let r=e>0?i.length-1:0;s=i[r],!(e>0?r==0:r==i.length-1||s.top0?-1:1);return this.length?s:Xs(s,this.side>0)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}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?bs(e,0,t,i,(s,r)=>s.domAtPos(r),s=>new re(i,Math.min(s,i.nodeValue.length))):new re(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?bs(e,t,i,s,(r,o,l)=>r.coordsAt(o,l),(r,o)=>ys(s,r,o)):ys(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 bs(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=Vt(o,i),h=l.length+(a?i.nodeValue.length:0);if(n0?re.before(this.dom):re.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){let t=this.dom.getBoundingClientRect(),i=kc(this,this.side>0?-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}get isHidden(){return!0}}ht.prototype.children=nt.prototype.children=St.prototype.children=Ys;function kc(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||r instanceof St&&t>0)&&(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 xi(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 An 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 An&&this.tagName==e.tagName&&this.class==e.class&&Qs(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)}}An.prototype.point=!1;class xi extends B{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof xi&&this.spec.class==e.spec.class&&Qs(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)}}xi.prototype.mapMode=ce.TrackBefore;xi.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?ce.TrackBefore:ce.TrackAfter:ce.TrackDel}get type(){return this.startSide=5}eq(e){return e instanceof vt&&Ac(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 Ac(n,e){return n==e||!!(n&&e&&n.compare(e))}function Ss(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){Qs(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=ws(t,this.attrs||{})),i&&(this.attrs=ws({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&&(xs(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,t;for(let i of this.children){if(!(i instanceof ht)||/[^ -~]/.test(i.text))return null;let s=hi(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=Nl(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=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(Oi(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&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(Oi(new St(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Oi(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 Zs(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 Oi(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}get isHidden(){return!0}}const Vl=D.define(),Wl=D.define(),Hl=D.define(),zl=D.define(),vs=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 rn{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 rn(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 Mn=D.define({combine:n=>n.length?n[0]:!0});let Mc=0;const Zt=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(Mc++,e,i,o=>{let l=[Zt.of(o)];return r&&l.push(fi.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 Wn{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(),er=D.define(),fi=D.define(),Gl=D.define(),Jl=D.define(),ei=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 on{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 on(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,Dc=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 Rc(n,e){let t=n.length,i=e==ks?1:2,s=e==ks?2:1;if(!n||i==1&&!Pc.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 Nt(h,c,f?2:1))}else r.push(new Nt(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=Ic(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=Wc(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}=Zs.build(this.view.state.doc,a,h,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(M.gecko&&s.empty&&!this.compositionDeco.size&&Ec(r)){let a=document.createTextNode("");this.view.observer.ignore(()=>r.node.insertBefore(a,r.node.childNodes[r.offset]||null)),r=o=new re(a,0),i=!0}let l=this.view.observer.selectionRange;(i||!l.focusNode||!nn(r.node,r.offset,l.anchorNode,l.anchorOffset)||!nn(o.node,o.offset,l.focusNode,l.focusOffset))&&(this.view.observer.ignore(()=>{M.android&&M.chrome&&this.dom.contains(l.focusNode)&&Hc(l.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let a=tn(this.view.root);if(a)if(s.empty){if(M.gecko){let h=Fc(r.node,r.offset);if(h&&h!=3){let c=ea(r.node,r.offset,h==1?1:-1);c&&(r=new re(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 re(l.anchorNode,l.anchorOffset),this.impreciseHead=o.precise?null:new re(l.focusNode,l.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let{view:e}=this,t=e.state.selection.main,i=tn(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,g=p?hi(p):[];if(g.length){let m=g[g.length-1],y=a?m.right-d.left:d.right-m.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 r of this.children)if(r instanceof de){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;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 r=hi(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}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(fi).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};yc(this.view.scrollDOM,h,t.head0)i=i.childNodes[s-1],s=ci(i);else break}if(t>=0)for(let i=n,s=e;;){if(i.nodeType==3)return i;if(i.nodeType==1&&s=0)i=i.childNodes[s],s=0;else break}return null}function Fc(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 $c(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Hn(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 As(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let g=hi(p);for(let m=0;mA||o==A&&r>v){i=p,s=y,r=v,o=A;let x=A?t0?m0)}v==0?t>y.bottom&&(!c||c.bottomy.top)&&(h=p,f=y):c&&Hn(c,y)?c=Gr(c,y.bottom):f&&Hn(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 As(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)&&Wt(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,S=!1;a=n.elementAtHeight(u),a.type!=z.Text;)for(;u=i>0?a.bottom+x:a.top-x,!(u>=0&&u<=h);){if(S)return t?null:0;S=!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,g=n.root.elementFromPoint?n.root:p,m=g.elementFromPoint(c,f);m&&!n.contentDOM.contains(m)&&(m=null),m||(c=Math.max(o.left+1,Math.min(o.right-1,c)),m=g.elementFromPoint(c,f),m&&!n.contentDOM.contains(m)&&(m=null));let y,v=-1;if(m&&((s=n.docView.nearest(m))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let x=p.caretPositionFromPoint(c,f);x&&({offsetNode:y,offset:v}=x)}else if(p.caretRangeFromPoint){let x=p.caretRangeFromPoint(c,f);x&&({startContainer:y,startOffset:v}=x,(!n.contentDOM.contains(y)||M.safari&&Kc(y,v,c)||M.chrome&&jc(y,v,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:v}=As(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+fs(o,r,n.state.tabSize)}function Kc(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 Wt(n,i-1,i).getBoundingClientRect().left>t}function jc(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():Wt(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Uc(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=Lc(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 Gc(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 Jc(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,g=ta(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?gs))return b.cursor(g,e.assoc,void 0,o)}}function zn(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 _c{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.compositionPendingKey=!1,this.compositionPendingChange=!1,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)},Ms[i]),this.registeredEvents.push(i)}e.scrollDOM.addEventListener("mousedown",i=>{if(i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&(t(Z.mousedown,i),!i.defaultPrevented&&i.button==2)){let s=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=s,200)}}),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||Xc.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,It(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&!M.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!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"}],Xc="dthko",na=[16,17,18,20,91,92,224,225],Ti=6;function Bi(n){return Math.max(0,n)*.7+8}class Yc{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=bc(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)&&Qc(e,t),this.dragMove=Zc(e,t),this.dragging=ef(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+Ti?i=-Bi(r.left-e.clientX):e.clientX>=r.right-Ti&&(i=Bi(e.clientX-r.right)),e.clientY<=r.top+Ti?s=-Bi(r.top-e.clientY):e.clientY>=r.bottom-Ti&&(s=Bi(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 Qc(n,e){let t=n.state.facet(Vl);return t.length?t[0](e):M.mac?e.metaKey:e.ctrlKey}function Zc(n,e){let t=n.state.facet(Wl);return t.length?t[0](e):M.mac?!e.altKey:!e.ctrlKey}function ef(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=tn(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),Ms=Object.create(null),sa=M.ie&&M.ie_version<15||M.ios&&M.webkit_version<604;function tf(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(Ds!=null&&t.selection.ranges.every(a=>a.empty)&&Ds==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")};Ms.touchstart=Ms.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=rf(n,e)),t){let i=n.root.activeElement!=n.contentDOM;n.inputState.startMouseSelection(new Yc(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 zc(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 nf(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:nf(n,t,e.clientX,e.clientY)}}const sf=M.ie&&M.ie_version<=11;let to=null,io=0,no=0;function la(n){if(!sf)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 rf(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,c=Qr(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let f=Qr(n,t.pos,t.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=of(s,a.pos))?h:l?s.addRange(c):b.create([c])}}}function of(n,e){for(let t=0;t=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))}return null}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()):tf(n)};function lf(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 af(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 Ds=null;Z.copy=Z.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=af(n.state);if(!t&&!s)return;Ds=s?t:null;let r=sa?null:e.clipboardData;r?(e.preventDefault(),r.clearData(),r.setData("text/plain",t)):lf(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.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,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 hf{constructor(e){this.lineWrapping=e,this.doc=I.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,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,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){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)>_i&&(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 Ae 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 Ae||s instanceof ie&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof ie?s=new Ae(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)>=_i&&(a=-2);let u=new Ae(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)>=_i||Math.abs(a-this.heightMetrics(e,t).perLine)>=_i)&&(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 ff 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 uf=5;class tr{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 Ae?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ae(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=uf)&&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 Ae(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 Ae)return e;let t=new Ae(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 Ae)&&!this.isCovered?this.nodes.push(new Ae(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 mf(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class qn{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 hf(t),this.stateDeco=e.facet(fi).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 Pi(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?ao:new xf(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:ti(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(fi).filter(h=>typeof h!="function");let s=e.changedRanges,r=Ge.extendWithRanges(s,df(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?mf:gf)(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&&(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:S,textHeight:k}=e.docView.measureTextSize();o=x>0&&s.refresh(r,x,S,k,y/S,A),o&&(e.docView.minWidth=0,h|=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?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 cf(x.from,S))}s.heightChanged&&(h|=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(),(h&2||v)&&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 Pi(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&&mm.from>=f.from&&m.to<=f.to&&Math.abs(m.from-h)m.fromy));if(!g){if(cm.from<=c&&m.to>=c)){let m=t.moveToLineBoundary(b.cursor(c),!1,!0).head;m>h&&(c=m)}g=new qn(h,c,this.gapSize(f,h,c,u))}l.push(g)};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)||ti(this.heightMap.lineAt(e,H.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return ti(this.heightMap.lineAt(this.scaler.fromDOM(e),H.ByHeight,this.heightOracle,0,0),this.scaler)}elementAtHeight(e){return ti(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 Pi{constructor(e,t){this.from=e,this.to=t}}function bf(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 Li(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 wf(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 xf{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=tti(s,e)):n.type)}const Ei=D.define({combine:n=>n.join(" ")}),Os=D.define({combine:n=>n.indexOf(!0)>-1}),Ts=lt.newName(),ua=lt.newName(),da=lt.newName(),pa={"&light":"."+ua,"&dark":"."+da};function Bs(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 Sf=Bs("."+Ts,{"&":{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?[]:Cf(e),a=new Ql(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Af(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Vt(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||!Vt(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&&It(n.contentDOM,"Enter",13)||t.from==s.from-1&&t.to==s.to&&t.insert.length==0&&It(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&It(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&&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(g=>{if(g.from==s.from&&g.to==s.to)return{changes:h,range:c||g.map(h)};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}),A=g.to-s.to;return{changes:v,range:c?b.range(Math.max(0,c.anchor+A),Math.max(0,c.head+A)):g.map(v)}})}else l={changes:h,selection:c&&r.selection.replaceRange(c)}}let a="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,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 kf(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 Cf(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 Af(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 Mf={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},$n=M.ie&&M.ie_version<=11;class Df{constructor(e){this.view=e,this.active=!1,this.selectionRange=new wc,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()}),$n&&(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(Mn)?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&&nn(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&&gc(this.dom.ownerDocument)==this.dom&&Of(this.view)||tn(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&&It(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()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let 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 Of(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 nn(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||xc(e.parent)||document,this.viewState=new lo(e.state||N.create(e)),this.plugins=this.state.facet(Zt).map(t=>new Wn(t));for(let t of this.plugins)t.update(this);this.observer=new Df(this),this.inputState=new _c(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=on.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 rn(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=ln.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ei)!=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(Ei)!=s.state.facet(Ei)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let u of this.state.facet(vs))u(s);(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!ga(this,c)&&h.force&&It(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(Zt).map(i=>new Wn(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(Zt),i=e.state.facet(Zt);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Wn(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(m=>{try{return m.read(this)}catch(y){return Ee(this.state,y),co}}),d=on.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==a.from&&this.viewport.to==a.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(vs))l(t)}get themeClasses(){return Ts+" "+(this.state.facet(Os)?da:ua)+" "+this.state.facet(Ei)}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(Mn)?"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,er,t);let i=this.observer.ignore(()=>{let s=xs(this.contentDOM,this.contentAttrs,t),r=xs(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(ei),lt.mount(this.root,this.styleModules.concat(Sf).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 zn(this,e,Xr(this,e,t,i))}moveByGroup(e,t){return zn(this,e,Xr(this,e,t,i=>Gc(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return Uc(this,e,t,i)}moveVertically(e,t,i){return zn(this,e,Jc(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[Nt.find(r,e-s.from,-1,t)];return Xs(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>Tf)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=Rc(e.text,t);return this.bidiCache.push(new ln(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 rn(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=[Ei.of(i),ei.of(Bs(`.${i}`,e))];return t&&t.dark&&s.push(Os.of(!0)),s}static baseTheme(e){return At.lowest(ei.of(Bs("."+Ts,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}}O.styleModule=ei;O.inputHandler=ql;O.focusChangeEffect=$l;O.perLineTextDirection=Kl;O.exceptionSink=zl;O.updateListener=vs;O.editable=Mn;O.mouseSelectionStyle=Hl;O.dragMovesSelection=Wl;O.clickAddsSelectionRange=Vl;O.decorations=fi;O.atomicRanges=Gl;O.scrollMargins=Jl;O.darkTheme=Os;O.contentAttributes=er;O.editorAttributes=Ul;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=E.define();const Tf=4096,co={};class ln{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&&ws(o,t)}return t}const Bf=M.mac?"mac":M.windows?"win":M.linux?"linux":"key";function Pf(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 Lf(n,e,t){return ya(ma(n.state),e,n,t)}let tt=null;const Ef=4e3;function If(n,e=Bf){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(m=>Pf(m,e));for(let m=1;m{let A=tt={view:v,prefix:y,scope:o};return setTimeout(()=>{tt==A&&(tt=null)},Ef),!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())||[]});a&&g.run.push(a),h&&(g.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=pc(e),r=ne(s,0),o=Oe(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 g of p.run)if(!h.has(g)&&(h.add(g),g(t,e)))return!0;p.preventDefault&&(a=!0)}return!1},f=n[i],u,d;if(f){if(c(f[l+Ii(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+Ii(u,e,!0)]))return!0;if(e.shiftKey&&(d=ai[e.keyCode])!=s&&d!=u&&c(f[l+Ii(d,e,!1)]))return!0}else if(o&&e.shiftKey&&c(f[l+Ii(s,e,!0)]))return!0;if(c(f._any))return!0}return a}class Si{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 Si(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Nf(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 Nf(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),g=d.type==z.Text?d:null,m=p.type==z.Text?p:null;if(n.lineWrapping&&(g&&(g=po(n,i,g)),m&&(m=po(n,s,m))),g&&m&&g.from==m.from)return v(A(t.from,t.to,g));{let S=g?A(t.from,null,g):x(d,!1),k=m?A(null,t.to,m):x(p,!0),T=[];return(g||d).to<(m||p).from-1?T.push(y(f,S.bottom,u,k.top)):S.bottomX&&we.from=le)break;ee>te&&W(Math.max(_,te),S==null&&_<=X,Math.min(ee,le),k==null&&ee>=oe,xe.dir)}if(te=Ne.to+1,te>=le)break}return L.length==0&&W(X,S==null,oe,k==null,n.textDirection),{top:F,bottom:P,horizontal:L}}function x(S,k){let T=l.top+(k?S.top:S.bottom);return{top:T,bottom:T,horizontal:[]}}}function Ff(n,e){return n.constructor==e.constructor&&n.eq(e)}class Vf{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(Xi)!=e.state.facet(Xi)&&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(Xi);for(;t!Ff(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 Xi=D.define();function wa(n){return[ge.define(e=>new Vf(e,n)),Xi.of(n)]}const xa=!M.ios,ui=D.define({combine(n){return Mt(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Tg(n={}){return[ui.of(n),Wf,Hf,zf,jl.of(!0)]}function Sa(n){return n.startState.facet(ui)!=n.state.facet(ui)}const Wf=wa({above:!0,markers(n){let{state:e}=n,t=e.facet(ui),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 Si.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=Sa(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(ui).cursorBlinkRate+"ms"}const Hf=wa({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Si.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Sa(n)},class:"cm-selectionLayer"}),va={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};xa&&(va[".cm-line"].caretColor="transparent !important");const zf=At.highest(O.theme(va)),ka=E.define({map(n,e){return n==null?null:e.mapPos(n)}}),ii=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)}}),qf=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(ii);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(ii)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let n=this.view.state.field(ii),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(ii)!=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 Bg(){return[ii,qf]}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 $f(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 Kf{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 $f(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(g,m));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(m,e,g,p));t=t.update({filterFrom:c,filterTo:f,filter:(g,m)=>gf,add:u})}}return t}}const Ps=/x/.unicode!=null?"gu":"g",jf=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Ps),Uf={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 Kn=null;function Gf(){var n;if(Kn==null&&typeof document<"u"&&document.body){let e=document.body.style;Kn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Kn||!1}const Yi=D.define({combine(n){let e=Mt(n,{render:null,specialChars:jf,addSpecialChars:null});return(e.replaceTabs=!Gf())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ps)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ps)),e}});function Pg(n={}){return[Yi.of(n),Jf()]}let bo=null;function Jf(){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(Yi)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Kf({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=wi(o.text,l,i-o.from);return B.replace({widget:new Qf((l-a%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=B.replace({widget:new Yf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Yi);n.startState.facet(Yi)!=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 _f="•";function Xf(n){return n>=32?_f:n==10?"␤":String.fromCharCode(9216+n)}class Yf extends ct{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Xf(this.code),i=e.state.phrase("Control character")+" "+(Uf[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 Qf 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 Zf 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 Rg(n){return ge.fromClass(class{constructor(e){this.view=e,this.placeholder=B.set([B.widget({widget:new Zf(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?B.none:this.placeholder}},{decorations:e=>e.decorations})}const Rs=2e3;function eu(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Rs||t.off>Rs||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=fs(h.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(h.to));else{let f=fs(h.text,l,n.tabSize);r.push(b.range(h.from+c,h.from+f))}}}return r}function tu(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>Rs?-1:s==i.length?tu(n,e.clientX):wi(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function iu(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=eu(n.state,t,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function Lg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?iu(t,i):null)}const Ni="-10000px";class nu{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)||su}}}),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(jn);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 nu(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(jn);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=Ni,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(jn).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=Ni;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||ou,m=this.view.textDirection==J.LTR,y=c.width>i.right-i.left?m?i.left:i.right-c.width:m?Math.min(h.left-(f?14:0)+g.x,i.right-d):Math.max(i.left,h.left-d+(f?14:0)-g.x),v=!!o.above;!o.strictSide&&(v?h.top-(c.bottom-c.top)-g.yi.bottom)&&v==i.bottom-h.bottom>h.top-i.top&&(v=!v);let A=(v?h.top-i.top:i.bottom-h.bottom)-u;if(Ay&&k.topx&&(x=v?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+(m?g.x:-g.x)-(y+14-7)}px`),l.overlap!==!0&&s.push({left:y,top:x,right:S,bottom:x+p}),a.classList.toggle("cm-tooltip-above",v),a.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=Ni}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),ru=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:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),ou={x:0,y:0},Aa=D.define({enables:[Ca,ru]});function Ma(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 So=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 an(n,e){let t=n.plugin(Da),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Da=ge.fromClass(class{constructor(n){this.input=n.state.facet(hn),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(So);this.top=new Fi(n,!0,e.topContainer),this.bottom=new Fi(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(So);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Fi(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Fi(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(hn);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=>O.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Fi{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=vo(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=vo(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 vo(n){let e=n.nextSibling;return n.remove(),e}const hn=D.define({enables:Da});class kt extends wt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}kt.prototype.elementClass="";kt.prototype.toDOM=void 0;kt.prototype.mapMode=ce.TrackBefore;kt.prototype.startSide=kt.prototype.endSide=-1;kt.prototype.point=!0;const lu=D.define(),au=new class extends kt{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 Eg(){return hu}const cu=1024;let fu=0;class Te{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 nr{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:or(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 sr{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 sr(this.buffer,this.index)}}class Dt{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 Ta(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(Oa(s,i,f,f+c.length)){if(c instanceof Dt){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||rr(c)){let u;if(!(r&U.IgnoreMounts)&&c.props&&(u=c.prop(R.mounted))&&!u.overlay)return new Re(u.tree,f,e,o);let d=new Re(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 Re(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 di(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 Ta(this,e)}getChild(e,t=null,i=null){let s=cn(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return cn(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return fn(this,e)}}function cn(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 fn(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 di(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 Ta(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let s=cn(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return cn(this,e,t,i)}get node(){return this}matchContext(e){return fn(this,e)}}class di{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 Re)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 Re?(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 Dt||!l.type.isAnonymous||rr(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 fn(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 rr(n){return n.children.some(e=>e instanceof Dt||!e.type.isAnonymous||rr(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 sr(t,t.length):t,a=i.types,h=0,c=0;function f(x,S,k,T,F){let{id:P,start:L,end:W,size:X}=l,oe=c;for(;X<0;)if(l.next(),X==-1){let xe=r[P];k.push(xe),T.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,le,Ne=L-x;if(W-L<=s&&(le=g(l.pos-S,F))){let xe=new Uint16Array(le.size-le.skip),_=l.pos-le.size,ee=xe.length;for(;l.pos>_;)ee=m(le.start,xe,ee);te=new Dt(xe,W-le.start,i),Ne=le.start-x}else{let xe=l.pos-X;l.next();let _=[],ee=[],ut=P>=o?P:-1,Ot=0,Ci=W;for(;l.pos>xe;)ut>=0&&l.id==ut&&l.size>=0?(l.end<=Ci-s&&(d(_,ee,L,Ot,l.end,Ci,ut,oe),Ot=_.length,Ci=l.end),l.next()):f(L,xe,_,ee,ut);if(ut>=0&&Ot>0&&Ot<_.length&&d(_,ee,L,Ot,L,Ci,ut,oe),_.reverse(),ee.reverse(),ut>-1&&Ot>0){let vr=u(we);te=or(we,_,ee,0,_.length,0,W-L,vr,vr)}else te=p(we,_,ee,W-L,oe-W)}k.push(te),T.push(Ne)}function u(x){return(S,k,T)=>{let F=0,P=S.length-1,L,W;if(P>=0&&(L=S[P])instanceof V){if(!P&&L.type==x&&L.length==T)return L;(W=L.prop(R.lookAhead))&&(F=k[P]+L.length+W)}return p(x,S,k,T,F)}}function d(x,S,k,T,F,P,L,W){let X=[],oe=[];for(;x.length>T;)X.push(x.pop()),oe.push(S.pop()+k-F);x.push(p(i.types[L],X,oe,P-F,W-P)),S.push(F-k)}function p(x,S,k,T,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,S,k,T,P)}function g(x,S){let k=l.fork(),T=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 oe=k.size;if(k.id==S&&oe>=0){W.size=T,W.start=F,W.skip=P,P+=4,T+=4,k.next();continue}let we=k.pos-oe;if(oe<0||we=o?4:0,le=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=le,T+=oe,P+=te}return(S<0||T==x)&&(W.size=T,W.start=F,W.skip=P),W.size>4?W:void 0}function m(x,S,k){let{id:T,start:F,end:P,size:L}=l;if(l.next(),L>=0&&T4){let X=l.pos-(L-4);for(;l.pos>X;)k=m(x,S,k)}S[--k]=W,S[--k]=P-x,S[--k]=F-x,S[--k]=T}else L==-3?h=T:L==-4&&(c=T);return k}let y=[],v=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,v,-1);let A=(e=n.length)!==null&&e!==void 0?e:y.length?v[0]+y[0].length:0;return new V(a[n.topID],y.reverse(),v.reverse(),A)}const Co=new WeakMap;function Qi(n,e){if(!n.isAnonymous||e instanceof Dt||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+=Qi(n,i)}Co.set(e,t)}return t}function or(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;k+=T}if(A==x+1){if(k>c){let T=p[x];d(T.children,T.positions,0,T.children.length,g[x]+v);continue}f.push(p[x])}else{let T=g[A-1]+p[A-1].length-S;f.push(or(n,p,g,x,A,S,T,null,a))}u.push(S+v-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class Ig{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 Re&&this.map.set(e.tree,t)}get(e){return e instanceof $e?this.getBuffer(e.context.buffer,e.index):e instanceof Re?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 Te(s.from,s.to)):[new Te(0,0)]:[new Te(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 Ng(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 Ls=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([[Ls,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 Te(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 Te(s.from,s.to)),a.fromnew Te(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 g=[],m=[];Mo(o,h,p,g,m,u);let y=l[p+1],v=l[p+2],A=y+r==e.from&&v+r==e.to&&l[p]==e.type.id;return g.push(A?e.toTree():a(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 V(f,g,m,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 Su{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(Ls))!==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(Ls))!==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 Te(l,a.to))):a.to>l?t[r--]=new Te(l,a.to):t.splice(r--,1))}}return i}function vu(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 Te(u.from+i,u.to+i)),f=vu(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,g=p?h:f[u].from;if(g>d&&t.push(new Ye(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 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 un;return t=>t.modified.indexOf(e)>-1?t:un.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let Cu=0;class un{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(un.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 dn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Pa.add(e)}const Pa=new R;class dn{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)||dn.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(m=>!m.scope||m.scope(u.tree.type)),g=e.firstChild();for(let m=0,y=l;;m++){let v=m=A||!e.nextSibling())););if(!v||A>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,h))}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),h)}while(e.nextSibling());e.parent()}}}function Pu(n){let e=n.type.prop(Pa);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const w=ze.define,Wi=w(),Ze=w(),Bo=w(Ze),Po=w(Ze),et=w(),Hi=w(et),Un=w(et),He=w(),dt=w(He),Ve=w(),We=w(),Es=w(),Xt=w(Es),zi=w(),C={comment:Wi,lineComment:w(Wi),blockComment:w(Wi),docComment:w(Wi),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:Hi,docString:w(Hi),character:w(Hi),attributeValue:w(Hi),number:Un,integer:w(Un),float:w(Un),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:Es,separator:w(Es),bracket:Xt,angleBracket:w(Xt),squareBracket:w(Xt),paren:w(Xt),brace:w(Xt),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:zi,documentMeta:w(zi),annotation:w(zi),processingInstruction:w(zi),definition:ze.defineModifier(),constant:ze.defineModifier(),function:ze.defineModifier(),standard:ze.defineModifier(),local:ze.defineModifier(),special:ze.defineModifier()};Ra([{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 Gn;const mt=new R;function La(n){return D.define({combine:n?e=>e.concat(n):void 0})}const Ru=new R;class Be{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 Is(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ye(n){let e=n.field(Be.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 Yt=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=Yt;Yt=this;try{return e()}finally{Yt=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 Ba{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=Yt;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 Yt}}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)}}Be.state=be.define({create:qt.init,update(n,e){for(let t of e.effects)if(t.is(Be.setState))return t.value;return e.startState.facet($t)!=e.state.facet($t)?qt.init(e.state):n.apply(e)}});let Ea=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Ea=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Jn=typeof navigator<"u"&&(!((Gn=navigator.scheduling)===null||Gn===void 0)&&Gn.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(Be.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(Be.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Ea(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>Jn&&Jn()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Be.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=>[Be.state,Eu,O.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Vg{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Ia=D.define(),Dn=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 Ct(n){let e=n.facet(Dn);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function pn(n,e){let t="",i=n.tabSize,s=n.facet(Dn)[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 wi(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 Fa(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=>Va(o,!0,1,void 0,r&&!Fu(o)?s.from:void 0)}return n.parent==null?Wu:null}function Fa(n,e,t){for(;n;n=n.parent){let i=Vu(n);if(i)return i(lr.create(t,e,n))}return null}function Wu(){return 0}class lr extends On{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 lr(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?Fa(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.fromVa(i,e,t,n)}function Va(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 Hg=n=>n.baseIndent;function zg({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const qg=new R;function $g(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(mt)==o.data:o?l=>l==o:void 0,this.style=Ra(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 Tn(e,t||{})}}const Ns=D.define(),Wa=D.define({combine(n){return n.length?[n[0]]:null}});function _n(n){let e=n.facet(Ns);return e.length?e:n.facet(Wa)}function Kg(n,e){let t=[$u],i;return n instanceof Tn&&(n.module&&t.push(O.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Wa.of(n)):i?t.push(Ns.computeN([O.darkTheme],s=>s.facet(O.darkTheme)==(i=="dark")?[n]:[])):t.push(Ns.of(n)),t}class qu{constructor(e){this.markCache=Object.create(null),this.tree=ye(e.state),this.decorations=this.buildDeco(e,_n(e.state))}update(e){let t=ye(e.state),i=_n(e.state),s=i!=_n(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=At.high(ge.fromClass(qu,{decorations:n=>n.decorations})),jg=Tn.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=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ha=1e4,za="()[]{}",qa=D.define({combine(n){return Mt(n,{afterCursor:!0,brackets:za,maxScanDistance:Ha,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(qa);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.headO.decorations.from(n)}),_u=[Ju,Ku];function Ug(n={}){return[qa.of(n),_u]}const Xu=new R;function Fs(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 Vs(n){let e=n.type.prop(Xu);return e?e(n.node):n}function Ke(n,e,t,i={}){let s=i.maxScanDistance||Ha,r=i.brackets||za,o=ye(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=Fs(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 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:h,end:{from:p+g,to:p+g+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||hr}}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 Ka extends Be{constructor(e){let t=La(e.languageData),i=Zu(e),s,r=new class extends Ba{createParse(o,l,a){return new id(s,o,l,a)}};super(t,r,[Ia.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 Ja(i.tokenTable):sd}static define(e){return new Ka(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&&ar(n,s.tree,0-s.offset,t,o),a;if(l&&(a=ja(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?Ct(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 $a(t,e?e.state.tabSize:4,e?Ct(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Ua(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 hr=Object.create(null),pi=[me.none],nd=new nr(pi),No=[],Ga=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"]])Ga[n]=_a(hr,e);class Ja{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Ga)}resolve(e){return e?this.table[e]||(this.table[e]=_a(this.extra,e)):0}}const sd=new Ja(hr);function Xn(n,e){No.indexOf(n)>-1||(No.push(n),console.warn(e))}function _a(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):Xn(r,`Modifier ${r} used at start of tag`):t?Xn(r,`Tag ${r} used as modifier`):t=o:Xn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=me.define({id:pi.length,name:i,props:[Du({[i]:t})]});return pi.push(s),s.id}function rd(n){let e=me.define({id:pi.length,name:"Document",props:[mt.add(()=>n)]});return pi.push(e),e}const od=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=fr(n.state,t.from);return i.line?ld(n):i.block?hd(n):!1};function cr(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=cr(ud,0),ad=cr(Xa,0),hd=cr((n,e)=>Xa(n,e,fd(e)),0);function fr(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Qt=50;function cd(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Qt,i),o=n.sliceDoc(s,s+Qt),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*Qt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Qt),f=n.sliceDoc(s-Qt,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 Xa(n,e,t=e.selection.ranges){let i=t.map(r=>fr(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>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?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 Ws=Qe.define(),dd=Qe.define(),pd=D.define(),Ya=D.define({combine(n){return Mt(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 Qa=be.define({create(){return je.empty},update(n,e){let t=e.state.facet(Ya),i=e.annotation(Ws);if(i){let a=e.docChanged?b.single(gd(e.changes)):void 0,h=ve.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=gn(f,f.length,t.minDepth,h):f=th(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=ve.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(ve.fromJSON),n.undone.map(ve.fromJSON))}});function Gg(n={}){return[Qa,Ya.of(n),O.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Za:e.inputType=="historyRedo"?Hs:null;return i?(e.preventDefault(),i(t)):!1}})]}function Bn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(Qa,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const Za=Bn(0,!1),Hs=Bn(1,!1),md=Bn(0,!0),yd=Bn(1,!0);class ve{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 ve(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 ve(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=Pe;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 ve(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Pe)}static selection(e){return new ve(void 0,Pe,void 0,void 0,e)}}function gn(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 eh(n,e){return n.length?e.length?n.concat(e):n:e}const Pe=[],xd=200;function th(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),gn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[ve.selection([e])]}function Sd(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 Yn(n,e){if(!n.length)return n;let t=n.length,i=Pe;for(;t;){let s=vd(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?[ve.selection(i)]:Pe}function vd(n,e,t){let i=eh(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Pe,t);if(!n.changes)return ve.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new ve(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):Pn(t,e))}function fe(n){return n.textDirectionAt(n.state.selection.main.head)==J.LTR}const nh=n=>ih(n,!fe(n)),sh=n=>ih(n,fe(n));function rh(n,e){return Ie(n,t=>t.empty?n.moveByGroup(t,e):Pn(t,e))}const Cd=n=>rh(n,!fe(n)),Ad=n=>rh(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 Rn(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=>Rn(n.state,e,!fe(n))),Od=n=>Ie(n,e=>Rn(n.state,e,fe(n)));function oh(n,e){return Ie(n,t=>{if(!t.empty)return Pn(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const lh=n=>oh(n,!1),ah=n=>oh(n,!0);function hh(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Pn(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.bottomch(n,!1),zs=n=>ch(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 fh(n,e){return Le(n,t=>n.moveByChar(t,e))}const uh=n=>fh(n,!fe(n)),dh=n=>fh(n,fe(n));function ph(n,e){return Le(n,t=>n.moveByGroup(t,e))}const Fd=n=>ph(n,!fe(n)),Vd=n=>ph(n,fe(n)),Wd=n=>Le(n,e=>Rn(n.state,e,!fe(n))),Hd=n=>Le(n,e=>Rn(n.state,e,fe(n)));function gh(n,e){return Le(n,t=>n.moveVertically(t,e))}const mh=n=>gh(n,!1),yh=n=>gh(n,!0);function bh(n,e){return Le(n,t=>n.moveVertically(t,e,hh(n).height))}const Vo=n=>bh(n,!1),Wo=n=>bh(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=En(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 Ln(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=qi(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=qi(n,o,!1),l=qi(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 qi(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 wh=(n,e)=>Ln(n,t=>{let{state:i}=n,s=i.doc.lineAt(t),r,o;if(!e&&t>s.from&&twh(n,!1),xh=n=>wh(n,!0),Sh=(n,e)=>Ln(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=>Sh(n,!1),Yd=n=>Sh(n,!0),kh=n=>Ln(n,e=>{let t=n.lineBlockAt(e).to;return eLn(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 En(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 Ch(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of En(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})=>Ch(n,e,!1),ip=({state:n,dispatch:e})=>Ch(n,e,!0);function Ah(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of En(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})=>Ah(n,e,!1),sp=({state:n,dispatch:e})=>Ah(n,e,!0),rp=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(En(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=Mh(!1),ap=Mh(!0);function Mh(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 On(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Na(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 On(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=ur(n,(r,o,l)=>{let a=Na(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=pn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(ur(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Dn)})}),{userEvent:"input.indent"})),!0),fp=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(ur(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=wi(s,n.tabSize),o=0,l=pn(n,Math.max(0,r-Ct(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),_g=[{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 ae(){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=Us(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Oe(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=mn(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 Ft(t,e.sliceString(t,i));return Qn.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=mn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ft.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Th.prototype[Symbol.iterator]=Bh.prototype[Symbol.iterator]=function(){return this});function pp(n){try{return new RegExp(n,dr),!0}catch{return!1}}function mn(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function $s(n){let e=ae("input",{class:"cm-textfield",name:"line"}),t=ae("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:yn.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},ae("label",n.state.phrase("Go to line"),": ",e)," ",ae("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:yn.of(!1),selection:b.cursor(d.from+Math.max(0,Math.min(f,d.length))),scrollIntoView:!0}),n.focus()}return{dom:t}}const yn=E.define(),jo=be.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(yn)&&(n=t.value);return n},provide:n=>hn.from(n,e=>e?$s:null)}),gp=n=>{let e=an(n,$s);if(!e){let t=[yn.of(!0)];n.state.field(jo,!1)==null&&t.push(E.appendConfig.of([jo,mp])),n.dispatch({effects:t}),e=an(n,$s)}return e&&e.dom.querySelector("input").focus(),!0},mp=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),yp={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ph=D.define({combine(n){return Mt(n,yp,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Xg(n){let e=[vp,Sp];return n&&e.push(Ph.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 Sp=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(Ph),{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}),vp=O.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:O.scrollIntoView(s.to)})),!0):!1},Ut=D.define({combine(n){return Mt(n,{top:!1,caseSensitive:!1,literal:!1,wholeWord:!1,createPanel:e=>new Np(e),scrollToMatch:e=>O.scrollIntoView(e)})}});class Rh{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?Pt(this,s,t,i):Bt(this,s,t,i)}}class Lh{constructor(e){this.spec=e}}function Bt(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=Bt(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 Pt(n,e,t,i){return new Th(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Op(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function bn(n,e){return n.slice(ue(n,e,!1),e)}function wn(n,e){return n.slice(e,ue(n,e))}function Op(n){return(e,t,i)=>!i[0].length||(n(bn(i.input,i.index))!=$.Word||n(wn(i.input,i.index))!=$.Word)&&(n(wn(i.input,i.index+i[0].length))!=$.Word||n(bn(i.input,i.index+i[0].length))!=$.Word)}class Tp extends Lh{nextMatch(e,t,i){let s=Pt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Pt(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=Pt(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=Pt(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 gi=E.define(),pr=E.define(),rt=be.define({create(n){return new Zn(Ks(n).create(),null)},update(n,e){for(let t of e.effects)t.is(gi)?n=new Zn(t.value.create(),n.panel):t.is(pr)&&(n=new Zn(n.query,t.value?gr:null));return n},provide:n=>hn.from(n,e=>e.panel)});class Zn{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 vi(n){return e=>{let t=e.state.field(rt,!1);return t&&t.query.spec.valid?n(e,t):Eh(e)}}const xn=vi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(Ut);return n.dispatch({selection:s,effects:[mr(n,i),r.scrollToMatch(s.main)],userEvent:"select.search"}),!0}),Sn=vi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=b.single(s.from,s.to),o=n.state.facet(Ut);return n.dispatch({selection:r,effects:[mr(n,s),o.scrollToMatch(r.main)],userEvent:"select.search"}),!0}),Lp=vi((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=vi((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(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-a.length;l=b.single(r.from-c,r.to-c),h.push(mr(n,r)),h.push(t.facet(Ut).scrollToMatch(l.main))}return n.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),Ip=vi((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 gr(n){return n.state.facet(Ut).createPanel(n)}function Ks(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(Ut);return new Rh({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 Eh=n=>{let e=n.state.field(rt,!1);if(e&&e.panel){let t=an(n,gr);if(!t)return!1;let i=t.dom.querySelector("[main-field]");if(i&&i!=n.root.activeElement){let s=Ks(n.state,e.query.spec);s.valid&&n.dispatch({effects:gi.of(s)}),i.focus(),i.select()}}else n.dispatch({effects:[pr.of(!0),e?gi.of(Ks(n.state,e.query.spec)):E.appendConfig.of(Vp)]});return!0},Ih=n=>{let e=n.state.field(rt,!1);if(!e||!e.panel)return!1;let t=an(n,gr);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:pr.of(!1)}),!0},Yg=[{key:"Mod-f",run:Eh,scope:"editor search-panel"},{key:"F3",run:xn,shift:Sn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:xn,shift:Sn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Ih,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=ae("input",{value:t.search,placeholder:Ce(e,"Find"),"aria-label":Ce(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ae("input",{value:t.replace,placeholder:Ce(e,"Replace"),"aria-label":Ce(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ae("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=ae("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=ae("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return ae("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=ae("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>xn(e),[Ce(e,"next")]),i("prev",()=>Sn(e),[Ce(e,"previous")]),i("select",()=>Lp(e),[Ce(e,"all")]),ae("label",null,[this.caseField,Ce(e,"match case")]),ae("label",null,[this.reField,Ce(e,"regexp")]),ae("label",null,[this.wordField,Ce(e,"by word")]),...e.state.readOnly?[]:[ae("br"),this.replaceField,i("replace",()=>Go(e),[Ce(e,"replace")]),i("replaceAll",()=>Ip(e),[Ce(e,"replace all")])],ae("button",{name:"close",onclick:()=>Ih(e),"aria-label":Ce(e,"close"),type:"button"},["×"])])}commit(){let e=new Rh({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:gi.of(e)}))}keydown(e){Lf(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Sn:xn)(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(gi)&&!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(Ut).top}}function Ce(n,e){return n.state.phrase(e)}const $i=30,Ki=/[\s\.,:;?!]/;function mr(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-$i),o=Math.min(s,t+$i),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;a<$i;a++)if(!Ki.test(l[a+1])&&Ki.test(l[a])){l=l.slice(a);break}}if(o!=s){for(let a=l.length-1;a>l.length-$i;a--)if(!Ki.test(l[a-1])&&Ki.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const Fp=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"}}),Vp=[rt,At.lowest(Rp),Fp];class Nh{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(Fh(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 Qg(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,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function ot(n){return n.selection.main.from}function Fh(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 Vh=Qe.define();function zp(n,e,t,i){let{main:s}=n.selection,r=i-t;return Object.assign(Object.assign({},n.changeByRange(o=>o!=s&&r&&n.sliceDoc(o.from-r,o.from+i-s.from)!=n.sliceDoc(t,i)?{range:o}:{changes:{from:o.from-r,to:i==s.from?o.to:o.from+i-s.from,insert:e},range:b.cursor(o.from-r+e.length)})),{userEvent:"input.complete"})}function Wh(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:Vh.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}const yr=E.define(),mi=E.define();class $p{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:(k=Us(S))!=k.toLowerCase()?1:k!=k.toUpperCase()?2:0;(!v||T==1&&m||x==0&&T!=0)&&(t[f]==S||i[f]==S&&(u=!0)?o[f++]=v:o.length&&(y=!1)),x=T,v+=Oe(S)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?[-200-e.length+(g==e.length?0:-100),0,g]:l>-1?[-700-e.length,l,l+this.pattern.length]:d==a?[-200+-700-e.length,p,g]: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?Oe(ne(i,o)):1);r>1&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return s}}const ke=D.define({combine(n){return Mt(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Kp,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,e,t,i,s){let r=n.textDirection==J.RTL,o=r,l=!1,a="top",h,c,f=e.left-s.left,u=s.right-e.right,d=i.right-i.left,p=i.bottom-i.top;if(o&&f=p||g>e.top?h=t.bottom-e.top:(a="bottom",h=e.bottom-t.top)}return{style:`${a}: ${h}px; max-width: ${c}px`,class:"cm-completionInfo-"+(l?r?"left-narrow":"right-narrow":o?"left":"right")}}function jp(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 Up{constructor(e,t){this.view=e,this.stateField=t,this.info=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:s,selected:r}=i.open,o=e.state.facet(ke);this.optionContent=jp(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]{let a=e.state.field(this.stateField,!1);a&&a.tooltip&&e.state.facet(ke).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:mi.of(null)})}),this.list=this.dom.appendChild(this.createListBox(s,i.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}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.placeInfoReq)}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(ke).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.placeInfoReq)})),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.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?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 o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottomi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew Up(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 _p(n,e){let t=[],i=null,s=a=>{t.push(a);let{section:h}=a.completion;if(h){i||(i=[]);let c=typeof h=="string"?h:h.name;i.some(f=>f.name==c)||i.push(typeof h=="string"?{name:c}:h)}};for(let a of n)if(a.hasResult())if(a.result.filter===!1){let h=a.result.getMatch;for(let c of a.result.options){let f=[1e9-t.length];if(h)for(let u of h(c))f.push(u);s(new _o(c,a,f,f[0]))}}else{let h=new $p(e.sliceDoc(a.from,a.to)),c;for(let f of a.result.options)(c=h.match(f.label))&&s(new _o(f,a,c,c[0]+(f.boost||0)))}if(i){let a=Object.create(null),h=0,c=(f,u)=>{var d,p;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((p=u.rank)!==null&&p!==void 0?p:1e9)||(f.namec.score-h.score||l(h.completion,c.completion)))!o||o.label!=a.completion.label||o.detail!=a.completion.detail||o.type!=null&&a.completion.type!=null&&o.type!=a.completion.type||o.apply!=a.completion.apply?r.push(a):Zo(a.completion)>Zo(o)&&(r[r.length-1]=a),o=a.completion;return r}class Rt{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 Rt(this.options,el(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=_p(e,t);if(!o.length)return s&&e.some(a=>a.state==1)?new Rt(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(ke).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:Gp(De),above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new Rt(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class vn{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new vn(Qp,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(ke),r=(i.override||t.languageDataAt("autocomplete",ot(t)).map(qp)).map(l=>(this.active.find(h=>h.source==l)||new Se(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))||!Xp(r,this.active)?o=Rt.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 Se(l.source,0):l));for(let l of e.effects)l.is(zh)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new vn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Yp}}function Xp(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const Qp=[];function js(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class Se{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=js(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new Se(s.source,0));for(let r of e.effects)if(r.is(yr))s=new Se(s.source,1,r.value?ot(e.state):-1);else if(r.is(mi))s=new Se(s.source,0);else if(r.is(Hh))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 Se(this.source,1)}handleChange(e){return e.changes.touchesRange(ot(e.startState))?new Se(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Se(this.source,this.state,e.mapPos(this.explicitPos))}}class ri extends Se{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 Se(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return Zp(this.result.validFor,e.state,r,o)?new ri(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new Nh(e.state,l,a>=0)))?new ri(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:ot(e.state)):new Se(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Se(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new ri(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function Zp(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Fh(n,!0).test(s)}const Hh=E.define({map(n,e){return n.map(t=>t.map(e))}}),zh=E.define(),De=be.define({create(){return vn.start()},update(n,e){return n.update(e)},provide:n=>[Aa.from(n,e=>e.tooltip),O.contentAttributes.from(n,e=>e.attrs)]});function ji(n,e="option"){return t=>{let i=t.state.field(De,!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:zh.of(l)}),!0}}const eg=n=>{let e=n.state.field(De,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||Date.now()-e.open.timestampn.state.field(De,!1)?(n.dispatch({effects:yr.of(!0)}),!0):!1,ig=n=>{let e=n.state.field(De,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:mi.of(null)}),!0)};class ng{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const tl=50,sg=50,rg=1e3,og=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(De).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(De);if(!n.selectionSet&&!n.docChanged&&n.startState.field(De)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!js(i));for(let i=0;isg&&Date.now()-s.time>rg){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)js(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(De);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 Nh(e,t,n.explicitPos==t),s=new ng(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:mi.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(ke);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new Se(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:Hh.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(De,!1);if(e&&e.tooltip&&this.view.state.facet(ke).closeOnBlur){let t=e.open&&Ma(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:mi.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:yr.of(!1)}),20),this.composing=0}}}),qh=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, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class lg{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class br{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,ce.TrackDel),i=e.mapPos(this.to,1,ce.TrackDel);return t==null||i==null?null:new br(this.field,t,i)}}class wr{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 br(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 lg(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 wr(i,s)}}let ag=B.widget({widget:new class extends ct{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),hg=B.mark({class:"cm-snippetField"});class Gt{constructor(e,t){this.ranges=e,this.active=t,this.deco=B.set(e.map(i=>(i.from==i.to?ag:hg).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 Gt(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)}}),cg=E.define(),yi=be.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(ki))return t.value;if(t.is(cg)&&n)return new Gt(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:B.none)});function xr(n,e){return b.create(n.filter(t=>t.field==e).map(t=>b.range(t.from,t.to)))}function fg(n){let e=wr.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:Vh.of(i)};if(l.length&&(a.selection=xr(l,0)),l.length>1){let h=new Gt(l,0),c=a.effects=[ki.of(h)];t.state.field(yi,!1)===void 0&&c.push(E.appendConfig.of([yi,mg,yg,qh]))}t.dispatch(t.state.update(a))}}function $h(n){return({state:e,dispatch:t})=>{let i=e.field(yi,!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:xr(i.ranges,s),effects:ki.of(r?null:new Gt(i.ranges,s))})),!0}}const ug=({state:n,dispatch:e})=>n.field(yi,!1)?(e(n.update({effects:ki.of(null)})),!0):!1,dg=$h(1),pg=$h(-1),gg=[{key:"Tab",run:dg,shift:pg},{key:"Escape",run:ug}],il=D.define({combine(n){return n.length?n[0]:gg}}),mg=At.highest(ir.compute([il],n=>n.facet(il)));function Zg(n,e){return Object.assign(Object.assign({},e),{apply:fg(n)})}const yg=O.domEventHandlers({mousedown(n,e){let t=e.state.field(yi,!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:xr(t.ranges,s.field),effects:ki.of(t.ranges.some(r=>r.field>s.field)?new Gt(t.ranges,s.field):null)}),!0)}}),bi={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},yt=E.define({map(n,e){let t=e.mapPos(n,-1,ce.TrackAfter);return t??void 0}}),Sr=new class extends wt{};Sr.startSide=1;Sr.endSide=-1;const Kh=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:[Sr.range(t.value,t.value+1)]}));return n}});function em(){return[wg,Kh]}const es="()[]{}<>";function jh(n){for(let e=0;e{if((bg?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Oe(ne(i,0))==1||e!=s.from||t!=s.to)return!1;let r=Sg(n.state,i);return r?(n.dispatch(r),!0):!1}),xg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Uh(n,n.selection.main.head).brackets||bi.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&&In(n.doc,o.head)==jh(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},tm=[{key:"Backspace",run:xg}];function Sg(n,e){let t=Uh(n,n.selection.main.head),i=t.brackets||bi.brackets;for(let s of i){let r=jh(ne(s,0));if(e==s)return r==s?Ag(n,s,i.indexOf(s+s+s)>-1,t):kg(n,s,r,t.before||bi.before);if(e==r&&Gh(n,n.selection.main.from))return Cg(n,s,r)}return null}function Gh(n,e){let t=!1;return n.field(Kh).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function In(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Oe(ne(t,0)))}function vg(n,e){let t=n.sliceString(e-2,e);return Oe(ne(t,0))==t.length?t:t.slice(1)}function kg(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=In(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 Cg(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&In(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:b.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Ag(n,e,t,i){let s=i.stringPrefixes||bi.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=In(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(Gh(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}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&&!Mg(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 Mg(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 im(n={}){return[De,ke.of(n),og,Og,qh]}const Dg=[{key:"Ctrl-Space",run:tg},{key:"Escape",run:ig},{key:"ArrowDown",run:ji(!0)},{key:"ArrowUp",run:ji(!1)},{key:"PageDown",run:ji(!0,"page")},{key:"PageUp",run:ji(!1,"page")},{key:"Enter",run:eg}],Og=At.highest(ir.computeN([ke],n=>n.facet(ke).defaultKeymap?[Dg]:[]));export{zg as A,qg as B,kn as C,cu as D,O as E,$g as F,Vg as G,ye as H,U as I,Ig as J,Qg as K,Is as L,Hp as M,nr as N,b as O,Ba as P,Hg as Q,Wg as R,Ka as S,V as T,Ru as U,Zg as V,La as W,Xu as X,N as a,Pg as b,Gg as c,Tg as d,Bg as e,Ug as f,em as g,Eg as h,Xg as i,tm as j,ir as k,_g as l,Yg as m,Jg as n,Dg as o,im as p,Rg as q,Lg as r,Kg as s,jg as t,me as u,R as v,Du as w,C as x,Ng as y,Iu as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index 4bfe6e49..ce4c4dee 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -44,7 +44,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + diff --git a/ui/package-lock.json b/ui/package-lock.json index f65281e4..6f79267c 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -31,9 +31,9 @@ } }, "node_modules/@codemirror/autocomplete": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.4.2.tgz", - "integrity": "sha512-8WE2xp+D0MpWEv5lZ6zPW1/tf4AGb358T5GWYiKEuCP8MvFfT3tH2mIF9Y2yr2e3KbHuSvsVhosiEyqCpiJhZQ==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.5.1.tgz", + "integrity": "sha512-/Sv9yJmqyILbZ26U4LBHnAtbikuVxWUp+rQ8BXuRGtxZfbfKOY/WPbsUtvSP2h0ZUZMlkxV/hqbKRFzowlA6xw==", "dev": true, "dependencies": { "@codemirror/language": "^6.0.0", @@ -90,9 +90,9 @@ } }, "node_modules/@codemirror/lang-javascript": { - "version": "6.1.5", - "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.1.5.tgz", - "integrity": "sha512-BS2SmI1IXxWqMPhbJ0DC3eAHAK9V9XvdHMSqwvTBnmh5xFALt+cVDg7XE/A1dxdxzXYXyeqGddgqx1rQv7AYaw==", + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.1.6.tgz", + "integrity": "sha512-TTK28z+vJQY9GAefLTDDptI2LMqMfAiuTpt8s9SsNwocjVQ1v9yTzfReMf1hYhspQCdhfa7fdKnQJ78mKe/bHQ==", "dev": true, "dependencies": { "@codemirror/autocomplete": "^6.0.0", @@ -105,9 +105,9 @@ } }, "node_modules/@codemirror/lang-sql": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.4.0.tgz", - "integrity": "sha512-UWGK1+zc9+JtkiT+XxHByp4N6VLgLvC2x0tIudrJG26gyNtn0hWOVoB0A8kh/NABPWkKl3tLWDYf2qOBJS9Zdw==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.4.1.tgz", + "integrity": "sha512-PFB56L+A0WGY35uRya+Trt5g19V9k2V9X3c55xoFW4RgiATr/yLqWsbbnEsdxuMn5tLpuikp7Kmj9smRsqBXAg==", "dev": true, "dependencies": { "@codemirror/autocomplete": "^6.0.0", @@ -141,9 +141,9 @@ } }, "node_modules/@codemirror/lint": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.2.0.tgz", - "integrity": "sha512-KVCECmR2fFeYBr1ZXDVue7x3q5PMI0PzcIbA+zKufnkniMBo1325t0h1jM85AKp8l3tj67LRxVpZfgDxEXlQkg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.2.1.tgz", + "integrity": "sha512-y1muai5U/uUPAGRyHMx9mHuHLypPcHWxzlZGknp/U5Mdb5Ol8Q5ZLp67UqyTbNFJJ3unVxZ8iX3g1fMN79S1JQ==", "dev": true, "dependencies": { "@codemirror/state": "^6.0.0", @@ -169,9 +169,9 @@ "dev": true }, "node_modules/@codemirror/view": { - "version": "6.9.3", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.9.3.tgz", - "integrity": "sha512-BJ5mvEIhFM+SrNwc5X8pLIvMM9ffjkviVbxpg84Xk2OE8ZyKaEbId8kX+nAYEEso7+qnbwsXe1bkAHsasebMow==", + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.9.4.tgz", + "integrity": "sha512-Ov2H9gwlGUxiH94zWxlLtTlyogSFaQDIYjtSEcfzgh7MkKmKVchkmr4JbtR5zBev3jY5DVtKvUC8yjd1bKW55A==", "dev": true, "dependencies": { "@codemirror/state": "^6.1.4", @@ -1038,12 +1038,12 @@ } }, "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.3.tgz", + "integrity": "sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==", "dev": true, "dependencies": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.12.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -1077,9 +1077,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.61.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.61.0.tgz", - "integrity": "sha512-PDsN7BrVkNZK2+dj/dpKQAWZavbAQ87IXqVvw2+oEYI+GwlTWkvbQtL7F2cCNbMqJEYKPh1EcjSxsnqIb/kyaQ==", + "version": "1.62.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.62.0.tgz", + "integrity": "sha512-Q4USplo4pLYgCi+XlipZCWUQz5pkg/ruSSgJ0WRDSb/+3z9tXUOkQ7QPYn4XrhZKYAK4HlpaQecRwKLJX6+DBg==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -1249,9 +1249,9 @@ }, "dependencies": { "@codemirror/autocomplete": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.4.2.tgz", - "integrity": "sha512-8WE2xp+D0MpWEv5lZ6zPW1/tf4AGb358T5GWYiKEuCP8MvFfT3tH2mIF9Y2yr2e3KbHuSvsVhosiEyqCpiJhZQ==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.5.1.tgz", + "integrity": "sha512-/Sv9yJmqyILbZ26U4LBHnAtbikuVxWUp+rQ8BXuRGtxZfbfKOY/WPbsUtvSP2h0ZUZMlkxV/hqbKRFzowlA6xw==", "dev": true, "requires": { "@codemirror/language": "^6.0.0", @@ -1302,9 +1302,9 @@ } }, "@codemirror/lang-javascript": { - "version": "6.1.5", - "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.1.5.tgz", - "integrity": "sha512-BS2SmI1IXxWqMPhbJ0DC3eAHAK9V9XvdHMSqwvTBnmh5xFALt+cVDg7XE/A1dxdxzXYXyeqGddgqx1rQv7AYaw==", + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.1.6.tgz", + "integrity": "sha512-TTK28z+vJQY9GAefLTDDptI2LMqMfAiuTpt8s9SsNwocjVQ1v9yTzfReMf1hYhspQCdhfa7fdKnQJ78mKe/bHQ==", "dev": true, "requires": { "@codemirror/autocomplete": "^6.0.0", @@ -1317,9 +1317,9 @@ } }, "@codemirror/lang-sql": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.4.0.tgz", - "integrity": "sha512-UWGK1+zc9+JtkiT+XxHByp4N6VLgLvC2x0tIudrJG26gyNtn0hWOVoB0A8kh/NABPWkKl3tLWDYf2qOBJS9Zdw==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.4.1.tgz", + "integrity": "sha512-PFB56L+A0WGY35uRya+Trt5g19V9k2V9X3c55xoFW4RgiATr/yLqWsbbnEsdxuMn5tLpuikp7Kmj9smRsqBXAg==", "dev": true, "requires": { "@codemirror/autocomplete": "^6.0.0", @@ -1353,9 +1353,9 @@ } }, "@codemirror/lint": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.2.0.tgz", - "integrity": "sha512-KVCECmR2fFeYBr1ZXDVue7x3q5PMI0PzcIbA+zKufnkniMBo1325t0h1jM85AKp8l3tj67LRxVpZfgDxEXlQkg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.2.1.tgz", + "integrity": "sha512-y1muai5U/uUPAGRyHMx9mHuHLypPcHWxzlZGknp/U5Mdb5Ol8Q5ZLp67UqyTbNFJJ3unVxZ8iX3g1fMN79S1JQ==", "dev": true, "requires": { "@codemirror/state": "^6.0.0", @@ -1381,9 +1381,9 @@ "dev": true }, "@codemirror/view": { - "version": "6.9.3", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.9.3.tgz", - "integrity": "sha512-BJ5mvEIhFM+SrNwc5X8pLIvMM9ffjkviVbxpg84Xk2OE8ZyKaEbId8kX+nAYEEso7+qnbwsXe1bkAHsasebMow==", + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.9.4.tgz", + "integrity": "sha512-Ov2H9gwlGUxiH94zWxlLtTlyogSFaQDIYjtSEcfzgh7MkKmKVchkmr4JbtR5zBev3jY5DVtKvUC8yjd1bKW55A==", "dev": true, "requires": { "@codemirror/state": "^6.1.4", @@ -1921,12 +1921,12 @@ "dev": true }, "resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.3.tgz", + "integrity": "sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==", "dev": true, "requires": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.12.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -1947,9 +1947,9 @@ "dev": true }, "sass": { - "version": "1.61.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.61.0.tgz", - "integrity": "sha512-PDsN7BrVkNZK2+dj/dpKQAWZavbAQ87IXqVvw2+oEYI+GwlTWkvbQtL7F2cCNbMqJEYKPh1EcjSxsnqIb/kyaQ==", + "version": "1.62.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.62.0.tgz", + "integrity": "sha512-Q4USplo4pLYgCi+XlipZCWUQz5pkg/ruSSgJ0WRDSb/+3z9tXUOkQ7QPYn4XrhZKYAK4HlpaQecRwKLJX6+DBg==", "dev": true, "requires": { "chokidar": ">=3.0.0 <4.0.0",