pocketbase/ui/dist/assets/index-a4705b02.js

212 lines
926 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(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 Sl=n=>n;function qe(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 zt(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 Cn(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 Ct(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?qe(t.ctx.slice(),n[1](i(e))):t.ctx}function Mt(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;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Ot(n,e,t,i,s,l){if(s){const o=F_(e,t,i,l);n.p(o,s)}}function Dt(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Ut(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Ge(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function Oi(n){return n??""}function tn(n,e,t){return n.set(t),e}function Ee(n){return n&&zt(n.destroy)?n.destroy:Q}function du(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const R_=typeof window<"u";let Ro=R_?()=>window.performance.now():()=>Date.now(),_a=R_?n=>requestAnimationFrame(n):Q;const vs=new Set;function q_(n){vs.forEach(e=>{e.c(n)||(vs.delete(e),e.f())}),vs.size!==0&&_a(q_)}function qo(n){let e;return vs.size===0&&_a(q_),{promise:new Promise(t=>{vs.add(e={c:n,f:t})}),abort(){vs.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 pt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function y(n){return document.createElement(n)}function U(n){return document.createTextNode(n)}function E(){return U(" ")}function Se(){return U("")}function J(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function ct(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Mn(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 ti(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 gt(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 fl(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 cl(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=Sl,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&&(_=fl(n,0,1,o,l,r,d)),l||(m=!0)}function b(){d&&cl(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 dl;function fi(n){dl=n}function $l(){if(!dl)throw new Error("Function called outside component initialization");return dl}function Xt(n){$l().$$.on_mount.push(n)}function Ab(n){$l().$$.after_update.push(n)}function z_(n){$l().$$.on_destroy.push(n)}function wt(){const n=$l();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 bs=[],se=[];let ys=[];const jr=[],B_=Promise.resolve();let Vr=!1;function U_(){Vr||(Vr=!0,B_.then(ga))}function un(){return U_(),B_}function tt(n){ys.push(n)}function ye(n){jr.push(n)}const ir=new Set;let ds=0;function ga(){if(ds!==0)return;const n=dl;do{try{for(;ds<bs.length;){const e=bs[ds];ds++,fi(e),Ib(e.$$)}}catch(e){throw bs.length=0,ds=0,e}for(fi(null),bs.length=0,ds=0;se.length;)se.pop()();for(let e=0;e<ys.length;e+=1){const t=ys[e];ir.has(t)||(ir.add(t),t())}ys.length=0}while(bs.length);for(;jr.length;)jr.pop()();Vr=!1,ir.clear(),fi(n)}function Ib(n){if(n.fragment!==null){n.update(),De(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(tt)}}function Pb(n){const e=[],t=[];ys.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ys=e}let js;function ba(){return js||(js=Promise.resolve(),js.then(()=>{js=null})),js}function Xi(n,e,t){n.dispatchEvent(V_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Qn;function re(){Qn={r:0,c:[],p:Qn}}function ae(){Qn.r||De(Qn.c),Qn=Qn.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),Qn.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&&cl(n,o)}function f(){const{delay:p=0,duration:m=300,easing:_=Sl,tick:g=Q,css:b}=s||va;b&&(o=fl(n,0,1,m,p,_,b,a++)),g(0,1);const k=Ro()+p,$=k+m;r&&r.abort(),l=!0,tt(()=>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,cl(n),zt(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=Qn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:d=Sl,tick:p=Q,css:m}=s||va;m&&(o=fl(n,1,0,f,u,d,m));const _=Ro()+u,g=_+f;tt(()=>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 zt(s)?ba().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&cl(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&&cl(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=Sl,tick:k=Q,css:$}=l||va,T={start:Ro()+_,b:m};m||(T.group=Qn,Qn.r+=1),r||a?a=T:($&&(f(),u=fl(n,o,m,g,_,b,$)),m&&k(0,1),r=d(T,g),tt(()=>Xi(n,m,"start")),qo(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,Xi(n,r.b,"start"),$&&(f(),u=fl(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 O=C-r.start;o=r.a+r.d*b(O/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(m){zt(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=$l();if(n.then(l=>{fi(s),i(e.then,1,e.value,l),fi(null)},l=>{if(fi(s),i(e.catch,2,e.error,l),fi(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 is(n,e){n.d(1),e.delete(n.key)}function Kt(n,e){P(n,1,1,()=>{e.delete(n.key)})}function Rb(n,e){n.f(),Kt(n,e)}function kt(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 D=d(s,l,_),I=t(D);let L=o.get(I);L?i&&T.push(()=>L.p(D,e)):(L=u(I,D),L.c()),k.set(I,b[_]=L),I in g&&$.set(I,Math.abs(_-g[I]))}const C=new Set,O=new Set;function M(D){A(D,1),D.m(r,f),o.set(D.key,D),f=D.first,m--}for(;p&&m;){const D=b[m-1],I=n[p-1],L=D.key,F=I.key;D===I?(f=D.first,p--,m--):k.has(F)?!o.has(L)||C.has(L)?M(D):O.has(F)?p--:$.get(L)>$.get(F)?(O.add(L),M(D)):(C.add(F),p--):(a(I,o),p--)}for(;p--;){const D=n[p];k.has(D.key)||a(D,o)}for(;m;)M(b[m-1]);return De(T),b}function $t(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 Wt(n){return typeof n=="object"&&n!==null?n:{}}function me(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function H(n){n&&n.c()}function j(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||tt(()=>{const o=n.$$.on_mount.map(L_).filter(zt);n.$$.on_destroy?n.$$.on_destroy.push(...o):De(o),n.$$.on_mount=[]}),l.forEach(tt)}function V(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&&(bs.push(n),U_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function be(n,e,t,i,s,l,o,r=[-1]){const a=dl;fi(n);const u=n.$$={fragment:null,ctx:[],props:l,update:Q,not_equal:s,bound:cu(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:cu(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};o&&o(u.root);let f=!1;if(u.ctx=t?t(n,e.props||{},(d,p,...m)=>{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),j(n,e.target,e.anchor,e.customElement),ga()}fi(a)}class ve{$destroy(){V(this,1),this.$destroy=Q}$on(e,t){if(!zt(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 Ft(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<n.conditions.length;t++)if(!n.conditions[t]||typeof n.conditions[t]!="function")throw Error("Invalid parameter conditions["+t+"]")}return n.loadingComponent&&(n.asyncComponent.loading=n.loadingComponent,n.asyncComponent.loadingParams=n.loadingParams||void 0),{component:n.asyncComponent,userData:n.userData,conditions:n.conditions&&n.conditions.length?n.conditions:void 0,props:n.props&&Object.keys(n.props).length?n.props:{},_sveltesparouter:!0}}const ps=[];function W_(n,e){return{subscribe:On(n,e).subscribe}}function On(n,e=Q){let t;const i=new Set;function s(r){if(_e(n,r)&&(n=r,t)){const a=!ps.length;for(const u of i)u[1](),ps.push(u,n);if(a){for(let u=0;u<ps.length;u+=2)ps[u][0](ps[u+1]);ps.length=0}}}function l(r){s(r(n))}function o(r,a=Q){const u=[r,a];return i.add(u),i.size===1&&(t=e(s)||Q),r(n),()=>{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=zt(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<s.length;u+=1)a=qe(a,s[u]);return{props:a}}return l&&(e=Pt(l,o()),e.$on("routeEvent",n[7])),{c(){e&&H(e.$$.fragment),t=Se()},m(r,a){e&&j(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a&4?$t(s,[Wt(r[2])]):{};if(a&1&&l!==(l=r[0])){if(e){re();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}l?(e=Pt(l,o()),e.$on("routeEvent",r[7]),H(e.$$.fragment),A(e.$$.fragment,1),j(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&&V(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<s.length;u+=1)a=qe(a,s[u]);return{props:a}}return l&&(e=Pt(l,o()),e.$on("routeEvent",n[6])),{c(){e&&H(e.$$.fragment),t=Se()},m(r,a){e&&j(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a&6?$t(s,[a&2&&{params:r[1]},a&4&&Wt(r[2])]):{};if(a&1&&l!==(l=r[0])){if(e){re();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}l?(e=Pt(l,o()),e.$on("routeEvent",r[6]),H(e.$$.fragment),A(e.$$.fragment,1),j(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&&V(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=On(void 0);async function Ii(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await un();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 ln(n,e){if(e=gu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> 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(O,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!O||typeof O=="string"&&(O.length<1||O.charAt(0)!="/"&&O.charAt(0)!="*")||typeof O=="object"&&!(O instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:I}=K_(O);this.path=O,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=D,this._keys=I}match(O){if(s){if(typeof s=="string")if(O.startsWith(s))O=O.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const L=O.match(s);if(L&&L[0])O=O.substr(L[0].length)||"/";else return null}}const M=this._pattern.exec(O);if(M===null)return null;if(this._keys===!1)return M;const D={};let I=0;for(;I<this._keys.length;){try{D[this._keys[I]]=decodeURIComponent(M[I+1]||"")||null}catch{D[this._keys[I]]=null}I++}return D}async checkConditions(O){for(let M=0;M<this.conditions.length;M++)if(!await this.conditions[M](O))return!1;return!0}}const r=[];i instanceof Map?i.forEach((C,O)=>{r.push(new o(O,C))}):Object.keys(i).forEach(C=>{r.push(new o(C,i[C]))});let a=null,u=null,f={};const d=wt();async function p(C,O){await un(),d(C,O)}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 O=0;for(;O<r.length;){const M=r[O].match(C.location);if(!M){O++;continue}const D={route:r[O].path,location:C.location,querystring:C.querystring,userData:r[O].userData,params:M&&typeof M=="object"&&Object.keys(M).length?M:null};if(!await r[O].checkConditions(D)){t(0,a=null),b=null,p("conditionsFailed",D);return}p("routeLoading",Object.assign({},D));const I=r[O].component;if(b!=I){I.loading?(t(0,a=I.loading),b=I,t(1,u=I.loadingParams),t(2,f={}),p("routeLoaded",Object.assign({},D,{component:a,name:a.name,params:u}))):(t(0,a=null),b=null);const L=await I();if(C!=g)return;t(0,a=L&&L.default||L),b=I}M&&typeof M=="object"&&Object.keys(M).length?t(1,u=M):t(1,u=null),t(2,f=r[O].props),p("routeLoaded",Object.assign({},D,{component:a,name:a.name,params:u})).then(()=>{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 Un(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={},at=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 Gt(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;i<s;i++)for(var l in t=arguments[i])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e},zr.apply(this,arguments)};function on(n,e,t,i){return new(t||(t=Promise))(function(s,l){function o(u){try{a(i.next(u))}catch(f){l(f)}}function r(u){try{a(i.throw(u))}catch(f){l(f)}}function a(u){u.done?s(u.value):function(d){return d instanceof t?d:new t(function(p){p(d)})}(u.value).then(o,r)}a((i=i.apply(n,e||[])).next())})}function rn(n,e){var t,i,s,l,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(a){return function(u){return function(d){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,i&&(s=2&d[0]?i.return:d[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,d[1])).done)return s;switch(i=0,s&&(d=[2&d[0],s.value]),d[0]){case 0:case 1:s=d;break;case 4:return o.label++,{value:d[1],done:!1};case 5:o.label++,i=d[1],d=[0];continue;case 7:d=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!((s=s.length>0&&s[s.length-1])||d[0]!==6&&d[0]!==2)){o=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){o.label=d[1];break}if(d[0]===6&&o.label<s[1]){o.label=s[1],s=d;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(d);break}s[2]&&o.ops.pop(),o.trys.pop();continue}d=e.call(n,o)}catch(p){d=[6,p],i=0}finally{t=s=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([a,u])}}}var G_,pl=function(n){function e(t){var i,s,l,o,r=this;return(r=n.call(this,"ClientResponseError")||this).url="",r.status=0,r.response={},r.isAbort=!1,r.originalError=null,Object.setPrototypeOf(r,e.prototype),t instanceof e||(r.originalError=t),t!==null&&typeof t=="object"&&(r.url=typeof t.url=="string"?t.url:"",r.status=typeof t.status=="number"?t.status:0,r.response=t.data!==null&&typeof t.data=="object"?t.data:{},r.isAbort=!!t.isAbort),typeof DOMException<"u"&&t instanceof DOMException&&(r.isAbort=!0),r.name="ClientResponseError "+r.status,r.message=(i=r.response)===null||i===void 0?void 0:i.message,r.message||(r.isAbort?r.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":!((o=(l=(s=r.originalError)===null||s===void 0?void 0:s.cause)===null||l===void 0?void 0:l.message)===null||o===void 0)&&o.includes("ECONNREFUSED ::1")?r.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":r.message="Something went wrong while processing your request."),r}return Gt(e,n),Object.defineProperty(e.prototype,"data",{get:function(){return this.response},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return zr({},this)},e}(Error),jl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function yu(n,e,t){var i=Object.assign({},t||{}),s=i.encode||Zb;if(!jl.test(n))throw new TypeError("argument name is invalid");var l=s(e);if(l&&!jl.test(l))throw new TypeError("argument val is invalid");var o=n+"="+l;if(i.maxAge!=null){var r=i.maxAge-0;if(isNaN(r)||!isFinite(r))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(r)}if(i.domain){if(!jl.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain="+i.domain}if(i.path){if(!jl.test(i.path))throw new TypeError("option path is invalid");o+="; Path="+i.path}if(i.expires){if(!function(u){return Object.prototype.toString.call(u)==="[object Date]"||u instanceof Date}(i.expires)||isNaN(i.expires.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():i.priority){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o}function Jb(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function Zb(n){return encodeURIComponent(n)}function X_(n){if(n)try{var e=decodeURIComponent(G_(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}function Q_(n,e){e===void 0&&(e=0);var t=X_(n);return!(Object.keys(t).length>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 Tl=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);t<i.length;t++){var s=i[t],l=s[0],o=s[1];this[l]=o}this.id=e.id!==void 0?e.id:"",this.created=e.created!==void 0?e.created:"",this.updated=e.updated!==void 0?e.updated:""},Object.defineProperty(n.prototype,"isNew",{get:function(){return this.$isNew},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"$isNew",{get:function(){return!this.id},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return this.$clone()},n.prototype.$clone=function(){var e=typeof structuredClone=="function"?structuredClone(this):JSON.parse(JSON.stringify(this));return new this.constructor(e)},n.prototype.export=function(){return this.$export()},n.prototype.$export=function(){return Object.assign({},this)},n}(),di=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Gt(e,n),e.prototype.$load=function(t){n.prototype.$load.call(this,t),this.collectionId=typeof t.collectionId=="string"?t.collectionId:"",this.collectionName=typeof t.collectionName=="string"?t.collectionName:"",this._loadExpand(t.expand)},e.prototype._loadExpand=function(t){for(var i in t=t||{},this.expand={},t)Array.isArray(t[i])?this.expand[i]=t[i].map(function(s){return new e(s||{})}):this.expand[i]=new e(t[i]||{})},e}(Tl),ts=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Gt(e,n),e.prototype.$load=function(t){n.prototype.$load.call(this,t),this.avatar=typeof t.avatar=="number"?t.avatar:0,this.email=typeof t.email=="string"?t.email:""},e}(Tl),Gb=function(){function n(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}return Object.defineProperty(n.prototype,"token",{get:function(){return this.baseToken},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.baseModel},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isValid",{get:function(){return!Q_(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this.baseToken=e||"",this.baseModel=t!==null&&typeof t=="object"?t.collectionId!==void 0?new di(t):new ts(t):null,this.triggerChange()},n.prototype.clear=function(){this.baseToken="",this.baseModel=null,this.triggerChange()},n.prototype.loadFromCookie=function(e,t){t===void 0&&(t="pb_auth");var i=function(o,r){var a={};if(typeof o!="string")return a;for(var u=Object.assign({},r||{}).decode||Jb,f=0;f<o.length;){var d=o.indexOf("=",f);if(d===-1)break;var p=o.indexOf(";",f);if(p===-1)p=o.length;else if(p<d){f=o.lastIndexOf(";",d-1)+1;continue}var m=o.slice(f,d).trim();if(a[m]===void 0){var _=o.slice(d+1,p).trim();_.charCodeAt(0)===34&&(_=_.slice(1,-1));try{a[m]=u(_)}catch{a[m]=_}}f=p+1}return a}(e||"")[t]||"",s={};try{(typeof(s=JSON.parse(i))===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)},n.prototype.exportToCookie=function(e,t){var i,s,l;t===void 0&&(t="pb_auth");var o={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},r=X_(this.token);r!=null&&r.exp?o.expires=new Date(1e3*r.exp):o.expires=new Date("1970-01-01"),e=Object.assign({},o,e);var a={token:this.token,model:((i=this.model)===null||i===void 0?void 0:i.export())||null},u=yu(t,JSON.stringify(a),e),f=typeof Blob<"u"?new Blob([u]).size:u.length;return a.model&&f>4096&&(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 di&&(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;e<t.length;e++){var i=t[e];i&&i(this.token,this.model)}},n}(),x_=function(n){function e(t){t===void 0&&(t="pocketbase_auth");var i=n.call(this)||this;return i.storageFallback={},i.storageKey=t,i}return Gt(e,n),Object.defineProperty(e.prototype,"token",{get:function(){return(this._storageGet(this.storageKey)||{}).token||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){var t,i=this._storageGet(this.storageKey)||{};return i===null||typeof i!="object"||i.model===null||typeof i.model!="object"?null:((t=i.model)===null||t===void 0?void 0:t.collectionId)===void 0?new ts(i.model):new di(i.model)},enumerable:!1,configurable:!0}),e.prototype.save=function(t,i){this._storageSet(this.storageKey,{token:t,model:i}),n.prototype.save.call(this,t,i)},e.prototype.clear=function(){this._storageRemove(this.storageKey),n.prototype.clear.call(this)},e.prototype._storageGet=function(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){var i=window.localStorage.getItem(t)||"";try{return JSON.parse(i)}catch{return i}}return this.storageFallback[t]},e.prototype._storageSet=function(t,i){if(typeof window<"u"&&(window!=null&&window.localStorage)){var s=i;typeof i!="string"&&(s=JSON.stringify(i)),window.localStorage.setItem(t,s)}else this.storageFallback[t]=i},e.prototype._storageRemove=function(t){var i;typeof window<"u"&&(window!=null&&window.localStorage)&&((i=window.localStorage)===null||i===void 0||i.removeItem(t)),delete this.storageFallback[t]},e}(Gb),Is=function(e){this.client=e},Xb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Gt(e,n),e.prototype.getAll=function(t){return t===void 0&&(t={}),this.client.send("/api/settings",{method:"GET",params:t}).then(function(i){return i||{}})},e.prototype.update=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send("/api/settings",{method:"PATCH",params:i,body:t}).then(function(s){return s||{}})},e.prototype.testS3=function(t){return t===void 0&&(t={}),this.client.send("/api/settings/test/s3",{method:"POST",params:t}).then(function(){return!0})},e.prototype.testEmail=function(t,i,s){s===void 0&&(s={});var l={email:t,template:i};return this.client.send("/api/settings/test/email",{method:"POST",params:s,body:l}).then(function(){return!0})},e.prototype.generateAppleClientSecret=function(t,i,s,l,o,r,a){return r===void 0&&(r={}),a===void 0&&(a={}),r=Object.assign({clientId:t,teamId:i,keyId:s,privateKey:l,duration:o},r),this.client.send("/api/settings/apple/generate-client-secret",{method:"POST",params:a,body:r})},e}(Is),eg=function(e,t,i,s,l){this.page=e>0?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 Gt(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 Gt(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 on(l,void 0,void 0,function(){return rn(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<f.length;u++){var d=f[u];a.push(o.decode(d))}}return new eg((r==null?void 0:r.page)||1,(r==null?void 0:r.perPage)||0,(r==null?void 0:r.totalItems)||0,(r==null?void 0:r.totalPages)||0,a)})},e.prototype._getOne=function(t,i,s){var l=this;return s===void 0&&(s={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"GET",params:s}).then(function(o){return l.decode(o)})},e.prototype._getFirstListItem=function(t,i,s){return s===void 0&&(s={}),s=Object.assign({filter:i,$cancelKey:"one_by_filter_"+t+"_"+i},s),this._getList(t,1,1,s).then(function(l){var o;if(!(!((o=l==null?void 0:l.items)===null||o===void 0)&&o.length))throw new pl({status:404,data:{code:404,message:"The requested resource wasn't found.",data:{}}});return l.items[0]})},e.prototype._create=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),this.client.send(t,{method:"POST",params:s,body:i}).then(function(o){return l.decode(o)})},e.prototype._update=function(t,i,s,l){var o=this;return s===void 0&&(s={}),l===void 0&&(l={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"PATCH",params:l,body:s}).then(function(r){return o.decode(r)})},e.prototype._delete=function(t,i,s){return s===void 0&&(s={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"DELETE",params:s}).then(function(){return!0})},e}(Is)),Qb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Gt(e,n),e.prototype.decode=function(t){return new ts(t)},Object.defineProperty(e.prototype,"baseCrudPath",{get:function(){return"/api/admins"},enumerable:!1,configurable:!0}),e.prototype.update=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),n.prototype.update.call(this,t,i,s).then(function(o){var r,a;return l.client.authStore.model&&((r=l.client.authStore.model)===null||r===void 0?void 0:r.collectionId)===void 0&&((a=l.client.authStore.model)===null||a===void 0?void 0:a.id)===(o==null?void 0:o.id)&&l.client.authStore.save(l.client.authStore.token,o),o})},e.prototype.delete=function(t,i){var s=this;return i===void 0&&(i={}),n.prototype.delete.call(this,t,i).then(function(l){var o,r;return l&&s.client.authStore.model&&((o=s.client.authStore.model)===null||o===void 0?void 0:o.collectionId)===void 0&&((r=s.client.authStore.model)===null||r===void 0?void 0:r.id)===t&&s.client.authStore.clear(),l})},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:i})},e.prototype.authWithPassword=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({identity:t,password:i},s),this.client.send(this.baseCrudPath+"/auth-with-password",{method:"POST",params:l,body:s}).then(this.authResponse.bind(this))},e.prototype.authRefresh=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCrudPath+"/auth-refresh",{method:"POST",params:i,body:t}).then(this.authResponse.bind(this))},e.prototype.requestPasswordReset=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCrudPath+"/request-password-reset",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,s,l,o){return l===void 0&&(l={}),o===void 0&&(o={}),l=Object.assign({token:t,password:i,passwordConfirm:s},l),this.client.send(this.baseCrudPath+"/confirm-password-reset",{method:"POST",params:o,body:l}).then(function(){return!0})},e}(ka),xb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Gt(e,n),e.prototype.$load=function(t){n.prototype.$load.call(this,t),this.recordId=typeof t.recordId=="string"?t.recordId:"",this.collectionId=typeof t.collectionId=="string"?t.collectionId:"",this.provider=typeof t.provider=="string"?t.provider:"",this.providerId=typeof t.providerId=="string"?t.providerId:""},e}(Tl),e0=function(n){function e(t,i){var s=n.call(this,t)||this;return s.collectionIdOrName=i,s}return Gt(e,n),e.prototype.decode=function(t){return new di(t)},Object.defineProperty(e.prototype,"baseCrudPath",{get:function(){return this.baseCollectionPath+"/records"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseCollectionPath",{get:function(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)},enumerable:!1,configurable:!0}),e.prototype.subscribeOne=function(t,i){return on(this,void 0,void 0,function(){return rn(this,function(s){return console.warn("PocketBase: subscribeOne(recordId, callback) is deprecated. Please replace it with subscribe(recordId, callback)."),[2,this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,i)]})})},e.prototype.subscribe=function(t,i){return on(this,void 0,void 0,function(){var s;return rn(this,function(l){if(typeof t=="function")return console.warn("PocketBase: subscribe(callback) is deprecated. Please replace it with subscribe('*', callback)."),[2,this.client.realtime.subscribe(this.collectionIdOrName,t)];if(!i)throw new Error("Missing subscription callback.");if(t==="")throw new Error("Missing topic.");return s=this.collectionIdOrName,t!=="*"&&(s+="/"+t),[2,this.client.realtime.subscribe(s,i)]})})},e.prototype.unsubscribe=function(t){return on(this,void 0,void 0,function(){return rn(this,function(i){return t==="*"?[2,this.client.realtime.unsubscribe(this.collectionIdOrName)]:t?[2,this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t)]:[2,this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)]})})},e.prototype.getFullList=function(t,i){if(typeof t=="number")return n.prototype.getFullList.call(this,t,i);var s=Object.assign({},t,i);return n.prototype.getFullList.call(this,s)},e.prototype.getList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),n.prototype.getList.call(this,t,i,s)},e.prototype.getFirstListItem=function(t,i){return i===void 0&&(i={}),n.prototype.getFirstListItem.call(this,t,i)},e.prototype.getOne=function(t,i){return i===void 0&&(i={}),n.prototype.getOne.call(this,t,i)},e.prototype.create=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),n.prototype.create.call(this,t,i)},e.prototype.update=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),n.prototype.update.call(this,t,i,s).then(function(o){var r,a,u;return((r=l.client.authStore.model)===null||r===void 0?void 0:r.id)!==(o==null?void 0:o.id)||((a=l.client.authStore.model)===null||a===void 0?void 0:a.collectionId)!==l.collectionIdOrName&&((u=l.client.authStore.model)===null||u===void 0?void 0:u.collectionName)!==l.collectionIdOrName||l.client.authStore.save(l.client.authStore.token,o),o})},e.prototype.delete=function(t,i){var s=this;return i===void 0&&(i={}),n.prototype.delete.call(this,t,i).then(function(l){var o,r,a;return!l||((o=s.client.authStore.model)===null||o===void 0?void 0:o.id)!==t||((r=s.client.authStore.model)===null||r===void 0?void 0:r.collectionId)!==s.collectionIdOrName&&((a=s.client.authStore.model)===null||a===void 0?void 0:a.collectionName)!==s.collectionIdOrName||s.client.authStore.clear(),l})},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:i})},e.prototype.listAuthMethods=function(t){return t===void 0&&(t={}),this.client.send(this.baseCollectionPath+"/auth-methods",{method:"GET",params:t}).then(function(i){return Object.assign({},i,{usernamePassword:!!(i!=null&&i.usernamePassword),emailPassword:!!(i!=null&&i.emailPassword),authProviders:Array.isArray(i==null?void 0:i.authProviders)?i==null?void 0:i.authProviders:[]})})},e.prototype.authWithPassword=function(t,i,s,l){var o=this;return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({identity:t,password:i},s),this.client.send(this.baseCollectionPath+"/auth-with-password",{method:"POST",params:l,body:s}).then(function(r){return o.authResponse(r)})},e.prototype.authWithOAuth2=function(t,i,s,l,o,r,a){var u=this;return o===void 0&&(o={}),r===void 0&&(r={}),a===void 0&&(a={}),r=Object.assign({provider:t,code:i,codeVerifier:s,redirectUrl:l,createData:o},r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",{method:"POST",params:a,body:r}).then(function(f){return u.authResponse(f)})},e.prototype.authRefresh=function(t,i){var s=this;return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCollectionPath+"/auth-refresh",{method:"POST",params:i,body:t}).then(function(l){return s.authResponse(l)})},e.prototype.requestPasswordReset=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCollectionPath+"/request-password-reset",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,s,l,o){return l===void 0&&(l={}),o===void 0&&(o={}),l=Object.assign({token:t,password:i,passwordConfirm:s},l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",{method:"POST",params:o,body:l}).then(function(){return!0})},e.prototype.requestVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCollectionPath+"/request-verification",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({token:t},i),this.client.send(this.baseCollectionPath+"/confirm-verification",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.requestEmailChange=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({newEmail:t},i),this.client.send(this.baseCollectionPath+"/request-email-change",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmEmailChange=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({token:t,password:i},s),this.client.send(this.baseCollectionPath+"/confirm-email-change",{method:"POST",params:l,body:s}).then(function(){return!0})},e.prototype.listExternalAuths=function(t,i){return i===void 0&&(i={}),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",{method:"GET",params:i}).then(function(s){var l=[];if(Array.isArray(s))for(var o=0,r=s;o<r.length;o++){var a=r[o];l.push(new xb(a))}return l})},e.prototype.unlinkExternalAuth=function(t,i,s){return s===void 0&&(s={}),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(i),{method:"DELETE",params:s}).then(function(){return!0})},e}(ka),vn=function(e){e===void 0&&(e={}),this.id=e.id!==void 0?e.id:"",this.name=e.name!==void 0?e.name:"",this.type=e.type!==void 0?e.type:"text",this.system=!!e.system,this.required=!!e.required,this.options=typeof e.options=="object"&&e.options!==null?e.options:{}},bn=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Gt(e,n),e.prototype.$load=function(t){n.prototype.$load.call(this,t),this.system=!!t.system,this.name=typeof t.name=="string"?t.name:"",this.type=typeof t.type=="string"?t.type:"base",this.options=t.options!==void 0&&t.options!==null?t.options:{},this.indexes=Array.isArray(t.indexes)?t.indexes:[],this.listRule=typeof t.listRule=="string"?t.listRule:null,this.viewRule=typeof t.viewRule=="string"?t.viewRule:null,this.createRule=typeof t.createRule=="string"?t.createRule:null,this.updateRule=typeof t.updateRule=="string"?t.updateRule:null,this.deleteRule=typeof t.deleteRule=="string"?t.deleteRule:null,t.schema=Array.isArray(t.schema)?t.schema:[],this.schema=[];for(var i=0,s=t.schema;i<s.length;i++){var l=s[i];this.schema.push(new vn(l))}},Object.defineProperty(e.prototype,"isBase",{get:function(){return this.$isBase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$isBase",{get:function(){return this.type==="base"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAuth",{get:function(){return this.$isAuth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$isAuth",{get:function(){return this.type==="auth"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isView",{get:function(){return this.$isView},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$isView",{get:function(){return this.type==="view"},enumerable:!1,configurable:!0}),e}(Tl),t0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Gt(e,n),e.prototype.decode=function(t){return new bn(t)},Object.defineProperty(e.prototype,"baseCrudPath",{get:function(){return"/api/collections"},enumerable:!1,configurable:!0}),e.prototype.import=function(t,i,s){return i===void 0&&(i=!1),s===void 0&&(s={}),on(this,void 0,void 0,function(){return rn(this,function(l){return[2,this.client.send(this.baseCrudPath+"/import",{method:"PUT",params:s,body:{collections:t,deleteMissing:i}}).then(function(){return!0})]})})},e}(ka),Br=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Gt(e,n),e.prototype.$load=function(t){n.prototype.$load.call(this,t),t.remoteIp=t.remoteIp||t.ip,this.url=typeof t.url=="string"?t.url:"",this.method=typeof t.method=="string"?t.method:"GET",this.status=typeof t.status=="number"?t.status:200,this.auth=typeof t.auth=="string"?t.auth:"guest",this.remoteIp=typeof t.remoteIp=="string"?t.remoteIp:"",this.userIp=typeof t.userIp=="string"?t.userIp:"",this.referer=typeof t.referer=="string"?t.referer:"",this.userAgent=typeof t.userAgent=="string"?t.userAgent:"",this.meta=typeof t.meta=="object"&&t.meta!==null?t.meta:{}},e}(Tl),n0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Gt(e,n),e.prototype.getRequestsList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),s=Object.assign({page:t,perPage:i},s),this.client.send("/api/logs/requests",{method:"GET",params:s}).then(function(l){var o=[];if(l!=null&&l.items){l.items=(l==null?void 0:l.items)||[];for(var r=0,a=l.items;r<a.length;r++){var u=a[r];o.push(new Br(u))}}return new eg((l==null?void 0:l.page)||1,(l==null?void 0:l.perPage)||0,(l==null?void 0:l.totalItems)||0,(l==null?void 0:l.totalPages)||0,o)})},e.prototype.getRequest=function(t,i){return i===void 0&&(i={}),this.client.send("/api/logs/requests/"+encodeURIComponent(t),{method:"GET",params:i}).then(function(s){return new Br(s)})},e.prototype.getRequestsStats=function(t){return t===void 0&&(t={}),this.client.send("/api/logs/requests/stats",{method:"GET",params:t}).then(function(i){return i})},e}(Is),i0=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.clientId="",t.eventSource=null,t.subscriptions={},t.lastSentTopics=[],t.maxConnectTimeout=15e3,t.reconnectAttempts=0,t.maxReconnectAttempts=1/0,t.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],t.pendingConnects=[],t}return Gt(e,n),Object.defineProperty(e.prototype,"isConnected",{get:function(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(t,i){var s;return on(this,void 0,void 0,function(){var l,o=this;return rn(this,function(r){switch(r.label){case 0:if(!t)throw new Error("topic must be set.");return l=function(a){var u,f=a;try{u=JSON.parse(f==null?void 0:f.data)}catch{}i(u||{})},this.subscriptions[t]||(this.subscriptions[t]=[]),this.subscriptions[t].push(l),this.isConnected?[3,2]:[4,this.connect()];case 1:return r.sent(),[3,5];case 2:return this.subscriptions[t].length!==1?[3,4]:[4,this.submitSubscriptions()];case 3:return r.sent(),[3,5];case 4:(s=this.eventSource)===null||s===void 0||s.addEventListener(t,l),r.label=5;case 5:return[2,function(){return on(o,void 0,void 0,function(){return rn(this,function(a){return[2,this.unsubscribeByTopicAndListener(t,l)]})})}]}})})},e.prototype.unsubscribe=function(t){var i;return on(this,void 0,void 0,function(){var s,l,o;return rn(this,function(r){switch(r.label){case 0:if(!this.hasSubscriptionListeners(t))return[2];if(t){for(s=0,l=this.subscriptions[t];s<l.length;s++)o=l[s],(i=this.eventSource)===null||i===void 0||i.removeEventListener(t,o);delete this.subscriptions[t]}else this.subscriptions={};return this.hasSubscriptionListeners()?[3,1]:(this.disconnect(),[3,3]);case 1:return this.hasSubscriptionListeners(t)?[3,3]:[4,this.submitSubscriptions()];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.unsubscribeByPrefix=function(t){var i;return on(this,void 0,void 0,function(){var s,l,o,r,a;return rn(this,function(u){switch(u.label){case 0:for(l in s=!1,this.subscriptions)if(l.startsWith(t)){for(s=!0,o=0,r=this.subscriptions[l];o<r.length;o++)a=r[o],(i=this.eventSource)===null||i===void 0||i.removeEventListener(l,a);delete this.subscriptions[l]}return s?this.hasSubscriptionListeners()?[4,this.submitSubscriptions()]:[3,2]:[2];case 1:return u.sent(),[3,3];case 2:this.disconnect(),u.label=3;case 3:return[2]}})})},e.prototype.unsubscribeByTopicAndListener=function(t,i){var s;return on(this,void 0,void 0,function(){var l,o;return rn(this,function(r){switch(r.label){case 0:if(!Array.isArray(this.subscriptions[t])||!this.subscriptions[t].length)return[2];for(l=!1,o=this.subscriptions[t].length-1;o>=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 on(this,void 0,void 0,function(){return rn(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];i<s.length;i++){var l=s[i];this.eventSource.addEventListener(t,l)}},e.prototype.removeAllSubscriptionListeners=function(){if(this.eventSource)for(var t in this.subscriptions)for(var i=0,s=this.subscriptions[t];i<s.length;i++){var l=s[i];this.eventSource.removeEventListener(t,l)}},e.prototype.connect=function(){return on(this,void 0,void 0,function(){var t=this;return rn(this,function(i){return this.reconnectAttempts>0?[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 on(t,void 0,void 0,function(){var l;return rn(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;l<o.length;l++)o[l].resolve();t.pendingConnects=[],t.reconnectAttempts=0,clearTimeout(t.reconnectTimeoutId),clearTimeout(t.connectTimeoutId)}).catch(function(l){t.clientId="",t.connectErrorHandler(l)})})},e.prototype.hasUnsentSubscriptions=function(){var t=this.getNonEmptySubscriptionTopics();if(t.length!=this.lastSentTopics.length)return!0;for(var i=0,s=t;i<s.length;i++){var l=s[i];if(!this.lastSentTopics.includes(l))return!0}return!1},e.prototype.connectErrorHandler=function(t){var i=this;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(var s=0,l=this.pendingConnects;s<l.length;s++)l[s].reject(new pl(t));this.disconnect()}else{this.disconnect(!0);var o=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(function(){i.initConnect()},o)}},e.prototype.disconnect=function(t){var i;if(t===void 0&&(t=!1),clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),(i=this.eventSource)===null||i===void 0||i.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(var s=new pl(new Error("Realtime disconnected.")),l=0,o=this.pendingConnects;l<o.length;l++)o[l].reject(s);this.pendingConnects=[]}},e}(Is),s0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Gt(e,n),e.prototype.check=function(t){return t===void 0&&(t={}),this.client.send("/api/health",{method:"GET",params:t})},e}(Is),l0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Gt(e,n),e.prototype.getUrl=function(t,i,s){s===void 0&&(s={});var l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(t.collectionId||t.collectionName)),l.push(encodeURIComponent(t.id)),l.push(encodeURIComponent(i));var o=this.client.buildUrl(l.join("/"));if(Object.keys(s).length){var r=new URLSearchParams(s);o+=(o.includes("?")?"&":"?")+r}return o},e.prototype.getToken=function(t){return t===void 0&&(t={}),this.client.send("/api/files/token",{method:"POST",params:t}).then(function(i){return(i==null?void 0:i.token)||""})},e}(Is),Vo=function(){function n(e,t,i){e===void 0&&(e="/"),i===void 0&&(i="en-US"),this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new x_,this.admins=new Qb(this),this.collections=new t0(this),this.files=new l0(this),this.logs=new n0(this),this.settings=new Xb(this),this.realtime=new i0(this),this.health=new s0(this)}return n.prototype.collection=function(e){return this.recordServices[e]||(this.recordServices[e]=new e0(this,e)),this.recordServices[e]},n.prototype.autoCancellation=function(e){return this.enableAutoCancellation=!!e,this},n.prototype.cancelRequest=function(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this},n.prototype.cancelAllRequests=function(){for(var e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this},n.prototype.send=function(e,t){var i,s,l,o,r,a,u,f;return on(this,void 0,void 0,function(){var d,p,m,_,g,b,k,$,T,C=this;return rn(this,function(O){switch(O.label){case 0:return d=Object.assign({method:"GET"},t),this.isFormData(d.body)||(d.body&&typeof d.body!="string"&&(d.body=JSON.stringify(d.body)),((i=d==null?void 0:d.headers)===null||i===void 0?void 0:i["Content-Type"])===void 0&&(d.headers=Object.assign({},d.headers,{"Content-Type":"application/json"}))),((s=d==null?void 0:d.headers)===null||s===void 0?void 0:s["Accept-Language"])===void 0&&(d.headers=Object.assign({},d.headers,{"Accept-Language":this.lang})),!((l=this.authStore)===null||l===void 0)&&l.token&&((o=d==null?void 0:d.headers)===null||o===void 0?void 0:o.Authorization)===void 0&&(d.headers=Object.assign({},d.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&((r=d.params)===null||r===void 0?void 0:r.$autoCancel)!==!1&&(p=((a=d.params)===null||a===void 0?void 0:a.$cancelKey)||(d.method||"GET")+e,this.cancelRequest(p),m=new AbortController,this.cancelControllers[p]=m,d.signal=m.signal),(u=d.params)===null||u===void 0||delete u.$autoCancel,(f=d.params)===null||f===void 0||delete f.$cancelKey,_=this.buildUrl(e),d.params!==void 0&&((g=this.serializeQueryParams(d.params))&&(_+=(_.includes("?")?"&":"?")+g),delete d.params),this.beforeSend?($=(k=Object).assign,T=[{}],[4,this.beforeSend(_,d)]):[3,2];case 1:(b=$.apply(k,T.concat([O.sent()]))).url!==void 0||b.options!==void 0?(_=b.url||_,d=b.options||d):Object.keys(b).length&&(d=b,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`.")),O.label=2;case 2:return[2,fetch(_,d).then(function(M){return on(C,void 0,void 0,function(){var D;return rn(this,function(I){switch(I.label){case 0:D={},I.label=1;case 1:return I.trys.push([1,3,,4]),[4,M.json()];case 2:return D=I.sent(),[3,4];case 3:return I.sent(),[3,4];case 4:return this.afterSend?[4,this.afterSend(M,D)]:[3,6];case 5:D=I.sent(),I.label=6;case 6:if(M.status>=400)throw new pl({url:M.url,status:M.status,data:D});return[2,D]}})})}).catch(function(M){throw new pl(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<r.length;o++){var a=r[o];t.push(l+"="+encodeURIComponent(a))}else s instanceof Date?t.push(l+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?t.push(l+"="+encodeURIComponent(JSON.stringify(s))):t.push(l+"="+encodeURIComponent(s))}return t.join("&")},n}();class ss extends Error{}class o0 extends ss{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class r0 extends ss{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class a0 extends ss{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Xs extends ss{}class tg extends ss{constructor(e){super(`Invalid unit ${e}`)}}class Fn extends ss{}class vi extends ss{constructor(){super("Zone is an abstract class")}}const Ae="numeric",Kn="short",Tn="long",Ur={year:Ae,month:Ae,day:Ae},ng={year:Ae,month:Kn,day:Ae},u0={year:Ae,month:Kn,day:Ae,weekday:Kn},ig={year:Ae,month:Tn,day:Ae},sg={year:Ae,month:Tn,day:Ae,weekday:Tn},lg={hour:Ae,minute:Ae},og={hour:Ae,minute:Ae,second:Ae},rg={hour:Ae,minute:Ae,second:Ae,timeZoneName:Kn},ag={hour:Ae,minute:Ae,second:Ae,timeZoneName:Tn},ug={hour:Ae,minute:Ae,hourCycle:"h23"},fg={hour:Ae,minute:Ae,second:Ae,hourCycle:"h23"},cg={hour:Ae,minute:Ae,second:Ae,hourCycle:"h23",timeZoneName:Kn},dg={hour:Ae,minute:Ae,second:Ae,hourCycle:"h23",timeZoneName:Tn},pg={year:Ae,month:Ae,day:Ae,hour:Ae,minute:Ae},mg={year:Ae,month:Ae,day:Ae,hour:Ae,minute:Ae,second:Ae},hg={year:Ae,month:Kn,day:Ae,hour:Ae,minute:Ae},_g={year:Ae,month:Kn,day:Ae,hour:Ae,minute:Ae,second:Ae},f0={year:Ae,month:Kn,day:Ae,weekday:Kn,hour:Ae,minute:Ae},gg={year:Ae,month:Tn,day:Ae,hour:Ae,minute:Ae,timeZoneName:Kn},bg={year:Ae,month:Tn,day:Ae,hour:Ae,minute:Ae,second:Ae,timeZoneName:Kn},vg={year:Ae,month:Tn,day:Ae,weekday:Tn,hour:Ae,minute:Ae,timeZoneName:Tn},yg={year:Ae,month:Tn,day:Ae,weekday:Tn,hour:Ae,minute:Ae,second:Ae,timeZoneName:Tn};function it(n){return typeof n>"u"}function Qi(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 Cs(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ci(n,e,t){return Ho(n)&&n>=e&&n<=t}function h0(n,e){return n-e*Math.floor(n/e)}function jt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function ki(n){if(!(it(n)||n===null||n===""))return parseInt(n,10)}function Vi(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 Cl(n){return n%4===0&&(n%100!==0||n%400===0)}function tl(n){return Cl(n)?366:365}function go(n,e){const t=h0(e-1,12)+1,i=n+(e-t)/12;return t===2?Cl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function $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 Fn(`Invalid unit value ${n}`);return e}function vo(n,e){const t={};for(const i in n)if(Cs(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=Sg(s)}return t}function nl(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}${jt(t,2)}:${jt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${jt(t,2)}${jt(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 gn{static create(e,t={}){return new gn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o<e.length;o++){const r=e.charAt(o);r==="'"?(i.length>0&&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 jt(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 _=gn.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(gn.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=gn.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 Wn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ml{get type(){throw new vi}get name(){throw new vi}get ianaName(){return this.name}get isUniversal(){throw new vi}offsetName(e,t){throw new vi}formatOffset(e,t){throw new vi}offset(e){throw new vi}equals(e){throw new vi}get isValid(){throw new vi}}let sr=null;class Ta extends Ml{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 nl(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<t.length;s++){const{type:l,value:o}=t[s],r=D0[l];l==="era"?i[r]=o:it(r)||(i[r]=parseInt(o,10))}return i}let Vl={};class pi extends Ml{static create(e){return Vl[e]||(Vl[e]=new pi(e)),Vl[e]}static resetCache(){Vl={},uo={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=pi.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return wg(e,t,i,this.name)}formatOffset(e,t){return nl(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=O0(this.name);let[s,l,o,r,a,u,f]=i.formatToParts?A0(i,t):E0(i,t);r==="BC"&&(s=-Math.abs(s)+1);const p=$a({year:s,month:l,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let m=+t;const _=m%1e3;return m-=_>=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 an extends Ml{static get utcInstance(){return lr===null&&(lr=new an(0)),lr}static instance(e){return e===0?an.utcInstance:new an(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new an(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${nl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${nl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return nl(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 Ml{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 wi(n,e){if(it(n)||n===null)return e;if(n instanceof Ml)return n;if(c0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?an.utcInstance:an.parseSpecifier(t)||pi.create(n)}else return Qi(n)?an.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 Bt{static get now(){return Su}static set now(e){Su=e}static set defaultZone(e){$u=e}static get defaultZone(){return wi($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(){Tt.resetCache(),pi.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 Qs=null;function F0(){return Qs||(Qs=new Intl.DateTimeFormat().resolvedOptions().locale,Qs)}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 jt(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&&pi.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 Tt{static fromOpts(e){return Tt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Bt.defaultLocale,o=l||(s?"en-US":F0()),r=t||Bt.defaultNumberingSystem,a=i||Bt.defaultOutputCalendar;return new Tt(o,r,a,l)}static resetCache(){Qs=null,Yr={},Jr={},Zr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Tt.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:Tt.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 Ps(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ls(...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 Ns(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;s<n.length;s++)i[n[s]]=ki(e[t+s]);return[i,null,t+s]}}const Pg=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,W0=`(?:${Pg.source}?(?:\\[(${$g.source})\\])?)?`,Ca=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Lg=RegExp(`${Ca.source}${W0}`),Ma=RegExp(`(?:T${Lg.source})?`),Y0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,K0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,J0=/(\d{4})-?(\d{3})/,Z0=Ig("weekYear","weekNumber","weekDay"),G0=Ig("year","ordinal"),X0=/(\d{4})-(\d\d)-(\d\d)/,Ng=RegExp(`${Ca.source} ?(?:${Pg.source}|(${$g.source}))?`),Q0=RegExp(`(?: ${Ng.source})?`);function ks(n,e,t){const i=n[e];return it(i)?t:ki(i)}function x0(n,e){return[{year:ks(n,e),month:ks(n,e+1,1),day:ks(n,e+2,1)},null,e+3]}function Fs(n,e){return[{hours:ks(n,e,0),minutes:ks(n,e+1,0),seconds:ks(n,e+2,0),milliseconds:wa(n[e+3])},null,e+4]}function Ol(n,e){const t=!n[e]&&!n[e+1],i=zo(n[e+1],n[e+2]),s=t?null:an.instance(i);return[{},s,e+3]}function Dl(n,e){const t=n[e]?pi.create(n[e]):null;return[{},t,e+1]}const ev=RegExp(`^T?${Ca.source}$`),tv=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function nv(n){const[e,t,i,s,l,o,r,a,u]=n,f=e[0]==="-",d=a&&a[0]==="-",p=(m,_=!1)=>m!==void 0&&(_||m&&f)?-m:m;return[{years:p(Vi(t)),months:p(Vi(i)),weeks:p(Vi(s)),days:p(Vi(l)),hours:p(Vi(o)),minutes:p(Vi(r)),seconds:p(Vi(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(ki(e)):ki(e),month:Tg.indexOf(t)+1,day:ki(i),hour:ki(s),minute:ki(l)};return o&&(r.second=ki(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 an(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),an.utcInstance]}function fv(n){const[,e,t,i,s,l,o,r]=n;return[Oa(e,r,t,i,s,l,o),an.utcInstance]}const cv=Ps(Y0,Ma),dv=Ps(K0,Ma),pv=Ps(J0,Ma),mv=Ps(Lg),Fg=Ls(x0,Fs,Ol,Dl),hv=Ls(Z0,Fs,Ol,Dl),_v=Ls(G0,Fs,Ol,Dl),gv=Ls(Fs,Ol,Dl);function bv(n){return Ns(n,[cv,Fg],[dv,hv],[pv,_v],[mv,gv])}function vv(n){return Ns(ov(n),[sv,lv])}function yv(n){return Ns(n,[rv,Eu],[av,Eu],[uv,fv])}function kv(n){return Ns(n,[tv,nv])}const wv=Ls(Fs);function Sv(n){return Ns(n,[ev,wv])}const $v=Ps(X0,Q0),Tv=Ps(Ng),Cv=Ls(Fs,Ol,Dl);function Mv(n){return Ns(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},An=146097/400,ms=146097/4800,Ev={years:{quarters:4,months:12,weeks:An/7,days:An,hours:An*24,minutes:An*24*60,seconds:An*24*60*60,milliseconds:An*24*60*60*1e3},quarters:{months:3,weeks:An/28,days:An/4,hours:An*24/4,minutes:An*24*60/4,seconds:An*24*60*60/4,milliseconds:An*24*60*60*1e3/4},months:{weeks:ms/7,days:ms,hours:ms*24,minutes:ms*24*60,seconds:ms*24*60*60,milliseconds:ms*24*60*60*1e3},...Rg},Yi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Av=Yi.slice(0).reverse();function Hi(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||Tt.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 Fn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:vo(e,ot.normalizeUnit),loc:Tt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(Qi(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new Fn(`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 Fn("need to specify a reason the Duration is invalid");const i=e instanceof Wn?e:new Wn(e,t);if(Bt.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?gn.create(this.loc,i).formatDurationFromString(this,e):Ov}toHuman(e={}){const t=Yi.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 Yi)(Cs(t.values,s)||Cs(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Hi(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 Hi(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 Hi(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),Hi(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),Hi(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 Yi)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;Qi(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)Yi.indexOf(u)>Yi.indexOf(o)&&qg(this.matrix,s,u,t,o)}else Qi(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 Hi(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 Hi(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 Yi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Vs="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"):e<n?Et.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`):null}class Et{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new Fn("need to specify a reason the Interval is invalid");const i=e instanceof Wn?e:new Wn(e,t);if(Bt.throwOnInvalid)throw new r0(i);return new Et({invalid:i})}static fromDateTimes(e,t){const i=Bs(e),s=Bs(t),l=Lv(i,s);return l??new Et({start:i,end:s})}static after(e,t){const i=ot.fromDurationLike(t),s=Bs(e);return Et.fromDateTimes(s,s.plus(i))}static before(e,t){const i=ot.fromDurationLike(t),s=Bs(e);return Et.fromDateTimes(s.minus(i),s)}static fromISO(e,t){const[i,s]=(e||"").split("/",2);if(i&&s){let l,o;try{l=ze.fromISO(i,t),o=l.isValid}catch{o=!1}let r,a;try{r=ze.fromISO(s,t),a=r.isValid}catch{a=!1}if(o&&a)return Et.fromDateTimes(l,r);if(o){const u=ot.fromISO(s,t);if(u.isValid)return Et.after(l,u)}else if(a){const u=ot.fromISO(i,t);if(u.isValid)return Et.before(r,u)}}return Et.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;const t=this.start.startOf(e),i=this.end.startOf(e);return Math.floor(i.diff(t,e).get(e))+1}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!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(Bs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s<this.e;){const o=t[l]||this.e,r=+o>+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(;i<this.e;){const r=this.start.plus(t.mapUnits(a=>a*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}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=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<e.e?this.e:e.e;return t>=i?null:Et.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,i=this.e>e.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()})`:Vs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Vs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Vs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Vs}toFormat(e,{separator:t=" "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Vs}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=Bt.defaultZone){const t=ze.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return pi.isValidZone(e)}static normalizeZone(e){return wi(e,Bt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Tt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Tt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Tt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Tt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Tt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Tt.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&&(o<e&&(o=s.plus({[r]:1})),o!==s&&(l[r]=(l[r]||0)+a/(o-s)));const f=ot.fromObject(l,i);return u.length>0?ot.fromMillis(a,i).shiftTo(...u).plus(f):f}const Da={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",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<n.length;t++){const i=n.charCodeAt(t);if(n[t].search(Da.hanidec)!==-1)e+=Rv.indexOf(n[t]);else for(const s in Iu){const[l,o]=Iu[s];i>=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function zn({numberingSystem:n},e=""){return new RegExp(`${Da[n||"latn"]}${e}`)}const jv="missing Intl.DateTimeFormat.formatToParts support";function ut(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 Bn(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=zn(e),i=zn(e,"{2}"),s=zn(e,"{3}"),l=zn(e,"{4}"),o=zn(e,"{6}"),r=zn(e,"{1,2}"),a=zn(e,"{1,3}"),u=zn(e,"{1,6}"),f=zn(e,"{1,9}"),d=zn(e,"{2,4}"),p=zn(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 Bn(e.eras("short",!1),0);case"GG":return Bn(e.eras("long",!1),0);case"y":return ut(u);case"yy":return ut(d,Wr);case"yyyy":return ut(l);case"yyyyy":return ut(p);case"yyyyyy":return ut(o);case"M":return ut(r);case"MM":return ut(i);case"MMM":return Bn(e.months("short",!0,!1),1);case"MMMM":return Bn(e.months("long",!0,!1),1);case"L":return ut(r);case"LL":return ut(i);case"LLL":return Bn(e.months("short",!1,!1),1);case"LLLL":return Bn(e.months("long",!1,!1),1);case"d":return ut(r);case"dd":return ut(i);case"o":return ut(a);case"ooo":return ut(s);case"HH":return ut(i);case"H":return ut(r);case"hh":return ut(i);case"h":return ut(r);case"mm":return ut(i);case"m":return ut(r);case"q":return ut(r);case"qq":return ut(i);case"s":return ut(r);case"ss":return ut(i);case"S":return ut(a);case"SSS":return ut(s);case"u":return or(f);case"uu":return or(r);case"uuu":return ut(t);case"a":return Bn(e.meridiems(),0);case"kkkk":return ut(l);case"kk":return ut(d,Wr);case"W":return ut(r);case"WW":return ut(i);case"E":case"c":return ut(t);case"EEE":return Bn(e.weekdays("short",!1,!1),1);case"EEEE":return Bn(e.weekdays("long",!1,!1),1);case"ccc":return Bn(e.weekdays("short",!0,!1),1);case"cccc":return Bn(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(Cs(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function 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=pi.create(n.z)),it(n.Z)||(t||(t=new an(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=gn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=gn.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(gn.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(Cs(f,"a")&&Cs(f,"H"))throw new Xs("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 qn(n,e){return new Wn("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+(Cl(n)?Bg:zg)[e-1]}function Yg(n,e){const t=Cl(n)?Bg:zg,i=t.findIndex(l=>l<e),s=e-t[i];return{month:i+1,day:s}}function Gr(n){const{year:e,month:t,day:i}=n,s=Wg(e,t,i),l=Ug(e,t,i);let o=Math.floor((s-l+10)/7),r;return o<1?(r=e-1,o=bo(r)):o>bo(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=tl(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=tl(r)):o>l?(r=e+1,o-=tl(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=ci(n.weekNumber,1,bo(n.weekYear)),i=ci(n.weekday,1,7);return e?t?i?!1:qn("weekday",n.weekday):qn("week",n.week):qn("weekYear",n.weekYear)}function ey(n){const e=Ho(n.year),t=ci(n.ordinal,1,tl(n.year));return e?t?!1:qn("ordinal",n.ordinal):qn("year",n.year)}function Kg(n){const e=Ho(n.year),t=ci(n.month,1,12),i=ci(n.day,1,go(n.year,n.month));return e?t?i?!1:qn("day",n.day):qn("month",n.month):qn("year",n.year)}function Jg(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ci(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ci(t,0,59),r=ci(i,0,59),a=ci(s,0,999);return l?o?r?a?!1:qn("millisecond",s):qn("second",i):qn("minute",t):qn("hour",e)}const ur="Invalid DateTime",Ru=864e13;function Bl(n){return new Wn("unsupported zone",`the zone "${n.name}" is not supported`)}function fr(n){return n.weekData===null&&(n.weekData=Gr(n.c)),n.weekData}function Hs(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 zs(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 Wn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Ul(n,e,t=!0){return n.isValid?gn.create(Tt.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+=jt(n.c.year,t?6:4),e?(i+="-",i+=jt(n.c.month),i+="-",i+=jt(n.c.day)):(i+=jt(n.c.month),i+=jt(n.c.day)),i}function Vu(n,e,t,i,s,l){let o=jt(n.c.hour);return e?(o+=":",o+=jt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=jt(n.c.minute),(n.c.second!==0||!t)&&(o+=jt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=jt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=jt(Math.trunc(-n.o/60)),o+=":",o+=jt(Math.trunc(-n.o%60))):(o+="+",o+=jt(Math.trunc(n.o/60)),o+=":",o+=jt(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=wi(e.zone,Bt.defaultZone),i=Tt.fromObject(e),s=Bt.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||Bt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Wn("invalid input"):null)||(t.isValid?null:Bl(t));this.ts=it(e.ts)?Bt.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 Wn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Tt.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=an.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=wi(t.zone,Bt.defaultZone);return s.isValid?new ze({ts:i,zone:s,loc:Tt.fromObject(t)}):ze.invalid(Bl(s))}static fromMillis(e,t={}){if(Qi(e))return e<-Ru||e>Ru?ze.invalid("Timestamp out of range"):new ze({ts:e,zone:wi(t.zone,Bt.defaultZone),loc:Tt.fromObject(t)});throw new Fn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Qi(e))return new ze({ts:e*1e3,zone:wi(t.zone,Bt.defaultZone),loc:Tt.fromObject(t)});throw new Fn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=wi(t.zone,Bt.defaultZone);if(!i.isValid)return ze.invalid(Bl(i));const s=Bt.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=Tt.fromObject(t);if((f||r)&&d)throw new Xs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Xs("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,[O,M]=fo(C,l,i),D=new ze({ts:O,zone:i,o:M,loc:p});return o.weekday&&f&&e.weekday!==D.weekday?ze.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${D.toISO()}`):D}static fromISO(e,t={}){const[i,s]=bv(e);return zs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=vv(e);return zs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=yv(e);return zs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new Fn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Tt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=Qv(o,e,t);return f?ze.invalid(f):zs(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 zs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Fn("need to specify a reason the DateTime is invalid");const i=e instanceof Wn?e:new Wn(e,t);if(Bt.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 Cl(this.year)}get daysInMonth(){return go(this.year,this.month)}get daysInYear(){return this.isValid?tl(this.year):NaN}get weeksInWeekYear(){return this.isValid?bo(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=gn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(an.instance(e),t)}toLocal(){return this.setZone(Bt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=wi(e,Bt.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 Hs(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 Hs(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 Xs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Xs("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 Hs(this,{ts:f,o:d})}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return Hs(this,ju(this,t))}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e).negate();return Hs(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?gn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ur}toLocaleString(e=Ur,t={}){return this.isValid?gn.create(this.loc.clone(t),e).formatDateTime(this):ur}toLocaleParts(e={}){return this.isValid?gn.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?this<t?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],l=e.unit;return Array.isArray(e.unit)&&(s=e.unit,l=void 0),Bu(t,this.plus(i),{...e,numeric:"always",units:s,unit:l})}toRelativeCalendar(e={}){return this.isValid?Bu(e.base||ze.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(ze.isDateTime))throw new Fn("min requires all arguments be DateTimes");return ku(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(ze.isDateTime))throw new Fn("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=Tt.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 Bs(n){if(ze.isDateTime(n))return n;if(n&&n.valueOf&&Qi(n.valueOf()))return ze.fromJSDate(n);if(n&&typeof n=="object")return ze.fromObject(n);throw new Fn(`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 z{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||z.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 z.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!z.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!z.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){z.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]=z.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(!z.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)(!z.isObject(l)&&!Array.isArray(l)||!z.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)(!z.isObject(s)&&!Array.isArray(s)||!z.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):z.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||z.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||z.isObject(e)&&Object.keys(e).length>0)&&z.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s<e;s++)t+=i.charAt(Math.floor(Math.random()*i.length));return t}static sentenize(e,t=!0){if(typeof e!="string")return"";if(e=e.trim().split("_").join(" "),e==="")return e;if(e=e[0].toUpperCase()+e.substring(1),t){let i=e[e.length-1];i!=="."&&i!=="?"&&i!=="!"&&(e+=".")}return e}static trimQuotedValue(e){return typeof e=="string"&&(e[0]=='"'||e[0]=="'"||e[0]=="`")&&e[0]==e[e.length-1]?e.slice(1,-1):e}static plainText(e){return e?(new DOMParser().parseFromString(e,"text/html").body.innerText||"").trim():""}static truncate(e,t=150,i=!0){return e=e||"",e.length<=t?e:e.substring(0,t)+(i?"...":"")}static truncateObject(e){const t={};for(let i in e){let s=e[i];typeof s=="string"&&(s=z.truncate(s,150,!0)),t[i]=s}return t}static slugify(e,t="_",i=[".","=","-"]){if(e==="")return"";const s={a:/а|à|á|å|â/gi,b:/б/gi,c:/ц|ç/gi,d:/д/gi,e:/е|è|é|ê|ẽ|ë/gi,f:/ф/gi,g:/г/gi,h:/х/gi,i:/й|и|ì|í|î/gi,j:/ж/gi,k:/к/gi,l:/л/gi,m:/м/gi,n:/н|ñ/gi,o:/о|ò|ó|ô|ø/gi,p:/п/gi,q:/я/gi,r:/р/gi,s:/с/gi,t:/т/gi,u:/ю|ù|ú|ů|û/gi,v:/в/gi,w:/в/gi,x:/ь/gi,y:/ъ/gi,z:/з/gi,ae:/ä|æ/gi,oe:/ö/gi,ue:/ü/gi,Ae:/Ä/gi,Ue:/Ü/gi,Oe:/Ö/gi,ss:/ß/gi,and:/&/gi};for(let o in s)e=e.replace(s[o],o);const l=e.replace(new RegExp("["+i.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t);return l.charAt(0).toLowerCase()+l.slice(1)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const i=(e||"").split(t),s=[];for(let l of i)l=l.trim(),z.isEmpty(l)||s.push(l);return s}static joinNonEmpty(e,t=", "){const i=[];for(let s of e)s=typeof s=="string"?s.trim():"",z.isEmpty(s)||i.push(s);return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=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 z.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return z.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 z.hasImageExtension(e)?"image":z.hasDocumentExtension(e)?"document":z.hasVideoExtension(e)?"video":z.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(z.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)z.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):z.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)||z.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)||z.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<String>";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)&&!z.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!z.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=z.isObject(u)&&z.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"||(z.isEmpty(r)?s.push(i):typeof r=="boolean"?s.push(r?"True":"False"):typeof r=="string"?(r=r.indexOf("<")>=0?z.plainText(r):r,s.push(z.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(!z.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 z.extractColumnsFromQuery(e.options.query))z.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)z.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=!z.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_"+z.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=z.parseIndex(e);return i.tableName=t,z.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=z.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?z.buildIndex(s):e}}const Uo=On([]);function Qg(n,e=4e3){return Wo(n,"info",e)}function Yt(n,e=3e3){return Wo(n,"success",e)}function ml(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),z.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=z.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),z.removeByKey(n,"message",t.message))}const _i=On({});function fn(n){_i.set(n||{})}function Di(n){_i.update(e=>(z.deleteByPath(e,n),e))}const Ia=On({});function Xr(n){Ia.set(n||{})}const dr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Ii("/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&&ml(l)}if(z.isEmpty(s.data)||fn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Ii("/")};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 ts&&Xr(t)}clear(){super.clear(),Xr(null)}}const he=new Vo("../",new fy("pb_admin_auth"));he.authStore.model instanceof ts&&Xr(he.authStore.model);function cy(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=n[3].default,_=Ct(m,n,n[2],null);return{c(){e=y("div"),t=y("main"),_&&_.c(),i=E(),s=y("footer"),l=y("a"),l.innerHTML=`<i class="ri-book-open-line txt-sm"></i>
<span class="txt">Docs</span>`,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)&&Ot(_,m,g,g[2],p?Mt(m,g[2],b,null):Dt(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 Dn 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=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,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=Ct(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)&&Ot(o,l,r,r[2],i?Mt(l,r[2],a,null):Dt(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 Dn({props:{class:"full-page",center:!0,$$slots:{default:[py]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(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){V(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=Sl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ni(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 St(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 Ht(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,zi;const xr="app-tooltip";function Yu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ci(){return zi=zi||document.querySelector("."+xr),zi||(zi=document.createElement("div"),zi.classList.add(xr),document.body.appendChild(zi)),zi}function t1(n,e){let t=Ci();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),Ci().classList.remove("active"),Ci().activeNode=void 0}function _y(n,e){Ci().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Ci().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&&z.isFocusable(n))&&n.addEventListener("click",s),Ci(),{update(l){var o,r;t=Yu(l),(r=(o=Ci())==null?void 0:o.activeNode)!=null&&r.contains(n)&&t1(n,t)},destroy(){var l,o;(o=(l=Ci())==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;o<i.length;o+=1)s[o]=Zu(Ku(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Se()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&8){i=o[3];let a;for(a=0;a<i.length;a+=1){const u=Ku(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Zu(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){pt(s,o),o&&w(e)}}}function vy(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("i"),h(t,"class","ri-error-warning-fill txt-danger"),h(e,"class","form-field-addon")},m(a,u){S(a,e,u),v(e,t),l=!0,o||(r=Ee(i=Ue.call(null,t,{position:"left",text:n[3].map(ko).join(`
`)})),o=!0)},p(a,u){i&&zt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(ko).join(`
`)})},i(a){l||(a&&tt(()=>{l&&(s||(s=Ve(t,Ht,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=Ve(t,Ht,{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&&tt(()=>{r&&(o||(o=Ve(e,St,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Ve(e,St,{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=Ct(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)&&Ot(u,a,m,m[8],l?Mt(a,m[8],_,gy):Dt(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,_i,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+z.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,d=[];function p(){Di(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=z.toArray(z.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="<h4>Create your first admin account in order to continue</h4>",i=E(),H(s.$$.fragment),l=E(),H(o.$$.fragment),r=E(),H(a.$$.fragment),u=E(),f=y("button"),f.innerHTML=`<span class="txt">Create and login</span>
<i class="ri-arrow-right-line"></i>`,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),j(s,e,null),v(e,l),j(o,e,null),v(e,r),j(a,e,null),v(e,u),v(e,f),d=!0,p||(m=J(e,"submit",ct(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),V(s),V(o),V(a),p=!1,m()}}}function Cy(n,e,t){const i=wt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await he.admins.create({email:s,password:l,passwordConfirm:o}),await he.admins.authWithPassword(s,l),i("submit")}catch(p){he.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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function Oy(n){let e,t;return e=new My({}),e.$on("submit",n[1]),{c(){H(e.$$.fragment)},m(i,s){j(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){V(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")){he.logout(!1),t(0,i=!0);return}he.authStore.isValid?Ii("/collections"):he.logout()}return[i,async()=>{t(0,i=!1),await un(),window.location.search=""}]}class Ay extends ve{constructor(e){super(),be(this,e,Ey,Dy,_e,{})}}const Lt=On(""),wo=On(""),Ms=On(!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(()=>me(e,"value",l)),e.$on("submit",n[10])),{c(){e&&H(e.$$.fragment),i=Se()},m(a,u){e&&j(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],ye(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{V(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>me(e,"value",l)),e.$on("submit",a[10]),H(e.$$.fragment),A(e.$$.fragment,1),j(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&&V(e,a)}}}function Qu(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Search</span>',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&&tt(()=>{i&&(t||(t=Ve(e,ni,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,ni,{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='<span class="txt">Clear</span>',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&&tt(()=>{i&&(t||(t=Ve(e,ni,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,ni,{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",Mn(n[11])),J(e,"submit",ct(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=wt(),s="search_"+z.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new bn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,d,p="";function m(O=!0){t(7,p=""),O&&(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 at(()=>import("./FilterAutocompleteInput-d952f6bd.js"),["./FilterAutocompleteInput-d952f6bd.js","./index-6f704b4c.js"],import.meta.url)).default),t(5,f=!1))}Xt(()=>{g()});function b(O){pe.call(this,n,O)}function k(O){p=O,t(7,p),t(0,l)}function $(O){se[O?"unshift":"push"](()=>{d=O,t(6,d)})}function T(){p=this.value,t(7,p),t(0,l)}const C=()=>{m(!1),_()};return n.$$set=O=>{"value"in O&&t(0,l=O.value),"placeholder"in O&&t(1,o=O.placeholder),"autocompleteCollection"in O&&t(2,r=O.autocompleteCollection),"extraAutocompleteKeys"in O&&t(3,a=O.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='<i class="ri-refresh-line svelte-1bvelc2"></i>',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&&zt(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=wt();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=Ct(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)&&Ot(r,o,a,a[5],i?Mt(o,a[5],u,null):Dt(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 xt 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 mi 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=Ct(u,n,n[4],tf),d=n[5].default,p=Ct(d,n,n[4],null),m=n[5].after,_=Ct(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)&&Ot(f,u,g,g[4],o?Mt(u,g[4],b,Wy):Dt(g[4]),tf),p&&p.p&&(!o||b&16)&&Ot(p,d,g,g[4],o?Mt(d,g[4],b,null):Dt(g[4]),null),(!o||b&9&&s!==(s="horizontal-scroller "+g[0]+" "+g[3]+" svelte-wc2j9h"))&&h(i,"class",s),_&&_.p&&(!o||b&16)&&Ot(_,m,g,g[4],o?Mt(m,g[4],b,Uy):Dt(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=`<i class="ri-global-line"></i>
<span class="txt">Method</span>`,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",z.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",z.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",z.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",z.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",z.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=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},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='<span class="txt">Clear filters</span>',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,ht;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,O,M,D,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,je=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((ht=e[23].meta)==null?void 0:ht.errorData))&&of();ie=new mi({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(),je&&je.c(),g=E(),b=y("td"),k=y("span"),T=U($),O=E(),M=y("td"),D=y("span"),L=U(I),R=E(),N=y("td"),q=y("span"),B=U(Y),Z=E(),ee=y("td"),H(ie.$$.fragment),X=E(),fe=y("td"),fe.innerHTML='<i class="ri-arrow-right-line"></i>',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(D,"class","txt txt-ellipsis"),h(D,"title",F=e[23].userIp),x(D,"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,_),je&&je.m(u,null),v(t,g),v(t,b),v(b,k),v(k,T),v(t,O),v(t,M),v(M,D),v(D,L),v(t,R),v(t,N),v(N,q),v(q,B),v(t,Z),v(t,ee),j(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 Re,Qe,Jt;e=Ze,(!ce||We&8)&&l!==(l=((Re=e[23].method)==null?void 0:Re.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||(Jt=e[23].meta)!=null&&Jt.errorData?je||(je=of(),je.c(),je.m(u,null)):je&&(je.d(1),je=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(D,"title",F),(!ce||We&8)&&x(D,"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),je&&je.d(),V(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,O,M,D,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 xt({props:q}),se.push(()=>me(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 xt({props:B}),se.push(()=>me(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 xt({props:ee}),se.push(()=>me(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 xt({props:X}),se.push(()=>me(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 xt({props:G}),se.push(()=>me(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 xt({props:ge}),se.push(()=>me(T,"sort",ce));let Me=n[3];const je=we=>we[23].id;for(let we=0;we<Me.length;we+=1){let Ce=nf(n,Me,we),Je=je(Ce);F.set(Je,L[we]=rf(Je,Ce))}let He=null;return Me.length||(He=sf(n)),{c(){e=y("table"),t=y("thead"),i=y("tr"),H(s.$$.fragment),o=E(),H(r.$$.fragment),u=E(),H(f.$$.fragment),p=E(),H(m.$$.fragment),g=E(),H(b.$$.fragment),$=E(),H(T.$$.fragment),O=E(),M=y("th"),D=E(),I=y("tbody");for(let we=0;we<L.length;we+=1)L[we].c();He&&He.c(),h(M,"class","col-type-action min-width"),h(e,"class","table"),x(e,"table-loading",n[6])},m(we,Ce){S(we,e,Ce),v(e,t),v(t,i),j(s,i,null),v(i,o),j(r,i,null),v(i,u),j(f,i,null),v(i,p),j(m,i,null),v(i,g),j(b,i,null),v(i,$),j(T,i,null),v(i,O),v(i,M),v(e,D),v(e,I);for(let Je=0;Je<L.length;Je+=1)L[Je]&&L[Je].m(I,null);He&&He.m(I,null),R=!0},p(we,Ce){const Je={};Ce&67108864&&(Je.$$scope={dirty:Ce,ctx:we}),!l&&Ce&2&&(l=!0,Je.sort=we[1],ye(()=>l=!1)),s.$set(Je);const ht={};Ce&67108864&&(ht.$$scope={dirty:Ce,ctx:we}),!a&&Ce&2&&(a=!0,ht.sort=we[1],ye(()=>a=!1)),r.$set(ht);const Ze={};Ce&67108864&&(Ze.$$scope={dirty:Ce,ctx:we}),!d&&Ce&2&&(d=!0,Ze.sort=we[1],ye(()=>d=!1)),f.$set(Ze);const We={};Ce&67108864&&(We.$$scope={dirty:Ce,ctx:we}),!_&&Ce&2&&(_=!0,We.sort=we[1],ye(()=>_=!1)),m.$set(We);const te={};Ce&67108864&&(te.$$scope={dirty:Ce,ctx:we}),!k&&Ce&2&&(k=!0,te.sort=we[1],ye(()=>k=!1)),b.$set(te);const Re={};Ce&67108864&&(Re.$$scope={dirty:Ce,ctx:we}),!C&&Ce&2&&(C=!0,Re.sort=we[1],ye(()=>C=!1)),T.$set(Re),Ce&841&&(Me=we[3],re(),L=kt(L,Ce,je,1,we,Me,F,I,Kt,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<Me.length;Ce+=1)A(L[Ce]);R=!0}},o(we){P(s.$$.fragment,we),P(r.$$.fragment,we),P(f.$$.fragment,we),P(m.$$.fragment,we),P(b.$$.fragment,we),P(T.$$.fragment,we);for(let Ce=0;Ce<L.length;Ce+=1)P(L[Ce]);R=!1},d(we){we&&w(e),V(s),V(r),V(f),V(m),V(b),V(T);for(let Ce=0;Ce<L.length;Ce+=1)L[Ce].d();He&&He.d()}}}function af(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=y("small"),t=U("Showing "),s=U(i),l=U(" of "),o=U(n[4]),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&8&&i!==(i=r[3].length+"")&&le(s,i),a&16&&le(o,r[4])},d(r){r&&w(e)}}}function uf(n){let e,t,i,s,l=n[4]-n[3].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[6]),x(t,"btn-disabled",n[6]),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[20]),a=!0)},p(f,d){d&24&&l!==(l=f[4]-f[3].length+"")&&le(o,l),d&64&&x(t,"btn-loading",f[6]),d&64&&x(t,"btn-disabled",f[6])},d(f){f&&w(e),a=!1,u()}}}function i2(n){let e,t,i,s,l;e=new La({props:{class:"table-wrapper",$$slots:{default:[n2]},$$scope:{ctx:n}}});let o=n[3].length&&af(n),r=n[3].length&&n[7]&&uf(n);return{c(){H(e.$$.fragment),t=E(),o&&o.c(),i=E(),r&&r.c(),s=Se()},m(a,u){j(e,a,u),S(a,t,u),o&&o.m(a,u),S(a,i,u),r&&r.m(a,u),S(a,s,u),l=!0},p(a,[u]){const f={};u&67108939&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length?o?o.p(a,u):(o=af(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[3].length&&a[7]?r?r.p(a,u):(r=uf(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){l||(A(e.$$.fragment,a),l=!0)},o(a){P(e.$$.fragment,a),l=!1},d(a){V(e,a),a&&w(t),o&&o.d(a),a&&w(i),r&&r.d(a),a&&w(s)}}}function s2(n,e,t){let i;const s=wt(),l={get:"label-info",post:"label-success",patch:"label-warning",delete:"label-danger"};let{filter:o=""}=e,{presets:r=""}=e,{sort:a="-rowid"}=e,u=[],f=1,d=0,p=!1,m=0;async function _(F=1,R=!0){return t(6,p=!0),he.logs.getRequestsList(F,30,{sort:a,filter:[r,o].filter(Boolean).join("&&")}).then(async N=>{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 z.yieldToMain()}else t(3,u=u.concat(N.items))}).catch(N=>{N!=null&&N.isAbort||(t(6,p=!1),console.warn(N),g(),he.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 O(F){a=F,t(1,a)}const M=F=>s("select",F),D=(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,O,M,D,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]}}/*!
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function oi(){}const o2=function(){let n=0;return function(){return n++}}();function dt(n){return n===null||typeof n>"u"}function yt(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 Rt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Pn(n,e){return Rt(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 mt(n,e,t,i){let s,l,o;if(yt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(xe(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function So(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function $o(n){if(yt(n))return n.map($o);if(xe(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=$o(n[t[s]]);return e}return n}function i1(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function a2(n,e,t,i){if(!i1(n))return;const s=e[n],l=t[n];xe(s)&&xe(l)?hl(s,l,i):e[n]=$o(l)}function hl(n,e,t){const i=yt(e)?e:[e],s=i.length;if(!xe(n))return n;t=t||{};const l=t.merger||a2;for(let o=0;o<s;++o){if(e=i[o],!xe(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function il(n,e){return hl(n,e,{merger:u2})}function u2(n,e,t){if(!i1(n))return;const i=e[n],s=t[n];xe(i)&&xe(s)?il(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=$o(s))}const ff={"":n=>n,x:n=>n.x,y:n=>n.y};function Ei(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 jn=n=>typeof n<"u",Ai=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,_t=2*Nt,p2=_t+Nt,To=Number.POSITIVE_INFINITY,m2=Nt/180,It=Nt/2,Us=Nt/4,df=Nt*2/3,Rn=Math.log10,ei=Math.sign;function pf(n){const e=Math.round(n);n=sl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Rn(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;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Os(n){return!isNaN(parseFloat(n))&&isFinite(n)}function sl(n,e,t){return Math.abs(n-e)<t}function _2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function s1(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Yn(n){return n*(Nt/180)}function Fa(n){return n*(180/Nt)}function mf(n){if(!Rt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function l1(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Nt&&(l+=_t),{angle:l,distance:s}}function ta(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function g2(n,e){return(n-e+p2)%_t-Nt}function Sn(n){return(n%_t+_t)%_t}function _l(n,e,t,i){const s=Sn(n),l=Sn(e),o=Sn(t),r=Sn(l-s),a=Sn(o-s),u=Sn(s-l),f=Sn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function en(n,e,t){return Math.max(e,Math.min(t,n))}function b2(n){return en(n,-32768,32767)}function gl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ra(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Gi=(n,e,t,i)=>Ra(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),v2=(n,e,t)=>Ra(n,t,i=>n[i][e]>=t);function y2(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}const o1=["push","pop","shift","splice","unshift"];function k2(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),o1.forEach(t=>{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<i;++t)e.add(n[t]);return e.size===i?n:Array.from(e)}const a1=function(){return typeof window>"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=en(Math.min(Gi(r,o.axis,u).lo,t?i:Gi(e,a,o.getPixelForValue(u)).lo),0,i-1)),p?l=en(Math.max(Gi(r,o.axis,f,!0).hi+1,t?0:Gi(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)*_t/t)),bf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*_t/t)+1,ll={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-ll.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?ll.easeInBounce(n*2)*.5:ll.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 El(n){return n+.5|0}const Si=(n,e,t)=>Math.max(Math.min(n,t),e);function xs(n){return Si(El(n*2.55),0,255)}function Mi(n){return Si(El(n*255),0,255)}function ui(n){return Si(El(n/2.55)/100,0,1)}function vf(n){return Si(El(n*100),0,100)}const In={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&In[n[1]]*17,g:255&In[n[2]]*17,b:255&In[n[3]]*17,a:e===5?In[n[4]]*17:255}:(e===7||e===9)&&(t={r:In[n[1]]<<4|In[n[2]],g:In[n[3]]<<4|In[n[4]],b:In[n[5]]<<4|In[n[6]],a:e===9?In[n[7]]<<4|In[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<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function qa(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.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(Mi)}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]?xs(+e[5]):Mi(+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}%, ${ui(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<e.length;i++){for(o=r=e[i],s=0;s<t.length;s++)l=t[s],r=r.replace(l,yf[l]);l=parseInt(kf[o],16),n[r]=[l>>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]?xs(o):Si(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?xs(i):Si(i,0,255)),s=255&(e[4]?xs(s):Si(s,0,255)),l=255&(e[6]?xs(l):Si(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}, ${ui(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,hs=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function U2(n,e,t){const i=hs(ui(n.r)),s=hs(ui(n.g)),l=hs(ui(n.b));return{r:Mi(pr(i+t*(hs(ui(e.r))-i))),g:Mi(pr(s+t*(hs(ui(e.g))-s))),b:Mi(pr(l+t*(hs(ui(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=Mi(n[3]))):(e=m1(n,{r:0,g:0,b:0,a:1}),e.a=Mi(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=ui(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=Mi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=El(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 ns=Object.create(null),ia=Object.create(null);function ol(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;i<s;++i){const l=t[i];n=n[l]||(n[l]=Object.create(null))}return n}function hr(n,e,t){return typeof e=="string"?hl(ol(n,e),t):hl(ol(n,""),e)}class Y2{constructor(e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.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 ol(this,e)}describe(e,t){return hr(ia,e,t)}override(e,t){return hr(ns,e,t)}route(e,t,i,s){const l=ol(this,e),o=ol(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||dt(n.size)||dt(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;a<r;a++)if(d=t[a],d!=null&&yt(d)!==!0)o=Mo(n,s,l,o,d);else if(yt(d))for(u=0,f=d.length;u<f;u++)p=d[u],p!=null&&!yt(p)&&(o=Mo(n,s,l,o,p));n.restore();const m=l.length/2;if(m>t.length){for(a=0;a<m;a++)delete s[l[a]];l.splice(0,m)}return o}function Bi(n,e,t){const i=n.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((e-s)*i)/i+s}function $f(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function sa(n,e,t,i){Z2(n,e,t,i,null)}function Z2(n,e,t,i,s){let l,o,r,a,u,f;const d=e.pointStyle,p=e.rotation,m=e.radius;let _=(p||0)*m2;if(d&&typeof d=="object"&&(l=d.toString(),l==="[object HTMLImageElement]"||l==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(_),n.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),n.restore();return}if(!(isNaN(m)||m<=0)){switch(n.beginPath(),d){default:s?n.ellipse(t,i,s/2,m,0,0,_t):n.arc(t,i,m,0,_t),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(_)*m,i-Math.cos(_)*m),_+=df,n.lineTo(t+Math.sin(_)*m,i-Math.cos(_)*m),_+=df,n.lineTo(t+Math.sin(_)*m,i-Math.cos(_)*m),n.closePath();break;case"rectRounded":u=m*.516,a=m-u,o=Math.cos(_+Us)*a,r=Math.sin(_+Us)*a,n.arc(t-o,i-r,u,_-Nt,_-It),n.arc(t+r,i-o,u,_-It,_),n.arc(t+o,i+r,u,_,_+It),n.arc(t-r,i+o,u,_+It,_+Nt),n.closePath();break;case"rect":if(!p){a=Math.SQRT1_2*m,f=s?s/2:a,n.rect(t-f,i-a,2*f,2*a);break}_+=Us;case"rectRot":o=Math.cos(_)*m,r=Math.sin(_)*m,n.moveTo(t-o,i-r),n.lineTo(t+r,i-o),n.lineTo(t+o,i+r),n.lineTo(t-r,i+o),n.closePath();break;case"crossRot":_+=Us;case"cross":o=Math.cos(_)*m,r=Math.sin(_)*m,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o);break;case"star":o=Math.cos(_)*m,r=Math.sin(_)*m,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o),_+=Us,o=Math.cos(_)*m,r=Math.sin(_)*m,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o);break;case"line":o=s?s/2:Math.cos(_)*m,r=Math.sin(_)*m,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(_)*m,i+Math.sin(_)*m);break}n.fill(),e.borderWidth>0&&n.stroke()}}function bl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function Ha(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function za(n){n.restore()}function G2(n,e,t,i,s){if(!e)return n.lineTo(t.x,t.y);if(s==="middle"){const l=(e.x+t.x)/2;n.lineTo(l,e.y),n.lineTo(l,t.y)}else s==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function X2(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function Oo(n,e,t,i,s,l={}){const o=yt(e)?e:[e],r=l.strokeWidth>0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,Q2(n,l),a=0;a<o.length;++a)u=o[a],r&&(l.strokeColor&&(n.strokeStyle=l.strokeColor),dt(l.strokeWidth)||(n.lineWidth=l.strokeWidth),n.strokeText(u,t,i,l.maxWidth)),n.fillText(u,t,i,l.maxWidth),x2(n,t,i,u,l),i+=s.lineHeight;n.restore()}function Q2(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),dt(e.rotation)||n.rotate(e.rotation),e.color&&(n.fillStyle=e.color),e.textAlign&&(n.textAlign=e.textAlign),e.textBaseline&&(n.textBaseline=e.textBaseline)}function x2(n,e,t,i,s){if(s.strikethrough||s.underline){const l=n.measureText(i),o=e-l.actualBoundingBoxLeft,r=e+l.actualBoundingBoxRight,a=t-l.actualBoundingBoxAscent,u=t+l.actualBoundingBoxDescent,f=s.strikethrough?(a+u)/2:u;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,f),n.lineTo(r,f),n.stroke()}}function Do(n,e){const{x:t,y:i,w:s,h:l,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,-It,Nt,!0),n.lineTo(t,i+l-o.bottomLeft),n.arc(t+o.bottomLeft,i+l-o.bottomLeft,o.bottomLeft,Nt,It,!0),n.lineTo(t+s-o.bottomRight,i+l),n.arc(t+s-o.bottomRight,i+l-o.bottomRight,o.bottomRight,It,0,!0),n.lineTo(t+s,i+o.topRight),n.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-It,!0),n.lineTo(t+o.topLeft,i)}const ek=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),tk=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function nk(n,e){const t=(""+n).match(ek);if(!t||t[1]==="normal")return e*1.2;switch(n=+t[2],t[3]){case"px":return n;case"%":n/=100;break}return e*n}const ik=n=>+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 ws(n){return Ba(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Vn(n){const e=g1(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function $n(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;l<o;++l)if(r=n[l],r!==void 0&&(e!==void 0&&typeof r=="function"&&(r=r(e),s=!1),t!==void 0&&yt(r)&&(r=r[t%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function sk(n,e,t){const{min:i,max:s}=n,l=n1(e,(s-i)/2),o=(r,a)=>t&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Pi(n,e){return Object.assign(Object.create(n),e)}function Ua(n,e=[""],t=n,i,s=()=>n[0]){jn(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 Ds(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:b1(n,i),setContext:l=>Ds(n,l,t,i),override:l=>Ds(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:Ai(t)?t:()=>t,isIndexable:Ai(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 Ai(r)&&o.isScriptable(e)&&(r=rk(e,r,n,t)),yt(r)&&r.length&&(r=ak(e,r,n,o.isIndexable)),Wa(e,r)&&(r=Ds(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(jn(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(Ds(d,l,o&&o[n],r))}}return e}function y1(n,e,t){return Ai(n)?n(e,t):n}const uk=(n,e)=>n===!0?e:typeof n=="string"?Ei(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(jn(r)&&r!==t&&r!==i)return r}else if(o===!1&&jn(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||jn(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 yt(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),jn(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(jn(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;r<a;++r)u=r+t,f=e[u],o[r]={r:s.parse(Ei(f,l),u)};return o}const mk=Number.EPSILON||1e-14,Es=(n,e)=>e<n.length&&!n[e].skip&&n[e],S1=n=>n==="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=Es(n,0);for(let f=0;f<i-1;++f)if(a=u,u=Es(n,f+1),!(!a||!u)){if(sl(e[f],0,mk)){t[f]=t[f+1]=0;continue}s=t[f]/e[f],l=t[f+1]/e[f],r=Math.pow(s,2)+Math.pow(l,2),!(r<=9)&&(o=3/Math.sqrt(r),t[f]=s*o*e[f],t[f+1]=l*o*e[f])}}function gk(n,e,t="x"){const i=S1(t),s=n.length;let l,o,r,a=Es(n,0);for(let u=0;u<s;++u){if(o=r,r=a,a=Es(n,u+1),!r)continue;const f=r[t],d=r[i];o&&(l=(f-o[t])/3,r[`cp1${t}`]=f-l,r[`cp1${i}`]=d-l*e[u]),a&&(l=(a[t]-f)/3,r[`cp2${t}`]=f+l,r[`cp2${i}`]=d+l*e[u])}}function bk(n,e="x"){const t=S1(e),i=n.length,s=Array(i).fill(0),l=Array(i);let o,r,a,u=Es(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=Es(n,o+1),!!a){if(u){const f=u[e]-a[e];s[o]=f!==0?(u[t]-a[t])/f:0}l[o]=r?u?ei(s[o-1])!==ei(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}_k(n,s,l),gk(n,l,e)}function Gl(n,e,t){return Math.max(Math.min(n,t),e)}function vk(n,e){let t,i,s,l,o,r=bl(n[0],e);for(t=0,i=n.length;t<i;++t)o=l,l=r,r=t<i-1&&bl(n[t+1],e),l&&(s=n[t],o&&(s.cp1x=Gl(s.cp1x,e.left,e.right),s.cp1y=Gl(s.cp1y,e.top,e.bottom)),r&&(s.cp2x=Gl(s.cp2x,e.left,e.right),s.cp2y=Gl(s.cp2y,e.top,e.bottom)))}function yk(n,e,t,i,s){let l,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")bk(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;l<o;++l)r=n[l],a=hk(u,r,n[Math.min(l+1,o-(i?0:1))%o],e.tension),r.cp1x=a.previous.x,r.cp1y=a.previous.y,r.cp2x=a.next.x,r.cp2y=a.next.y,u=r}e.capBezierPoints&&vk(n,t)}function $1(){return typeof window<"u"&&typeof document<"u"}function Ka(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Eo(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}const Jo=n=>window.getComputedStyle(n,null);function kk(n,e){return Jo(n).getPropertyValue(e)}const wk=["top","right","bottom","left"];function xi(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 Ki(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Jo(t),l=s.boxSizing==="border-box",o=xi(s,"padding"),r=xi(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=xi(r,"border","width"),u=xi(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=xi(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=xi(s,"border","width"),p=xi(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 Ji(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=Ji(n,s,t),r=Ji(s,l,t),a=Ji(l,e,t),u=Ji(o,r,t),f=Ji(r,a,t);return Ji(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 Al(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:_l,compare:g2,normalize:Sn}:{between:gl,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;p<m&&o(r(e[u%a][i]),s,l);++p)u--,f--;u%=a,f%=a}return f<u&&(f+=a),{start:u,end:f,loop:d,style:n.style}}function C1(n,e,t){if(!t)return[n];const{property:i,start:s,end:l}=t,o=e.length,{compare:r,between:a,normalize:u}=T1(i),{start:f,end:d,loop:p,style:m}=Nk(n,e,t),_=[];let g=!1,b=null,k,$,T;const C=()=>a(s,T,k)&&r(s,T)!==0,O=()=>r(l,k)===0||a(l,T,k),M=()=>g||C(),D=()=>!g||O();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&&D()&&(_.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;s<i.length;s++){const l=C1(i[s],n.points,e);l.length&&t.push(...l)}return t}function Fk(n,e,t,i){let s=0,l=e-1;if(t&&!i)for(;s<e&&!n[s].skip;)s++;for(;s<e&&n[s].skip;)s++;for(s%=e,t&&(l+=s);l>s&&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=r<o?r+s:r,u=!!n._fullLoop&&o===0&&r===s-1;return Af(n,Rk(t,o,a,u),t,e)}function Af(n,e,t,i){return!i||!i.setContext||!t?e:jk(n,e,t,i)}function jk(n,e,t,i){const s=n._chart.getContext(),l=If(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=l,d=e[0].start,p=d;function m(_,g,b,k){const $=r?-1:1;if(_!==g){for(_+=a;t[_%a].skip;)_-=$;for(;t[g%a].skip;)g+=$;_%a!==g%a&&(u.push({start:_%a,end:g%a,loop:b,style:k}),f=k,d=g%a)}}for(const _ of e){d=r?d:_.start;let g=t[d%a],b;for(p=d+1;p<=_.end;p++){const k=t[p%a];b=If(i.setContext(Pi(s,{type:"segment",p0:g,p1:k,p0DataIndex:(p-1)%a,p1DataIndex:p%a,datasetIndex:o}))),Vk(b,f)&&m(d,p-1,_.loop,f),g=k,f=b}d<p-1&&m(d,p-1,_.loop,f)}return u}function If(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Vk(n,e){return e&&JSON.stringify(n)!==JSON.stringify(e)}/*!
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class Hk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({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 ri=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=ll[e.easing]||ll.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||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?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;s<i.length;s++)i[s][t]()}}const Uk=["x","y","borderWidth","radius","tension"],Wk=["color","borderColor","backgroundColor"];lt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Yk=Object.keys(lt.animation);lt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="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];(yt(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 ri.add(this._chart,i),!0}}function Kk(n,e){const t=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const l=n[i[s]];l&&l.active()&&t.push(l.wait())}return Promise.all(t)}function Jk(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function Lf(n,e){const t=n&&n.options||{},i=t.reverse,s=t.min===void 0?e:0,l=t.max===void 0?e:0;return{start:i?l:s,end:i?s:l}}function Zk(n,e,t){if(t===!1)return!1;const i=Lf(n,t),s=Lf(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Gk(n){let e,t,i,s;return xe(n)?(e=n.top,t=n.right,i=n.bottom,s=n.left):e=t=i=s=n,{top:e,right:t,bottom:i,left:s,disabled:n===!1}}function D1(n,e){const t=[],i=n._getSortedDatasetMetas(e);let s,l;for(s=0,l=i.length;s<l;++s)t.push(i[s].index);return t}function Nf(n,e,t,i={}){const s=n.keys,l=i.mode==="single";let o,r,a,u;if(e!==null){for(o=0,r=s.length;o<r;++o){if(a=+s[o],a===t){if(i.all)continue;break}u=n.values[a],Rt(u)&&(l||e===0||ei(e)===ei(u))&&(e+=u)}return e}}function Xk(n){const e=Object.keys(n),t=new Array(e.length);let i,s,l;for(i=0,s=e.length;i<s;++i)l=e[i],t[i]={x:l,y:n[l]};return t}function Ff(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function Qk(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function xk(n){const{min:e,max:t,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY}}function ew(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function Rf(n,e,t,i){for(const s of e.getMatchingVisibleMetas(i).reverse()){const l=n[s.index];if(t&&l>0||!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;m<d;++m){const _=e[m],{[a]:g,[u]:b}=_,k=_._stacks||(_._stacks={});p=k[u]=ew(s,f,g),p[r]=b,p._top=Rf(p,o,!0,i.type),p._bottom=Rf(p,o,!1,i.type)}}function br(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function tw(n,e){return Pi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function nw(n,e,t){return Pi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Ws(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 Jn{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&&Ws(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&&Ws(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;Ws(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,Ws(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{yt(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]<u[r];for(f=0;f<t;++f)i._parsed[f+e]=d=p[f],a&&(m()&&(a=!1),u=d);i._sorted=a}o&&qf(this,p)}parsePrimitiveData(e,t,i,s){const{iScale:l,vScale:o}=e,r=l.axis,a=o.axis,u=l.getLabels(),f=l===o,d=new Array(s);let p,m,_;for(p=0,m=s;p<m;++p)_=p+i,d[p]={[r]:f||l.parse(u[_],_),[a]:o.parse(t[_],_)};return d}parseArrayData(e,t,i,s){const{xScale:l,yScale:o}=e,r=new Array(s);let a,u,f,d;for(a=0,u=s;a<u;++a)f=a+i,d=t[f],r[a]={x:l.parse(d[0],f),y:o.parse(d[1],f)};return r}parseObjectData(e,t,i,s){const{xScale:l,yScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=new Array(s);let f,d,p,m;for(f=0,d=s;f<d;++f)p=f+i,m=t[p],u[f]={x:l.parse(Ei(m,r),p),y:o.parse(Ei(m,a),p)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const s=this.chart,l=this._cachedMeta,o=t[e.axis],r={keys:D1(s,!0),values:t._stacks[e.axis]};return Nf(r,o,l.index,{mode:i})}updateRangeFromParsed(e,t,i,s){const l=i[t.axis];let o=l===null?NaN:l;const r=s&&i._stacks[t.axis];s&&r&&(s.values=r,o=Nf(s,l,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){const i=this._cachedMeta,s=i._parsed,l=i._sorted&&e===i.iScale,o=s.length,r=this._getOtherScale(e),a=iw(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:d}=xk(r);let p,m;function _(){m=s[p];const g=m[r.axis];return!Rt(m[e.axis])||f>g||d<g}for(p=0;p<o&&!(!_()&&(this.updateRangeFromParsed(u,e,m,a),l));++p);if(l){for(p=o-1;p>=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<l;++s)o=t[s][e.axis],Rt(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,s=t.vScale,l=this.getParsed(e);return{label:i?""+i.getLabelForValue(l[i.axis]):"",value:s?""+s.getLabelForValue(l[s.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=Gk(st(this.options.clip,Zk(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,s=i.data||[],l=t.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||s.length-r,u=this.options.drawActiveElementsOnTop;let f;for(i.dataset&&i.dataset.draw(e,l,r,a),f=r;f<r+a;++f){const d=s[f];d.hidden||(d.active&&u?o.push(d):d.draw(e,l))}for(f=0;f<o.length;++f)o[f].draw(e,l)}getStyle(e,t){const i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const s=this.getDataset();let l;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];l=o.$context||(o.$context=nw(this.getContext(),e,o)),l.parsed=this.getParsed(e),l.raw=s.data[e],l.index=l.dataIndex=e}else l=this.$context||(this.$context=tw(this.chart.getContext(),this.index)),l.dataset=s,l.index=l.datasetIndex=this.index;return l.active=!!t,l.mode=i,l}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const s=t==="active",l=this._cachedDataOpts,o=e+"-"+t,r=l[o],a=this.enableOptionSharing&&jn(i);if(r)return jf(r,a);const u=this.chart.config,f=u.datasetElementScopeKeys(this._type,e),d=s?[`${e}Hover`,"hover",e,""]:[e,""],p=u.getOptionScopes(this.getDataset(),f),m=Object.keys(lt.elements[e]),_=()=>this.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<s&&this._removeElements(l,s-l)}_insertElements(e,t,i=!0){const s=this._cachedMeta,l=s.data,o=e+t;let r;const a=u=>{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;r<o;++r)l[r]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(e,t),i&&this.updateElements(l,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,t);i._stacked&&Ws(i,s)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,s]=e;this[t](i,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Jn.defaults={};Jn.prototype.datasetElementType=null;Jn.prototype.dataElementType=null;function sw(n,e){if(!n._cache.$bar){const t=n.getMatchingVisibleMetas(e);let i=[];for(let s=0,l=t.length;s<l;s++)i=i.concat(t[s].controller.getAllParsedValues(n));n._cache.$bar=r1(i.sort((s,l)=>s-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||(jn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s<l;++s)o=e.getPixelForValue(t[s]),a();for(r=void 0,s=0,l=e.ticks.length;s<l;++s)o=e.getPixelForTick(s),a();return i}function ow(n,e,t,i){const s=t.barThickness;let l,o;return dt(s)?(l=e.min*t.categoryPercentage,o=t.barPercentage):(l=s*i,o=1),{chunk:l/i,ratio:o,start:e.pixels[n]-l/2}}function rw(n,e,t,i){const s=e.pixels,l=s[n];let o=n>0?s[n-1]:null,r=n<s.length-1?s[n+1]:null;const a=t.categoryPercentage;o===null&&(o=l-(r===null?e.end-e.start:r-l)),r===null&&(r=l+l-o);const u=l-(l-Math.min(o,r))/2*a;return{chunk:Math.abs(r-o)/2*a/i,ratio:t.barPercentage,start:u}}function aw(n,e,t,i){const s=t.parse(n[0],i),l=t.parse(n[1],i),o=Math.min(s,l),r=Math.max(s,l);let a=o,u=r;Math.abs(o)>Math.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 yt(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<f;++u)p=e[u],d={},d[s.axis]=r||s.parse(o[u],u),a.push(E1(p,d,l,u));return a}function yr(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function uw(n,e,t){return n!==0?ei(n):(e.isHorizontal()?1:-1)*(e.min>=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.base<n.y,t="bottom",i="top"),e?(s="end",l="start"):(s="start",l="end"),{start:t,end:i,reverse:e,top:s,bottom:l}}function cw(n,e,t,i){let s=e.borderSkipped;const l={};if(!s){n.borderSkipped=l;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:r,reverse:a,top:u,bottom:f}=fw(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=u:(t._bottom||0)===i?s=f:(l[Hf(f,o,r,a)]=!0,s=u)),l[Hf(s,o,r,a)]=!0,n.borderSkipped=l}function Hf(n,e,t,i){return i?(n=dw(n,e,t),n=zf(n,t,e)):n=zf(n,e,t),n}function dw(n,e,t){return n===e?t:n===t?e:n}function zf(n,e,t){return n==="start"?e:n==="end"?t:n}function pw(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class Ja extends Jn{parsePrimitiveData(e,t,i,s){return Vf(e,t,i,s)}parseArrayData(e,t,i,s){return Vf(e,t,i,s)}parseObjectData(e,t,i,s){const{iScale:l,vScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=l.axis==="x"?r:a,f=o.axis==="x"?r:a,d=[];let p,m,_,g;for(p=i,m=i+s;p<m;++p)g=t[p],_={},_[l.axis]=l.parse(Ei(g,u),p),d.push(E1(Ei(g,f),_,o,p));return d}updateRangeFromParsed(e,t,i,s){super.updateRangeFromParsed(e,t,i,s);const l=i._custom;l&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,l.min),e.max=Math.max(e.max,l.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:s}=t,l=this.getParsed(e),o=l._custom,r=yr(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(l[s.axis]);return{label:""+i.getLabelForValue(l[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,s){const l=s==="reset",{index:o,_cachedMeta:{vScale:r}}=this,a=r.getBasePixel(),u=r.isHorizontal(),f=this._getRuler(),{sharedOptions:d,includeOptions:p}=this._getSharedOptions(t,s);for(let m=t;m<t+i;m++){const _=this.getParsed(m),g=l||dt(_[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,f),k=(_._stacks||{})[r.axis],$={horizontal:u,base:g.base,enableBorderRadius:!k||yr(_._custom)||o===k._top||o===k._bottom,x:u?g.head:b.center,y:u?b.center:g.head,height:u?b.size:Math.abs(g.size),width:u?Math.abs(g.size):b.size};p&&($.options=d||this.resolveDataElementOptions(m,e[m].active?"active":s));const T=$.options||e[m].options;cw($,T,k,o),pw($,T,f.ratio),this.updateElement(e[m],m,$,s)}}_getStacks(e,t){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(a=>a.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(dt(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<o;++l)s.push(i.getPixelForValue(this.getParsed(l)[i.axis],l));const r=e.barThickness;return{min:r||lw(t),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:r?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i},options:{base:s,minBarLength:l}}=this,o=s||0,r=this.getParsed(e),a=r._custom,u=yr(a);let f=r[t.axis],d=0,p=i?this.applyStack(t,r,i):f,m,_;p!==f&&(d=p-f,p=f),u&&(f=a.barStart,p=a.barEnd-a.barStart,f!==0&&ei(f)!==ei(a.barEnd)&&(d=0),d+=f);const g=!dt(s)&&!u?s:d;let b=t.getPixelForValue(g);if(this.chart.getDataVisibility(e)?m=t.getPixelForValue(d+p):m=b,_=m-b,Math.abs(_)<l){_=uw(_,t,o)*l,f===o&&(b-=_/2);const k=t.getPixelForDecimal(0),$=t.getPixelForDecimal(1),T=Math.min(k,$),C=Math.max(k,$);b=Math.max(Math.min(b,C),T),m=b+_}if(b===t.getPixelForValue(o)){const k=ei(_)*t.getLineWidthForValue(o)/2;b+=k,_-=k}return{size:_,base:b,head:m,center:m+_/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,l=s.skipNull,o=st(s.maxBarThickness,1/0);let r,a;if(t.grouped){const u=l?this._getStackCount(e):t.stackCount,f=s.barThickness==="flex"?rw(e,t,s,u):ow(e,t,s,u),d=this._getStackIndex(this.index,this._cachedMeta.stack,l?e:void 0);r=f.start+f.chunk*d+f.chunk/2,a=Math.min(o,f.chunk*f.ratio)}else r=i.getPixelForValue(this.getParsed(e)[i.axis],e),a=Math.min(o,t.min*t.ratio);return{base:r-a/2,head:r+a/2,center:r,size:a}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length;let l=0;for(;l<s;++l)this.getParsed(l)[t.axis]!==null&&i[l].draw(this._ctx)}}Ja.id="bar";Ja.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};Ja.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Za extends Jn{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,i,s){const l=super.parsePrimitiveData(e,t,i,s);for(let o=0;o<l.length;o++)l[o]._custom=this.resolveDataElementOptions(o+i).radius;return l}parseArrayData(e,t,i,s){const l=super.parseArrayData(e,t,i,s);for(let o=0;o<l.length;o++){const r=t[i+o];l[o]._custom=st(r[2],this.resolveDataElementOptions(o+i).radius)}return l}parseObjectData(e,t,i,s){const l=super.parseObjectData(e,t,i,s);for(let o=0;o<l.length;o++){const r=t[i+o];l[o]._custom=st(r&&r.r&&+r.r,this.resolveDataElementOptions(o+i).radius)}return l}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let i=e.length-1;i>=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;p<t+i;p++){const m=e[p],_=!l&&this.getParsed(p),g={},b=g[f]=l?o.getPixelForDecimal(.5):o.getPixelForValue(_[f]),k=g[d]=l?r.getBasePixel():r.getPixelForValue(_[d]);g.skip=isNaN(b)||isNaN(k),u&&(g.options=a||this.resolveDataElementOptions(p,m.active?"active":s),l&&(g.options.radius=0)),this.updateElement(m,p,g,s)}}resolveDataElementOptions(e,t){const i=this.getParsed(e);let s=super.resolveDataElementOptions(e,t);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const l=s.radius;return t!=="active"&&(s.radius=0),s.radius+=st(i&&i._custom,l),s}}Za.id="bubble";Za.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Za.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function mw(n,e,t){let i=1,s=1,l=0,o=0;if(e<_t){const r=n,a=r+e,u=Math.cos(r),f=Math.sin(r),d=Math.cos(a),p=Math.sin(a),m=(T,C,O)=>_l(T,r,a,!0)?1:Math.max(C,C*t,O,O*t),_=(T,C,O)=>_l(T,r,a,!0)?-1:Math.min(C,C*t,O,O*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 Il extends Jn{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=>+Ei(i[u],a)}let o,r;for(o=e,r=e+t;o<r;++o)s._parsed[o]=l(o)}}_getRotation(){return Yn(this.options.rotation-90)}_getCircumference(){return Yn(this.options.circumference)}_getRotationExtents(){let e=_t,t=-_t;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const s=this.chart.getDatasetMeta(i).controller,l=s._getRotation(),o=s._getCircumference();e=Math.min(e,l),t=Math.max(t,l+o)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:i}=t,s=this._cachedMeta,l=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(l)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-o)/2,0),a=Math.min(r2(this.options.cutout,r),1),u=this._getRingWeight(this.index),{circumference:f,rotation:d}=this._getRotationExtents(),{ratioX:p,ratioY:m,offsetX:_,offsetY:g}=mw(d,f,a),b=(i.width-o)/p,k=(i.height-o)/m,$=Math.max(Math.min(b,k)/2,0),T=n1(this.options.radius,$),C=Math.max(T*a,0),O=(T-C)/this._getVisibleDatasetWeightTotal();this.offsetX=_*T,this.offsetY=g*T,s.total=this.calculateTotal(),this.outerRadius=T-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*u,0),this.updateElements(l,0,l.length,e)}_circumference(e,t){const i=this.options,s=this._cachedMeta,l=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*l/_t)}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,r=o.chartArea,u=o.options.animation,f=(r.left+r.right)/2,d=(r.top+r.bottom)/2,p=l&&u.animateScale,m=p?0:this.innerRadius,_=p?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(t,s);let k=this._getRotation(),$;for($=0;$<t;++$)k+=this._circumference($,l);for($=t;$<t+i;++$){const T=this._circumference($,l),C=e[$],O={x:f+this.offsetX,y:d+this.offsetY,startAngle:k,endAngle:k+T,circumference:T,outerRadius:_,innerRadius:m};b&&(O.options=g||this.resolveDataElementOptions($,C.active?"active":s)),k+=T,this.updateElement(C,$,O,s)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let i=0,s;for(s=0;s<t.length;s++){const l=e._parsed[s];l!==null&&!isNaN(l)&&this.chart.getDataVisibility(s)&&!t[s].hidden&&(i+=Math.abs(l))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?_t*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Al(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;s<l;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),e=o.data,r=o.controller;break}}if(!e)return 0;for(s=0,l=e.length;s<l;++s)a=r.resolveDataElementOptions(s),a.borderAlign!=="inner"&&(t=Math.max(t,a.borderWidth||0,a.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,s=e.length;i<s;++i){const l=this.resolveDataElementOptions(i);t=Math.max(t,l.offset||0,l.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(t+=this._getRingWeight(i));return t}_getRingWeight(e){return Math.max(st(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Il.id="doughnut";Il.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};Il.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};Il.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 yt(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Zo extends Jn{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=Os(_)?_:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||l||s==="none";let $=t>0&&this.getParsed(t-1);for(let T=t;T<t+i;++T){const C=e[T],O=this.getParsed(T),M=k?C:{},D=dt(O[m]),I=M[p]=o.getPixelForValue(O[p],T),L=M[m]=l||D?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,O,a):O[m],T);M.skip=isNaN(I)||isNaN(L)||D,M.stop=T>0&&Math.abs(O[p]-$[p])>b,g&&(M.parsed=O,M.raw=u.data[T]),d&&(M.options=f||this.resolveDataElementOptions(T,C.active?"active":s)),k||this.updateElement(C,T,M,s),$=O}}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 Jn{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=Al(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)&&(l<t.min&&(t.min=l),l>t.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;_<t;++_)m+=this._computeAngle(_,s,g);for(_=t;_<t+i;_++){const b=e[_];let k=m,$=m+this._computeAngle(_,s,g),T=o.getDataVisibility(_)?u.getDistanceFromCenterForValue(this.getParsed(_).r):0;m=$,l&&(a.animateScale&&(T=0),a.animateRotate&&(k=$=p));const C={x:f,y:d,innerRadius:0,outerRadius:T,startAngle:k,endAngle:$,options:this.resolveDataElementOptions(_,b.active?"active":s)};this.updateElement(b,_,C,s)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Yn(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 Il{}A1.id="pie";A1.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Xa extends Jn{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<t+i;r++){const a=e[r],u=this.resolveDataElementOptions(r,a.active?"active":s),f=l.getPointPositionForValue(r,this.getParsed(r).r),d=o?l.xCenter:f.x,p=o?l.yCenter:f.y,m={x:d,y:p,angle:f.angle,skip:isNaN(d)||isNaN(p),options:u};this.updateElement(a,r,m,s)}}}Xa.id="radar";Xa.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Xa.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};let gi=class{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Os(this.x)&&Os(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const s={};return e.forEach(l=>{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}};gi.defaults={};gi.defaultRoutes=void 0;const I1={values(n){return yt(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=Rn(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),Al(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Rn(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,dt(p)?0:o-p,o),f=0,d=l-1;f<d;f++)Xl(e,a,u,s[f],s[f+1]);return Xl(e,a,u,r,dt(p)?e.length:r+p),a}return Xl(e,a,u),a}function gw(n){const e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),s=n._maxLength/t;return Math.floor(Math.min(i,s))}function bw(n,e,t){const i=kw(n),s=e.length/t;if(!i)return Math.max(s,1);const l=h2(i);for(let o=0,r=l.length-1;o<r;o++){const a=l[o];if(a>s)return a}return Math.max(s,1)}function vw(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function yw(n,e,t,i){let s=0,l=t[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===l&&(e.push(n[o]),s++,l=t[s*i])}function Xl(n,e,t,i,s){const l=st(i,0),o=Math.min(st(s,n.length),n.length);let r=0,a,u,f;for(t=Math.ceil(t),s&&(a=s-i,t=a/Math.floor(a/t)),f=l;f<0;)r++,f=Math.round(l+r*t);for(u=Math.max(l,0);u<o;u++)u===f&&(e.push(n[u]),r++,f=Math.round(l+r*t))}function kw(n){const e=n.length;let t,i;if(e<2)return!1;for(i=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==i)return!1;return i}const ww=n=>n==="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(;l<s;l+=i)t.push(n[Math.floor(l)]);return t}function Sw(n,e,t){const i=n.ticks.length,s=Math.min(e,i-1),l=n._startPixel,o=n._endPixel,r=1e-6;let a=n.getPixelForTick(s),u;if(!(t&&(i===1?u=Math.max(a-l,o-a):e===0?u=(n.getPixelForTick(1)-a)/2:u=(a-n.getPixelForTick(s-1))/2,a+=s<e?u:-u,a<l-r||a>o+r)))return a}function $w(n,e){mt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;l<s;++l)delete t.data[i[l]];i.splice(0,s)}})}function Ys(n){return n.drawTicks?n.tickLength:0}function Wf(n,e){if(!n.display)return 0;const t=$n(n.font,e),i=Vn(n.padding);return(yt(n.text)?n.text.length:1)*t.lineHeight+i.height}function Tw(n,e){return Pi(n,{scale:e,type:"scale"})}function Cw(n,e,t){return Pi(n,{tick:t,index:e,type:"tick"})}function Mw(n,e,t){let i=S2(n);return(t&&e!=="right"||!t&&e==="right")&&(i=ww(i)),i}function Ow(n,e,t,i){const{top:s,left:l,bottom:o,right:r,chart:a}=n,{chartArea:u,scales:f}=a;let d=0,p,m,_;const g=o-s,b=r-l;if(n.isHorizontal()){if(m=_f(i,l,r),xe(t)){const k=Object.keys(t)[0],$=t[k];_=f[k].getPixelForValue($)+g-e}else t==="center"?_=(u.bottom+u.top)/2+g-e:_=Bf(n,t,e);p=r-l}else{if(xe(t)){const k=Object.keys(t)[0],$=t[k];m=f[k].getPixelForValue($)-b+e}else t==="center"?m=(u.left+u.right)/2-b+e:m=Bf(n,t,e);_=_f(i,o,s),d=t==="left"?-It:It}return{titleX:m,titleY:_,maxWidth:p,rotation:d}}class ls extends gi{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:s}=this;return e=Pn(e,Number.POSITIVE_INFINITY),t=Pn(t,Number.NEGATIVE_INFINITY),i=Pn(i,Number.POSITIVE_INFINITY),s=Pn(s,Number.NEGATIVE_INFINITY),{min:Pn(e,i),max:Pn(t,s),minDefined:Rt(e),maxDefined:Rt(t)}}getMinMax(e){let{min:t,max:i,minDefined:s,maxDefined:l}=this.getUserBounds(),o;if(s&&l)return{min:t,max:i};const r=this.getMatchingVisibleMetas();for(let a=0,u=r.length;a<u;++a)o=r[a].controller.getMinMax(this,e),s||(t=Math.min(t,o.min)),l||(i=Math.max(i,o.max));return t=l&&t>i?i:t,i=s&&t>i?t:i,{min:Pn(t,Pn(i,t)),max:Pn(i,Pn(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<this.ticks.length;this._convertTicksToLabels(a?Uf(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=_w(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){At(this.options.afterUpdate,[this])}beforeSetDimensions(){At(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){At(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),At(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){At(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,s,l;for(i=0,s=e.length;i<s;i++)l=e[i],l.label=At(t.callback,[l.value,i,e],this)}afterTickToLabelConversion(){At(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){At(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=this.ticks.length,s=t.minRotation||0,l=t.maxRotation;let o=s,r,a,u;if(!this._isVisible()||!t.display||s>=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),d=f.widest.width,p=f.highest.height,m=en(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-Ys(e.grid)-t.padding-Wf(e.title,this.chart.options.font),u=Math.sqrt(d*d+p*p),o=Fa(Math.min(Math.asin(en((f.highest.height+6)/r,-1,1)),Math.asin(en(a/u,-1,1))-Math.asin(en(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=Ys(l)+a):(e.height=this.maxHeight,e.width=Ys(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:d,highest:p}=this._getLabelSizes(),m=i.padding*2,_=Yn(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<i;t++)dt(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=Uf(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(e,t){const{ctx:i,_longestTextCache:s}=this,l=[],o=[];let r=0,a=0,u,f,d,p,m,_,g,b,k,$,T;for(u=0;u<t;++u){if(p=e[u].label,m=this._resolveTickFontOptions(u),i.font=_=m.string,g=s[_]=s[_]||{data:{},gc:[]},b=m.lineHeight,k=$=0,!dt(p)&&!yt(p))k=Mo(i,g.data,g.gc,k,p),$=b;else if(yt(p))for(f=0,d=p.length;f<d;++f)T=p[f],!dt(T)&&!yt(T)&&(k=Mo(i,g.data,g.gc,k,T),$+=b);l.push(k),o.push($),r=Math.max(k,r),a=Math.max($,a)}$w(s,t);const C=l.indexOf(r),O=o.indexOf(a),M=D=>({width:l[D]||0,height:o[D]||0});return{first:M(0),last:M(t-1),widest:M(C),highest:M(O),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?Bi(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&&e<t.length){const i=t[e];return i.$context||(i.$context=Cw(this.getContext(),e,i))}return this.$context||(this.$context=Tw(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Yn(this.labelRotation),i=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),l=this._getLabelSizes(),o=e.autoSkipPadding||0,r=l?l.widest.width+o:0,a=l?l.highest.height+o:0;return this.isHorizontal()?a*i>r*s?r/i:a/s:a*s<r*i?a/i:r/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_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=Ys(l),p=[],m=l.setContext(this.getContext()),_=m.drawBorder?m.borderWidth:0,g=_/2,b=function(B){return Bi(i,B,_)};let k,$,T,C,O,M,D,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),O=this.right-d,D=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,O=k+g,D=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))}O=k-g,D=O-d,L=e.left,R=e.right}const q=st(s.ticks.maxTicksLimit,f),Y=Math.max(1,Math.ceil(f/q));for($=0;$<f;$+=Y){const B=l.setContext(this.getContext($)),Z=B.lineWidth,ee=B.color,ie=B.borderDash||[],X=B.borderDashOffset,fe=B.tickWidth,G=B.tickColor,ce=B.tickBorderDash||[],ge=B.tickBorderDashOffset;T=Sw(this,$,r),T!==void 0&&(C=Bi(i,T,Z),a?O=D=L=R=C:M=I=F=N=C,p.push({tx1:O,ty1:M,tx2:D,ty2:I,x1:L,y1:F,x2:R,y2:N,width:Z,color:ee,borderDash:ie,borderDashOffset:X,tickWidth:fe,tickColor:G,tickBorderDash:ce,tickBorderDashOffset:ge}))}return this._ticksLength=f,this._borderValue=k,p}_computeLabelItems(e){const t=this.axis,i=this.options,{position:s,ticks:l}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:u,padding:f,mirror:d}=l,p=Ys(i.grid),m=p+f,_=d?-f:m,g=-Yn(this.labelRotation),b=[];let k,$,T,C,O,M,D,I,L,F,R,N,q="middle";if(s==="top")M=this.bottom-_,D=this._getXAxisLabelAlignment();else if(s==="bottom")M=this.top+_,D=this._getXAxisLabelAlignment();else if(s==="left"){const B=this._getYAxisLabelAlignment(p);D=B.textAlign,O=B.x}else if(s==="right"){const B=this._getYAxisLabelAlignment(p);D=B.textAlign,O=B.x}else if(t==="x"){if(s==="center")M=(e.top+e.bottom)/2+m;else if(xe(s)){const B=Object.keys(s)[0],Z=s[B];M=this.chart.scales[B].getPixelForValue(Z)+m}D=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")O=(e.left+e.right)/2-m;else if(xe(s)){const B=Object.keys(s)[0],Z=s[B];O=this.chart.scales[B].getPixelForValue(Z)}D=this._getYAxisLabelAlignment(p).textAlign}t==="y"&&(a==="start"?q="top":a==="end"&&(q="bottom"));const Y=this._getLabelSizes();for(k=0,$=r.length;k<$;++k){T=r[k],C=T.label;const B=l.setContext(this.getContext(k));I=this.getPixelForTick(k)+l.labelOffset,L=this._resolveTickFontOptions(k),F=L.lineHeight,R=yt(C)?C.length:1;const Z=R/2,ee=B.color,ie=B.textStrokeColor,X=B.textStrokeWidth;let fe=D;o?(O=I,D==="inner"&&(k===$-1?fe=this.options.reverse?"left":"right":k===0?fe=this.options.reverse?"right":"left":fe="center"),s==="top"?u==="near"||g!==0?N=-R*F+F/2:u==="center"?N=-Y.highest.height/2-Z*F+F:N=-Y.highest.height+F/2:u==="near"||g!==0?N=F/2:u==="center"?N=Y.highest.height/2-Z*F:N=Y.highest.height-R*F,d&&(N*=-1)):(M=I,N=(1-R)*F/2);let G;if(B.showLabelBackdrop){const ce=Vn(B.backdropPadding),ge=Y.heights[k],Me=Y.widths[k];let je=M+N-ce.top,He=O-ce.left;switch(q){case"middle":je-=ge/2;break;case"bottom":je-=ge;break}switch(D){case"center":He-=Me/2;break;case"right":He-=Me;break}G={left:He,top:je,width:Me+ce.width,height:ge+ce.height,color:B.backdropColor}}b.push({rotation:g,label:C,font:L,color:ee,strokeColor:ie,strokeWidth:X,textOffset:N,textAlign:fe,textBaseline:q,translation:[O,M],backdrop:G})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Yn(this.labelRotation))return e==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:s,padding:l}}=this.options,o=this._getLabelSizes(),r=e+l,a=o.widest.width;let u,f;return t==="left"?s?(f=this.right+l,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f+=a)):(f=this.right-r,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f=this.left)):t==="right"?s?(f=this.left+l,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f-=a)):(f=this.left+r,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f=this.right)):u="right",{textAlign:u,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:s,width:l,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,l,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const s=this.ticks.findIndex(l=>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<o;++l){const a=s[l];t.drawOnChartArea&&r({x:a.x1,y:a.y1},{x:a.x2,y:a.y2},a),t.drawTicks&&r({x:a.tx1,y:a.ty1},{x:a.tx2,y:a.ty2},{color:a.tickColor,width:a.tickWidth,borderDash:a.tickBorderDash,borderDashOffset:a.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{grid:i}}=this,s=i.setContext(this.getContext()),l=i.drawBorder?s.borderWidth:0;if(!l)return;const o=i.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let a,u,f,d;this.isHorizontal()?(a=Bi(e,this.left,l)-l/2,u=Bi(e,this.right,o)+o/2,f=d=r):(f=Bi(e,this.top,l)-l/2,d=Bi(e,this.bottom,o)+o/2,a=u=r),t.save(),t.lineWidth=s.borderWidth,t.strokeStyle=s.borderColor,t.beginPath(),t.moveTo(a,f),t.lineTo(u,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Ha(i,s);const l=this._labelItems||(this._labelItems=this._computeLabelItems(e));let o,r;for(o=0,r=l.length;o<r;++o){const a=l[o],u=a.font,f=a.label;a.backdrop&&(i.fillStyle=a.backdrop.color,i.fillRect(a.backdrop.left,a.backdrop.top,a.backdrop.width,a.backdrop.height));let d=a.textOffset;Oo(i,f,0,d,u,a)}s&&za(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const l=$n(i.font),o=Vn(i.padding),r=i.align;let a=l.lineHeight/2;t==="bottom"||t==="center"||xe(t)?(a+=o.bottom,yt(i.text)&&(a+=l.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:d,rotation:p}=Ow(this,a,t,r);Oo(e,i.text,0,0,l,{color:i.color,maxWidth:d,rotation:p,textAlign:Mw(r,t,s),textBaseline:"middle",translation:[u,f]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=st(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==ls.prototype.draw?[{z:t,draw:s=>{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<o;++l){const r=t[l];r[i]===this.id&&(!e||r.type===e)&&s.push(r)}return s}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return $n(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Ql{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;Aw(t)&&(i=this.register(t));const s=this.items,l=e.id,o=this.scope+"."+l;if(!l)throw new Error("class does not have id: "+e);return l in s||(s[l]=e,Dw(e,o,i),this.override&&lt.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,s=this.scope;i in t&&delete t[i],s&&i in lt[s]&&(delete lt[s][i],this.override&&delete ns[i])}}function Dw(n,e,t){const i=hl(Object.create(null),[t?lt.get(t):{},lt.get(e),n.defaults]);lt.set(e,i),n.defaultRoutes&&Ew(e,n.defaultRoutes),n.descriptors&&lt.describe(e,n.descriptors)}function Ew(n,e){Object.keys(e).forEach(t=>{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(Jn,"datasets",!0),this.elements=new Ql(gi,"elements"),this.plugins=new Ql(Object,"plugins"),this.scales=new Ql(ls,"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):mt(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;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const s=t.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return s}}var xn=new Iw;class Qa extends Jn{update(e){const t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled;let{start:l,count:o}=f1(t,i,s);if(this._drawStart=l,this._drawCount=o,c1(t)&&(l=0,o=i.length),this.options.showLine){const{dataset:r,_dataset:a}=t;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!a._decimated,r.points=i;const u=this.resolveDatasetElementOptions(e);u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:u},e)}this.updateElements(i,l,o,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=xn.getElement("line")),super.addElements()}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,f=this.resolveDataElementOptions(t,s),d=this.getSharedOptions(f),p=this.includeOptions(s,d),m=o.axis,_=r.axis,{spanGaps:g,segment:b}=this.options,k=Os(g)?g:Number.POSITIVE_INFINITY,$=this.chart._animationsDisabled||l||s==="none";let T=t>0&&this.getParsed(t-1);for(let C=t;C<t+i;++C){const O=e[C],M=this.getParsed(C),D=$?O:{},I=dt(M[_]),L=D[m]=o.getPixelForValue(M[m],C),F=D[_]=l||I?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,M,a):M[_],C);D.skip=isNaN(L)||isNaN(F)||I,D.stop=C>0&&Math.abs(M[m]-T[m])>k,b&&(D.parsed=M,D.raw=u.data[C]),p&&(D.options=d||this.resolveDataElementOptions(C,O.active?"active":s)),$||this.updateElement(O,C,D,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 Ui(){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 Ui()}parse(e,t){return Ui()}format(e,t){return Ui()}add(e,t,i){return Ui()}diff(e,t,i){return Ui()}startOf(e,t,i){return Ui()}endOf(e,t){return Ui()}}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:Gi;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 Pl(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r<a;++r){const{index:u,data:f}=l[r],{lo:d,hi:p}=Pw(l[r],e,o,s);for(let m=d;m<=p;++m){const _=f[m];_.skip||i(_,u,m)}}}function Lw(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,s){const l=e?Math.abs(i.x-s.x):0,o=t?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(l,2)+Math.pow(o,2))}}function kr(n,e,t,i,s){const l=[];return!s&&!n.isPointInArea(e)||Pl(n,t,e,function(r,a,u){!s&&!bl(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&l.push({element:r,datasetIndex:a,index:u})},!0),l}function Nw(n,e,t,i){let s=[];function l(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:d}=l1(o,{x:e.x,y:e.y});_l(d,u,f)&&s.push({element:o,datasetIndex:r,index:a})}return Pl(n,t,e,l),s}function Fw(n,e,t,i,s,l){let o=[];const r=Lw(t);let a=Number.POSITIVE_INFINITY;function u(f,d,p){const m=f.inRange(e.x,e.y,s);if(i&&!m)return;const _=f.getCenterPoint(s);if(!(!!l||n.isPointInArea(_))&&!m)return;const b=r(e,_);b<a?(o=[{element:f,datasetIndex:d,index:p}],a=b):b===a&&o.push({element:f,datasetIndex:d,index:p})}return Pl(n,t,e,u),o}function wr(n,e,t,i,s,l){return!l&&!n.isPointInArea(e)?[]:t==="r"&&!i?Nw(n,e,t,s):Fw(n,e,t,i,s,l)}function Yf(n,e,t,i,s){const l=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return Pl(n,t,e,(a,u,f)=>{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:Pl,modes:{index(n,e,t,i){const s=Ki(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=Ki(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;f<u.length;++f)r.push({element:u[f],datasetIndex:a,index:f})}return r},point(n,e,t,i){const s=Ki(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return kr(n,s,l,i,o)},nearest(n,e,t,i){const s=Ki(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return wr(n,s,l,t.intersect,i,o)},x(n,e,t,i){const s=Ki(e,n);return Yf(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=Ki(e,n);return Yf(n,s,"y",t.intersect,i)}}};const L1=["left","top","right","bottom"];function Ks(n,e){return n.filter(t=>t.pos===e)}function Kf(n,e){return n.filter(t=>L1.indexOf(t.pos)===-1&&t.box.axis===e)}function Js(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;t<i;++t)s=n[t],{position:l,options:{stack:o,stackWeight:r=1}}=s,e.push({index:t,box:s,pos:l,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&l+o,stackWeight:r});return e}function jw(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:l}=t;if(!i||!L1.includes(s))continue;const o=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=l}return e}function Vw(n,e){const t=jw(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=e;let l,o,r;for(l=0,o=n.length;l<o;++l){r=n[l];const{fullSize:a}=r.box,u=t[r.stack],f=u&&r.stackWeight/u.weight;r.horizontal?(r.width=f?f*i:a&&e.availableWidth,r.height=s):(r.width=i,r.height=f?f*s:a&&e.availableHeight)}return t}function Hw(n){const e=qw(n),t=Js(e.filter(u=>u.box.fullSize),!0),i=Js(Ks(e,"left"),!0),s=Js(Ks(e,"right")),l=Js(Ks(e,"top"),!0),o=Js(Ks(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:Ks(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 el(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l<o;++l){r=n[l],a=r.box,a.update(r.width||e.w,r.height||e.h,Uw(r.horizontal,e));const{same:d,other:p}=zw(e,t,r,i);u|=d&&s.length,f=f||p,a.fullSize||s.push(r)}return u&&el(s,e,t,i)||f}function xl(n,e,t,i,s){n.top=t,n.left=e,n.right=e+i,n.bottom=t+s,n.width=i,n.height=s}function Zf(n,e,t,i){const s=t.padding;let{x:l,y:o}=e;for(const r of n){const a=r.box,u=i[r.stack]||{count:1,placed:0,weight:1},f=r.stackWeight/u.weight||1;if(r.horizontal){const d=e.w*f,p=u.size||a.height;jn(u.start)&&(o=u.start),a.fullSize?xl(a,s.left,o,t.outerWidth-s.right-s.left,p):xl(a,e.left+u.placed,o,d,p),u.start=o,u.placed+=d,o=a.bottom}else{const d=e.h*f,p=u.size||a.width;jn(u.start)&&(l=u.start),a.fullSize?xl(a,l,s.top,p,t.outerHeight-s.bottom-s.top):xl(a,l,e.top+u.placed,p,d),u.start=l,u.placed+=d,l=a.right}}e.x=l,e.y=o}lt.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var eo={addBox(n,e){n.boxes||(n.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){const t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,i){if(!n)return;const s=Vn(n.options.layout.padding),l=Math.max(e-s.width,0),o=Math.max(t-s.height,0),r=Hw(n.boxes),a=r.vertical,u=r.horizontal;mt(n.boxes,g=>{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,Vn(i));const m=Object.assign({maxPadding:p,w:l,h:o,x:s.left,y:s.top},s),_=Vw(a.concat(u),d);el(r.fullSize,m,d,_),el(a,m,d,_),el(u,m,d,_)&&el(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},mt(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}=Ki(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 vl=new Map;let Xf=0;function q1(){const n=window.devicePixelRatio;n!==Xf&&(Xf=n,vl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function xw(n,e){vl.size||window.addEventListener("resize",q1),vl.set(n,e)}function e3(n){vl.delete(n),vl.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<s.clientWidth&&t()},window),o=new ResizeObserver(r=>{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];dt(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(){dt(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(xn.plugins.items);for(let l=0;l<i.length;l++)t.push(xn.getPlugin(i[l]));const s=n.plugins||[];for(let l=0;l<s.length;l++){const o=s[l];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function r3(n,e){return!e&&n===!1?null:n===!0?{}:n}function a3(n,{plugins:e,localIds:t},i,s){const l=[],o=n.getContext();for(const r of e){const a=r.id,u=r3(i[a],s);u!==null&&l.push({plugin:r,options:u3(n.config,{plugin:r,local:t[a]},u,o)})}return l}function u3(n,{plugin:e,local:t},i,s){const l=n.pluginScopeKeys(e),o=n.getOptionScopes(i,l);return t&&e.defaults&&o.push(e.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function oa(n,e){const t=lt.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function f3(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function c3(n,e){return n===e?"_index_":"_value_"}function d3(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ra(n,e){return n==="x"||n==="y"?n:e.axis||d3(e.position)||n.charAt(0).toLowerCase()}function p3(n,e){const t=ns[n.type]||{scales:{}},i=e.scales||{},s=oa(n.type,e),l=Object.create(null),o=Object.create(null);return Object.keys(i).forEach(r=>{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]=il(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=(ns[a]||{}).scales||{};Object.keys(d).forEach(p=>{const m=f3(p,u),_=r[m+"AxisID"]||l[m]||m;o[_]=o[_]||Object.create(null),il(o[_],[{axis:m},i[_],d[p]])})}),Object.keys(o).forEach(r=>{const a=o[r];il(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 Zs=(n,e,t)=>{const i=Ei(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=>Zs(a,e,d))),f.forEach(d=>Zs(a,s,d)),f.forEach(d=>Zs(a,ns[l]||{},d)),f.forEach(d=>Zs(a,lt,d)),f.forEach(d=>Zs(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,ns[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=Ai(i)?i():i;const u=this.createResolver(e,i,r);a=Ds(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)?Ds(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||Ai(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&&(Ai(r)||_3(r))||o&&yt(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}ri.listen(this,"complete",nc),ri.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 dt(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 ri.stop(this),this}resize(e,t){ri.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||{};mt(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"}}))),mt(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=xn.getScale(f);d=new p({id:a,type:f,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(r,e)}),mt(s,(o,r)=>{o||delete i[r]}),mt(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;s<i;++s)this._destroyDatasetMeta(s);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(tc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.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<s;i++){const l=t[i];let o=this.getDatasetMeta(i);const r=l.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=r,o.indexAxis=l.indexAxis||oa(r,this.options),o.order=l.order||0,o.index=i,o.label=""+l.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const a=xn.getController(r),{datasetElementType:u,dataElementType:f}=lt.datasets[r];Object.assign(a.prototype,{dataElementType:xn.getElement(f),datasetElementType:u&&xn.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){mt(this.data.datasets,(e,t)=>{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<f;u++){const{controller:d}=this.getDatasetMeta(u),p=!s&&l.indexOf(d)===-1;d.buildOrUpdateElements(p),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||mt(l,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(){mt(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;l<t;l++)if(!cf(s,i(l)))return;return Array.from(s).map(l=>l.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=[],mt(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<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,Ai(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),s={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(t),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ri.has(this)?this.attached&&!ri.running(this)&&ri.start(this):(this.draw(),nc({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let s,l;for(s=0,l=t.length;s<l;++s){const o=t[s];(!e||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;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 bl(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=Pi(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);jn(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(),ri.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),$f(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Io[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(l,o)=>{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};mt(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(){mt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},mt(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<a;++r){o=e[r];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:l,index:o})=>{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=()=>mt(Po.instances,n=>n._plugins.invalidate()),yi=!0;Object.defineProperties(Po,{defaults:{enumerable:yi,value:lt},instances:{enumerable:yi,value:Io},overrides:{enumerable:yi,value:ns},registry:{enumerable:yi,value:xn},version:{enumerable:yi,value:b3},getChart:{enumerable:yi,value:B1},register:{enumerable:yi,value:(...n)=>{xn.add(...n),ic()}},unregister:{enumerable:yi,value:(...n)=>{xn.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 en(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:en(s.innerStart,0,o),innerEnd:en(s.innerEnd,0,o)}}function _s(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:O,innerEnd:M}=$3(e,p,d,$-k),D=d-T,I=d-C,L=k+T/D,F=$-C/I,R=p+O,N=p+M,q=k+O/R,Y=$-M/N;if(n.beginPath(),l){if(n.arc(o,r,d,L,F),C>0){const ee=_s(I,F,o,r);n.arc(ee.x,ee.y,C,F,$+It)}const B=_s(N,$,o,r);if(n.lineTo(B.x,B.y),M>0){const ee=_s(N,Y,o,r);n.arc(ee.x,ee.y,M,$+It,Y+Math.PI)}if(n.arc(o,r,p,$-M/p,k+O/p,!0),O>0){const ee=_s(R,q,o,r);n.arc(ee.x,ee.y,O,q+Math.PI,k-It)}const Z=_s(D,k,o,r);if(n.lineTo(Z.x,Z.y),T>0){const ee=_s(D,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+_t,s);for(let u=0;u<l;++u)n.fill();isNaN(r)||(a=o+r%_t,r%_t===0&&(a+=_t))}return aa(n,e,t,i,a,s),n.fill(),a}function C3(n,e,t){const{x:i,y:s,startAngle:l,pixelMargin:o,fullCircles:r}=e,a=Math.max(e.outerRadius-o,0),u=e.innerRadius+o;let f;for(t&&U1(n,e,l+_t),n.beginPath(),n.arc(i,s,u,l+_t,l,!0),f=0;f<r;++f)n.stroke();for(n.beginPath(),n.arc(i,s,a,l,l+_t),f=0;f<r;++f)n.stroke()}function M3(n,e,t,i,s,l){const{options:o}=e,{borderWidth:r,borderJoinStyle:a}=o,u=o.borderAlign==="inner";r&&(u?(n.lineWidth=r*2,n.lineJoin=a||"round"):(n.lineWidth=r,n.lineJoin=a||"bevel"),e.fullCircles&&C3(n,e,u),u&&U1(n,e,s),aa(n,e,t,i,s,l),n.stroke())}class xa extends gi{constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.getProps(["x","y"],i),{angle:l,distance:o}=l1(s,{x:e,y:t}),{startAngle:r,endAngle:a,innerRadius:u,outerRadius:f,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=this.options.spacing/2,_=st(d,a-r)>=_t||_l(l,r,a),g=gl(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>_t?Math.floor(i/_t):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=s<o&&l<o||s>r&&l>r;return{count:i,start:a,loop:e.loop,ilen:u<a&&!f?i+u-a:u-a}}function E3(n,e,t,i){const{points:s,options:l}=e,{count:o,start:r,loop:a,ilen:u}=Y1(s,t,i),f=D3(l);let{move:d=!0,reverse:p}=i||{},m,_,g;for(m=0;m<=u;++m)_=s[(r+(p?u-m:m))%o],!_.skip&&(d?(n.moveTo(_.x,_.y),d=!1):f(n,g,_,p,l.stepped),g=_);return a&&(_=s[(r+(p?u:0))%o],f(n,g,_,p,l.stepped)),!!a}function A3(n,e,t,i){const s=e.points,{count:l,start:o,ilen:r}=Y1(s,t,i),{move:a=!0,reverse:u}=i||{};let f=0,d=0,p,m,_,g,b,k;const $=C=>(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,O=m.y,M=C|0;M===_?(O<g?g=O:O>b&&(b=O),f=(d*f+C)/++d):(T(),n.lineTo(C,O),_=M,d=0,g=b=O),k=O}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:Ji}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 Li extends gi{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;u<f;++u){const{start:d,end:p}=o[u],m=l[d],_=l[p];if(m===_){r.push(m);continue}const g=Math.abs((s-m[t])/(_[t]-m[t])),b=a(m,_,g,i.stepped);b[t]=e[t],r.push(b)}return r.length===1?r[0]:r}pathSegment(e,t,i){return ua(this)(e,this,t,i)}path(e,t,i){const s=this.segments,l=ua(this);let o=this._loop;t=t||0,i=i||this.points.length-t;for(const r of s)o&=l(e,this,r,{start:t,end:t+i-1});return!!o}draw(e,t,i,s){const l=this.options||{};(this.points||[]).length&&l.borderWidth&&(e.save(),F3(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Li.id="line";Li.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};Li.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Li.descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"};function sc(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l)<s.radius+s.hitRadius}class Xo extends gi{constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.options,{x:l,y:o}=this.getProps(["x","y"],i);return Math.pow(e-l,2)+Math.pow(t-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(e,t){return sc(this,e,"x",t)}inYRange(e,t){return sc(this,e,"y",t)}getCenterPoint(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);const i=t&&e.borderWidth||0;return(t+i)*2}draw(e,t){const i=this.options;this.skip||i.radius<.1||!bl(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,sa(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}Xo.id="point";Xo.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Xo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function K1(n,e){const{x:t,y:i,base:s,width:l,height:o}=n.getProps(["x","y","base","width","height"],e);let r,a,u,f,d;return n.horizontal?(d=o/2,r=Math.min(t,s),a=Math.max(t,s),u=i-d,f=i+d):(d=l/2,r=t-d,a=t+d,u=Math.min(i,s),f=Math.max(i,s)),{left:r,top:u,right:a,bottom:f}}function $i(n,e,t,i){return n?0:en(e,t,i)}function R3(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,l=g1(i);return{t:$i(s.top,l.top,0,t),r:$i(s.right,l.right,0,e),b:$i(s.bottom,l.bottom,0,t),l:$i(s.left,l.left,0,e)}}function q3(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,l=ws(s),o=Math.min(e,t),r=n.borderSkipped,a=i||xe(s);return{topLeft:$i(!a||r.top||r.left,l.topLeft,0,o),topRight:$i(!a||r.top||r.right,l.topRight,0,o),bottomLeft:$i(!a||r.bottom||r.left,l.bottomLeft,0,o),bottomRight:$i(!a||r.bottom||r.right,l.bottomRight,0,o)}}function j3(n){const e=K1(n),t=e.right-e.left,i=e.bottom-e.top,s=R3(n,t/2,i/2),l=q3(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:l},inner:{x:e.left+s.l,y:e.top+s.t,w:t-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,l.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,l.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,l.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,l.bottomRight-Math.max(s.b,s.r))}}}}function $r(n,e,t,i){const s=e===null,l=t===null,r=n&&!(s&&l)&&K1(n,i);return r&&(s||gl(e,r.left,r.right))&&(l||gl(t,r.top,r.bottom))}function V3(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function H3(n,e){n.rect(e.x,e.y,e.w,e.h)}function Tr(n,e,t={}){const i=n.x!==t.x?-e:0,s=n.y!==t.y?-e:0,l=(n.x+n.w!==t.x+t.w?e:0)-i,o=(n.y+n.h!==t.y+t.h?e:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+l,h:n.h+o,radius:n.radius}}class eu extends gi{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:s}}=this,{inner:l,outer:o}=j3(this),r=V3(o.radius)?Do:H3;e.save(),(o.w!==l.w||o.h!==l.h)&&(e.beginPath(),r(e,Tr(o,t,l)),e.clip(),r(e,Tr(l,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,Tr(l,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return $r(this,e,t,i)}inXRange(e,t){return $r(this,e,null,t)}inYRange(e,t){return $r(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:s,horizontal:l}=this.getProps(["x","y","base","horizontal"],e);return{x:l?(t+s)/2:t,y:l?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}eu.id="bar";eu.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};eu.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function z3(n,e,t){const i=n.segments,s=n.points,l=e.points,o=[];for(const r of i){let{start:a,end:u}=r;u=tu(a,u,s);const f=fa(t,s[a],s[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:s[a],end:s[u]});continue}const d=M1(e,f);for(const p of d){const m=fa(t,l[p.start],l[p.end],p.loop),_=C1(r,s,m);for(const g of _)o.push({source:g,target:p,start:{[t]:lc(f,m,"start",Math.max)},end:{[t]:lc(f,m,"end",Math.min)}})}}return o}function fa(n,e,t,i){if(i)return;let s=e[n],l=t[n];return n==="angle"&&(s=Sn(s),l=Sn(l)),{property:n,start:s,end:l}}function B3(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,l=[];return e.segments.forEach(({start:o,end:r})=>{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 yt(n)?(i=!0,t=n):t=B3(n,e),t.length?new Li({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(!Rt(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 Rt(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<l.length;a++){const u=l[a];for(let f=u.start;f<=u.end;f++)Q3(s,o[f],r)}return new Li({points:s,options:{}})}function X3(n,e){const t=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const l=i[s];if(l.index===e)break;l.hidden||t.unshift(l.dataset)}return t}function Q3(n,e,t){const i=[];for(let s=0;s<t.length;s++){const l=t[s],{first:o,last:r,point:a}=x3(l,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function x3(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const s=i[t],l=n.segments,o=n.points;let r=!1,a=!1;for(let u=0;u<l.length;u++){const f=l[u],d=o[f.start][t],p=o[f.end][t];if(gl(s,d,p)){r=s===d,a=s===p;break}}return{first:r,last:a,point:i}}class Z1{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:s,y:l,radius:o}=this;return t=t||{start:0,end:_t},e.arc(s,l,o,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:s}=this,l=e.angle;return{x:t+Math.cos(l)*s,y:i+Math.sin(l)*s,angle:l}}}function eS(n){const{chart:e,fill:t,line:i}=n;if(Rt(t))return tS(e,t);if(t==="stack")return G3(n);if(t==="shape")return!0;const s=nS(n);return s instanceof Z1?s:J1(s,i)}function tS(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function nS(n){return(n.scale||{}).getPointPositionForValue?sS(n):iS(n)}function iS(n){const{scale:e={},fill:t}=n,i=K3(t,e);if(Rt(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function sS(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,l=i.reverse?e.max:e.min,o=J3(t,e,l),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,l);return new Z1({x:a.x,y:a.y,radius:e.getDistanceFromCenterForValue(o)})}for(let a=0;a<s;++a)r.push(e.getPointPositionForValue(a,o));return r}function Cr(n,e,t){const i=eS(e),{line:s,scale:l,axis:o}=e,r=s.options,a=r.fill,u=r.backgroundColor,{above:f=u,below:d=u}=a||{};i&&s.points.length&&(Ha(n,t),lS(n,{line:s,target:i,above:f,below:d,area:t,scale:l,axis:o}),za(n))}function lS(n,e){const{line:t,target:i,above:s,below:l,area:o,scale:r}=e,a=t._loop?"angle":e.axis;n.save(),a==="x"&&l!==s&&(rc(n,i,o.top),ac(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore(),n.save(),rc(n,i,o.bottom)),ac(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore()}function rc(n,e,t){const{segments:i,points:s}=e;let l=!0,o=!1;n.beginPath();for(const r of i){const{start:a,end:u}=r,f=s[a],d=s[tu(a,u,s)];l?(n.moveTo(f.x,f.y),l=!1):(n.lineTo(f.x,t),n.lineTo(f.x,f.y)),o=!!e.pathSegment(n,r,{move:o}),o?n.closePath():n.lineTo(d.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function ac(n,e){const{line:t,target:i,property:s,color:l,scale:o}=e,r=z3(t,i,s);for(const{source:a,target:u,start:f,end:d}of r){const{style:{backgroundColor:p=l}={}}=a,m=i!==!0;n.save(),n.fillStyle=p,oS(n,o,m&&fa(s,f,d)),n.beginPath();const _=!!t.pathSegment(n,a);let g;if(m){_?n.closePath():uc(n,i,d,s);const b=!!i.pathSegment(n,u,{move:_,reverse:!0});g=_&&b,g||uc(n,i,f,s)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function oS(n,e,t){const{top:i,bottom:s}=e.chart.chartArea,{property:l,start:o,end:r}=t||{};l==="x"&&(n.beginPath(),n.rect(o,i,r-o,s-i),n.clip())}function uc(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var rS={id:"filler",afterDatasetsUpdate(n,e,t){const i=(n.data.datasets||[]).length,s=[];let l,o,r,a;for(o=0;o<i;++o)l=n.getDatasetMeta(o),r=l.dataset,a=null,r&&r.options&&r instanceof Li&&(a={visible:n.isDatasetVisible(o),index:o,fill:W3(r,o,i),chart:n,axis:l.controller.options.indexAxis,scale:l.vScale,line:r}),l.$filler=a,s.push(a);for(o=0;o<i;++o)a=s[o],!(!a||a.fill===!1)&&(a.fill=U3(s,o,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),l=n.chartArea;for(let o=s.length-1;o>=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 rl={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e<t;++e){const o=n[e].element;if(o&&o.hasValue()){const r=o.tooltipPosition();i+=r.x,s+=r.y,++l}}return{x:i/l,y:s/l}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,s=Number.POSITIVE_INFINITY,l,o,r;for(l=0,o=n.length;l<o;++l){const a=n[l].element;if(a&&a.hasValue()){const u=a.getCenterPoint(),f=ta(e,u);f<s&&(s=f,r=a)}}if(r){const a=r.tooltipPosition();t=a.x,i=a.y}return{x:t,y:i}}};function Xn(n,e){return e&&(yt(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function ai(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-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=$n(e.bodyFont),u=$n(e.titleFont),f=$n(e.footerFont),d=l.length,p=s.length,m=i.length,_=Vn(e.padding);let g=_.height,b=0,k=i.reduce((C,O)=>C+O.before.length+O.lines.length+O.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,mt(n.title,T),t.font=a.string,mt(n.beforeBody.concat(n.afterBody),T),$=e.displayColors?o+2+e.boxPadding:0,mt(i,C=>{mt(C.before,T),mt(C.lines,T),mt(C.after,T)}),$=0,t.font=f.string,mt(n.footer,T),t.restore(),b+=_.width,{width:b,height:g}}function uS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.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}=ws(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:en(_,0,i.width-e.width),y:en(g,0,i.height-e.height)}}function no(n,e,t){const i=Vn(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 Xn([],ai(n))}function mS(n,e,t){return Pi(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 gi{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=Xn(r,ai(s)),r=Xn(r,ai(l)),r=Xn(r,ai(o)),r}getBeforeBody(e,t){return pc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return mt(e,l=>{const o={before:[],lines:[],after:[]},r=mc(i,l);Xn(o.before,ai(r.beforeLabel.call(this,l))),Xn(o.lines,r.label.call(this,l)),Xn(o.after,ai(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=Xn(r,ai(s)),r=Xn(r,ai(l)),r=Xn(r,ai(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;a<u;++a)r.push(aS(this.chart,t[a]));return e.filter&&(r=r.filter((f,d,p)=>e.filter(f,d,p,i))),e.itemSort&&(r=r.sort((f,d)=>e.itemSort(f,d,i))),mt(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=rl[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}=ws(r),{x:p,y:m}=e,{width:_,height:g}=t;let b,k,$,T,C,O;return l==="center"?(C=m+g/2,s==="left"?(b=p,k=b-o,T=C+o,O=C-o):(b=p+_,k=b+o,T=C-o,O=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),O=T),{x1:b,x2:k,x3:$,y1:T,y2:C,y3:O}}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=$n(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;a<l;++a)t.fillText(s[a],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r,a+1===l&&(e.y+=i.titleMarginBottom-r)}}_drawColorBox(e,t,i,s,l){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:u,boxPadding:f}=l,d=$n(l.bodyFont),p=no(this,"left",l),m=s.x(p),_=a<d.lineHeight?(d.lineHeight-a)/2:0,g=t.y+_;if(l.usePointStyle){const b={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},k=s.leftForLtr(m,u)+u/2,$=g+a/2;e.strokeStyle=l.multiKeyBackground,e.fillStyle=l.multiKeyBackground,sa(e,b,k,$),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,sa(e,b,k,$)}else{e.lineWidth=xe(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const b=s.leftForLtr(m,u-f),k=s.leftForLtr(s.xPlus(m,1),u-f-2),$=ws(o.borderRadius);Object.values($).some(T=>T!==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=$n(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,O,M,D;for(t.textAlign=o,t.textBaseline="middle",t.font=d.string,e.x=no(this,b,i),t.fillStyle=i.bodyColor,mt(this.beforeBody,g),m=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,C=0,M=s.length;C<M;++C){for(k=s[C],$=this.labelTextColors[C],t.fillStyle=$,mt(k.before,g),T=k.lines,r&&T.length&&(this._drawColorBox(t,e,C,_,i),p=Math.max(d.lineHeight,a)),O=0,D=T.length;O<D;++O)g(T[O]),p=d.lineHeight;mt(k.after,g)}m=0,p=d.lineHeight,mt(this.afterBody,g),e.y-=l}drawFooter(e,t,i){const s=this.footer,l=s.length;let o,r;if(l){const a=gr(i.rtl,this.x,this.width);for(e.x=no(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",o=$n(i.footerFont),t.fillStyle=i.footerColor,t.font=o.string,r=0;r<l;++r)t.fillText(s[r],a.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,t,i,s){const{xAlign:l,yAlign:o}=this,{x:r,y:a}=e,{width:u,height:f}=i,{topLeft:d,topRight:p,bottomLeft:m,bottomRight:_}=ws(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(r+d,a),o==="top"&&this.drawCaret(e,t,i,s),t.lineTo(r+u-p,a),t.quadraticCurveTo(r+u,a,r+u,a+p),o==="center"&&l==="right"&&this.drawCaret(e,t,i,s),t.lineTo(r+u,a+f-_),t.quadraticCurveTo(r+u,a+f,r+u-_,a+f),o==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(r+m,a+f),t.quadraticCurveTo(r,a+f,r,a+f-m),o==="center"&&l==="left"&&this.drawCaret(e,t,i,s),t.lineTo(r,a+d),t.quadraticCurveTo(r,a,r+d,a),t.closePath(),t.fill(),s.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=rl[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=Vn(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=rl[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ca.positioners=rl;var hS={id:"tooltip",_element:ca,positioners:rl,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:oi,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.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:oi,beforeBody:oi,beforeLabel:oi,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return dt(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:oi,afterBody:oi,beforeFooter:oi,footer:oi,afterFooter:oi}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="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:en(Math.round(n),0,e);class da extends ls{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(dt(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&&e<t.length?t[e]:e}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.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=!dt(o),$=!dt(r),T=!dt(u),C=(b-g)/(d+1);let O=pf((b-g)/_/m)*m,M,D,I,L;if(O<1e-14&&!k&&!$)return[{value:g},{value:b}];L=Math.ceil(b/O)-Math.floor(g/O),L>_&&(O=pf(L*O/_/m)*m),dt(a)||(M=Math.pow(10,a),O=Math.ceil(O*M)/M),s==="ticks"?(D=Math.floor(g/O)*O,I=Math.ceil(b/O)*O):(D=g,I=b),k&&$&&l&&_2((r-o)/l,O/1e3)?(L=Math.round(Math.min((r-o)/O,f)),O=(r-o)/L,D=o,I=r):T?(D=k?o:D,I=$?r:I,L=u-1,O=(I-D)/L):(L=(I-D)/O,sl(L,Math.round(L),O/1e3)?L=Math.round(L):L=Math.ceil(L));const F=Math.max(mf(O),mf(D));M=Math.pow(10,dt(a)?F:a),D=Math.round(D*M)/M,I=Math.round(I*M)/M;let R=0;for(k&&(p&&D!==o?(t.push({value:o}),D<o&&R++,sl(Math.round((D+R*O)*M)/M,o,hc(o,C,n))&&R++):D<o&&R++);R<L;++R)t.push({value:Math.round((D+R*O)*M)/M});return $&&p&&I!==r?t.length&&sl(t[t.length-1].value,r,hc(r,C,n))?t[t.length-1].value=r:t.push({value:r}):(!$||I===r)&&t.push({value:I}),t}function hc(n,e,{horizontal:t,minRotation:i}){const s=Yn(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class Lo extends ls{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return dt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:s,max:l}=this;const o=a=>s=t?s:a,r=a=>l=i?l:a;if(e){const a=ei(s),u=ei(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 Al(e,this.chart.options.locale,this.options.ticks.format)}}class nu extends Lo{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Rt(e)?e:0,this.max=Rt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Yn(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(Rn(n)))===1}function yS(n,e){const t=Math.floor(Rn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Pn(n.min,Math.pow(10,Math.floor(Rn(e.min)))),o=Math.floor(Rn(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(o<t||o===t&&r<i);const u=Pn(n.max,l);return s.push({value:u,major:_c(l)}),s}class G1 extends ls{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=Lo.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return Rt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Rt(e)?Math.max(0,e):null,this.max=Rt(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(Rn(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":Al(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Rn(e),this._valueRange=Rn(this.max)-Rn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Rn(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=Vn(e.backdropPadding);return st(e.font&&e.font.size,lt.font.size)+t.height}return 0}function kS(n,e,t){return t=yt(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}:n<i||n>s?{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;a<l;a++){const u=o.setContext(n.getPointLabelContext(a));s[a]=u.padding;const f=n.getPointPosition(a,n.drawingArea+s[a],r),d=$n(u.font),p=kS(n.ctx,d,n._pointLabels[a]);i[a]=p;const m=Sn(n.getIndexAngle(a)+r),_=Math.round(Fa(m)),g=gc(_,f.x,p.w,0,180),b=gc(_,f.y,p.h,90,270);SS(t,e,m,g,b)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=$S(n,i,s)}function SS(n,e,t,i,s){const l=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t));let r=0,a=0;i.start<e.l?(r=(e.l-i.start)/l,n.l=Math.min(n.l,e.l-r)):i.end>e.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.start<e.t?(a=(e.t-s.start)/o,n.t=Math.min(n.t,e.t-a)):s.end>e.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;u<s;u++){const f=n.getPointPosition(u,r+o+t[u],a),d=Math.round(Fa(Sn(f.angle+It))),p=e[u],m=MS(f.y,p.h,d),_=TS(d),g=CS(f.x,p.w,_);i.push({x:f.x,y:m,textAlign:_,left:g,top:m,right:g+p.w,bottom:m+p.h})}return i}function TS(n){return n===0||n===180?"center":n<180?"left":"right"}function CS(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function MS(n,e,t){return t===90||t===270?n-=e/2:(t>270||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=$n(l.font),{x:r,y:a,textAlign:u,left:f,top:d,right:p,bottom:m}=n._pointLabelItems[s],{backdropColor:_}=l;if(!dt(_)){const g=ws(l.borderRadius),b=Vn(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(O=>O!==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,_t);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o<i;o++)l=n.getPointPosition(o,e),s.lineTo(l.x,l.y)}}function DS(n,e,t,i){const s=n.ctx,l=e.circular,{color:o,lineWidth:r}=e;!l&&!i||!o||!r||t<0||(s.save(),s.strokeStyle=o,s.lineWidth=r,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),X1(n,t,l,i),s.closePath(),s.stroke(),s.restore())}function ES(n,e,t){return Pi(n,{label:t,index:e,type:"pointLabel"})}class Qo extends Lo{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Vn(pa(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=Rt(e)&&!isNaN(e)?e:0,this.max=Rt(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/pa(this.options))}generateTickLabels(e){Lo.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{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=_t/(this._pointLabels.length||1),i=this.options.startAngle||0;return Sn(e*t+Yn(i))}getDistanceFromCenterForValue(e){if(dt(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(dt(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<t.length){const i=t[e];return ES(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const s=this.getIndexAngle(e)-It+i;return{x:Math.cos(s)*t+this.xCenter,y:Math.sin(s)*t+this.yCenter,angle:s}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:i,right:s,bottom:l}=this._pointLabelItems[e];return{left:t,top:i,right:s,bottom:l}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),X1(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:i,grid:s}=t,l=this._pointLabels.length;let o,r,a;if(t.pointLabels.display&&OS(this,l),s.display&&this.ticks.forEach((u,f)=>{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=$n(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=Vn(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}},hn=Object.keys(xo);function AS(n,e){return n-e}function bc(n,e){if(dt(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)),Rt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Os(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function vc(n,e,t,i){const s=hn.length;for(let l=hn.indexOf(n);l<s-1;++l){const o=xo[hn[l]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return hn[l]}return hn[s-1]}function IS(n,e,t,i,s){for(let l=hn.length-1;l>=hn.indexOf(t);l--){const o=hn[l];if(xo[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return hn[t?hn.indexOf(t):0]}function PS(n){for(let e=hn.indexOf(n)+1,t=hn.length;e<t;++e)if(xo[hn[e]].common)return hn[e]}function yc(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=Ra(t,e),l=t[i]>=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<l;++o)r=e[o],s[r]=o,i.push({value:r,major:!1});return l===0||!t?i:LS(n,i,s,t)}class Ll extends ls{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t){const i=e.time||(e.time={}),s=this._adapter=new P1._date(e.adapters.date);s.init(t),il(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:bc(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:s,max:l,minDefined:o,maxDefined:r}=this.getUserBounds();function a(u){!o&&!isNaN(u.min)&&(s=Math.min(s,u.min)),!r&&!isNaN(u.max)&&(l=Math.max(l,u.max))}(!o||!r)&&(a(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&a(this.getMinMax(!1))),s=Rt(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),l=Rt(l)&&!isNaN(l)?l:+t.endOf(Date.now(),i)+1,this.min=Math.min(s,l-1),this.max=Math.max(s+1,l)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const l=this.min,o=this.max,r=y2(s,l,o);return this._unit=t.unit||(i.autoSkip?vc(t.minUnit,this.min,this.max,this._getLabelCapacity(l)):IS(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:PS(this._unit),this.initOffsets(s),e.reverse&&r.reverse(),kc(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+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=en(t,0,o),i=en(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=Os(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;p<i;p=+e.add(p,r,o),m++)yc(f,p,_);return(p===i||s.bounds==="ticks"||m===1)&&yc(f,p,_),Object.keys(f).sort((g,b)=>g-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;t<i;++t)s=e[t],s.label=this._tickFormatFunction(s.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,s=Yn(this.isHorizontal()?t.maxRotation:t.minRotation),l=Math.cos(s),o=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*l+r*o,h:i*o+r*l}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,s=i[t.unit]||i.millisecond,l=this._tickFormatFunction(e,0,kc(this,[e],this._majorUnit),s),o=this._getLabelSize(l),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?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<i;++t)e=e.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const s=this.getLabels();for(t=0,i=s.length;t<i;++t)e.push(bc(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return r1(e.sort(AS))}}Ll.id="time";Ll.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function io(n,e,t){let i=0,s=n.length-1,l,o,r,a;t?(e>=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Gi(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}=Gi(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 Ll{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<r;++o)u=e[o],u>=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<r;++o)f=s[o+1],a=s[o-1],u=s[o],Math.round((f+a)/2)!==u&&l.push({time:u,pos:o/(r-1)});return l}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(io(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return io(this._table,i*this._tableRange+this._minPos,!0)}}Q1.id="timeseries";Q1.defaults=Ll.defaults;/*!
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const NS={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"}};P1._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 NS},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&&tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,Ht,{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),he.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),he.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function d(){t(1,a=0),t(7,r=[])}Xt(()=>(Po.register(Li,Xo,Zo,nu,Ll,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:{};/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @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,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++l}),$.__id},clone:function $(T,C){C=C||{};var O,M;switch(r.util.type(T)){case"Object":if(M=r.util.objId(T),C[M])return C[M];O={},C[M]=O;for(var D in T)T.hasOwnProperty(D)&&(O[D]=$(T[D],C));return O;case"Array":return M=r.util.objId(T),C[M]?C[M]:(O=[],C[M]=O,T.forEach(function(I,L){O[L]=$(I,C)}),O);default:return T}},getLanguage:function($){for(;$;){var T=s.exec($.className);if(T)return T[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,T){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(O){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(O.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 O="no-"+T;$;){var M=$.classList;if(M.contains(T))return!0;if(M.contains(O))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 O in T)C[O]=T[O];return C},insertBefore:function($,T,C,O){O=O||r.languages;var M=O[$],D={};for(var I in M)if(M.hasOwnProperty(I)){if(I==T)for(var L in C)C.hasOwnProperty(L)&&(D[L]=C[L]);C.hasOwnProperty(I)||(D[I]=M[I])}var F=O[$];return O[$]=D,r.languages.DFS(r.languages,function(R,N){N===F&&R!=$&&(this[R]=D)}),D},DFS:function $(T,C,O,M){M=M||{};var D=r.util.objId;for(var I in T)if(T.hasOwnProperty(I)){C.call(T,I,T[I],O||I);var L=T[I],F=r.util.type(L);F==="Object"&&!M[D(L)]?(M[D(L)]=!0,$(L,C,null,M)):F==="Array"&&!M[D(L)]&&(M[D(L)]=!0,$(L,C,I,M))}}},plugins:{},highlightAll:function($,T){r.highlightAllUnder(document,$,T)},highlightAllUnder:function($,T,C){var O={callback:C,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",O),O.elements=Array.prototype.slice.apply(O.container.querySelectorAll(O.selector)),r.hooks.run("before-all-elements-highlight",O);for(var M=0,D;D=O.elements[M++];)r.highlightElement(D,T===!0,O.callback)},highlightElement:function($,T,C){var O=r.util.getLanguage($),M=r.languages[O];r.util.setLanguage($,O);var D=$.parentElement;D&&D.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(D,O);var I=$.textContent,L={element:$,language:O,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),D=L.element.parentElement,D&&D.nodeName.toLowerCase()==="pre"&&!D.hasAttribute("tabindex")&&D.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 O={code:$,grammar:T,language:C};if(r.hooks.run("before-tokenize",O),!O.grammar)throw new Error('The language "'+O.language+'" has no grammar.');return O.tokens=r.tokenize(O.code,O.grammar),r.hooks.run("after-tokenize",O),a.stringify(r.util.encode(O.tokens),O.language)},tokenize:function($,T){var C=T.rest;if(C){for(var O in C)T[O]=C[O];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 O=0,M;M=C[O++];)M(T)}},Token:a};i.Prism=r;function a($,T,C,O){this.type=$,this.content=T,this.alias=C,this.length=(O||"").length|0}a.stringify=function $(T,C){if(typeof T=="string")return T;if(Array.isArray(T)){var O="";return T.forEach(function(F){O+=$(F,C)}),O}var M={type:T.type,content:$(T.content,C),tag:"span",classes:["token",T.type],attributes:{},language:C},D=T.alias;D&&(Array.isArray(D)?Array.prototype.push.apply(M.classes,D):M.classes.push(D)),r.hooks.run("wrap",M);var I="";for(var L in M.attributes)I+=" "+L+'="'+(M.attributes[L]||"").replace(/"/g,"&quot;")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+I+">"+M.content+"</"+M.tag+">"};function u($,T,C,O){$.lastIndex=T;var M=$.exec(C);if(M&&O&&M[1]){var D=M[1].length;M.index+=D,M[0]=M[0].slice(D)}return M}function f($,T,C,O,M,D){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<L.length;++F){if(D&&D.cause==I+","+F)return;var R=L[F],N=R.inside,q=!!R.lookbehind,Y=!!R.greedy,B=R.alias;if(Y&&!R.pattern.global){var Z=R.pattern.toString().match(/[imsuy]*$/)[0];R.pattern=RegExp(R.pattern.source,Z+"g")}for(var ee=R.pattern||R,ie=O.next,X=M;ie!==T.tail&&!(D&&X>=D.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 je=ie;je!==T.tail&&(Me<ge||typeof je.value=="string");je=je.next)G++,Me+=je.value.length;G--,fe=$.slice(X,Me),ce.index-=X}else if(ce=u(ee,0,fe,q),!ce)continue;var He=ce.index,we=ce[0],Ce=fe.slice(0,He),Je=fe.slice(He+we.length),ht=X+fe.length;D&&ht>D.reach&&(D.reach=ht);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:ht};f($,T,C,ie.prev,X,te),D&&te.reach>D.reach&&(D.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 O=T.next,M={value:C,prev:T,next:O};return T.next=M,O.prev=M,$.length++,M}function m($,T,C){for(var O=T.next,M=0;M<C&&O!==$.tail;M++)O=O.next;T.next=O,O.prev=T,$.length-=M}function _($){for(var T=[],C=$.head.next;C!==$.tail;)T.push(C.value),C=C.next;return T}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function($){var T=JSON.parse($.data),C=T.language,O=T.code,M=T.immediateClose;i.postMessage(r.highlight(O,r.languages[C],C)),M&&i.close()},!1)),r;var g=r.util.currentScript();g&&(r.filename=g.src,g.hasAttribute("data-manual")&&(r.manual=!0));function b(){r.manual||r.highlightAll()}if(!r.manual){var k=document.readyState;k==="loading"||k==="interactive"&&g&&g.defer?document.addEventListener("DOMContentLoaded",b):window.requestAnimationFrame?window.requestAnimationFrame(b):window.setTimeout(b,16)}return r}(e);n.exports&&(n.exports=t),typeof Sc<"u"&&(Sc.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\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:/<!\[CDATA\[[\s\S]*?\]\]>/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(/&amp;/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.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 O=t.plugins.autoloader;O&&O.loadLanguages(T),p($,function(M){b.setAttribute(r,u);var D=m(b.getAttribute("data-range"));if(D){var I=M.split(/\r\n?|\n/g),L=D[0],F=D[1]==null?I.length:D[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 Gs=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<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),d=0,p=0;p<f.length;++p){var m=s(f[p]);d+=m,d>r&&(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<p.length;++b){var k=p[b];k==o.element?g=!0:k.nodeName==="#text"&&(g?_+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--b)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+_,o.code=r.normalize(o.code,o.settings);else{var $=m+o.element.innerHTML+_;o.element.innerHTML=r.normalize($,o.settings),o.code=o.element.textContent}}}})})()})(zS);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\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=Gs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Gs.highlight(a,Gs.languages[l]||Gs.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 Gs<"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,O=Ct(C,n,n[18],Cc);let M=n[4]&&n[2]&&Dc(n);const D=n[19].default,I=Ct(D,n,n[18],null),L=n[19].footer,F=Ct(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(),O&&O.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),O&&O.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",ct(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),O&&O.p&&(!b||N[0]&262144)&&Ot(O,C,n,n[18],b?Mt(C,n[18],N,YS):Dt(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)&&Ot(I,D,n,n[18],b?Mt(D,n[18],N,null):Dt(n[18]),null),F&&F.p&&(!b||N[0]&262144)&&Ot(F,L,n,n[18],b?Mt(L,n[18],N,WS):Dt(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&&tt(()=>{b&&(i||(i=Ve(t,yo,{duration:gs,opacity:0},!0)),i.run(1))}),A(O,R),A(I,R),A(F,R),tt(()=>{b&&(g&&g.end(1),_=Lb(l,ni,n[2]?{duration:gs,y:-10}:{duration:gs,x:50}),_.start())}),b=!0)},o(R){R&&(i||(i=Ve(t,yo,{duration:gs,opacity:0},!1)),i.run(0)),P(O,R),P(I,R),P(F,R),_&&_.invalidate(),g=Nb(l,ni,n[2]?{duration:gs,y:10}:{duration:gs,x:50}),b=!1},d(R){R&&w(e),R&&i&&i.end(),T&&T.d(),O&&O.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='<i class="ri-close-line"></i>',h(e,"type","button"),h(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=J(e,"click",ct(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='<i class="ri-close-line txt-lg"></i>',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",ct(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")},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 Wi,Mr=[];function eb(){return Wi=Wi||document.querySelector(".overlays"),Wi||(Wi=document.createElement("div"),Wi.classList.add("overlays"),document.body.appendChild(Wi)),Wi}let gs=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=wt(),_="op_"+z.randomString(10);let g,b,k,$,T="",C=o;function O(){typeof d=="function"&&d()===!1||t(0,o=!0)}function M(){typeof p=="function"&&p()===!1||t(0,o=!1)}function D(){return o}async function I(X){t(17,C=X),X?(k=document.activeElement,g==null||g.focus(),m("show")):(clearTimeout($),k==null||k.focus(),m("hide")),await un(),L()}function L(){g&&(o?t(6,g.style.zIndex=Ec(),g):t(6,g.style="",g))}function F(){z.pushUnique(Mr,_),document.body.classList.add("overlay-active")}function R(){z.removeByValue(Mr,_),Mr.length||document.body.classList.remove("overlay-active")}function N(X){o&&f&&X.code=="Escape"&&!z.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,O,D,C,s,i,B,Z,ee,ie]}class cn 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"),H(t.$$.fragment),h(e,"class","block")},m(s,l){S(s,e,l),j(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),V(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,O,M=((Ie=n[2].method)==null?void 0:Ie.toUpperCase())+"",D,I,L,F,R,N,q=n[2].auth+"",Y,B,Z,ee,ie,X,fe=n[2].url+"",G,ce,ge,Me,je,He,we,Ce,Je,ht,Ze,We=n[2].remoteIp+"",te,Re,Qe,Jt,Ne,$e,Xe=n[2].userIp+"",ke,Pe,nt,vt,En,rt,Zn=n[2].userAgent+"",os,Nl,bi,rs,Fl,Ri,as,dn,et,us,li,fs,qi,ji,Zt,nn;function Rl(Le,Oe){return Le[2].referer?GS:ZS}let W=Rl(n),K=W(n);const ne=[QS,XS],oe=[];function Te(Le,Oe){return Oe&4&&(as=null),as==null&&(as=!z.isEmpty(Le[2].meta)),as?0:1}return dn=Te(n,-1),et=oe[dn]=ne[dn](n),Zt=new mi({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(),O=y("td"),D=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",je=E(),He=y("td"),K.c(),we=E(),Ce=y("tr"),Je=y("td"),Je.textContent="Remote IP",ht=E(),Ze=y("td"),te=U(We),Re=E(),Qe=y("tr"),Jt=y("td"),Jt.textContent="User IP",Ne=E(),$e=y("td"),ke=U(Xe),Pe=E(),nt=y("tr"),vt=y("td"),vt.textContent="UserAgent",En=E(),rt=y("td"),os=U(Zn),Nl=E(),bi=y("tr"),rs=y("td"),rs.textContent="Meta",Fl=E(),Ri=y("td"),et.c(),us=E(),li=y("tr"),fs=y("td"),fs.textContent="Created",qi=E(),ji=y("td"),H(Zt.$$.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(Jt,"class","min-width txt-hint txt-bold"),h(vt,"class","min-width txt-hint txt-bold"),h(rs,"class","min-width txt-hint txt-bold"),h(fs,"class","min-width txt-hint txt-bold"),h(e,"class","table-border")},m(Le,Oe){S(Le,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($,O),v(O,D),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,je),v(ge,He),K.m(He,null),v(t,we),v(t,Ce),v(Ce,Je),v(Ce,ht),v(Ce,Ze),v(Ze,te),v(t,Re),v(t,Qe),v(Qe,Jt),v(Qe,Ne),v(Qe,$e),v($e,ke),v(t,Pe),v(t,nt),v(nt,vt),v(nt,En),v(nt,rt),v(rt,os),v(t,Nl),v(t,bi),v(bi,rs),v(bi,Fl),v(bi,Ri),oe[dn].m(Ri,null),v(t,us),v(t,li),v(li,fs),v(li,qi),v(li,ji),j(Zt,ji,null),nn=!0},p(Le,Oe){var Be;(!nn||Oe&4)&&r!==(r=Le[2].id+"")&&le(a,r),(!nn||Oe&4)&&g!==(g=Le[2].status+"")&&le(b,g),(!nn||Oe&4)&&x(_,"label-danger",Le[2].status>=400),(!nn||Oe&4)&&M!==(M=((Be=Le[2].method)==null?void 0:Be.toUpperCase())+"")&&le(D,M),(!nn||Oe&4)&&q!==(q=Le[2].auth+"")&&le(Y,q),(!nn||Oe&4)&&fe!==(fe=Le[2].url+"")&&le(G,fe),W===(W=Rl(Le))&&K?K.p(Le,Oe):(K.d(1),K=W(Le),K&&(K.c(),K.m(He,null))),(!nn||Oe&4)&&We!==(We=Le[2].remoteIp+"")&&le(te,We),(!nn||Oe&4)&&Xe!==(Xe=Le[2].userIp+"")&&le(ke,Xe),(!nn||Oe&4)&&Zn!==(Zn=Le[2].userAgent+"")&&le(os,Zn);let Ye=dn;dn=Te(Le,Oe),dn===Ye?oe[dn].p(Le,Oe):(re(),P(oe[Ye],1,1,()=>{oe[Ye]=null}),ae(),et=oe[dn],et?et.p(Le,Oe):(et=oe[dn]=ne[dn](Le),et.c()),A(et,1),et.m(Ri,null));const Fe={};Oe&4&&(Fe.date=Le[2].created),Zt.$set(Fe)},i(Le){nn||(A(et),A(Zt.$$.fragment,Le),nn=!0)},o(Le){P(et),P(Zt.$$.fragment,Le),nn=!1},d(Le){Le&&w(e),K.d(),oe[dn].d(),V(Zt)}}}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='<span class="txt">Close</span>',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 cn({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){H(e.$$.fragment)},m(s,l){j(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),V(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[0],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&h(e,"id",t),f&1&&(e.checked=u[0]),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,i;function s(o){n[10](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new VS({props:l}),se.push(()=>me(e,"filter",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Ic(n){let e,t,i;function s(o){n[11](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new l2({props:l}),se.push(()=>me(e,"filter",s)),e.$on("select",n[12]),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}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],O,M;r=new Pa({}),r.$on("refresh",n[7]),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[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","remoteIp","userIp","referer","status","auth","userAgent"]}}),_.$on("submit",n[9]);let D=Ac(n),I=Ic(n);return{c(){e=y("div"),t=y("header"),i=y("nav"),s=y("div"),l=U(n[5]),o=E(),H(r.$$.fragment),a=E(),u=y("div"),f=E(),d=y("div"),H(p.$$.fragment),m=E(),H(_.$$.fragment),g=E(),b=y("div"),k=E(),D.c(),T=E(),I.c(),O=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),j(r,t,null),v(t,a),v(t,u),v(t,f),v(t,d),j(p,d,null),v(e,m),j(_,e,null),v(e,g),v(e,b),v(e,k),D.m(e,null),S(L,T,F),I.m(L,F),S(L,O,F),M=!0},p(L,F){(!M||F&32)&&le(l,L[5]);const R={};F&49153&&(R.$$scope={dirty:F,ctx:L}),p.$set(R);const N={};F&4&&(N.value=L[2]),_.$set(N),F&8&&_e($,$=L[3])?(re(),P(D,1,1,Q),ae(),D=Ac(L),D.c(),A(D,1),D.m(e,null)):D.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(O.parentNode,O)):I.p(L,F)},i(L){M||(A(r.$$.fragment,L),A(p.$$.fragment,L),A(_.$$.fragment,L),A(D),A(I),M=!0)},o(L){P(r.$$.fragment,L),P(p.$$.fragment,L),P(_.$$.fragment,L),P(D),P(I),M=!1},d(L){L&&w(e),V(r),V(p),V(_),D.d(L),L&&w(T),L&&w(O),I.d(L)}}}function r$(n){let e,t,i,s;e=new Dn({props:{$$slots:{default:[o$]},$$scope:{ctx:n}}});let l={};return i=new s$({props:l}),n[13](i),{c(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(o,r){j(e,o,r),S(o,t,r),j(i,o,r),s=!0},p(o,[r]){const a={};r&32831&&(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){V(e,o),o&&w(t),n[13](null),V(i,o)}}}const Pc="includeAdminLogs";function a$(n,e,t){var k;let i,s;Ke(n,Lt,$=>t(5,s=$)),tn(Lt,s="Request logs",s);let l,o="",r=((k=window.localStorage)==null?void 0:k.getItem(Pc))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function d(){r=this.checked,t(0,r)}const p=$=>t(2,o=$.detail);function m($){o=$,t(2,o)}function _($){o=$,t(2,o)}const g=$=>l==null?void 0:l.show($==null?void 0:$.detail);function b($){se[$?"unshift":"push"](()=>{l=$,t(1,l)})}return n.$$.update=()=>{n.$$.dirty&1&&t(4,i=r?"":'auth!="admin"'),n.$$.dirty&1&&typeof r<"u"&&window.localStorage&&window.localStorage.setItem(Pc,r<<0)},[r,l,o,a,i,s,u,f,d,p,m,_,g,b]}class u$ extends ve{constructor(e){super(),be(this,e,a$,r$,_e,{})}}const ii=On([]),hi=On({}),No=On(!1),tb=On({});function f$(n){ii.update(e=>{const t=z.findByKey(e,"id",n);return t?hi.set(t):e.length&&hi.set(e[0]),e})}function c$(n){hi.update(e=>z.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),ii.update(e=>(z.pushOrReplaceByKey(e,n,"id"),iu(),z.sortCollections(e)))}function d$(n){ii.update(e=>(z.removeByKey(e,"id",n.id),hi.update(t=>t.id===n.id?e[0]:t),iu(),e))}async function p$(n=null){No.set(!0);try{let e=await he.collections.getFullList(200,{sort:"+name"});e=z.sortCollections(e),ii.set(e);const t=n&&z.findByKey(e,"id",n);t?hi.set(t):e.length&&hi.set(e[0]),iu()}catch(e){he.errorResponseHandler(e)}No.set(!1)}function iu(){tb.update(n=>(ii.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=On({});function _n(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=Ct(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)&&Ot(l,s,o,o[16],i?Mt(s,o[16],r,null):Dt(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&&tt(()=>{i&&(t||(t=Ve(e,ni,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=Ve(e,ni,{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=wt();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 O(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 D(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",O),m.addEventListener("click",O),m.addEventListener("keydown",M))}function N(){clearTimeout(_),m&&(d==null||d.removeEventListener("click",O),m.removeEventListener("click",O),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,D,I,L,F,l,r,a,u,k,$,T,m,s,i,q,Y]}class Hn 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(()=>me(e,"value",l))),{c(){e&&H(e.$$.fragment),i=Se()},m(a,u){e&&j(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],ye(()=>t=!1)),u[0]&128&&o!==(o=a[7])){if(e){re();const p=e;P(p.$$.fragment,1,0,()=>{V(p,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>me(e,"value",l)),H(e.$$.fragment),A(e.$$.fragment,1),j(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&&V(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<s.length;o+=1)l[o]=Rc(Nc(n,s,o));return{c(){e=y("div"),t=y("span"),t.textContent="Presets",i=E();for(let o=0;o<l.length;o+=1)l[o].c();h(t,"class","txt txt-hint"),h(e,"class","inline-flex gap-10")},m(o,r){S(o,e,r),v(e,t),v(e,i);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null)},p(o,r){if(r[0]&9728){s=o[10];let a;for(a=0;a<s.length;a+=1){const u=Nc(o,s,a);l[a]?l[a].p(u,r):(l[a]=Rc(u),l[a].c(),l[a].m(e,null))}for(;a<l.length;a+=1)l[a].d(1);l.length=s.length}},d(o){o&&w(e),pt(l,o)}}}function Rc(n){let e,t=n[27]+"",i,s,l,o;function r(){return n[21](n[27])}return{c(){e=y("button"),i=U(t),s=E(),h(e,"type","button"),h(e,"class","label link-primary"),x(e,"label-info",n[9].includes(n[27]))},m(a,u){S(a,e,u),v(e,i),v(e,s),l||(o=J(e,"click",r),l=!0)},p(a,u){n=a,u[0]&1024&&t!==(t=n[27]+"")&&le(i,t),u[0]&1536&&x(e,"label-info",n[9].includes(n[27]))},d(a){a&&w(e),l=!1,o()}}}function y$(n){let e,t,i,s,l,o;e=new de({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[_$,({uniqueId:a})=>({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(){H(e.$$.fragment),t=E(),H(i.$$.fragment),s=E(),r&&r.c(),l=Se()},m(a,u){j(e,a,u),S(a,t,u),j(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){V(e,a),a&&w(t),V(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='<i class="ri-delete-bin-7-line"></i>',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='<span class="txt">Cancel</span>',i=E(),s=y("button"),s.innerHTML='<span class="txt">Set index</span>',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;l<i.length;l+=1)s=qe(s,i[l]);return e=new cn({props:s}),n[22](e),e.$on("hide",n[23]),e.$on("show",n[24]),{c(){H(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){const r=o[0]&16384?$t(i,[i[0],Wt(l[14])]):{};o[0]&2029|o[1]&1&&(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[22](null),V(e,l)}}}function $$(n,e,t){let i,s,l;const o=["collection","show","hide"];let r=Ge(e,o);const a=wt();let{collection:u}=e,f,d="",p="",m="",_,g=!1;function b(B,Z){return t(6,m=z.isEmpty(Z)?"":Z),t(5,d=B||$()),t(2,p=d),f==null?void 0:f.show()}function k(){return f==null?void 0:f.hide()}function $(){const B=z.parseIndex("");return B.tableName=(u==null?void 0:u.name)||"",z.buildIndex(B)}function T(){a("remove",d),k()}function C(){l.length&&(a("submit",{old:d,new:p}),k())}function O(B){const Z=z.clone(s),ee=Z.columns.find(ie=>ie.name==B);ee?z.removeByValue(Z.columns,ee):z.pushUnique(Z.columns,{name:B}),t(2,p=z.buildIndex(Z))}Xt(async()=>{t(8,g=!0);try{t(7,_=(await at(()=>import("./CodeEditor-462b7ad0.js"),["./CodeEditor-462b7ad0.js","./index-6f704b4c.js"],import.meta.url)).default)}catch(B){console.warn(B)}t(8,g=!1)});const M=()=>T(),D=()=>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=z.buildIndex(s))};function F(B){p=B,t(2,p)}const R=B=>O(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=qe(qe({},e),Ut(B)),t(14,r=Ge(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=z.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,O,r,b,M,D,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=z.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&&zt(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,O,M;let e,t,i=(((O=(C=n[0])==null?void 0:C.indexes)==null?void 0:O.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 D=0;D<b.length;D+=1)k[D]=Hc(jc(n,b,D));function $(D){n[7](D)}let T={};return n[0]!==void 0&&(T.collection=n[0]),d=new T$({props:T}),n[6](d),se.push(()=>me(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 D=0;D<k.length;D+=1)k[D].c();a=E(),u=y("button"),u.innerHTML=`<span class="txt">+</span>
<span class="txt">New index</span>`,f=E(),H(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(D,I){S(D,e,I),v(e,t),v(e,s),v(e,l),S(D,o,I),S(D,r,I);for(let L=0;L<k.length;L+=1)k[L]&&k[L].m(r,null);v(r,a),v(r,u),S(D,f,I),j(d,D,I),m=!0,_||(g=J(u,"click",n[5]),_=!0)},p(D,[I]){var F,R,N;if((!m||I&1)&&i!==(i=(((R=(F=D[0])==null?void 0:F.indexes)==null?void 0:R.length)||0)+"")&&le(s,i),I&7){b=((N=D[0])==null?void 0:N.indexes)||[];let q;for(q=0;q<b.length;q+=1){const Y=jc(D,b,q);k[q]?k[q].p(Y,I):(k[q]=Hc(Y),k[q].c(),k[q].m(r,a))}for(;q<k.length;q+=1)k[q].d(1);k.length=b.length}const L={};!p&&I&1&&(p=!0,L.collection=D[0],ye(()=>p=!1)),d.$set(L)},i(D){m||(A(d.$$.fragment,D),m=!0)},o(D){P(d.$$.fragment,D),m=!1},d(D){D&&w(e),D&&w(o),D&&w(r),pt(k,D),D&&w(f),n[6](null),V(d,D),_=!1,g()}}}const zc=n=>n.name;function M$(n,e,t){let i;Ke(n,_i,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let g=0;g<s.indexes.length;g++)if(s.indexes[g]==m){t(0,s.indexes[g]=_,s),Di("indexes."+g);return}s.indexes.push(_),t(0,s)}const r=(m,_)=>l==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;_<s.indexes.length;_++)if(s.indexes[_]==m.detail){s.indexes.splice(_,1),Di("indexes."+_);break}t(0,s)},p=m=>{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",Mn(f)),J(e,"keydown",Mn(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<t.length;s+=1)i[s]=Uc(Bc(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&12){t=s[2];let o;for(o=0;o<t.length;o+=1){const r=Bc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Uc(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){pt(i,s),s&&w(e)}}}function E$(n){let e,t,i,s,l,o,r,a,u,f;return o=new Hn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[D$]},$$scope:{ctx:n}}}),{c(){e=y("button"),t=y("i"),i=E(),s=y("div"),s.textContent="New field",l=E(),H(o.$$.fragment),h(t,"class","ri-add-line"),h(s,"class","txt"),h(e,"type","button"),h(e,"class",r=Oi(n[0])+" svelte-1p626x7")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(e,l),j(o,e,null),a=!0,u||(f=J(e,"click",n[1]),u=!0)},p(d,[p]){const m={};p&512&&(m.$$scope={dirty:p,ctx:d}),o.$set(m),(!a||p&1&&r!==(r=Oi(d[0])+" svelte-1p626x7"))&&h(e,"class",r)},i(d){a||(A(o.$$.fragment,d),a=!0)},o(d){P(o.$$.fragment,d),a=!1},d(d){d&&w(e),V(o),u=!1,f()}}}function A$(n,e,t){let{class:i=""}=e;const s=wt(),l=[{label:"Plain text",value:"text",icon:z.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:z.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:z.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:z.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:z.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:z.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:z.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:z.getFieldTypeIcon("select")},{label:"File",value:"file",icon:z.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:z.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:z.getFieldTypeIcon("json")}];function o(u){s("select",u)}const r=u=>{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='<span class="drag-handle"></span>',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&&zt(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=z.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=z.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='<i class="ri-restart-line"></i>',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 Hn({props:{class:"dropdown dropdown-block schema-field-dropdown",trigger:n[3],$$slots:{default:[z$]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(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){V(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 ${z.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&&zt(u.update)&&_&1&&u.update.call(null,{text:`Requires the field value NOT to be ${z.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 Hn({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(),H(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),j(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),V(a)}}}function H$(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Remove</span>',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=Ct(f,n,n[23],Kc),p=n[13].beforeNonempty,m=Ct(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=Ct(_,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"),H(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),j(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)&&Ot(d,f,k,k[23],u?Mt(f,k[23],$,N$):Dt(k[23]),Kc),m&&m.p&&(!u||$&8388800)&&Ot(m,p,k,k[23],u?Mt(p,k[23],$,L$):Dt(k[23]),Yc);const T={};$&41943073&&(T.$$scope={dirty:$,ctx:k}),o.$set(T),g&&g.p&&(!u||$&8388800)&&Ot(g,_,k,k[23],u?Mt(_,k[23],$,P$):Dt(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),V(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,_=Ct(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(),H(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),j(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",ct(n[21])),J(e,"dragleave",n[22]),J(e,"dragover",ct(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 O={};C&128&&(O.class="form-field required m-0 "+(T[7]?"":"disabled")),C&2&&(O.name="schema."+T[1]+".name"),C&8388773&&(O.$$scope={dirty:C,ctx:T}),s.$set(O),_&&_.p&&(!u||C&8388800)&&Ot(_,m,T,T[23],u?Mt(m,T[23],C,F$):Dt(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&&tt(()=>{u&&(a||(a=Ve(e,St,{duration:150},!0)),a.run(1))}),u=!0)},o(T){P(s.$$.fragment,T),P(_,T),P($),T&&(a||(a=Ve(e,St,{duration:150},!1)),a.run(0)),u=!1},d(T){T&&w(e),p&&p.d(),V(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,_i,N=>t(12,o=N));let{$$slots:r={},$$scope:a}=e,{key:u=""}=e,{field:f=new vn}=e,d,p,m=!1;const _=wt(),g={bool:"Nonfalsey",number:"Nonzero"};function b(){f.id?t(0,f.toDelete=!0,f):_("remove")}function k(){t(0,f.toDelete=!1,f),fn({})}function $(N){return z.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 O=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 D(){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=!z.isEmpty(z.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,O,M,D,I,L,F,R,a]}class si 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&&gt(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&&gt(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"),H(i.$$.fragment),s=E(),l=y("div"),H(o.$$.fragment),r=E(),a=y("div"),H(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),j(i,t,null),v(e,s),v(e,l),j(o,l,null),v(e,r),v(e,a),j(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),V(i),V(o),V(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;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(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(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?$t(s,[a&2&&{key:r[1]},a&4&&Wt(r[2])]):{};a&16387&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function G$(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=gt(this.value),t(0,l)}function a(){l.options.max=gt(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=qe(qe({},e),Ut(k)),t(2,s=Ge(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&&gt(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&&gt(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"),H(i.$$.fragment),s=E(),l=y("div"),H(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),j(i,t,null),v(e,s),v(e,l),j(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),V(i),V(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;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(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(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?$t(s,[a&2&&{key:r[1]},a&4&&Wt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function nT(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=gt(this.value),t(0,l)}function a(){l.options.max=gt(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=qe(qe({},e),Ut(b)),t(2,s=Ge(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;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(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(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?$t(s,[a&2&&{key:r[1]},a&4&&Wt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function lT(n,e,t){const i=["field","key"];let s=Ge(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=qe(qe({},e),Ut(_)),t(2,s=Ge(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<l.length;r+=1)o=qe(o,l[r]);return{c(){e=y("input"),ti(e,o)},m(r,a){S(r,e,a),"value"in o&&(e.value=o.value),e.autofocus&&e.focus(),i||(s=J(e,"input",n[4]),i=!0)},p(r,[a]){ti(e,o=$t(l,[a&8&&t!==(t=r[3].type||"text")&&{type:t},a&4&&e.value!==r[2]&&{value:r[2]},a&8&&r[3]])),"value"in o&&(e.value=o.value)},i:Q,o:Q,d(r){r&&w(e),i=!1,s()}}}function aT(n,e,t){let i;const s=["value","separator"];let l=Ge(e,s),{value:o=[]}=e,{separator:r=","}=e;const a=u=>{t(0,o=z.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=qe(qe({},e),Ut(u)),t(3,l=Ge(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 Rs 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:!z.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(g.value=n[0].options.exceptDomains),r=new Rs({props:g}),se.push(()=>me(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=E(),s=y("i"),o=E(),H(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),j(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=!z.isEmpty(b[0].options.onlyDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptDomains,ye(()=>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),V(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:!z.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(g.value=n[0].options.onlyDomains),r=new Rs({props:g}),se.push(()=>me(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),H(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),j(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=!z.isEmpty(b[0].options.exceptDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyDomains,ye(()=>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),V(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"),H(i.$$.fragment),s=E(),l=y("div"),H(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),j(i,t,null),v(e,s),v(e,l),j(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),V(i),V(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;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(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(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?$t(s,[a&2&&{key:r[1]},a&4&&Wt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function pT(n,e,t){const i=["field","key"];let s=Ge(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=qe(qe({},e),Ut(b)),t(2,s=Ge(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;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ib({props:o}),se.push(()=>me(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(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?$t(s,[a&2&&{key:r[1]},a&4&&Wt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function hT(n,e,t){const i=["field","key"];let s=Ge(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=qe(qe({},e),Ut(_)),t(2,s=Ge(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;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(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(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?$t(s,[a&2&&{key:r[1]},a&4&&Wt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function bT(n,e,t){const i=["field","key"];let s=Ge(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=qe(qe({},e),Ut(_)),t(2,s=Ge(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"],Ss={_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:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},yl={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},pn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Ln=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 sn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ft(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=ft("div","numInputWrapper"),i=ft("input","numInput "+n),s=ft("span","arrowUp"),l=ft("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 kn(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*Ln(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))}},Zi={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})"},al={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[al.w(n,e,t)]},F:function(n,e,t){return Fo(al.n(n,e,t)-1,!1,e)},G:function(n,e,t){return pn(al.h(n,e,t))},H:function(n){return pn(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[Ln(n.getHours()>11)]},M:function(n,e){return Fo(n.getMonth(),!0,e)},S:function(n){return pn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return pn(n.getFullYear(),4)},d:function(n){return pn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return pn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return pn(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?Ss:e,i=n.l10n,s=i===void 0?yl: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 al[d]&&m[p-1]!=="\\"?al[d](r,f,t):d!=="\\"?d:""}).join("")}},ha=function(n){var e=n.config,t=e===void 0?Ss:e,i=n.l10n,s=i===void 0?yl: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||Ss).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,$="";b<p.length;b++){var T=p[b],C=T==="\\",O=p[b-1]==="\\"||C;if(Zi[T]&&!O){$+=Zi[T];var M=new RegExp($).exec(l);M&&(_=!0)&&g[T!=="Y"?"push":"unshift"]({fn:yT[T],val:M[++k]})}else C||($+=".")}f=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),g.forEach(function(D){var I=D.fn,L=D.val;return f=I(f,L,u)||f}),f=_?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){t.errorHandler(new Error("Invalid date provided: "+d));return}return r===!0&&f.setHours(0,0,0,0),f}}};function wn(n,e,t){return t===void 0&&(t=!0),t!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):n.getTime()-e.getTime()}var kT=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Ar=function(n,e,t){return n*3600+e*60+t},wT=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},ST={DAY:864e5};function Ir(n){var e=n.defaultHour,t=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var s=n.minDate.getHours(),l=n.minDate.getMinutes(),o=n.minDate.getSeconds();e<s&&(e=s),e===s&&t<l&&(t=l),e===s&&t===l&&i<o&&(i=n.minDate.getSeconds())}if(n.maxDate!==void 0){var r=n.maxDate.getHours(),a=n.maxDate.getMinutes();e=Math.min(e,r),e===r&&(t=Math.min(a,t)),e===r&&t===a&&(i=n.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:i}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=function(r){r&&Object.keys(r).forEach(function(a){return n[a]=r[a]})},s=0,l=e;s<l.length;s++){var o=l[s];i(o)}return n});var Qt=globalThis&&globalThis.__assign||function(){return Qt=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},Qt.apply(this,arguments)},ed=globalThis&&globalThis.__spreadArrays||function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var i=Array(n),s=0,e=0;e<t;e++)for(var l=arguments[e],o=0,r=l.length;o<r;o++,s++)i[s]=l[o];return i},$T=300;function TT(n,e){var t={config:Qt(Qt({},Ss),Vt.defaultConfig),l10n:yl};t.parseDate=ha({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=g,t._setHoursFromDate=p,t._positionCalendar=Xe,t.changeMonth=G,t.changeYear=we,t.clear=ce,t.close=ge,t.onMouseOver=We,t._createElement=ft,t.createDay=M,t.destroy=Me,t.isEnabled=Ce,t.jumpToDate=$,t.updateValue=Zt,t.open=Re,t.redraw=nt,t.set=Zn,t.setDate=Nl,t.toggle=dn;function i(){t.utils={getDaysInMonth:function(W,K){return W===void 0&&(W=t.currentMonth),K===void 0&&(K=t.currentYear),W===1&&(K%4===0&&K%100!==0||K%400===0)?29:t.l10n.daysInMonth[W]}}}function s(){t.element=t.input=n,t.isOpen=!1,Jt(),$e(),Fl(),rs(),i(),t.isMobile||O(),k(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&p(t.config.noCalendar?t.latestSelectedDateObj:void 0),Zt(!1)),r();var W=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&W&&Xe(),et("onReady")}function l(){var W;return((W=t.calendarContainer)===null||W===void 0?void 0:W.getRootNode()).activeElement||document.activeElement}function o(W){return W.bind(t)}function r(){var W=t.config;W.weekNumbers===!1&&W.showMonths===1||W.noCalendar!==!0&&window.requestAnimationFrame(function(){if(t.calendarContainer!==void 0&&(t.calendarContainer.style.visibility="hidden",t.calendarContainer.style.display="block"),t.daysContainer!==void 0){var K=(t.days.offsetWidth+1)*W.showMonths;t.daysContainer.style.width=K+"px",t.calendarContainer.style.width=K+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(W){if(t.selectedDates.length===0){var K=t.config.minDate===void 0||wn(new Date,t.config.minDate)>=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(),Zt(),t._input.value!==oe&&t._debouncedChange()}function u(W,K){return W%12+12*Ln(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&&wn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&wn(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()),Le=Ar(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Oe=Ar(W,K,ne);if(Oe>Le&&Oe<Ie){var Ye=wT(Ie);W=Ye[0],K=Ye[1],ne=Ye[2]}}else{if(Te){var Fe=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;W=Math.min(W,Fe.getHours()),W===Fe.getHours()&&(K=Math.min(K,Fe.getMinutes())),K===Fe.getMinutes()&&(ne=Math.min(ne,Fe.getSeconds()))}if(oe){var Be=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;W=Math.max(W,Be.getHours()),W===Be.getHours()&&K<Be.getMinutes()&&(K=Be.getMinutes()),K===Be.getMinutes()&&(ne=Math.max(ne,Be.getSeconds()))}}m(W,K,ne)}}function p(W){var K=W||t.latestSelectedDateObj;K&&K instanceof Date&&m(K.getHours(),K.getMinutes(),K.getSeconds())}function m(W,K,ne){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(W%24,K,ne||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=pn(t.config.time_24hr?W:(12+W)%12+12*Ln(W%12===0)),t.minuteElement.value=pn(K),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Ln(W>=12)]),t.secondElement!==void 0&&(t.secondElement.value=pn(ne)))}function _(W){var K=kn(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(){et("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){as();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(kn(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",nn),g(t.monthNav,["keyup","increment"],_),g(t.daysContainer,"click",En)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var K=function(ne){return kn(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",ht)}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.maxDate<t.now?t.config.maxDate:t.now),oe=t.currentYear,Te=t.currentMonth;try{ne!==void 0&&(t.currentYear=ne.getFullYear(),t.currentMonth=ne.getMonth())}catch(Ie){Ie.message="Invalid date supplied: "+ne,t.config.errorHandler(Ie)}K&&t.currentYear!==oe&&(et("onYearChange"),q()),K&&(t.currentYear!==oe||t.currentMonth!==Te)&&et("onMonthChange"),t.redraw()}function T(W){var K=kn(W);~K.className.indexOf("arrow")&&C(W,K.classList.contains("arrowUp")?1:-1)}function C(W,K,ne){var oe=W&&kn(W),Te=ne||oe&&oe.parentNode&&oe.parentNode.firstChild,Ie=us("increment");Ie.delta=K,Te&&Te.dispatchEvent(Ie)}function O(){var W=window.document.createDocumentFragment();if(t.calendarContainer=ft("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(W.appendChild(Z()),t.innerContainer=ft("div","flatpickr-innerContainer"),t.config.weekNumbers){var K=fe(),ne=K.weekWrapper,oe=K.weekNumbers;t.innerContainer.appendChild(ne),t.weekNumbers=oe,t.weekWrapper=ne}t.rContainer=ft("div","flatpickr-rContainer"),t.rContainer.appendChild(ie()),t.daysContainer||(t.daysContainer=ft("div","flatpickr-days"),t.daysContainer.tabIndex=-1),N(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),W.appendChild(t.innerContainer)}t.config.enableTime&&W.appendChild(ee()),sn(t.calendarContainer,"rangeMode",t.config.mode==="range"),sn(t.calendarContainer,"animate",t.config.animate===!0),sn(t.calendarContainer,"multiMonth",t.config.showMonths>1),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=ft("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=ft("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&&wn(K,t.now)===0&&(t.todayDateElem=Ie,Ie.classList.add("today"),Ie.setAttribute("aria-current","date")),Te?(Ie.tabIndex=-1,li(K)&&(Ie.classList.add("selected"),t.selectedDateElem=Ie,t.config.mode==="range"&&(sn(Ie,"startRange",t.selectedDates[0]&&wn(K,t.selectedDates[0],!0)===0),sn(Ie,"endRange",t.selectedDates[1]&&wn(K,t.selectedDates[1],!0)===0),W==="nextMonthDay"&&Ie.classList.add("inRange")))):Ie.classList.add("flatpickr-disabled"),t.config.mode==="range"&&fs(K)&&!li(K)&&Ie.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&W!=="prevMonthDay"&&oe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(K)+"</span>"),et("onDayCreate",Ie),Ie}function D(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,Le=W>0?Te.children.length:-1,Oe=Ie;Oe!=Le;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 Le=t.daysContainer.children[Ie],Oe=ne-t.currentMonth===Ie?W.$i+K:K<0?Le.children.length-1:0,Ye=Le.children.length,Fe=Oe;Fe>=0&&Fe<Ye&&Fe!=(K>0?Ye:-1);Fe+=Te){var Be=Le.children[Fe];if(Be.className.indexOf("hidden")===-1&&Ce(Be.dateObj)&&Math.abs(W.$i-Fe)>=Math.abs(K))return D(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):D(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(),Le=t.config.showMonths>1,Oe=Le?"prevMonthDay hidden":"prevMonthDay",Ye=Le?"nextMonthDay hidden":"nextMonthDay",Fe=oe+1-ne,Be=0;Fe<=oe;Fe++,Be++)Ie.appendChild(M("flatpickr-day "+Oe,new Date(W,K-1,Fe),Fe,Be));for(Fe=1;Fe<=Te;Fe++,Be++)Ie.appendChild(M("flatpickr-day",new Date(W,K,Fe),Fe,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 Gn=ft("div","dayContainer");return Gn.appendChild(Ie),Gn}function N(){if(t.daysContainer!==void 0){so(t.daysContainer),t.weekNumbers&&so(t.weekNumbers);for(var W=document.createDocumentFragment(),K=0;K<t.config.showMonths;K++){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+K),W.appendChild(R(ne.getFullYear(),ne.getMonth()))}t.daysContainer.appendChild(W),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&We()}}function q(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var W=function(oe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&oe<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&oe>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var K=0;K<12;K++)if(W(K)){var ne=ft("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=ft("div","flatpickr-month"),K=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=ft("span","cur-month"):(t.monthsDropdownContainer=ft("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(Le){var Oe=kn(Le),Ye=parseInt(Oe.value,10);t.changeMonth(Ye-t.currentMonth),et("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=ft("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=ft("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ft("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ft("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&&(sn(t.prevMonthNav,"flatpickr-disabled",W),t.__hidePrevMonthArrow=W)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(W){t.__hideNextMonthArrow!==W&&(sn(t.nextMonthNav,"flatpickr-disabled",W),t.__hideNextMonthArrow=W)}}),t.currentYearElement=t.yearElements[0],qi(),t.monthNav}function ee(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var W=Ir(t.config);t.timeContainer=ft("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var K=ft("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=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?W.hours:f(W.hours)),t.minuteElement.value=pn(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=pn(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(ft("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=ft("span","flatpickr-am-pm",t.l10n.amPM[Ln((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=ft("div","flatpickr-weekdays");for(var W=t.config.showMonths;W--;){var K=ft("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.length&&(K=ed(K.splice(W,K.length),K.splice(0,W)));for(var ne=t.config.showMonths;ne--;)t.weekdayContainer.children[ne].innerHTML=`
<span class='flatpickr-weekday'>
`+K.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var W=ft("div","flatpickr-weekwrapper");W.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var K=ft("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,et("onYearChange"),q()),N(),et("onMonthChange"),qi())}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&&et("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")),et("onClose")}function Me(){t.config!==void 0&&et("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 je(W){return t.calendarContainer.contains(W)}function He(W){if(t.isOpen&&!t.config.inline){var K=kn(W),ne=je(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&&!je(W.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Le){return Le.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&&W<t.config.minDate.getFullYear()||t.config.maxDate&&W>t.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(),et("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&&wn(oe,t.config.minDate,K!==void 0?K:!t.minDateHasTime)<0||t.config.maxDate&&oe&&wn(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,Le=0,Oe=void 0;Le<Ie.length;Le++){if(Oe=Ie[Le],typeof Oe=="function"&&Oe(oe))return Te;if(Oe instanceof Date&&oe!==void 0&&Oe.getTime()===oe.getTime())return Te;if(typeof Oe=="string"){var Ye=t.parseDate(Oe,void 0,!0);return Ye&&Ye.getTime()===oe.getTime()?Te:!Te}else if(typeof Oe=="object"&&oe!==void 0&&Oe.from&&Oe.to&&oe.getTime()>=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 ht(W){var K=W.target===t._input,ne=t._input.value.trimEnd()!==ji();K&&ne&&!(W.relatedTarget&&je(W.relatedTarget))&&t.setDate(t._input.value,!0,W.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ze(W){var K=kn(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(je(K)||Te||Ie){var Le=!!t.timeContainer&&t.timeContainer.contains(K);switch(W.keyCode){case 13:Le?(W.preventDefault(),a(),vt()):En(W);break;case 27:W.preventDefault(),vt();break;case 8:case 46:ne&&!t.config.allowInput&&(W.preventDefault(),t.clear());break;case 37:case 39:if(!Le&&!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 Fe=W.keyCode===40?1:-1;t.daysContainer&&K.$i!==void 0||K===t.input||K===t.altInput?W.ctrlKey?(W.stopPropagation(),we(t.currentYear-Fe),F(I(1),0)):Le||F(void 0,Fe*7):K===t.currentYearElement?we(t.currentYear-Fe):t.config.enableTime&&(!Le&&t.hourElement&&t.hourElement.focus(),a(W),t._debouncedChange());break;case 9:if(Le){var Be=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(yn){return yn}),bt=Be.indexOf(K);if(bt!==-1){var Gn=Be[bt+(W.shiftKey?-1:1)];W.preventDefault(),(Gn||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(),Zt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],d(),Zt();break}(ne||je(K))&&et("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()),Le=!1,Oe=0,Ye=0,Fe=Te;Fe<Ie;Fe+=ST.DAY)Ce(new Date(Fe),!0)||(Le=Le||Fe>Te&&Fe<Ie,Fe<oe&&(!Oe||Fe>Oe)?Oe=Fe:Fe>oe&&(!Ye||Fe<Ye)&&(Ye=Fe));var Be=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+K));Be.forEach(function(bt){var Gn=bt.dateObj,yn=Gn.getTime(),qs=Oe>0&&yn<Oe||Ye>0&&yn>Ye;if(qs){bt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(cs){bt.classList.remove(cs)});return}else if(Le&&!qs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(cs){bt.classList.remove(cs)}),W!==void 0&&(W.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),oe<ne&&yn===oe?bt.classList.add("startRange"):oe>ne&&yn===oe&&bt.classList.add("endRange"),yn>=Oe&&(Ye===0||yn<=Ye)&&kT(yn,oe,ne)&&bt.classList.add("inRange"))})}}function te(){t.isOpen&&!t.config.static&&!t.config.inline&&Xe()}function Re(W,K){if(K===void 0&&(K=t._positionElement),t.isMobile===!0){if(W){W.preventDefault();var ne=kn(W);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),et("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"),et("onOpen"),Xe(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),Zt()),t.daysContainer&&(nt(),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 Jt(){var W=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],K=Qt(Qt({},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=bi(Be)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Be){t.config._disable=bi(Be)}});var oe=K.mode==="time";if(!K.dateFormat&&(K.enableTime||oe)){var Te=Vt.defaultConfig.dateFormat||Ss.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=Vt.defaultConfig.altFormat||Ss.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 Le=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:Le("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Le("max")}),K.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,K);for(var Oe=0;Oe<W.length;Oe++)t.config[W[Oe]]=t.config[W[Oe]]===!0||t.config[W[Oe]]==="true";Or.filter(function(Be){return t.config[Be]!==void 0}).forEach(function(Be){t.config[Be]=Dr(t.config[Be]||[]).map(o)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Oe=0;Oe<t.config.plugins.length;Oe++){var Ye=t.config.plugins[Oe](t)||{};for(var Fe in Ye)Or.indexOf(Fe)>-1?t.config[Fe]=Dr(Ye[Fe]).map(o).concat(t.config[Fe]):typeof K[Fe]>"u"&&(t.config[Fe]=Ye[Fe])}K.altInputClass||(t.config.altInputClass=Ne().className+" "+t.config.altInputClass),et("onParseConfig")}function Ne(){return t.config.wrap?n.querySelector("[data-input]"):n}function $e(){typeof t.config.locale!="object"&&typeof Vt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Qt(Qt({},Vt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Vt.l10ns[t.config.locale]:void 0),Zi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Zi.l="("+t.l10n.weekdays.longhand.join("|")+")",Zi.M="("+t.l10n.months.shorthand.join("|")+")",Zi.F="("+t.l10n.months.longhand.join("|")+")",Zi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var W=Qt(Qt({},e),JSON.parse(JSON.stringify(n.dataset||{})));W.time_24hr===void 0&&Vt.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 Xe(W){if(typeof t.config.position=="function")return void t.config.position(t,W);if(t.calendarContainer!==void 0){et("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],Le=Te.length>1?Te[1]:null,Oe=K.getBoundingClientRect(),Ye=window.innerHeight-Oe.bottom,Fe=Ie==="above"||Ie!=="below"&&Ye<ne&&Oe.top>ne,Be=window.pageYOffset+Oe.top+(Fe?-ne-2:K.offsetHeight+2);if(sn(t.calendarContainer,"arrowTop",!Fe),sn(t.calendarContainer,"arrowBottom",Fe),!t.config.inline){var bt=window.pageXOffset+Oe.left,Gn=!1,yn=!1;Le==="center"?(bt-=(oe-Oe.width)/2,Gn=!0):Le==="right"&&(bt-=oe-Oe.width,yn=!0),sn(t.calendarContainer,"arrowLeft",!Gn&&!yn),sn(t.calendarContainer,"arrowCenter",Gn),sn(t.calendarContainer,"arrowRight",yn);var qs=window.document.body.offsetWidth-(window.pageXOffset+Oe.right),cs=bt+oe>window.document.body.offsetWidth,cb=qs+oe>window.document.body.offsetWidth;if(sn(t.calendarContainer,"rightMost",cs),!t.config.static)if(t.calendarContainer.style.top=Be+"px",!cs)t.calendarContainer.style.left=bt+"px",t.calendarContainer.style.right="auto";else if(!cb)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=qs+"px";else{var nr=ke();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;}";sn(t.calendarContainer,"rightMost",!1),sn(t.calendarContainer,"centerMost",!0),nr.insertRule(mb+","+hb+gb,_b),t.calendarContainer.style.left=pb+"px",t.calendarContainer.style.right="auto"}}}}function ke(){for(var W=null,K=0;K<document.styleSheets.length;K++){var ne=document.styleSheets[K];if(ne.cssRules){try{ne.cssRules}catch{continue}W=ne;break}}return W??Pe()}function Pe(){var W=document.createElement("style");return document.head.appendChild(W),W.sheet}function nt(){t.config.noCalendar||t.isMobile||(q(),qi(),N())}function vt(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function En(W){W.preventDefault(),W.stopPropagation();var K=function(Be){return Be.classList&&Be.classList.contains("flatpickr-day")&&!Be.classList.contains("flatpickr-disabled")&&!Be.classList.contains("notAllowed")},ne=sb(kn(W),K);if(ne!==void 0){var oe=ne,Te=t.latestSelectedDateObj=new Date(oe.dateObj.getTime()),Ie=(Te.getMonth()<t.currentMonth||Te.getMonth()>t.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 Le=li(Te);Le?t.selectedDates.splice(parseInt(Le),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),wn(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&&(et("onYearChange"),q()),et("onMonthChange")}if(qi(),N(),Zt(),!Ie&&t.config.mode!=="range"&&t.config.showMonths===1?D(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,Fe=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ye||Fe)&&vt()}b()}}var rt={locale:[$e,X],showMonths:[B,r,ie],minDate:[$],maxDate:[$],positionElement:[Ri],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 Zn(W,K){if(W!==null&&typeof W=="object"){Object.assign(t.config,W);for(var ne in W)rt[ne]!==void 0&&rt[ne].forEach(function(oe){return oe()})}else t.config[W]=K,rt[W]!==void 0?rt[W].forEach(function(oe){return oe()}):Or.indexOf(W)>-1&&(t.config[W]=Dr(K));t.redraw(),Zt(!0)}function os(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 Nl(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);os(W,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),$(void 0,K),p(),t.selectedDates.length===0&&t.clear(!1),Zt(K),K&&et("onChange")}function bi(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 rs(){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&&os(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()<t.now.getTime()?t.config.maxDate:t.now,t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth(),t.selectedDates.length>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=Ne(),!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=ft(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"),Ri()}function Ri(){t._positionElement=t.config.positionElement||t._input}function as(){var W=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ft("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(kn(K).value,!1,t.mobileFormatStr),et("onChange"),et("onClose")})}function dn(W){if(t.isOpen===!0)return t.close();t.open(W)}function et(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<ne.length;oe++)ne[oe](t.selectedDates,t.input.value,t,K);W==="onChange"&&(t.input.dispatchEvent(us("change")),t.input.dispatchEvent(us("input")))}}function us(W){var K=document.createEvent("Event");return K.initEvent(W,!0,!0),K}function li(W){for(var K=0;K<t.selectedDates.length;K++){var ne=t.selectedDates[K];if(ne instanceof Date&&wn(ne,W)===0)return""+K}return!1}function fs(W){return t.config.mode!=="range"||t.selectedDates.length<2?!1:wn(W,t.selectedDates[0])>=0&&wn(W,t.selectedDates[1])<=0}function qi(){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.currentYear<t.config.minDate.getFullYear()),t._hideNextMonthArrow=t.config.maxDate!==void 0&&(t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth+1>t.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function ji(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 Zt(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=ji(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=ji(t.config.altFormat)),W!==!1&&et("onValueUpdate")}function nn(W){var K=kn(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=kn(W),oe=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Ln(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(oe.getAttribute("min")),Ie=parseFloat(oe.getAttribute("max")),Le=parseFloat(oe.getAttribute("step")),Oe=parseInt(oe.value,10),Ye=W.delta||(K?W.which===38?1:-1:0),Fe=Oe+Le*Ye;if(typeof oe.value<"u"&&oe.value.length===2){var Be=oe===t.hourElement,bt=oe===t.minuteElement;Fe<Te?(Fe=Ie+Fe+Ln(!Be)+(Ln(Be)&&Ln(!t.amPM)),bt&&C(void 0,-1,t.hourElement)):Fe>Ie&&(Fe=oe===t.hourElement?Fe-Ie-Ln(!t.amPM):Te,bt&&C(void 0,1,t.hourElement)),t.amPM&&Be&&(Le===1?Fe+Oe===23:Math.abs(Fe-Oe)>Le)&&(t.amPM.textContent=t.l10n.amPM[Ln(t.amPM.textContent===t.l10n.amPM[0])]),oe.value=pn(Fe)}}return s(),t}function $s(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;s<t.length;s++){var l=t[s];try{if(l.getAttribute("data-fp-omit")!==null)continue;l._flatpickr!==void 0&&(l._flatpickr.destroy(),l._flatpickr=void 0),l._flatpickr=TT(l,e||{}),i.push(l._flatpickr)}catch(o){console.error(o)}}return i.length===1?i[0]:i}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return $s(this,n)},HTMLElement.prototype.flatpickr=function(n){return $s([this],n)});var Vt=function(n,e){return typeof n=="string"?$s(window.document.querySelectorAll(n),e):n instanceof Node?$s([n],e):$s(n,e)};Vt.defaultConfig={};Vt.l10ns={en:Qt({},yl),default:Qt({},yl)};Vt.localize=function(n){Vt.l10ns.default=Qt(Qt({},Vt.l10ns.default),n)};Vt.setDefaults=function(n){Vt.defaultConfig=Qt(Qt({},Vt.defaultConfig),n)};Vt.parseDate=ha({});Vt.formatDate=lb({});Vt.compareDates=wn;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return $s(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=Vt);function CT(n){let e,t=[n[1]],i={};for(let s=0;s<t.length;s+=1)i=qe(i,t[s]);return{c(){e=y("input"),ti(e,i)},m(s,l){S(s,e,l),e.autofocus&&e.focus(),n[11](e)},p(s,l){ti(e,i=$t(t,[l&2&&s[1]]))},d(s){s&&w(e),n[11](null)}}}function MT(n){let e;const t=n[10].default,i=Ct(t,n,n[9],null),s=i||CT(n);return{c(){s&&s.c()},m(l,o){s&&s.m(l,o),e=!0},p(l,[o]){i?i.p&&(!e||o&512)&&Ot(i,t,l,l[9],e?Mt(t,l[9],o,null):Dt(l[9]),null):s&&s.p&&(!e||o&3)&&s.p(l,e?o:-1)},i(l){e||(A(s,l),e=!0)},o(l){P(s,l),e=!1},d(l){s&&s.d(l)}}}function OT(n){return n.charAt(2).toLowerCase()+n.substring(3)}function td(n,e){var i;return(((i=n==null?void 0:n.config)==null?void 0:i.mode)??"single")==="single"?e[0]:e}function nd(n,e){return!!(n==e||n instanceof Date&&e instanceof Date&&n.valueOf()===e.valueOf()||Array.isArray(n)&&Array.isArray(e)&&n.length===e.length&&n.every((t,i)=>t===e[i]))}function DT(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Ge(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??_,O=k(p);return O.onReady.push((M,D,I)=>{a===void 0&&$(M,D,I),un().then(()=>{t(8,m=!0)})}),t(3,g=Vt(C,Object.assign(O,f?{wrap:!0}:{}))),()=>{g.destroy()}});const b=wt();function k(C={}){C=Object.assign({},C);for(const O of r){const M=(D,I,L)=>{b(OT(O),[D,I,L])};O in C?(Array.isArray(C[O])||(C[O]=[C[O]]),C[O].push(M)):C[O]=[M]}return C.onChange&&!C.onChange.includes($)&&C.onChange.push($),C}function $(C,O,M){const D=td(M,C);!nd(a,D)&&(a||D)&&t(2,a=D),t(4,u=O)}function T(C){se[C?"unshift":"push"](()=>{_=C,t(0,_)})}return n.$$set=C=>{e=qe(qe({},e),Ut(C)),t(1,s=Ge(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,O]of Object.entries(k(p)))g.set(C,O)},[_,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:z.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(()=>me(l,"value",u)),se.push(()=>me(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=y("label"),t=U("Min date (UTC)"),s=E(),H(l.$$.fragment),h(e,"for",i=n[19])},m(p,m){S(p,e,m),v(e,t),S(p,s,m),j(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],ye(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=p[0].options.min,ye(()=>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),V(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:z.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(()=>me(l,"value",u)),se.push(()=>me(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=y("label"),t=U("Max date (UTC)"),s=E(),H(l.$$.fragment),h(e,"for",i=n[19])},m(p,m){S(p,e,m),v(e,t),S(p,s,m),j(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],ye(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=p[0].options.max,ye(()=>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),V(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"),H(i.$$.fragment),s=E(),l=y("div"),H(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),j(i,t,null),v(e,s),v(e,l),j(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),V(i),V(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;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(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(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&34?$t(s,[a&2&&{key:r[1]},a&32&&Wt(r[5])]):{};a&1048591&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function LT(n,e,t){var D,I;const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e,r=(D=l==null?void 0:l.options)==null?void 0:D.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 O(L){pe.call(this,n,L)}function M(L){pe.call(this,n,L)}return n.$$set=L=>{e=qe(qe({},e),Ut(L)),t(5,s=Ge(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,O,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<s.length;u+=1)a=qe(a,s[u]);return{props:a}}return l&&(e=Pt(l,o())),{c(){e&&H(e.$$.fragment),t=Se()},m(r,a){e&&j(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a[0]&513?$t(s,[a[0]&1&&{item:r[46]},a[0]&512&&Wt(r[9])]):{};if(a[0]&256&&l!==(l=r[8])){if(e){re();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}l?(e=Pt(l,o()),H(e.$$.fragment),A(e.$$.fragment,1),j(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&&V(e,r)}}}function ad(n){let e,t,i;function s(){return n[34](n[46])}return{c(){e=y("span"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"class","clear")},m(l,o){S(l,e,o),t||(i=[Ee(Ue.call(null,e,"Clear")),J(e,"click",Mn(ct(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 Hn({props:i}),n[39](e),e.$on("show",n[24]),e.$on("hide",n[40]),{c(){H(e.$$.fragment)},m(s,l){j(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),V(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='<i class="ri-search-line"></i>',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='<i class="ri-close-line"></i>',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",Mn(ct(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<s.length;u+=1)a=qe(a,s[u]);return{props:a}}return l&&(e=Pt(l,o())),{c(){e&&H(e.$$.fragment),t=Se()},m(r,a){e&&j(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a[0]&1050624?$t(s,[a[0]&1048576&&{item:r[46]},a[0]&2048&&Wt(r[11])]):{};if(a[0]&1024&&l!==(l=r[10])){if(e){re();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}l?(e=Pt(l,o()),H(e.$$.fragment),A(e.$$.fragment,1),j(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&&V(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=Ct(r,n,n[42],ld);let u=n[20],f=[];for(let g=0;g<u.length;g+=1)f[g]=hd(sd(n,u,g));const d=g=>P(f[g],1,1,()=>{f[g]=null});let p=null;u.length||(p=pd(n));const m=n[33].afterOptions,_=Ct(m,n,n[42],id);return{c(){o&&o.c(),e=E(),a&&a.c(),t=E(),i=y("div");for(let g=0;g<f.length;g+=1)f[g].c();p&&p.c(),s=E(),_&&_.c(),h(i,"class","options-list")},m(g,b){o&&o.m(g,b),S(g,e,b),a&&a.m(g,b),S(g,t,b),S(g,i,b);for(let k=0;k<f.length;k+=1)f[k]&&f[k].m(i,null);p&&p.m(i,null),S(g,s,b),_&&_.m(g,b),l=!0},p(g,b){if(g[12]?o?o.p(g,b):(o=cd(g),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!l||b[1]&2048)&&Ot(a,r,g,g[42],l?Mt(r,g[42],b,RT):Dt(g[42]),ld),b[0]&14158978){u=g[20];let k;for(k=0;k<u.length;k+=1){const $=sd(g,u,k);f[k]?(f[k].p($,b),A(f[k],1)):(f[k]=hd($),f[k].c(),A(f[k],1),f[k].m(i,null))}for(re(),k=u.length;k<f.length;k+=1)d(k);ae(),!u.length&&p?p.p(g,b):u.length?p&&(p.d(1),p=null):(p=pd(g),p.c(),p.m(i,null))}_&&_.p&&(!l||b[1]&2048)&&Ot(_,m,g,g[42],l?Mt(m,g[42],b,FT):Dt(g[42]),id)},i(g){if(!l){A(a,g);for(let b=0;b<u.length;b+=1)A(f[b]);A(_,g),l=!0}},o(g){P(a,g),f=f.filter(Boolean);for(let b=0;b<f.length;b+=1)P(f[b]);P(_,g),l=!1},d(g){o&&o.d(g),g&&w(e),a&&a.d(g),g&&w(t),g&&w(i),pt(f,g),p&&p.d(),g&&w(s),_&&_.d(g)}}}function BT(n){let e,t,i,s,l,o,r=z.toArray(n[0]),a=[];for(let p=0;p<r.length;p+=1)a[p]=ud(od(n,r,p));const u=p=>P(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<a.length;p+=1)a[p].c();f&&f.c(),s=E(),d&&d.c(),h(t,"tabindex",i=n[5]?"-1":"0"),h(t,"class","selected-container"),x(t,"disabled",n[5]),h(e,"class",l="select "+n[13]),x(e,"multiple",n[4]),x(e,"disabled",n[5])},m(p,m){S(p,e,m),v(e,t);for(let _=0;_<a.length;_+=1)a[_]&&a[_].m(t,null);f&&f.m(t,null),n[35](t),v(e,s),d&&d.m(e,null),n[41](e),o=!0},p(p,m){if(m[0]&17269){r=z.toArray(p[0]);let _;for(_=0;_<r.length;_+=1){const g=od(p,r,_);a[_]?(a[_].p(g,m),A(a[_],1)):(a[_]=ud(g),a[_].c(),A(a[_],1),a[_].m(t,null))}for(re(),_=r.length;_<a.length;_+=1)u(_);ae(),!r.length&&f?f.p(p,m):r.length?f&&(f.d(1),f=null):(f=rd(p),f.c(),f.m(t,null))}(!o||m[0]&32&&i!==(i=p[5]?"-1":"0"))&&h(t,"tabindex",i),(!o||m[0]&32)&&x(t,"disabled",p[5]),p[5]?d&&(re(),P(d,1,1,()=>{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;m<r.length;m+=1)A(a[m]);A(d),o=!0}},o(p){a=a.filter(Boolean);for(let m=0;m<a.length;m+=1)P(a[m]);P(d),o=!1},d(p){p&&w(e),pt(a,p),f&&f.d(),n[35](null),d&&d.d(),n[41](null)}}}function UT(n,e){let t=(""+e).replace(/\s+/g,"").toLowerCase(),i=n;try{typeof n=="object"&&n!==null&&(i=JSON.stringify(n))}catch{}return(""+i).replace(/\s+/g,"").toLowerCase().includes(t)}function WT(n,e,t){let i,s,{$$slots:l={},$$scope:o}=e,{id:r=""}=e,{noOptionsText:a="No options found"}=e,{selectPlaceholder:u="- Select -"}=e,{searchPlaceholder:f="Search..."}=e,{items:d=[]}=e,{multiple:p=!1}=e,{disabled:m=!1}=e,{selected:_=p?[]:void 0}=e,{toggle:g=p}=e,{closable:b=!0}=e,{labelComponent:k=void 0}=e,{labelComponentProps:$={}}=e,{optionComponent:T=void 0}=e,{optionComponentProps:C={}}=e,{searchable:O=!1}=e,{searchFunc:M=void 0}=e,{class:D=""}=e,I,L="",F,R;function N(te){if(z.isEmpty(_))return;let Re=z.toArray(_);z.inArray(Re,te)&&(z.removeByValue(Re,te),t(0,_=Re)),F==null||F.dispatchEvent(new CustomEvent("change",{detail:_,bubbles:!0}))}function q(te){if(p){let Re=z.toArray(_);z.inArray(Re,te)||t(0,_=[...Re,te])}else t(0,_=te);F==null||F.dispatchEvent(new CustomEvent("change",{detail:_,bubbles:!0}))}function Y(te){return s(te)?N(te):q(te)}function B(){t(0,_=p?[]:void 0)}function Z(){I!=null&&I.show&&(I==null||I.show())}function ee(){I!=null&&I.hide&&(I==null||I.hide())}function ie(){if(z.isEmpty(_)||z.isEmpty(d))return;let te=z.toArray(_),Re=[];for(const Qe of te)z.inArray(d,Qe)||Re.push(Qe);if(Re.length){for(const Qe of Re)z.removeByValue(te,Qe);t(0,_=p?te:te[0])}}function X(){t(15,L="")}function fe(te,Re){te=te||[];const Qe=M||UT;return te.filter(Jt=>Qe(Jt,Re))||[]}function G(te,Re){te.preventDefault(),g&&p?Y(Re):q(Re)}function ce(te,Re){(te.code==="Enter"||te.code==="Space")&&G(te,Re)}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 Re of te)Re.addEventListener("click",Me);return()=>{for(const Re of te)Re.removeEventListener("click",Me)}});const je=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,Re)=>G(Re,te),Je=(te,Re)=>ce(Re,te);function ht(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,O=te.searchable),"searchFunc"in te&&t(27,M=te.searchFunc),"class"in te&&t(13,D=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 Re=z.toArray(_);return z.inArray(Re,te)})},[_,a,u,f,p,m,g,b,k,$,T,C,O,D,N,L,I,F,R,s,i,X,G,ce,ge,r,d,M,q,Y,B,Z,ee,l,je,He,we,Ce,Je,ht,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=Ct(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)&&Ot(i,t,s,s[12],e?Mt(t,s[12],l,JT):Dt(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;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.selected=n[0]),e=new ou({props:o}),se.push(()=>me(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&62?$t(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Wt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function XT(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Ge(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=z.toArray(T,!0);let C=[];for(let O of T){const M=z.findByKey(r,p,O);M&&C.push(M)}T.length&&!C.length||t(0,u=a?C:C[0])}async function g(T){let C=z.toArray(T,!0).map(O=>O[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=qe(qe({},e),Ut(T)),t(5,s=Ge(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 Ni 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 Rs({props:a}),se.push(()=>me(t,"value",r)),{c(){e=y("div"),H(t.$$.fragment)},m(u,f){S(u,e,f),j(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,ye(()=>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),V(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 Ni({props:l}),se.push(()=>me(e,"keyOfSelected",s)),{c(){H(e.$$.fragment)},m(o,r){j(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],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(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){V(e,l),l&&w(t),V(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(){H(e.$$.fragment)},m(i,s){j(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){V(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&&gt(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;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(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(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&18?$t(s,[a&2&&{key:r[1]},a&16&&Wt(r[4])]):{};a&786439&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function sC(n,e,t){var O;const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((O=l.options)==null?void 0:O.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=gt(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=qe(qe({},e),Ut(M)),t(4,s=Ge(e,i)),"field"in M&&t(0,l=M.field),"key"in M&&t(1,o=M.key)},n.$$.update=()=>{var M,D;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((D=(M=l.options)==null?void 0:M.values)==null?void 0:D.length)||2,l)),n.$$.dirty&1&&z.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,O,M,D='"{"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="&quot;true&quot; is converted to the json <code>true</code>",g=E(),b=y("li"),b.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=E(),$=y("li"),$.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",T=E(),C=y("li"),C.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",O=E(),M=y("li"),I=U(D),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,O),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&&tt(()=>{fe&&(X||(X=Ve(e,St,{duration:150},!0)),X.run(1))}),fe=!0)},o(G){G&&(X||(X=Ve(e,St,{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;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(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(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&10?$t(s,[a&2&&{key:r[1]},a&8&&Wt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function fC(n,e,t){const i=["field","key"];let s=Ge(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=qe(qe({},e),Ut(b)),t(3,s=Ge(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 Ni({props:l}),se.push(()=>me(e,"keyOfSelected",s)),{c(){H(e.$$.fragment)},m(o,r){j(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],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function gC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("button"),e.innerHTML='<span class="txt">Images (jpg, png, svg, gif, webp)</span>',t=E(),i=y("button"),i.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',s=E(),l=y("button"),l.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=E(),r=y("button"),r.innerHTML='<span class="txt">Archives (zip, 7zip, rar)</span>',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 O={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&&(O.keyOfSelected=n[0].options.mimeTypes),r=new Ni({props:O}),se.push(()=>me(r,"keyOfSelected",C)),b=new Hn({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(),H(r.$$.fragment),u=E(),f=y("div"),d=y("button"),p=y("span"),p.textContent="Choose presets",m=E(),_=y("i"),g=E(),H(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,D){S(M,e,D),v(e,t),v(e,i),v(e,s),S(M,o,D),j(r,M,D),S(M,u,D),S(M,f,D),v(f,d),v(d,p),v(d,m),v(d,_),v(d,g),j(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,D){(!k||D&67108864&&l!==(l=M[26]))&&h(e,"for",l);const I={};D&67108864&&(I.id=M[26]),D&8&&(I.items=M[3]),!a&&D&1&&(a=!0,I.keyOfSelected=M[0].options.mimeTypes,ye(()=>a=!1)),r.$set(I);const L={};D&268435457&&(L.$$scope={dirty:D,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),V(r,M),M&&w(u),M&&w(f),V(b),$=!1,T()}}}function vC(n){let e;return{c(){e=y("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,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,O;function M(I){n[13](I)}let D={id:n[26],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(D.value=n[0].options.thumbs),r=new Rs({props:D}),se.push(()=>me(r,"value",M)),$=new Hn({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(),H(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(),H($.$$.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),j(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),j($,m,null),T=!0,C||(O=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,ye(()=>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),V(r,I),I&&w(u),I&&w(f),V($),C=!1,O()}}}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&&gt(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"),H(t.$$.fragment),h(e,"class","col-sm-3")},m(s,l){S(s,e,l),j(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),V(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&&gt(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"),H(i.$$.fragment),s=E(),l=y("div"),H(o.$$.fragment),a=E(),u=y("div"),H(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),j(i,t,null),v(e,s),v(e,l),j(o,l,null),v(e,a),v(e,u),j(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),V(i),V(o),V(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"),H(t.$$.fragment),h(e,"class","col-sm-4")},m(s,l){S(s,e,l),j(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),V(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;r<s.length;r+=1)o=qe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>me(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(){H(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&34?$t(s,[a&2&&{key:r[1]},a&32&&Wt(r[5])]):{};a&402653199&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function MC(n,e,t){var Y;const i=["field","key"];let s=Ge(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(z.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=gt(this.value),t(0,l),t(6,f),t(2,u)}function O(){l.options.maxSelect=gt(this.value),t(0,l),t(6,f),t(2,u)}function M(B){u=B,t(2,u)}function D(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=qe(qe({},e),Ut(B)),t(5,s=Ge(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&&(z.isEmpty(l.options)?d():p())},[l,o,u,a,r,s,f,m,_,g,b,k,$,T,C,O,M,D,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=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,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 Ni({props:l}),se.push(()=>me(e,"keyOfSelected",s)),{c(){H(e.$$.fragment)},m(o,r){j(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,ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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 Ni({props:l}),se.push(()=>me(e,"keyOfSelected",s)),{c(){H(e.$$.fragment)},m(o,r){j(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],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(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){V(e,l),l&&w(t),V(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"),H(t.$$.fragment),i=E(),s=y("div"),H(l.$$.fragment),h(e,"class","col-sm-6"),h(s,"class","col-sm-6")},m(r,a){S(r,e,a),j(t,e,null),S(r,i,a),S(r,s,a),j(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),V(t),r&&w(i),r&&w(s),V(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&&gt(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&&gt(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(()=>me(r,"selected",p)),{c(){e=y("label"),t=y("span"),t.textContent="Display fields",i=E(),s=y("i"),o=E(),H(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),j(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,ye(()=>a=!1)),r.$set(b)},i(_){u||(A(r.$$.fragment,_),u=!0)},o(_){P(r.$$.fragment,_),u=!1},d(_){_&&w(e),_&&w(o),V(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 Ni({props:u}),se.push(()=>me(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("Delete main record on relation delete"),s=E(),H(l.$$.fragment),h(e,"for",i=n[32])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),j(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,ye(()=>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),V(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"),H(s.$$.fragment),l=E(),o=y("div"),H(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),j(s,i,null),v(e,l),v(e,o),j(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(),V(s),V(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;f<o.length;f+=1)a=qe(a,o[f]);n[0]!==void 0&&(a.field=n[0]),e=new si({props:a}),se.push(()=>me(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(){H(e.$$.fragment),i=E(),H(s.$$.fragment)},m(f,d){j(e,f,d),S(f,i,d),j(s,f,d),l=!0},p(f,d){const p=d[0]&258?$t(o,[d[0]&2&&{key:f[1]},d[0]&256&&Wt(f[8])]):{};d[0]&63|d[1]&12&&(p.$$scope={dirty:d,ctx:f}),!t&&d[0]&1&&(t=!0,p.field=f[0],ye(()=>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){V(e,f),f&&w(i),n[25](null),V(s,f)}}}function jC(n,e,t){var fe;let i;const s=["field","key"];let l=Ge(e,s),o;Ke(n,ii,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=gt(this.value),t(0,r),t(10,k),t(2,b)}function O(){r.options.maxSelect=gt(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 D(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=qe(qe({},e),Ut(G)),t(8,l=Ge(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&&z.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,O,M,D,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(`,
`),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(()=>me(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&&H(i.$$.fragment),l=Se(),this.first=t},m(m,_){S(m,t,_),i&&j(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],ye(()=>s=!1)),_&1&&d!==(d=e[1][e[17].type])){if(i){re();const b=i;P(b.$$.fragment,1,0,()=>{V(b,1)}),ae()}d?(i=Pt(d,p(e)),se.push(()=>me(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f),H(i.$$.fragment),A(i.$$.fragment,1),j(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&&V(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,O,M,D=n[0].$isAuth&&Td(),I=n[0].schema;const L=N=>N[17];for(let N=0;N<I.length;N+=1){let q=$d(n,I,N),Y=L(q);_.set(Y,m[N]=Cd(Y,q))}b=new I$({props:{class:"btn btn-block btn-outline"}}),b.$on("select",n[12]);function F(N){n[13](N)}let R={};return n[0]!==void 0&&(R.collection=n[0]),C=new O$({props:R}),se.push(()=>me(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(),D&&D.c(),f=U(`
.`),d=E(),p=y("div");for(let N=0;N<m.length;N+=1)m[N].c();g=E(),H(b.$$.fragment),k=E(),$=y("hr"),T=E(),H(C.$$.fragment),h(s,"class","txt-sm"),h(o,"class","txt-sm"),h(a,"class","txt-sm"),h(t,"class","txt-sm"),h(e,"class","block m-b-25"),h(p,"class","accordions schema-fields")},m(N,q){S(N,e,q),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),D&&D.m(t,null),v(t,f),S(N,d,q),S(N,p,q);for(let Y=0;Y<m.length;Y+=1)m[Y]&&m[Y].m(p,null);S(N,g,q),j(b,N,q),S(N,k,q),S(N,$,q),S(N,T,q),j(C,N,q),M=!0},p(N,[q]){N[0].$isAuth?D||(D=Td(),D.c(),D.m(t,f)):D&&(D.d(1),D=null),q&119&&(I=N[0].schema,re(),m=kt(m,q,L,1,N,I,_,p,Kt,Cd,null,$d),ae());const Y={};!O&&q&1&&(O=!0,Y.collection=N[0],ye(()=>O=!1)),C.$set(Y)},i(N){if(!M){for(let q=0;q<I.length;q+=1)A(m[q]);A(b.$$.fragment,N),A(C.$$.fragment,N),M=!0}},o(N){for(let q=0;q<m.length;q+=1)P(m[q]);P(b.$$.fragment,N),P(C.$$.fragment,N),M=!1},d(N){N&&w(e),D&&D.d(),N&&w(d),N&&w(p);for(let q=0;q<m.length;q+=1)m[q].d();N&&w(g),V(b,N),N&&w(k),N&&w($),N&&w(T),V(C,N)}}}function zC(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function BC(n,e,t){let i,{collection:s=new bn}=e;const l={text:X$,number:iT,bool:oT,email:ib,url:_T,editor:vT,date:NT,select:lC,json:cC,file:OC,relation:VC};function o(C){s.schema[C]&&(s.schema.splice(C,1),t(0,s))}function r(C="text"){const O=new vn({name:a(),type:C});O.onMountSelect=!0,s.schema.push(O),t(0,s)}function a(C="field"){let O="";for(;u(C+O);)++O;return C+O}function u(C){return!!s.schema.find(O=>O.name===C)}function f(C){return i.findIndex(O=>O===C)}function d(C,O){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||C===O||!O||t(0,s.indexes=s.indexes.map(D=>z.replaceIndexColumn(D,C,O)),s)}function p(C,O){if(!C)return;C.dataTransfer.dropEffect="move";const M=parseInt(C.dataTransfer.getData("text/plain")),D=s.schema;M<O?(D.splice(O+1,0,D[M]),D.splice(M,1)):(D.splice(O,0,D[M]),D.splice(M+1,1)),t(0,s.schema=D,s),fn({})}function m(C,O,M,D){M[D]=C,t(0,s)}const _=C=>o(C),g=C=>d(C.detail.oldName,C.detail.newName),b=(C,O)=>zC(O.detail,C),k=(C,O)=>p(O.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 bn),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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function KC(n){let e;return{c(){e=y("div"),e.innerHTML='<span class="loader"></span>',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=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,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=`<small class="txt svelte-1akuazq">Unlock and set custom rule</small>
<div class="icon svelte-1akuazq"><i class="ri-lock-unlock-line svelte-1akuazq"></i></div>`,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&&tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Ht,{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(()=>me(d,"value",$)));let O=n[9]&&Dd(n);const M=n[12].default,D=Ct(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&&H(d.$$.fragment),m=E(),O&&O.c(),_=E(),g=y("div"),D&&D.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&&j(d,e,null),v(e,m),O&&O.m(e,null),S(I,_,L),S(I,g,L),D&&D.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],ye(()=>p=!1)),L&128&&T!==(T=I[7])){if(d){re();const R=d;P(R.$$.fragment,1,0,()=>{V(R,1)}),ae()}T?(d=Pt(T,C(I)),I[13](d),se.push(()=>me(d,"value",$)),H(d.$$.fragment),A(d.$$.fragment,1),j(d,e,m)):d=null}else T&&d.$set(F);I[9]?O?(O.p(I,L),L&512&&A(O,1)):(O=Dd(I),O.c(),A(O,1),O.m(e,null)):O&&(re(),P(O,1,1,()=>{O=null}),ae()),D&&D.p&&(!b||L&33280)&&Ot(D,M,I,I[15],b?Mt(M,I[15],L,WC):Dt(I[15]),Md)},i(I){b||(d&&A(d.$$.fragment,I),A(O),A(D,I),b=!0)},o(I){d&&P(d.$$.fragment,I),P(O),P(D,I),b=!1},d(I){I&&w(e),k&&k.d(),n[13](null),d&&V(d),O&&O.d(),I&&w(_),I&&w(g),D&&D.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 at(()=>import("./FilterAutocompleteInput-d952f6bd.js"),["./FilterAutocompleteInput-d952f6bd.js","./index-6f704b4c.js"],import.meta.url)).default),Ed=_,t(8,g=!1))}async function k(){t(0,r=m||""),await un(),p==null||p.focus()}async function $(){m=r,t(0,r=null)}function T(O){se[O?"unshift":"push"](()=>{p=O,t(6,p)})}function C(O){r=O,t(0,r)}return n.$$set=O=>{"collection"in O&&t(1,o=O.collection),"rule"in O&&t(0,r=O.rule),"label"in O&&t(2,a=O.label),"formKey"in O&&t(3,u=O.formKey),"required"in O&&t(4,f=O.required),"placeholder"in O&&t(5,d=O.placeholder),"$$scope"in O&&t(15,l=O.$$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 Ts 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,O,M,D,I,L=n[2],F=[];for(let R=0;R<L.length;R+=1)F[R]=Pd(Ad(n,L,R));return{c(){e=y("div"),t=y("div"),i=y("div"),s=y("p"),s.textContent="The following record fields are available:",l=E(),o=y("div");for(let R=0;R<F.length;R+=1)F[R].c();r=E(),a=y("hr"),u=E(),f=y("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",d=E(),p=y("div"),p.innerHTML=`<code>@request.headers.*</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,m=E(),_=y("hr"),g=E(),b=y("p"),b.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=E(),$=y("div"),$.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",T=E(),C=y("hr"),O=E(),M=y("p"),M.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,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<F.length;q+=1)F[q]&&F[q].m(o,null);v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,m),v(i,_),v(i,g),v(i,b),v(i,k),v(i,$),v(i,T),v(i,C),v(i,O),v(i,M),I=!0},p(R,N){if(N&4){L=R[2];let q;for(q=0;q<L.length;q+=1){const Y=Ad(R,L,q);F[q]?F[q].p(Y,N):(F[q]=Pd(Y),F[q].c(),F[q].m(o,null))}for(;q<F.length;q+=1)F[q].d(1);F.length=L.length}},i(R){I||(R&&tt(()=>{I&&(D||(D=Ve(e,St,{duration:150},!0)),D.run(1))}),I=!0)},o(R){R&&(D||(D=Ve(e,St,{duration:150},!1)),D.run(0)),I=!1},d(R){R&&w(e),pt(F,R),R&&D&&D.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 Ts({props:d}),se.push(()=>me(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 Ts({props:m}),se.push(()=>me(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 Ts({props:g}),se.push(()=>me(r,"rule",_)),{c(){H(e.$$.fragment),i=E(),H(s.$$.fragment),o=E(),H(r.$$.fragment)},m(b,k){j(e,b,k),S(b,i,k),j(s,b,k),S(b,o,k),j(r,b,k),u=!0},p(b,k){const $={};k&1&&($.collection=b[0]),!t&&k&1&&(t=!0,$.rule=b[0].createRule,ye(()=>t=!1)),e.$set($);const T={};k&1&&(T.collection=b[0]),!l&&k&1&&(l=!0,T.rule=b[0].updateRule,ye(()=>l=!1)),s.$set(T);const C={};k&1&&(C.collection=b[0]),!a&&k&1&&(a=!0,C.rule=b[0].deleteRule,ye(()=>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){V(e,b),b&&w(i),V(s,b),b&&w(o),V(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 Ts({props:l}),se.push(()=>me(e,"rule",s)),{c(){H(e.$$.fragment)},m(o,r){j(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,ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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.
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 <code>create</code> and <code>update</code> 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,O=n[1]&&Id(n);function M(Y){n[4](Y)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),f=new Ts({props:D}),se.push(()=>me(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 Ts({props:L}),se.push(()=>me(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
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=E(),l=y("button"),r=U(o),a=E(),O&&O.c(),u=E(),H(f.$$.fragment),p=E(),H(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),O&&O.m(e,null),S(Y,u,B),j(f,Y,B),S(Y,p,B),j(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]?O?(O.p(Y,B),B&2&&A(O,1)):(O=Id(Y),O.c(),A(O,1),O.m(e,null)):O&&(re(),P(O,1,1,()=>{O=null}),ae());const Z={};B&1&&(Z.collection=Y[0]),!d&&B&1&&(d=!0,Z.rule=Y[0].listRule,ye(()=>d=!1)),f.$set(Z);const ee={};B&1&&(ee.collection=Y[0]),!_&&B&1&&(_=!0,ee.rule=Y[0].viewRule,ye(()=>_=!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(O),A(f.$$.fragment,Y),A(m.$$.fragment,Y),A(F),A(R),$=!0)},o(Y){P(O),P(f.$$.fragment,Y),P(m.$$.fragment,Y),P(F),P(R),$=!1},d(Y){Y&&w(e),O&&O.d(),Y&&w(u),V(f,Y),Y&&w(p),V(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 bn}=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=z.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(()=>me(e,"value",l)),e.$on("change",n[6])),{c(){e&&H(e.$$.fragment),i=Se()},m(a,u){e&&j(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,ye(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{V(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>me(e,"value",l)),e.$on("change",a[6]),H(e.$$.fragment),A(e.$$.fragment,1),j(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&&V(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<i.length;l+=1)s[l]=qd(Fd(n,i,l));return{c(){e=y("div"),t=y("div");for(let l=0;l<s.length;l+=1)s[l].c();h(t,"class","content"),h(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),v(e,t);for(let r=0;r<s.length;r+=1)s[r]&&s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=Fd(l,i,r);s[r]?s[r].p(a,o):(s[r]=qd(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),pt(s,l)}}}function qd(n){let e,t=n[9]+"",i;return{c(){e=y("p"),i=U(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function i4(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[n4,t4],m=[];function _(b,k){return b[2]?0:1}l=_(n),o=m[l]=p[l](n);let g=n[3].length&&Rd(n);return{c(){e=y("label"),t=y("span"),t.textContent="Select query",s=E(),o.c(),r=E(),a=y("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</li>
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li>
<li>Expressions must be aliased with a valid formatted field name (eg.
<code>MAX(balance) as maxBalance</code>).</li></ul>`,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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function l4(n,e,t){let i;Ke(n,_i,d=>t(4,i=d));let{collection:s=new bn}=e,l,o=!1,r=[];function a(d){var _;t(3,r=[]);const p=z.getNestedVal(d,"schema",null);if(z.isEmpty(p))return;if(p!=null&&p.message){r.push(p==null?void 0:p.message);return}const m=z.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);z.removeByValue(m,"id"),z.removeByValue(m,"created"),z.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(z.sentenize($+": "+k))}}Xt(async()=>{t(2,o=!0);try{t(1,l=(await at(()=>import("./CodeEditor-462b7ad0.js"),["./CodeEditor-462b7ad0.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&&Di("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=Ct(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)&&Ot(l,s,o,o[14],i?Mt(s,o[14],r,null):Dt(o[14]),null)},i(o){i||(A(l,o),o&&tt(()=>{i&&(t||(t=Ve(e,St,{duration:150},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=Ve(e,St,{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=Ct(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",ct(n[17])),J(t,"drop",ct(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",ct(n[16]))],o=!0)},p(d,[p]){u&&u.p&&(!l||p&16385)&&Ot(u,a,d,d[14],l?Mt(a,d[14],p,r4):Dt(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=wt();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(),O=F=>{u&&(t(7,m=!1),$(),l("drop",F))},M=F=>u&&l("dragstart",F),D=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,O,M,D,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(){H(e.$$.fragment)},m(i,s){j(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){V(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||(tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Ht,{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=`<i class="ri-user-star-line"></i>
<span class="txt">Username/Password</span>`,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 "+(z.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 "+(z.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"),H(i.$$.fragment),s=E(),l=y("div"),H(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),j(i,t,null),v(e,s),v(e,l),j(o,l,null),a=!0},p(u,f){const d={};f&1&&(d.class="form-field "+(z.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 "+(z.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&&tt(()=>{a&&(r||(r=Ve(e,St,{duration:150},!0)),r.run(1))}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=Ve(e,St,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),V(i),V(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:!z.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new Rs({props:g}),se.push(()=>me(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=E(),s=y("i"),o=E(),H(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),j(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=!z.isEmpty(b[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptEmailDomains,ye(()=>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),V(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:!z.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new Rs({props:g}),se.push(()=>me(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),H(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),j(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=!z.isEmpty(b[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyEmailDomains,ye(()=>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),V(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(){H(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){j(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){V(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||(tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Ht,{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=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,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='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',h(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&tt(()=>{i&&(t||(t=Ve(e,St,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,St,{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(){H(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){j(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){V(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||(tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Ht,{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=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,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&&gt(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"),H(s.$$.fragment),l=E(),H(o.$$.fragment),r=E(),H(a.$$.fragment),u=E(),f=y("hr"),d=E(),p=y("h4"),p.textContent="General",m=E(),H(_.$$.fragment),g=E(),H(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),j(s,i,null),v(i,l),j(o,i,null),v(i,r),j(a,i,null),S($,u,T),S($,f,T),S($,d,T),S($,p,T),S($,m,T),j(_,$,T),S($,g,T),j(b,$,T),k=!0},p($,[T]){const C={};T&8201&&(C.$$scope={dirty:T,ctx:$}),s.$set(C);const O={};T&8197&&(O.$$scope={dirty:T,ctx:$}),o.$set(O);const M={};T&8195&&(M.$$scope={dirty:T,ctx:$}),a.$set(M);const D={};T&12289&&(D.$$scope={dirty:T,ctx:$}),_.$set(D);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),V(s),V(o),V(a),$&&w(u),$&&w(f),$&&w(d),$&&w(p),$&&w(m),V(_,$),$&&w(g),V(b,$)}}}function E4(n,e,t){let i,s,l,o;Ke(n,_i,g=>t(4,o=g));let{collection:r=new bn}=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=gt(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&&z.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!z.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!z.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!z.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!z.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
`),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<s.length;f+=1)l[f]=xd(Jd(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=ep(Kd(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=tp(Yd(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=E();for(let f=0;f<r.length;f+=1)r[f].c();t=E();for(let f=0;f<u.length;f+=1)u[f].c();i=Se()},m(f,d){for(let p=0;p<l.length;p+=1)l[p]&&l[p].m(f,d);S(f,e,d);for(let p=0;p<r.length;p+=1)r[p]&&r[p].m(f,d);S(f,t,d);for(let p=0;p<u.length;p+=1)u[p]&&u[p].m(f,d);S(f,i,d)},p(f,d){if(d&32){s=f[5];let p;for(p=0;p<s.length;p+=1){const m=Jd(f,s,p);l[p]?l[p].p(m,d):(l[p]=xd(m),l[p].c(),l[p].m(e.parentNode,e))}for(;p<l.length;p+=1)l[p].d(1);l.length=s.length}if(d&128){o=f[7];let p;for(p=0;p<o.length;p+=1){const m=Kd(f,o,p);r[p]?r[p].p(m,d):(r[p]=ep(m),r[p].c(),r[p].m(t.parentNode,t))}for(;p<r.length;p+=1)r[p].d(1);r.length=o.length}if(d&64){a=f[6];let p;for(p=0;p<a.length;p+=1){const m=Yd(f,a,p);u[p]?u[p].p(m,d):(u[p]=tp(m),u[p].c(),u[p].m(i.parentNode,i))}for(;p<u.length;p+=1)u[p].d(1);u.length=a.length}},d(f){pt(l,f),f&&w(e),pt(r,f),f&&w(t),pt(u,f),f&&w(i)}}}function xd(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=y("li"),t=U(`Multiple to single value conversion of field
`),i=y("strong"),l=U(s),o=E(),r=y("em"),r.textContent="(will keep only the last array item)",h(r,"class","txt-sm"),h(e,"class","svelte-xqpcsf")},m(a,u){S(a,e,u),v(e,t),v(e,i),v(i,l),v(e,o),v(e,r)},p(a,u){u&32&&s!==(s=a[17].name+"")&&le(l,s)},d(a){a&&w(e)}}}function ep(n){let e,t,i,s,l=n[17].originalName+"",o,r,a,u,f,d=n[17].name+"",p;return{c(){e=y("li"),t=y("div"),i=U(`Renamed field
`),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 I4(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 class="ri-error-warning-line"></i>',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='<span class="txt">Cancel</span>',t=E(),i=y("button"),i.innerHTML='<span class="txt">Confirm</span>',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 cn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){H(e.$$.fragment)},m(s,l){j(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),V(e,s)}}}function F4(n,e,t){let i,s,l,o,r;const a=wt();let u,f,d;async function p(C,O){t(1,f=C),t(2,d=O),await un(),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,O,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(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(6,l=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(5,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>{var L,F,R;const I=(L=f==null?void 0:f.schema)==null?void 0:L.find(N=>N.id==D.id);return I?((F=I.options)==null?void 0:F.maxSelect)!=1&&((R=D.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(()=>me(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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(()=>me(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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(()=>me(t,"collection",l)),{c(){e=y("div"),H(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){S(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>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),V(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(()=>me(t,"collection",l)),{c(){e=y("div"),H(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[3]===As)},m(r,a){S(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&x(e,"active",r[3]===As)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),V(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]===kl&&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]===Ti),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]===Ti),m[3]===kl?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 Hn({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(),H(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),j(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),V(o)}}}function H4(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,t=E(),i=y("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,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",Mn(ct(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 Hn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[z4]},$$scope:{ctx:n}}}),{c(){e=y("i"),t=E(),H(i.$$.fragment),h(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),j(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),V(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=Oi(z.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=Oi(z.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<t.length;s+=1)i[s]=rp(np(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=np(s,t,o);i[o]?i[o].p(r,l):(i[o]=rp(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){pt(i,s),s&&w(e)}}}function ap(n){let e;return{c(){e=y("div"),e.textContent="System collection",h(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function B4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k=(n[6][n[2].type]||"N/A")+"",$,T,C,O,M,D,I,L,F,R=n[2].$isNew&&op(n),N=n[2].system&&ap();return{c(){e=y("label"),t=U("Name"),s=E(),l=y("input"),f=E(),d=y("div"),p=y("button"),m=y("span"),_=E(),g=y("span"),b=U("Type: "),$=U(k),T=E(),R&&R.c(),M=E(),N&&N.c(),D=Se(),h(e,"for",i=n[46]),h(l,"type","text"),h(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],h(l,"spellcheck","false"),l.autofocus=r=n[2].$isNew,h(l,"placeholder",a=n[2].$isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,h(g,"class","txt"),h(p,"type","button"),h(p,"class",C="btn btn-sm p-r-10 p-l-10 "+(n[2].$isNew?"btn-outline":"btn-transparent")),p.disabled=O=!n[2].$isNew,h(d,"class","form-field-addon")},m(q,Y){S(q,e,Y),v(e,t),S(q,s,Y),S(q,l,Y),S(q,f,Y),S(q,d,Y),v(d,p),v(p,m),v(p,_),v(p,g),v(g,b),v(g,$),v(p,T),R&&R.m(p,null),S(q,M,Y),N&&N.m(q,Y),S(q,D,Y),I=!0,n[2].$isNew&&l.focus(),L||(F=J(l,"input",n[26]),L=!0)},p(q,Y){(!I||Y[1]&32768&&i!==(i=q[46]))&&h(e,"for",i),(!I||Y[1]&32768&&o!==(o=q[46]))&&h(l,"id",o),(!I||Y[0]&8192)&&(l.disabled=q[13]),(!I||Y[0]&4&&r!==(r=q[2].$isNew))&&(l.autofocus=r),(!I||Y[0]&4&&a!==(a=q[2].$isAuth?'eg. "users"':'eg. "posts"'))&&h(l,"placeholder",a),(!I||Y[0]&4&&u!==(u=q[2].name)&&l.value!==u)&&(l.value=u),(!I||Y[0]&68)&&k!==(k=(q[6][q[2].type]||"N/A")+"")&&le($,k),q[2].$isNew?R?(R.p(q,Y),Y[0]&4&&A(R,1)):(R=op(q),R.c(),A(R,1),R.m(p,null)):R&&(re(),P(R,1,1,()=>{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&&O!==(O=!q[2].$isNew))&&(p.disabled=O),q[2].system?N||(N=ap(),N.c(),N.m(D.parentNode,D)):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(D),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&&zt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&tt(()=>{s&&(i||(i=Ve(e,Ht,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=Ve(e,Ht,{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&&tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Ht,{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=!z.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]===As)},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=!z.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]===As)},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&&tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Ht,{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=!z.isEmpty(n[11]),$,T,C,O,M=!z.isEmpty((Z=n[5])==null?void 0:Z.listRule)||!z.isEmpty((ee=n[5])==null?void 0:ee.viewRule)||!z.isEmpty((ie=n[5])==null?void 0:ie.createRule)||!z.isEmpty((X=n[5])==null?void 0:X.updateRule)||!z.isEmpty((fe=n[5])==null?void 0:fe.deleteRule)||!z.isEmpty((ce=(G=n[5])==null?void 0:G.options)==null?void 0:ce.manageRule),D,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"),H(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",O=E(),q&&q.c(),D=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]===Ti),h(C,"class","txt"),h(T,"type","button"),h(T,"class","tab-item"),x(T,"active",n[3]===kl),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),j(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,O),q&&q.m(T,null),v(d,D),Y&&Y.m(d,null),I=!0,L||(F=[J(o,"submit",ct(n[28])),J(p,"click",n[29]),J(T,"click",n[30])],L=!0)},p(ge,Me){var He,we,Ce,Je,ht,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 je={};Me[0]&8192&&(je.class="form-field collection-field-name required m-b-0 "+(ge[13]?"disabled":"")),Me[0]&8260|Me[1]&1081344&&(je.$$scope={dirty:Me,ctx:ge}),r.$set(je),(!I||Me[0]&4)&&_!==(_=(He=ge[2])!=null&&He.$isView?"Query":"Fields")&&le(g,_),Me[0]&2048&&(k=!z.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]===Ti),Me[0]&32&&(M=!z.isEmpty((we=ge[5])==null?void 0:we.listRule)||!z.isEmpty((Ce=ge[5])==null?void 0:Ce.viewRule)||!z.isEmpty((Je=ge[5])==null?void 0:Je.createRule)||!z.isEmpty((ht=ge[5])==null?void 0:ht.updateRule)||!z.isEmpty((Ze=ge[5])==null?void 0:Ze.deleteRule)||!z.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]===kl),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),V(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 cn({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(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(r,a){j(e,r,a),S(r,t,a),j(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),V(e,r),r&&w(t),n[40](null),V(i,r)}}}const Ti="schema",kl="api_rules",As="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,_i,te=>t(5,o=te));const r={};r[K4]="Base",r[mp]="View",r[pp]="Auth";const a=wt();let u,f,d=null,p=new bn,m=!1,_=!1,g=Ti,b=Pr(p),k="";function $(te){t(3,g=te)}function T(te){return O(te),t(10,_=!0),$(Ti),u==null?void 0:u.show()}function C(){return u==null?void 0:u.hide()}async function O(te){fn({}),typeof te<"u"?(t(20,d=te),t(2,p=te.$clone())):(t(20,d=null),t(2,p=new bn)),t(2,p.schema=p.schema||[],p),t(2,p.originalName=p.name||"",p),await un(),t(21,b=Pr(p))}function M(){p.$isNew?D():f==null||f.show(d,p)}function D(){if(m)return;t(9,m=!0);const te=I();let Re;p.$isNew?Re=he.collections.create(te):Re=he.collections.update(p.id,te),Re.then(Qe=>{Ea(),c$(Qe),t(10,_=!1),C(),Yt(p.$isNew?"Successfully created collection.":"Successfully updated collection."),a("save",{isNew:p.$isNew,collection:Qe})}).catch(Qe=>{he.errorResponseHandler(Qe)}).finally(()=>{t(9,m=!1)})}function I(){const te=p.$export();te.schema=te.schema.slice(0);for(let Re=te.schema.length-1;Re>=0;Re--)te.schema[Re].toDelete&&te.schema.splice(Re,1);return te}function L(){d!=null&&d.id&&_n(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>he.collections.delete(d==null?void 0:d.id).then(()=>{C(),Yt(`Successfully deleted collection "${d==null?void 0:d.name}".`),a("delete",d),d$(d)}).catch(te=>{he.errorResponseHandler(te)}))}function F(te){t(2,p.type=te,p),Di("schema")}function R(){s?_n("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",!z.isEmpty(te.schema))for(const Re of te.schema)Re.id="";if(!z.isEmpty(te.indexes))for(let Re=0;Re<te.indexes.length;Re++){const Qe=z.parseIndex(te.indexes[Re]);Qe.indexName="idx_"+z.randomString(7),Qe.tableName=te.name,te.indexes[Re]=z.buildIndex(Qe)}}T(te),await un(),t(21,b="")}const q=()=>C(),Y=()=>M(),B=()=>R(),Z=()=>L(),ee=te=>{t(2,p.name=z.slugify(te.target.value),p),te.target.value=p.name},ie=te=>F(te),X=()=>{l&&M()},fe=()=>$(Ti),G=()=>$(kl),ce=()=>$(As);function ge(te){p=te,t(2,p),t(20,d)}function Me(te){p=te,t(2,p),t(20,d)}function je(te){p=te,t(2,p),t(20,d)}function He(te){p=te,t(2,p),t(20,d)}const we=()=>s&&_?(_n("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 ht(te){pe.call(this,n,te)}function Ze(te){se[te?"unshift":"push"](()=>{f=te,t(8,f)})}const We=()=>D();return n.$$.update=()=>{var te,Re;n.$$.dirty[0]&32&&(o.schema||(te=o.options)!=null&&te.query?t(11,k=z.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=(Re=p.indexes)==null?void 0:Re.map(Qe=>z.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===As&&p.type!==pp&&$(Ti)},[$,C,p,g,s,o,r,u,f,m,_,k,l,i,M,D,L,F,R,T,d,b,q,Y,B,Z,ee,ie,X,fe,G,ce,ge,Me,je,He,we,Ce,Je,ht,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=z.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(ln.call(null,t)),d=!0)},p(m,_){var g;e=m,_&8&&s!==(s=z.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=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,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 O=L=>L[15].id;for(let L=0;L<C.length;L+=1){let F=hp(n,C,L),R=O(F);m.set(R,p[L]=bp(R,F))}let M=null;C.length||(M=_p(n));let D=!n[7]&&vp(n),I={};return b=new ru({props:I}),n[13](b),b.$on("save",n[14]),{c(){e=y("aside"),t=y("header"),i=y("div"),s=y("div"),l=y("button"),l.innerHTML='<i class="ri-close-line"></i>',o=E(),r=y("input"),a=E(),u=y("hr"),f=E(),d=y("div");for(let L=0;L<p.length;L+=1)p[L].c();M&&M.c(),_=E(),D&&D.c(),g=E(),H(b.$$.fragment),h(l,"type","button"),h(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[4]),h(s,"class","form-field-addon"),h(r,"type","text"),h(r,"placeholder","Search collections..."),h(i,"class","form-field search"),x(i,"active",n[4]),h(t,"class","sidebar-header"),h(u,"class","m-t-5 m-b-xs"),h(d,"class","sidebar-content"),x(d,"fade",n[6]),x(d,"sidebar-content-compact",n[3].length>20),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;R<p.length;R+=1)p[R]&&p[R].m(d,null);M&&M.m(d,null),v(e,_),D&&D.m(e,null),S(L,g,F),j(b,L,F),k=!0,$||(T=[J(l,"click",n[10]),J(r,"input",n[11])],$=!0)},p(L,[F]){(!k||F&16)&&x(l,"hidden",!L[4]),F&1&&r.value!==L[0]&&ue(r,L[0]),(!k||F&16)&&x(i,"active",L[4]),F&42&&(C=L[3],p=kt(p,F,O,1,L,C,m,d,is,bp,null,hp),!C.length&&M?M.p(L,F):C.length?M&&(M.d(1),M=null):(M=_p(L),M.c(),M.m(d,null))),(!k||F&64)&&x(d,"fade",L[6]),(!k||F&8)&&x(d,"sidebar-content-compact",L[3].length>20),L[7]?D&&(D.d(1),D=null):D?D.p(L,F):(D=vp(L),D.c(),D.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<p.length;F+=1)p[F].d();M&&M.d(),D&&D.d(),L&&w(g),n[13](null),V(b,L),$=!1,De(T)}}}function G4(){setTimeout(()=>{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,hi,$=>t(5,o=$)),Ke(n,ii,$=>t(9,r=$)),Ke(n,No,$=>t(6,a=$)),Ke(n,Ms,$=>t(7,u=$));let f,d="";function p($){tn(hi,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(){H(e.$$.fragment),t=E()},m(s,l){j(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){V(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;g<d.length;g+=1){let b=wp(n,d,g),k=p(b);l.set(k,s[g]=$p(k,b))}let m=Object.entries(n[3]);const _=g=>g[14];for(let g=0;g<m.length;g+=1){let b=yp(n,m,g),k=_(b);u.set(k,a[g]=Cp(k,b))}return{c(){var g;e=y("div"),t=y("aside"),i=y("nav");for(let b=0;b<s.length;b+=1)s[b].c();o=E(),r=y("div");for(let b=0;b<a.length;b+=1)a[b].c();h(i,"class","sidebar-content"),h(t,"class","docs-sidebar"),x(t,"compact",(g=n[2])==null?void 0:g.$isAuth),h(r,"class","docs-content"),h(e,"class","docs-content-wrapper")},m(g,b){S(g,e,b),v(e,t),v(t,i);for(let k=0;k<s.length;k+=1)s[k]&&s[k].m(i,null);v(e,o),v(e,r);for(let k=0;k<a.length;k+=1)a[k]&&a[k].m(r,null);f=!0},p(g,b){var k;b&106&&(d=Object.entries(g[3]),s=kt(s,b,p,1,g,d,l,i,is,$p,null,wp)),(!f||b&4)&&x(t,"compact",(k=g[2])==null?void 0:k.$isAuth),b&44&&(m=Object.entries(g[3]),re(),a=kt(a,b,_,1,g,m,u,r,Kt,Cp,null,yp),ae())},i(g){if(!f){for(let b=0;b<m.length;b+=1)A(a[b]);f=!0}},o(g){for(let b=0;b<a.length;b+=1)P(a[b]);f=!1},d(g){g&&w(e);for(let b=0;b<s.length;b+=1)s[b].d();for(let b=0;b<a.length;b+=1)a[b].d()}}}function i5(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Close</span>',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 cn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){H(e.$$.fragment)},m(s,l){j(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),V(e,s)}}}function l5(n,e,t){const i={list:{label:"List/Search",component:at(()=>import("./ListApiDocs-68b40cd3.js"),["./ListApiDocs-68b40cd3.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:at(()=>import("./ViewApiDocs-299214ca.js"),["./ViewApiDocs-299214ca.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},create:{label:"Create",component:at(()=>import("./CreateApiDocs-d361cb4d.js"),["./CreateApiDocs-d361cb4d.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},update:{label:"Update",component:at(()=>import("./UpdateApiDocs-a9a0e159.js"),["./UpdateApiDocs-a9a0e159.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},delete:{label:"Delete",component:at(()=>import("./DeleteApiDocs-da6f5a32.js"),["./DeleteApiDocs-da6f5a32.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:at(()=>import("./RealtimeApiDocs-1c7e54af.js"),["./RealtimeApiDocs-1c7e54af.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:at(()=>import("./AuthWithPasswordDocs-fa38cbdf.js"),["./AuthWithPasswordDocs-fa38cbdf.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:at(()=>import("./AuthWithOAuth2Docs-937df869.js"),["./AuthWithOAuth2Docs-937df869.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},refresh:{label:"Auth refresh",component:at(()=>import("./AuthRefreshDocs-6e6bdd49.js"),["./AuthRefreshDocs-6e6bdd49.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-verification":{label:"Request verification",component:at(()=>import("./RequestVerificationDocs-3b079aad.js"),["./RequestVerificationDocs-3b079aad.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:at(()=>import("./ConfirmVerificationDocs-ec8e972e.js"),["./ConfirmVerificationDocs-ec8e972e.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:at(()=>import("./RequestPasswordResetDocs-dea655c6.js"),["./RequestPasswordResetDocs-dea655c6.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:at(()=>import("./ConfirmPasswordResetDocs-1c23cc2f.js"),["./ConfirmPasswordResetDocs-1c23cc2f.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:at(()=>import("./RequestEmailChangeDocs-04c11750.js"),["./RequestEmailChangeDocs-04c11750.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:at(()=>import("./ConfirmEmailChangeDocs-c4135ea3.js"),["./ConfirmEmailChangeDocs-c4135ea3.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:at(()=>import("./AuthMethodsDocs-99d1684a.js"),["./AuthMethodsDocs-99d1684a.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:at(()=>import("./ListExternalAuthsDocs-294ce65e.js"),["./ListExternalAuthsDocs-294ce65e.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:at(()=>import("./UnlinkExternalAuthDocs-d8bee752.js"),["./UnlinkExternalAuthDocs-d8bee752.js","./SdkTabs-98b01dec.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o=new bn,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",z.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 O;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",z.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=$=(O=n[1].options)==null?void 0:O.requireEmail,h(g,"class","svelte-1751a4d")},m(O,M){S(O,e,M),v(e,t),v(e,i),v(e,s),S(O,o,M),S(O,r,M),v(r,a),v(a,u),v(u,f),v(u,p),S(O,_,M),S(O,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(O,M){var D;M&4096&&l!==(l=O[12])&&h(e,"for",l),M&1&&d!==(d=O[0].emailVisibility?"On":"Off")&&le(p,d),M&1&&m!==(m="btn btn-sm btn-transparent "+(O[0].emailVisibility?"btn-success":"btn-hint"))&&h(a,"class",m),M&1&&b!==(b=O[0].$isNew)&&(g.autofocus=b),M&4096&&k!==(k=O[12])&&h(g,"id",k),M&2&&$!==($=(D=O[1].options)==null?void 0:D.requireEmail)&&(g.required=$),M&1&&g.value!==O[0].email&&ue(g,O[0].email)},d(O){O&&w(e),O&&w(o),O&&w(r),O&&w(_),O&&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(){H(e.$$.fragment)},m(i,s){j(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){V(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"),H(s.$$.fragment),l=E(),o=y("div"),H(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),j(s,i,null),v(t,l),v(t,o),j(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&&tt(()=>{u&&(a||(a=Ve(e,St,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Ve(e,St,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),V(s),V(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",ct(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"),H(i.$$.fragment),s=E(),l=y("div"),H(o.$$.fragment),r=E(),a=y("div"),_&&_.c(),u=E(),g&&g.c(),f=E(),d=y("div"),H(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),j(i,t,null),v(e,s),v(e,l),j(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),j(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 O={};$&12289&&(O.$$scope={dirty:$,ctx:k}),p.$set(O)},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),V(i),V(o),_&&_.d(),g&&g.d(),V(p)}}}function m5(n,e,t){let{collection:i=new bn}=e,{record:s=new di}=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||_n("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),Di("password"),Di("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<s.length;o+=1)l=qe(l,s[o]);return{c(){e=y("textarea"),ti(e,l),x(e,"svelte-1x1pbts",!0)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[5](e),ue(e,n[0]),t||(i=[J(e,"input",n[6]),J(e,"keydown",n[2])],t=!0)},p(o,[r]){ti(e,l=$t(s,[r&8&&o[3]])),r&1&&ue(e,o[0]),x(e,"svelte-1x1pbts",!0)},i:Q,o:Q,d(o){o&&w(e),n[5](null),t=!1,De(i)}}}function g5(n,e,t){const i=["value","maxHeight"];let s=Ge(e,i),{value:l=""}=e,{maxHeight:o=200}=e,r,a;function u(){clearTimeout(a),a=setTimeout(()=>{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=qe(qe({},e),Ut(m)),t(3,s=Ge(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(()=>me(f,"value",m)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),H(f.$$.fragment),h(t,"class",i=z.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),j(f,g,b),p=!0},p(g,b){(!p||b&2&&i!==(i=z.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],ye(()=>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),V(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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function k5(n,e,t){let{field:i=new vn}=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=z.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=z.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&&gt(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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function T5(n,e,t){let{field:i=new vn}=e,{value:s=void 0}=e;function l(){s=gt(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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function D5(n,e,t){let{field:i=new vn}=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=z.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=z.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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function P5(n,e,t){let{field:i=new vn}=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=z.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=z.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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function R5(n,e,t){let{field:i=new vn}=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='<i class="ri-close-line"></i>',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:z.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(()=>me(p,"value",k)),se.push(()=>me(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(),H(p.$$.fragment),h(t,"class",i=Oi(z.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),h(l,"class","txt"),h(e,"for",u=n[8])},m(C,O){S(C,e,O),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),S(C,f,O),b&&b.m(C,O),S(C,d,O),j(p,C,O),g=!0},p(C,O){(!g||O&2&&i!==(i=Oi(z.getFieldTypeIcon(C[1].type))+" svelte-11df51y"))&&h(t,"class",i),(!g||O&2)&&o!==(o=C[1].name+"")&&le(r,o),(!g||O&256&&u!==(u=C[8]))&&h(e,"for",u),C[0]&&!C[1].required?b?b.p(C,O):(b=Dp(C),b.c(),b.m(d.parentNode,d)):b&&(b.d(1),b=null);const M={};O&256&&(M.id=C[8]),!m&&O&4&&(m=!0,M.value=C[2],ye(()=>m=!1)),!_&&O&1&&(_=!0,M.formattedValue=C[0],ye(()=>_=!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),V(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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function H5(n,e,t){let{field:i=new vn}=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,O,M;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,m,_;function g(D){n[3](D)}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:((O=n[1].options)==null?void 0:O.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new ou({props:b}),se.push(()=>me(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(),H(f.$$.fragment),p=E(),k&&k.c(),m=Se(),h(t,"class",i=z.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[4])},m(D,I){S(D,e,I),v(e,t),v(e,s),v(e,l),v(l,r),S(D,u,I),j(f,D,I),S(D,p,I),k&&k.m(D,I),S(D,m,I),_=!0},p(D,I){var F,R,N,q,Y;(!_||I&2&&i!==(i=z.getFieldTypeIcon(D[1].type)))&&h(t,"class",i),(!_||I&2)&&o!==(o=D[1].name+"")&&le(r,o),(!_||I&16&&a!==(a=D[4]))&&h(e,"for",a);const L={};I&16&&(L.id=D[4]),I&6&&(L.toggle=!D[1].required||D[2]),I&4&&(L.multiple=D[2]),I&7&&(L.closable=!D[2]||((F=D[0])==null?void 0:F.length)>=((R=D[1].options)==null?void 0:R.maxSelect)),I&2&&(L.items=(N=D[1].options)==null?void 0:N.values),I&2&&(L.searchable=((q=D[1].options)==null?void 0:q.values)>5),!d&&I&1&&(d=!0,L.selected=D[0],ye(()=>d=!1)),f.$set(L),((Y=D[1].options)==null?void 0:Y.maxSelect)>1?k?k.p(D,I):(k=Ep(D),k.c(),k.m(m.parentNode,m)):k&&(k.d(1),k=null)},i(D){_||(A(f.$$.fragment,D),_=!0)},o(D){P(f.$$.fragment,D),_=!1},d(D){D&&w(e),D&&w(u),V(f,D),D&&w(p),k&&k.d(D),D&&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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function W5(n,e,t){let i,{field:s=new vn}=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=z.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=z.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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function Z5(n,e,t){let{field:i=new vn}=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"),Cn(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&&!Cn(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=""),z.hasImageExtension(s==null?void 0:s.name)&&z.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"),Cn(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&&!Cn(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='<i class="ri-close-line"></i>',h(e,"type","button"),h(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=J(e,"click",ct(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 cn({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){H(e.$$.fragment)},m(s,l){j(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),V(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=z.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",Mn(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"),Cn(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&&!Cn(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(),H(t.$$.fragment)},m(a,u){o.m(a,u),S(a,e,u),j(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),V(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 he.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=z.getFileType(a)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(s)||a.endsWith(".pdf")),n.$$.dirty&1541&&t(6,p=_?"":he.files.getUrl(r,a,{token:m})),n.$$.dirty&1541&&t(5,d=_?"":he.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='<i class="ri-close-line"></i>',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='<span class="txt">Restore</span>',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"),H(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=he.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),j(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 O={};C[0]&4&&(O.record=e[2]),C[0]&16&&(O.filename=e[29]),s.$set(O),(!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=he.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),V(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"),H(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='<i class="ri-close-line"></i>',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),j(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),V(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,O,M,D,I,L=n[4];const F=Y=>Y[29]+Y[2].id;for(let Y=0;Y<L.length;Y+=1){let B=Pp(n,L,Y),Z=F(B);p.set(Z,d[Y]=Lp(Z,B))}let R=n[0],N=[];for(let Y=0;Y<R.length;Y+=1)N[Y]=Np(Ip(n,R,Y));const q=Y=>P(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<d.length;Y+=1)d[Y].c();m=E();for(let Y=0;Y<N.length;Y+=1)N[Y].c();_=E(),g=y("div"),b=y("input"),k=E(),$=y("button"),T=y("i"),C=E(),O=y("span"),O.textContent="Upload new file",h(t,"class",i=z.getFieldTypeIcon(n[3].type)),h(l,"class","txt"),h(e,"for",a=n[25]),h(b,"type","file"),h(b,"class","hidden"),b.multiple=n[5],h(T,"class","ri-upload-cloud-line"),h(O,"class","txt"),h($,"type","button"),h($,"class","btn btn-transparent btn-sm btn-block"),$.disabled=n[9],h(g,"class","list-item list-item-btn"),h(f,"class","list")},m(Y,B){S(Y,e,B),v(e,t),v(e,s),v(e,l),v(l,r),S(Y,u,B),S(Y,f,B);for(let Z=0;Z<d.length;Z+=1)d[Z]&&d[Z].m(f,null);v(f,m);for(let Z=0;Z<N.length;Z+=1)N[Z]&&N[Z].m(f,null);v(f,_),v(f,g),v(g,b),n[18](b),v(g,k),v(g,$),v($,T),v($,C),v($,O),n[21](f),M=!0,D||(I=[J(b,"change",n[19]),J($,"click",n[20])],D=!0)},p(Y,B){if((!M||B[0]&8&&i!==(i=z.getFieldTypeIcon(Y[3].type)))&&h(t,"class",i),(!M||B[0]&8)&&o!==(o=Y[3].name+"")&&le(r,o),(!M||B[0]&33554432&&a!==(a=Y[25]))&&h(e,"for",a),B[0]&3094&&(L=Y[4],re(),d=kt(d,B,F,1,Y,L,p,f,Kt,Lp,m,Pp),ae()),B[0]&4097){R=Y[0];let Z;for(Z=0;Z<R.length;Z+=1){const ee=Ip(Y,R,Z);N[Z]?(N[Z].p(ee,B),A(N[Z],1)):(N[Z]=Np(ee),N[Z].c(),A(N[Z],1),N[Z].m(f,_))}for(re(),Z=R.length;Z<N.length;Z+=1)q(Z);ae()}(!M||B[0]&32)&&(b.multiple=Y[5]),(!M||B[0]&512)&&($.disabled=Y[9])},i(Y){if(!M){for(let B=0;B<L.length;B+=1)A(d[B]);for(let B=0;B<R.length;B+=1)A(N[B]);M=!0}},o(Y){for(let B=0;B<d.length;B+=1)P(d[B]);N=N.filter(Boolean);for(let B=0;B<N.length;B+=1)P(N[B]);M=!1},d(Y){Y&&w(e),Y&&w(u),Y&&w(f);for(let B=0;B<d.length;B+=1)d[B].d();pt(N,Y),n[18](null),n[21](null),D=!1,De(I)}}}function yM(n){let e,t,i,s,l;return t=new de({props:{class:`
form-field form-field-list form-field-file
`+(n[3].required?"required":"")+`
`+(n[8]?"dragover":"")+`
`,name:n[3].name,$$slots:{default:[vM,({uniqueId:o})=>({25:o}),({uniqueId:o})=>[o?33554432:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),H(t.$$.fragment),h(e,"class","block")},m(o,r){S(o,e,r),j(t,e,null),i=!0,s||(l=[J(e,"dragover",ct(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),V(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 vn}=e,d,p,m=!1;function _(N){z.removeByValue(u,N),t(1,u)}function g(N){z.pushUnique(u,N),t(1,u)}function b(N){z.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),O=N=>b(N);function M(N){se[N?"unshift":"push"](()=>{d=N,t(6,d)})}const D=()=>{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=z.toArray(a))),n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=z.toArray(u))),n.$$.dirty[0]&8&&t(5,i=((N=f.options)==null?void 0:N.maxSelect)>1),n.$$.dirty[0]&16416&&z.isEmpty(r)&&t(14,r=i?[]:""),n.$$.dirty[0]&16384&&t(4,s=z.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,O,M,D,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=Ct(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",ct(n[9])),J(e,"dragleave",ct(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)&&Ot(o,l,r,r[7],t?Mt(l,r[7],a,$M):Dt(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=wt();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?(r.splice(T+1,0,r[C]),r.splice(C,1)):(r.splice(T,0,r[C]),r.splice(C+1,1)),t(5,r),l("sort",r)}const m=()=>{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=z.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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function Hp(n){let e=!z.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=!z.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;o<i.length;o+=1)s[o]=Hp(jp(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Se()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&3){i=o[7];let a;for(a=0;a<i.length;a+=1){const u=jp(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Hp(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){pt(s,o),o&&w(e)}}}function OM(n){let e,t,i,s,l,o,r=z.truncate(z.displayValue(n[0],n[2]),70)+"",a,u,f,d,p=n[1],m=[];for(let g=0;g<p.length;g+=1)m[g]=zp(qp(n,p,g));const _=g=>P(m[g],1,1,()=>{m[g]=null});return{c(){e=y("div"),t=y("i"),s=E();for(let g=0;g<m.length;g+=1)m[g].c();l=E(),o=y("span"),a=U(r),h(t,"class","link-hint txt-sm ri-information-line svelte-fhw3qk"),h(o,"class","txt txt-ellipsis svelte-fhw3qk"),h(e,"class","record-info svelte-fhw3qk")},m(g,b){S(g,e,b),v(e,t),v(e,s);for(let k=0;k<m.length;k+=1)m[k]&&m[k].m(e,null);v(e,l),v(e,o),v(o,a),u=!0,f||(d=Ee(i=Ue.call(null,t,{text:z.truncate(JSON.stringify(z.truncateObject(n[0]),null,2),800,!0),class:"code",position:"left"})),f=!0)},p(g,[b]){if(i&&zt(i.update)&&b&1&&i.update.call(null,{text:z.truncate(JSON.stringify(z.truncateObject(g[0]),null,2),800,!0),class:"code",position:"left"}),b&3){p=g[1];let k;for(k=0;k<p.length;k+=1){const $=qp(g,p,k);m[k]?(m[k].p($,b),A(m[k],1)):(m[k]=zp($),m[k].c(),A(m[k],1),m[k].m(e,l))}for(re(),k=p.length;k<m.length;k+=1)_(k);ae()}(!u||b&5)&&r!==(r=z.truncate(z.displayValue(g[0],g[2]),70)+"")&&le(a,r)},i(g){if(!u){for(let b=0;b<p.length;b+=1)A(m[b]);u=!0}},o(g){m=m.filter(Boolean);for(let b=0;b<m.length;b+=1)P(m[b]);u=!1},d(g){g&&w(e),pt(m,g),f=!1,d()}}}function DM(n,e,t){let i,s,l,o;Ke(n,ii,u=>t(5,o=u));let{record:r}=e,{displayFields:a=[]}=e;return n.$$set=u=>{"record"in u&&t(0,r=u.record),"displayFields"in u&&t(3,a=u.displayFields)},n.$$.update=()=>{n.$$.dirty&33&&t(4,i=o==null?void 0:o.find(u=>u.id==(r==null?void 0:r.collectionId))),n.$$.dirty&24&&t(1,s=(a==null?void 0:a.filter(u=>{var f;return!!((f=i==null?void 0:i.schema)!=null&&f.find(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='<div class="txt">New record</div>',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='<span class="loader loader-sm active"></span>',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='<span class="txt">Clear filters</span>',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='<i class="ri-pencil-line"></i>',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",Mn(n[27])),J(t,"click",Mn(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"),H(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),j(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 O;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),(O=e[10])!=null&&O.$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(),V(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;o<i.length;o+=1)s[o]=Xp(Bp(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){e=y("div");for(let o=0;o<s.length;o+=1)s[o].c();h(e,"class","selected-list svelte-1u8jhky")},m(o,r){S(o,e,r);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(e,null);t=!0},p(o,r){if(r[0]&73792|r[1]&6291456){i=o[6];let a;for(a=0;a<i.length;a+=1){const u=Bp(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Xp(u),s[a].c(),A(s[a],1),s[a].m(e,null))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){o&&w(e),pt(s,o)}}}function FM(n){let e,t,i,s,l,o,r,a;t=new er({props:{record:n[49],displayFields:n[13]}});function u(){return n[37](n[49])}return{c(){e=y("span"),H(t.$$.fragment),i=E(),s=y("button"),s.innerHTML='<i class="ri-close-line"></i>',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),j(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),V(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(()=>me(e,"list",s)),{c(){H(e.$$.fragment)},m(o,r){j(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],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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 O=N=>N[49].id;for(let N=0;N<C.length;N+=1){let q=Up(n,C,N),Y=O(q);r.set(Y,o[N]=Zp(Y,q))}let M=null;C.length||(M=Yp(n));let D=n[5]>1&&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"),H(t.$$.fragment),i=E(),T&&T.c(),s=E(),l=y("div");for(let N=0;N<o.length;N+=1)o[N].c();M&&M.c(),u=E(),f=y("h5"),d=U(`Selected
`),D&&D.c(),p=E(),_.c(),g=Se(),h(e,"class","flex m-b-base flex-gap-10"),h(l,"class","list picker-list m-b-base svelte-1u8jhky"),h(f,"class","section-title")},m(N,q){S(N,e,q),j(t,e,null),v(e,i),T&&T.m(e,null),S(N,s,q),S(N,l,q);for(let Y=0;Y<o.length;Y+=1)o[Y]&&o[Y].m(l,null);M&&M.m(l,null),S(N,u,q),S(N,f,q),v(f,d),D&&D.m(f,null),S(N,p,q),L[m].m(N,q),S(N,g,q),b=!0,k||($=Ee(a=SM.call(null,l,n[36])),k=!0)},p(N,q){var Z;const Y={};q[0]&4&&(Y.value=N[2]),q[0]&1024&&(Y.autocompleteCollection=N[10]),t.$set(Y),(Z=N[10])!=null&&Z.$isView?T&&(T.d(1),T=null):T?T.p(N,q):(T=Wp(N),T.c(),T.m(e,null)),q[0]&145324&&(C=N[3],re(),o=kt(o,q,O,1,N,C,r,l,Kt,Zp,null,Up),ae(),!C.length&&M?M.p(N,q):C.length?M&&(M.d(1),M=null):(M=Yp(N),M.c(),M.m(l,null))),a&&zt(a.update)&&q[0]&2064&&a.update.call(null,N[36]),N[5]>1?D?D.p(N,q):(D=Gp(N),D.c(),D.m(f,null)):D&&(D.d(1),D=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;q<C.length;q+=1)A(o[q]);A(_),b=!0}},o(N){P(t.$$.fragment,N);for(let q=0;q<o.length;q+=1)P(o[q]);P(_),b=!1},d(N){N&&w(e),V(t),T&&T.d(),N&&w(s),N&&w(l);for(let q=0;q<o.length;q+=1)o[q].d();M&&M.d(),N&&w(u),N&&w(f),D&&D.d(),N&&w(p),L[m].d(N),N&&w(g),k=!1,$()}}}function qM(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=y("h4"),t=U("Select "),i=y("strong"),l=U(s),o=U(" records")},m(a,u){S(a,e,u),v(e,t),v(e,i),v(i,l),v(e,o)},p(a,u){var f;u[0]&1024&&s!==(s=(((f=a[10])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function jM(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=y("button"),i.innerHTML='<span class="txt">Save selection</span>',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;a<l.length;a+=1)o=qe(o,l[a]);e=new cn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new rb({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),s=!0},p(a,u){const f=u[0]&524288?$t(l,[l[0],l[1],Wt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const d={};u[0]&1024&&(d.collection=a[10]),i.$set(d)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[39](null),V(e,a),a&&w(t),n[42](null),V(i,a)}}}const Lr=100;function HM(n,e,t){let i,s,l,o,r,a,u,f;const d=["value","field","show","hide"];let p=Ge(e,d),m;Ke(n,ii,Ne=>t(26,m=Ne));const _=wt(),g="picker_"+z.randomString(5);let{value:b}=e,{field:k}=e,$,T,C="",O=[],M=[],D=1,I=0,L=!1,F=!1;function R(){return t(2,C=""),t(3,O=[]),t(6,M=[]),q(),Y(!0),$==null?void 0:$.show()}function N(){return $==null?void 0:$.hide()}async function q(){const Ne=z.toArray(b);if(!s||!Ne.length)return;t(24,F=!0);let $e=[];const Xe=Ne.slice(),ke=[];for(;Xe.length>0;){const Pe=[];for(const nt of Xe.splice(0,Lr))Pe.push(`id="${nt}"`);ke.push(he.collection(s).getFullList(Lr,{filter:Pe.join("||"),$autoCancel:!1}))}try{await Promise.all(ke).then(Pe=>{$e=$e.concat(...Pe)}),t(6,M=[]);for(const Pe of Ne){const nt=z.findByKey($e,"id",Pe);nt&&M.push(nt)}C.trim()||t(3,O=z.filterDuplicatesByKey(M.concat(O)))}catch(Pe){he.errorResponseHandler(Pe)}t(24,F=!1)}async function Y(Ne=!1){if(s){t(4,L=!0),Ne&&(C.trim()?t(3,O=[]):t(3,O=z.toArray(M).slice()));try{const $e=Ne?1:D+1,Xe=await he.collection(s).getList($e,Lr,{filter:C,sort:o!=null&&o.$isView?"":"-created",$cancelKey:g+"loadList"});t(3,O=z.filterDuplicatesByKey(O.concat(Xe.items))),D=Xe.page,t(23,I=Xe.totalItems)}catch($e){he.errorResponseHandler($e)}t(4,L=!1)}}function B(Ne){i==1?t(6,M=[Ne]):u&&(z.pushOrReplaceByKey(M,Ne),t(6,M))}function Z(Ne){z.removeByKey(M,"id",Ne.id),t(6,M)}function ee(Ne){f(Ne)?Z(Ne):B(Ne)}function ie(){var Ne;i!=1?t(20,b=M.map($e=>$e.id)):t(20,b=((Ne=M==null?void 0:M[0])==null?void 0:Ne.id)||""),_("save",M),N()}function X(Ne){pe.call(this,n,Ne)}const fe=()=>N(),G=()=>ie(),ce=Ne=>t(2,C=Ne.detail),ge=()=>T==null?void 0:T.show(),Me=Ne=>T==null?void 0:T.show(Ne),je=Ne=>ee(Ne),He=(Ne,$e)=>{($e.code==="Enter"||$e.code==="Space")&&($e.preventDefault(),$e.stopPropagation(),ee(Ne))},we=()=>t(2,C=""),Ce=()=>{a&&!L&&Y()},Je=Ne=>Z(Ne);function ht(Ne){M=Ne,t(6,M)}function Ze(Ne){se[Ne?"unshift":"push"](()=>{$=Ne,t(1,$)})}function We(Ne){pe.call(this,n,Ne)}function te(Ne){pe.call(this,n,Ne)}function Re(Ne){se[Ne?"unshift":"push"](()=>{T=Ne,t(7,T)})}const Qe=Ne=>{z.removeByKey(O,"id",Ne.detail.id),O.unshift(Ne.detail),t(3,O),B(Ne.detail)},Jt=Ne=>{z.removeByKey(O,"id",Ne.detail.id),t(3,O),Z(Ne.detail)};return n.$$set=Ne=>{e=qe(qe({},e),Ut(Ne)),t(19,p=Ge(e,d)),"value"in Ne&&t(20,b=Ne.value),"field"in Ne&&t(21,k=Ne.field)},n.$$.update=()=>{var Ne,$e,Xe;n.$$.dirty[0]&2097152&&t(5,i=((Ne=k==null?void 0:k.options)==null?void 0:Ne.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=(Xe=k==null?void 0:k.options)==null?void 0:Xe.displayFields),n.$$.dirty[0]&100663296&&t(10,o=m.find(ke=>ke.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>O.length),n.$$.dirty[0]&96&&t(9,u=i===null||i>M.length),n.$$.dirty[0]&64&&t(8,f=function(ke){return z.findByKey(M,"id",ke.id)})},[N,$,C,O,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,je,He,we,Ce,Je,ht,Ze,We,te,Re,Qe,Jt]}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=z.toArray(n[0]).slice(0,10),i=[];for(let s=0;s<t.length;s+=1)i[s]=nm(xp(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&1){t=z.toArray(s[0]).slice(0,10);let o;for(o=0;o<t.length;o+=1){const r=xp(s,t,o);i[o]?i[o].p(r,l):(i[o]=nm(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){pt(i,s),s&&w(e)}}}function nm(n){let e;return{c(){e=y("div"),e.innerHTML=`<div class="skeleton-loader"></div>
`,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"),H(i.$$.fragment),s=E(),l=y("div"),o=y("button"),o.innerHTML='<i class="ri-close-line"></i>',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),j(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),V(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 O=null;return $.length||(O=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<T.length;M+=1)T[M].c();O&&O.c(),p=E(),m=y("div"),_=y("button"),_.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,h(t,"class",i=Oi(z.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,D){S(M,e,D),v(e,t),v(e,s),v(e,l),v(l,r),S(M,u,D),S(M,f,D),v(f,d);for(let I=0;I<T.length;I+=1)T[I]&&T[I].m(d,null);O&&O.m(d,null),v(f,p),v(f,m),v(m,_),g=!0,b||(k=J(_,"click",n[9]),b=!0)},p(M,D){if((!g||D&4&&i!==(i=Oi(z.getFieldTypeIcon(M[2].type))+" svelte-1ynw0pc"))&&h(t,"class",i),(!g||D&4)&&o!==(o=M[2].name+"")&&le(r,o),(!g||D&16384&&a!==(a=M[14]))&&h(e,"for",a),D&181){$=M[4];let I;for(I=0;I<$.length;I+=1){const L=Qp(M,$,I);T[I]?(T[I].p(L,D),A(T[I],1)):(T[I]=im(L),T[I].c(),A(T[I],1),T[I].m(d,null))}for(re(),I=$.length;I<T.length;I+=1)C(I);ae(),!$.length&&O?O.p(M,D):$.length?O&&(O.d(1),O=null):(O=em(M),O.c(),O.m(d,null))}},i(M){if(!g){for(let D=0;D<$.length;D+=1)A(T[D]);g=!0}},o(M){T=T.filter(Boolean);for(let D=0;D<T.length;D+=1)P(T[D]);g=!1},d(M){M&&w(e),M&&w(u),M&&w(f),pt(T,M),O&&O.d(),b=!1,k()}}}function UM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[BM,({uniqueId:r})=>({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(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(r,a){j(e,r,a),S(r,t,a),j(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),V(e,r),r&&w(t),n[11](null),V(i,r)}}}const sm=100;function WM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new vn}=e,r,a=[],u=!1;f();async function f(){var C,O;const k=z.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 D of $.splice(0,sm))M.push(`id="${D}"`);T.push(he.collection((O=o==null?void 0:o.options)==null?void 0:O.collectionId).getFullList(sm,{filter:M.join("||"),$autoCancel:!1}))}try{let M=[];await Promise.all(T).then(D=>{M=M.concat(...D)});for(const D of k){const I=z.findByKey(M,"id",D);I&&a.push(I)}t(4,a)}catch(M){he.errorResponseHandler(M)}t(5,u=!1)}function d(k){var $;z.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=wt(),O=()=>{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),O().init(F)};Xt(()=>{if(O()!==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=O())===null||F===void 0||F.remove(k))});function D(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,D,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:z.defaultEditorOptions()};return n[0]!==void 0&&(_.value=n[0]),f=new uu({props:_}),se.push(()=>me(f,"value",m)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),H(f.$$.fragment),h(t,"class",i=z.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),j(f,g,b),p=!0},p(g,b){(!p||b&2&&i!==(i=z.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],ye(()=>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),V(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(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function iO(n,e,t){let{field:i=new vn}=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(),H(i.$$.fragment),s=E(),H(l.$$.fragment),o=E(),H(r.$$.fragment),h(e,"class","section-title")},m(u,f){S(u,e,f),S(u,t,f),j(i,u,f),S(u,s,f),j(l,u,f),S(u,o,f),j(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),V(i,u),u&&w(s),V(l,u),u&&w(o),V(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(),H(i.$$.fragment),s=E(),H(l.$$.fragment),h(e,"class","section-title")},m(r,a){S(r,e,a),S(r,t,a),j(i,r,a),S(r,s,a),j(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),V(i,r),r&&w(s),V(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(),H(i.$$.fragment),s=E(),H(l.$$.fragment),o=E(),H(r.$$.fragment),h(e,"class","section-title")},m(u,f){S(u,e,f),S(u,t,f),j(i,u,f),S(u,s,f),j(l,u,f),S(u,o,f),j(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),V(i,u),u&&w(s),V(l,u),u&&w(o),V(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-----
...
-----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"),H(s.$$.fragment),l=E(),o=y("div"),H(r.$$.fragment),a=E(),u=y("div"),H(f.$$.fragment),d=E(),p=y("div"),H(m.$$.fragment),_=E(),H(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),j(s,i,null),v(t,l),v(t,o),j(r,o,null),v(t,a),v(t,u),j(f,u,null),v(t,d),v(t,p),j(m,p,null),v(t,_),j(g,t,null),b=!0,k||($=J(e,"submit",ct(n[17])),k=!0)},p(T,C){const O={};C&25165828&&(O.$$scope={dirty:C,ctx:T}),s.$set(O);const M={};C&25165832&&(M.$$scope={dirty:C,ctx:T}),r.$set(M);const D={};C&25165840&&(D.$$scope={dirty:C,ctx:T}),f.$set(D);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),V(s),V(r),V(f),V(m),V(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 cn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(s,l){j(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),V(e,s)}}}const mo=15777e3;function DO(n,e,t){let i;const s=wt(),l="apple_secret_"+z.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),fn({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function g(){t(7,p=!0);try{const F=await he.settings.generateAppleClientSecret(r,a,u,f.trim(),d);t(7,p=!1),Yt("Successfully generated client secret."),s("submit",F),o==null||o.hide()}catch(F){he.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 O=()=>g(),M=()=>!p;function D(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,O,M,D,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(),H(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),j(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),V(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 ul=[{key:"appleAuth",title:"Apple",logo:"/images/oauth2/apple.svg",optionsComponent:PO},{key:"googleAuth",title:"Google",logo:"/images/oauth2/google.svg"},{key:"facebookAuth",title:"Facebook",logo:"/images/oauth2/facebook.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"/images/oauth2/microsoft.svg",optionsComponent:mO},{key:"githubAuth",title:"GitHub",logo:"/images/oauth2/github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"/images/oauth2/gitlab.svg",optionsComponent:lm},{key:"giteeAuth",title:"Gitee",logo:"/images/oauth2/gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"/images/oauth2/gitea.svg",optionsComponent:lm},{key:"discordAuth",title:"Discord",logo:"/images/oauth2/discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"/images/oauth2/twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"/images/oauth2/kakao.svg"},{key:"spotifyAuth",title:"Spotify",logo:"/images/oauth2/spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"/images/oauth2/twitch.svg"},{key:"stravaAuth",title:"Strava",logo:"/images/oauth2/strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"/images/oauth2/livechat.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"/images/oauth2/oidc.svg",optionsComponent:Nr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"/images/oauth2/oidc.svg",optionsComponent:Nr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"/images/oauth2/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<t.length;s+=1)i[s]=rm(om(n,t,s));return{c(){e=y("div");for(let s=0;s<i.length;s+=1)i[s].c();h(e,"class","list")},m(s,l){S(s,e,l);for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(e,null)},p(s,l){if(l&58){t=s[1];let o;for(o=0;o<t.length;o+=1){const r=om(s,t,o);i[o]?i[o].p(r,l):(i[o]=rm(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){s&&w(e),pt(i,s)}}}function FO(n){let e;return{c(){e=y("div"),e.innerHTML='<span class="loader"></span>',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='<i class="ri-close-line"></i>',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=wt();let{record:s}=e,l=[],o=!1;function r(p){var m;return((m=ul[p+"Auth"])==null?void 0:m.title)||z.sentenize(p,!1)}function a(p){var m;return((m=ul[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 he.collection(s.collectionId).listExternalAuths(s.id))}catch(p){he.errorResponseHandler(p)}t(2,o=!1)}function f(p){!(s!=null&&s.id)||!p||_n(`Do you really want to unlink the ${r(p)} provider?`,()=>he.collection(s.collectionId).unlinkExternalAuth(s.id,p).then(()=>{Yt(`Successfully unlinked the ${r(p)} provider.`),i("unlink",p),u()}).catch(m=>{he.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[53]=e[t],i[54]=e,i[55]=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&&zt(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",z.getFieldTypeIcon("primary")),h(s,"class","txt"),h(o,"class","flex-fill"),h(e,"for",r=n[56]),h(f,"type","text"),h(f,"id",d=n[56]),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[30]),m=!0)},p(b,k){k[1]&33554432&&r!==(r=b[56])&&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]&33554432&&d!==(d=b[56])&&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[31](d)}let r={collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new h5({props:r}),se.push(()=>me(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&cm();return{c(){H(e.$$.fragment),i=E(),a&&a.c(),s=Se()},m(d,p){j(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],ye(()=>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){V(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[44](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new YM({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function zO(n){let e,t,i,s,l;function o(f){n[41](f,n[53])}function r(f){n[42](f,n[53])}function a(f){n[43](f,n[53])}let u={field:n[53],record:n[3]};return n[3][n[53].name]!==void 0&&(u.value=n[3][n[53].name]),n[4][n[53].name]!==void 0&&(u.uploadedFiles=n[4][n[53].name]),n[5][n[53].name]!==void 0&&(u.deletedFileIndexes=n[5][n[53].name]),e=new wM({props:u}),se.push(()=>me(e,"value",o)),se.push(()=>me(e,"uploadedFiles",r)),se.push(()=>me(e,"deletedFileIndexes",a)),{c(){H(e.$$.fragment)},m(f,d){j(e,f,d),l=!0},p(f,d){n=f;const p={};d[0]&1&&(p.field=n[53]),d[0]&8&&(p.record=n[3]),!t&&d[0]&9&&(t=!0,p.value=n[3][n[53].name],ye(()=>t=!1)),!i&&d[0]&17&&(i=!0,p.uploadedFiles=n[4][n[53].name],ye(()=>i=!1)),!s&&d[0]&33&&(s=!0,p.deletedFileIndexes=n[5][n[53].name],ye(()=>s=!1)),e.$set(p)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function BO(n){let e,t,i;function s(o){n[40](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new G5({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function UO(n){let e,t,i;function s(o){n[39](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new Y5({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function WO(n){let e,t,i;function s(o){n[38](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new z5({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function YO(n){let e,t,i;function s(o){n[37](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new sO({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function KO(n){let e,t,i;function s(o){n[36](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new q5({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function JO(n){let e,t,i;function s(o){n[35](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new L5({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function ZO(n){let e,t,i;function s(o){n[34](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new E5({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function GO(n){let e,t,i;function s(o){n[33](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new C5({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function XO(n){let e,t,i;function s(o){n[32](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new w5({props:l}),se.push(()=>me(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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[53].type==="text"?0:f[53].type==="number"?1:f[53].type==="bool"?2:f[53].type==="email"?3:f[53].type==="url"?4:f[53].type==="editor"?5:f[53].type==="date"?6:f[53].type==="select"?7:f[53].type==="json"?8:f[53].type==="file"?9:f[53].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"),H(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[11]===wl)},m(s,l){S(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&2048)&&x(e,"active",s[11]===wl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),V(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 readonly",name:"id",$$slots:{default:[VO,({uniqueId:$})=>({56:$}),({uniqueId:$})=>[0,$?33554432: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 _=$=>$[53].name;for(let $=0;$<m.length;$+=1){let T=am(n,m,$),C=_(T);r.set(C,o[$]=dm(C,T))}let g=n[0].$isAuth&&!n[6]&&pm(n);return{c(){e=y("div"),t=y("form"),H(i.$$.fragment),s=E(),p&&p.c(),l=E();for(let $=0;$<o.length;$+=1)o[$].c();a=E(),g&&g.c(),h(t,"id",n[14]),h(t,"class","tab-item"),x(t,"active",n[11]===es),h(e,"class","tabs-content")},m($,T){S($,e,T),v(e,t),j(i,t,null),v(t,s),p&&p.m(t,null),v(t,l);for(let C=0;C<o.length;C+=1)o[C]&&o[C].m(t,null);v(e,a),g&&g.m(e,null),u=!0,f||(d=J(t,"submit",ct(n[15])),f=!0)},p($,T){var O,M;const C={};T[0]&72|T[1]&100663296&&(C.$$scope={dirty:T,ctx:$}),i.$set(C),(O=$[0])!=null&&O.isAuth?p?(p.p($,T),T[0]&1&&A(p,1)):(p=fm($),p.c(),A(p,1),p.m(t,l)):p&&(re(),P(p,1,1,()=>{p=null}),ae()),T[0]&57&&(m=((M=$[0])==null?void 0:M.schema)||[],re(),o=kt(o,T,_,1,$,m,r,t,Kt,dm,null,am),ae()),(!u||T[0]&2048)&&x(t,"active",$[11]===es),$[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<m.length;T+=1)A(o[T]);A(g),u=!0}},o($){P(i.$$.fragment,$),P(p);for(let T=0;T<o.length;T+=1)P(o[T]);P(g),u=!1},d($){$&&w(e),V(i),p&&p.d();for(let T=0;T<o.length;T+=1)o[T].d();g&&g.d(),f=!1,d()}}}function mm(n){let e,t,i,s,l,o,r;return o=new Hn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[xO]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=E(),i=y("button"),s=y("i"),l=E(),H(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),j(o,i,null),r=!0},p(a,u){const f={};u[0]&5|u[1]&67108864&&(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),V(o)}}}function hm(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send verification email</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[24]),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=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,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 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=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=E(),l=y("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,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[26]),J(l,"click",Mn(ct(n[27])))],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[11]===es),h(s,"type","button"),h(s,"class","tab-item"),x(s,"active",n[11]===wl),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[28]),J(s,"click",n[29])],l=!0)},p(r,a){a[0]&2048&&x(t,"active",r[11]===es),a[0]&2048&&x(s,"active",r[11]===wl)},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[9],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[14]),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[23]),u=!0)},p(d,p){p[0]&512&&(e.disabled=d[9]),p[0]&64&&o!==(o=d[6]?"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,f()}}}function nD(n){var s;let e,t,i={class:`
record-panel
`+(n[13]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[6]?"colored-header":"")+`
`,beforeHide:n[45],$$slots:{footer:[tD],header:[eD],default:[QO]},$$scope:{ctx:n}};return e=new cn({props:i}),n[46](e),e.$on("hide",n[47]),e.$on("show",n[48]),{c(){H(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&8257&&(r.class=`
record-panel
`+(l[13]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[6]?"colored-header":"")+`
`),o[0]&1152&&(r.beforeHide=l[45]),o[0]&6781|o[1]&67108864&&(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[46](null),V(e,l)}}}const es="form",wl="providers";function bm(n){return JSON.stringify(n)}function iD(n,e,t){let i,s,l,o;const r=wt(),a="record_"+z.randomString(5);let{collection:u}=e,f,d=null,p=new di,m=!1,_=!1,g={},b={},k="",$=es,T=!0;function C(ke){return M(ke),t(10,_=!0),t(11,$=es),f==null?void 0:f.show()}function O(){return f==null?void 0:f.hide()}async function M(ke){fn({}),t(2,d=ke||new di),ke!=null&&ke.$clone?t(3,p=ke.$clone()):t(3,p=new di),t(4,g={}),t(5,b={}),await un(),t(21,k=bm(p))}function D(){if(m||!o||!(u!=null&&u.id))return;t(9,m=!0);const ke=L();let Pe;T?Pe=he.collection(u.id).create(ke):Pe=he.collection(u.id).update(p.id,ke),Pe.then(nt=>{Yt(T?"Successfully created record.":"Successfully updated record."),t(10,_=!1),O(),r("save",nt)}).catch(nt=>{he.errorResponseHandler(nt)}).finally(()=>{t(9,m=!1)})}function I(){d!=null&&d.id&&_n("Do you really want to delete the selected record?",()=>he.collection(d.collectionId).delete(d.id).then(()=>{O(),Yt("Successfully deleted record."),r("delete",d)}).catch(ke=>{he.errorResponseHandler(ke)}))}function L(){const ke=(p==null?void 0:p.$export())||{},Pe=new FormData,nt={id:ke.id};for(const vt of(u==null?void 0:u.schema)||[])nt[vt.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const vt in ke)nt[vt]&&(typeof ke[vt]>"u"&&(ke[vt]=null),z.addValueToFormData(Pe,vt,ke[vt]));for(const vt in g){const En=z.toArray(g[vt]);for(const rt of En)Pe.append(vt,rt)}for(const vt in b){const En=z.toArray(b[vt]);for(const rt of En)Pe.append(vt+"."+rt,"")}return Pe}function F(){!(u!=null&&u.id)||!(d!=null&&d.email)||_n(`Do you really want to sent verification email to ${d.email}?`,()=>he.collection(u.id).requestVerification(d.email).then(()=>{Yt(`Successfully sent verification email to ${d.email}.`)}).catch(ke=>{he.errorResponseHandler(ke)}))}function R(){!(u!=null&&u.id)||!(d!=null&&d.email)||_n(`Do you really want to sent password reset email to ${d.email}?`,()=>he.collection(u.id).requestPasswordReset(d.email).then(()=>{Yt(`Successfully sent password reset email to ${d.email}.`)}).catch(ke=>{he.errorResponseHandler(ke)}))}function N(){l?_n("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ke=d==null?void 0:d.$clone();if(ke){ke.id="",ke.created="",ke.updated="";const Pe=(u==null?void 0:u.schema)||[];for(const nt of Pe)nt.type==="file"&&delete ke[nt.name]}C(ke),await un(),t(21,k="")}const Y=()=>O(),B=()=>F(),Z=()=>R(),ee=()=>N(),ie=()=>I(),X=()=>t(11,$=es),fe=()=>t(11,$=wl);function G(){p.id=this.value,t(3,p)}function ce(ke){p=ke,t(3,p)}function ge(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function Me(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function je(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function He(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function we(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function Ce(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function Je(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function ht(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function Ze(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function We(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}function te(ke,Pe){n.$$.not_equal(g[Pe.name],ke)&&(g[Pe.name]=ke,t(4,g))}function Re(ke,Pe){n.$$.not_equal(b[Pe.name],ke)&&(b[Pe.name]=ke,t(5,b))}function Qe(ke,Pe){n.$$.not_equal(p[Pe.name],ke)&&(p[Pe.name]=ke,t(3,p))}const Jt=()=>l&&_?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),O()}),!1):(fn({}),!0);function Ne(ke){se[ke?"unshift":"push"](()=>{f=ke,t(8,f)})}function $e(ke){pe.call(this,n,ke)}function Xe(ke){pe.call(this,n,ke)}return n.$$set=ke=>{"collection"in ke&&t(0,u=ke.collection)},n.$$.update=()=>{var ke;n.$$.dirty[0]&1&&t(13,i=!!((ke=u==null?void 0:u.schema)!=null&&ke.find(Pe=>Pe.type==="editor"))),n.$$.dirty[0]&48&&t(22,s=z.hasNonEmptyProps(g)||z.hasNonEmptyProps(b)),n.$$.dirty[0]&6291464&&t(7,l=s||k!=bm(p)),n.$$.dirty[0]&4&&t(6,T=!d||d.isNew),n.$$.dirty[0]&192&&t(12,o=T||l)},[u,O,d,p,g,b,T,l,f,m,_,$,o,i,a,D,I,F,R,N,C,k,s,Y,B,Z,ee,ie,X,fe,G,ce,ge,Me,je,He,we,Ce,Je,ht,Ze,We,te,Re,Qe,Jt,Ne,$e,Xe]}class rb extends ve{constructor(e){super(),be(this,e,iD,nD,_e,{collection:0,show:20,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[20]}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",Mn(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&h(e,"class",t),i&&zt(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&&(z.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=z.toArray(e[3]);e[9]=t;const i=z.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=z.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=z.truncate(n[3])+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=z.truncate(n[3]))},m(l,o){S(l,e,o),v(e,i)},p(l,o){o&8&&t!==(t=z.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=z.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=z.toArray(n[3]);const o=r=>r[8]+r[16];for(let r=0;r<l.length;r+=1){let a=vm(n,l,r),u=o(a);i.set(u,t[r]=Sm(u,a))}return{c(){e=y("div");for(let r=0;r<t.length;r+=1)t[r].c();h(e,"class","inline-flex")},m(r,a){S(r,e,a);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(e,null);s=!0},p(r,a){a&9&&(l=z.toArray(r[3]),re(),t=kt(t,a,o,1,r,l,i,e,Kt,Sm,null,vm),ae())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&w(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function cD(n){let e,t,i,s,l;const o=[kD,yD],r=[];function a(f,d){return f[10].length?0:1}t=a(n),i=r[t]=o[t](n);let u=n[9].length>n[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=z.toArray(n[3]);const l=o=>o[8]+o[6];for(let o=0;o<s.length;o+=1){let r=wm(n,s,o),a=l(r);i.set(a,t[o]=Mm(a,r))}return{c(){e=y("div");for(let o=0;o<t.length;o+=1)t[o].c();h(e,"class","inline-flex")},m(o,r){S(o,e,r);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null)},p(o,r){r&8&&(s=z.toArray(o[3]),t=kt(t,r,l,1,o,s,i,e,is,Mm,null,wm))},i:Q,o:Q,d(o){o&&w(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function pD(n){let e,t;return e=new mi({props:{date:n[3]}}),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.date=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function mD(n){let e,t,i,s;const l=[SD,wD],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 hD(n){let e,t=z.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",Mn(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=z.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(),H(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),j(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),V(i,l)}}}function yD(n){let e,t=n[9].slice(0,n[11]),i=[];for(let s=0;s<t.length;s+=1)i[s]=$m(ym(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&12){t=s[9].slice(0,s[11]);let o;for(o=0;o<t.length;o+=1){const r=ym(s,t,o);i[o]?i[o].p(r,l):(i[o]=$m(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:Q,o:Q,d(s){pt(i,s),s&&w(e)}}}function kD(n){let e=[],t=new Map,i,s,l=n[10].slice(0,n[11]);const o=r=>r[8]+r[6];for(let r=0;r<l.length;r+=1){let a=km(n,l,r),u=o(a);t.set(u,e[r]=Tm(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=Se()},m(r,a){for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(r,a);S(r,i,a),s=!0},p(r,a){a&7&&(l=r[10].slice(0,r[11]),re(),e=kt(e,a,o,1,r,l,t,i.parentNode,Kt,Tm,i,km),ae())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)P(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&w(i)}}}function $m(n){let e,t=n[13]+"",i;return{c(){e=y("span"),i=U(t),h(e,"class","label")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&12&&t!==(t=s[13]+"")&&le(i,t)},d(s){s&&w(e)}}}function Tm(n,e){var o;let t,i,s,l;return i=new er({props:{record:e[6],displayFields:(o=e[1].options)==null?void 0:o.displayFields}}),{key:n,first:null,c(){t=y("span"),H(i.$$.fragment),s=E(),h(t,"class","label"),this.first=t},m(r,a){S(r,t,a),j(i,t,null),v(t,s),l=!0},p(r,a){var f;e=r;const u={};a&7&&(u.record=e[6]),a&2&&(u.displayFields=(f=e[1].options)==null?void 0:f.displayFields),i.$set(u)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){P(i.$$.fragment,r),l=!1},d(r){r&&w(t),V(i)}}}function Cm(n){let e;return{c(){e=U("...")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Mm(n,e){let t,i=e[6]+"",s;return{key:n,first:null,c(){t=y("span"),s=U(i),h(t,"class","label"),this.first=t},m(l,o){S(l,t,o),v(t,s)},p(l,o){e=l,o&8&&i!==(i=e[6]+"")&&le(s,i)},d(l){l&&w(t)}}}function wD(n){let e,t;return e=new uu({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",cssClass:"tinymce-preview",conf:{branding:!1,promotion:!1,menubar:!1,min_height:30,statusbar:!1,height:59,max_height:500,autoresize_bottom_margin:5,resize:!1,skin:"pocketbase",content_style:"body { font-size: 14px }",toolbar:"",plugins:["autoresize"]},value:n[3],disabled:!0}}),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function SD(n){let e,t=z.truncate(z.plainText(n[3]),250)+"",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=z.truncate(z.plainText(s[3]),250)+"")&&le(i,t)},i:Q,o:Q,d(s){s&&w(e)}}}function $D(n){let e,t=z.truncate(n[5],500,!0)+"",i,s,l,o,r=n[5].length>500&&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=z.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=z.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=z.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(){H(e.$$.fragment)},m(i,s){j(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){V(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=!!z.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"),H(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),j(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),V(r)}}}function Am(n){let e,t,i,s,l,o;return l=new mi({props:{date:n[3].created}}),{c(){e=y("tr"),t=y("td"),t.textContent="created",i=E(),s=y("td"),H(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),j(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),V(l)}}}function Im(n){let e,t,i,s,l,o;return l=new mi({props:{date:n[3].updated}}),{c(){e=y("tr"),t=y("td"),t.textContent="updated",i=E(),s=y("td"),H(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),j(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),V(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 D=0;D<k.length;D+=1)$[D]=Em(Dm(n,k,D));const T=D=>P($[D],1,1,()=>{$[D]=null});let C=n[3].created&&Am(n),O=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"),H(a.$$.fragment),u=E(),f=y("span"),p=U(d),m=E();for(let D=0;D<$.length;D+=1)$[D].c();_=E(),C&&C.c(),g=E(),O&&O.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(D,I){S(D,e,I),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(o,r),j(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),O&&O.m(t,null),b=!0},p(D,I){var F;const L={};if(I&8&&(L.value=D[3].id),a.$set(L),(!b||I&8)&&d!==(d=D[3].id+"")&&le(p,d),I&9){k=(F=D[0])==null?void 0:F.schema;let R;for(R=0;R<k.length;R+=1){const N=Dm(D,k,R);$[R]?($[R].p(N,I),A($[R],1)):($[R]=Em(N),$[R].c(),A($[R],1),$[R].m(t,_))}for(re(),R=k.length;R<$.length;R+=1)T(R);ae()}D[3].created?C?(C.p(D,I),I&8&&A(C,1)):(C=Am(D),C.c(),A(C,1),C.m(t,g)):C&&(re(),P(C,1,1,()=>{C=null}),ae()),D[3].updated?O?(O.p(D,I),I&8&&A(O,1)):(O=Im(D),O.c(),A(O,1),O.m(t,null)):O&&(re(),P(O,1,1,()=>{O=null}),ae())},i(D){if(!b){A(a.$$.fragment,D);for(let I=0;I<k.length;I+=1)A($[I]);A(C),A(O),b=!0}},o(D){P(a.$$.fragment,D),$=$.filter(Boolean);for(let I=0;I<$.length;I+=1)P($[I]);P(C),P(O),b=!1},d(D){D&&w(e),V(a),pt($,D),C&&C.d(),O&&O.d()}}}function DD(n){var o;let e,t,i=((o=n[0])==null?void 0:o.name)+"",s,l;return{c(){e=y("h4"),t=y("strong"),s=U(i),l=U(" record preview")},m(r,a){S(r,e,a),v(e,t),v(t,s),v(e,l)},p(r,a){var u;a&1&&i!==(i=((u=r[0])==null?void 0:u.name)+"")&&le(s,i)},d(r){r&&w(e)}}}function ED(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Close</span>',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 cn({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){H(e.$$.fragment)},m(s,l){j(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),V(e,s)}}}function ID(n,e,t){let i,{collection:s}=e,l,o=new di;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 xt({props:l}),se.push(()=>me(e,"sort",s)),{c(){H(e.$$.fragment)},m(o,r){j(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],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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",z.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 xt({props:l}),se.push(()=>me(e,"sort",s)),{c(){H(e.$$.fragment)},m(o,r){j(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],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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",z.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 xt({props:l}),se.push(()=>me(e,"sort",s)),{c(){H(e.$$.fragment)},m(o,r){j(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],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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",z.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=z.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=z.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 xt({props:r}),se.push(()=>me(i,"sort",o)),{key:n,first:null,c(){t=Se(),H(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),j(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],ye(()=>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),V(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 xt({props:l}),se.push(()=>me(e,"sort",s)),{c(){H(e.$$.fragment)},m(o,r){j(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],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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",z.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 xt({props:l}),se.push(()=>me(e,"sort",s)),{c(){H(e.$$.fragment)},m(o,r){j(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],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(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",z.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='<i class="ri-more-line"></i>',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=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},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=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,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='<span class="txt">Clear filters</span>',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",Mn(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"),H(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),j(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),V(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=!!z.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=!!z.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"),H(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),j(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),V(i)}}}function eh(n){let e,t,i;return t=new mi({props:{date:n[55].created}}),{c(){e=y("td"),H(t.$$.fragment),h(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),j(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),V(t)}}}function th(n){let e,t,i;return t=new mi({props:{date:n[55].updated}}),{c(){e=y("td"),H(t.$$.fragment),h(e,"class","col-type-date col-field-updated")},m(s,l){S(s,e,l),j(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),V(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),O=e[2].$isAuth&&Gm(e),M=e[18];const D=N=>N[58].name;for(let N=0;N<M.length;N+=1){let q=Lm(e,M,N),Y=D(q);a.set(Y,r[N]=xm(Y,q))}let I=f&&eh(e),L=p&&th(e);function F(){return e[37](e[55])}function R(...N){return e[38](e[55],...N)}return{key:n,first:null,c(){t=y("tr"),T&&T.c(),i=E(),C&&C.c(),l=E(),O&&O.c(),o=E();for(let N=0;N<r.length;N+=1)r[N].c();u=E(),I&&I.c(),d=E(),L&&L.c(),m=E(),_=y("td"),_.innerHTML='<i class="ri-arrow-right-line"></i>',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),O&&O.m(t,null),v(t,o);for(let Y=0;Y<r.length;Y+=1)r[Y]&&r[Y].m(t,null);v(t,u),I&&I.m(t,null),v(t,d),L&&L.m(t,null),v(t,m),v(t,_),v(t,g),b=!0,k||($=[J(t,"click",F),J(t,"keydown",R)],k=!0)},p(N,q){e=N,e[2].$isView?T&&(T.d(1),T=null):T?T.p(e,q):(T=Km(e),T.c(),T.m(t,i)),q[0]&128&&(s=!e[7].includes("@id")),s?C?(C.p(e,q),q[0]&128&&A(C,1)):(C=Jm(e),C.c(),A(C,1),C.m(t,l)):C&&(re(),P(C,1,1,()=>{C=null}),ae()),e[2].$isAuth?O?O.p(e,q):(O=Gm(e),O.c(),O.m(t,o)):O&&(O.d(1),O=null),q[0]&262160&&(M=e[18],re(),r=kt(r,q,D,1,e,M,a,t,Kt,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;q<M.length;q+=1)A(r[q]);A(I),A(L),b=!0}},o(N){P(C);for(let q=0;q<r.length;q+=1)P(r[q]);P(I),P(L),b=!1},d(N){N&&w(t),T&&T.d(),C&&C.d(),O&&O.d();for(let q=0;q<r.length;q+=1)r[q].d();I&&I.d(),L&&L.d(),k=!1,De($)}}}function QD(n){let e,t,i,s,l=!n[7].includes("@id"),o,r,a=[],u=new Map,f,d=n[10]&&!n[7].includes("@created"),p,m=n[9]&&!n[7].includes("@updated"),_,g,b,k,$=[],T=new Map,C,O=!n[2].$isView&&Rm(n),M=l&&qm(n),D=n[2].$isAuth&&jm(n),I=n[18];const L=Z=>Z[58].name;for(let Z=0;Z<I.length;Z+=1){let ee=Nm(n,I,Z),ie=L(ee);u.set(ie,a[Z]=zm(ie,ee))}let F=d&&Bm(n),R=m&&Um(n),N=n[15].length&&Wm(n),q=n[4];const Y=Z=>Z[2].$isView?Z[55]:Z[55].id;for(let Z=0;Z<q.length;Z+=1){let ee=Pm(n,q,Z),ie=Y(ee);T.set(ie,$[Z]=nh(ie,ee))}let B=null;return q.length||(B=Ym(n)),{c(){e=y("table"),t=y("thead"),i=y("tr"),O&&O.c(),s=E(),M&&M.c(),o=E(),D&&D.c(),r=E();for(let Z=0;Z<a.length;Z+=1)a[Z].c();f=E(),F&&F.c(),p=E(),R&&R.c(),_=E(),g=y("th"),N&&N.c(),b=E(),k=y("tbody");for(let Z=0;Z<$.length;Z+=1)$[Z].c();B&&B.c(),h(g,"class","col-type-action min-width"),h(e,"class","table"),x(e,"table-loading",n[12])},m(Z,ee){S(Z,e,ee),v(e,t),v(t,i),O&&O.m(i,null),v(i,s),M&&M.m(i,null),v(i,o),D&&D.m(i,null),v(i,r);for(let ie=0;ie<a.length;ie+=1)a[ie]&&a[ie].m(i,null);v(i,f),F&&F.m(i,null),v(i,p),R&&R.m(i,null),v(i,_),v(i,g),N&&N.m(g,null),v(e,b),v(e,k);for(let ie=0;ie<$.length;ie+=1)$[ie]&&$[ie].m(k,null);B&&B.m(k,null),C=!0},p(Z,ee){Z[2].$isView?O&&(O.d(1),O=null):O?O.p(Z,ee):(O=Rm(Z),O.c(),O.m(i,s)),ee[0]&128&&(l=!Z[7].includes("@id")),l?M?(M.p(Z,ee),ee[0]&128&&A(M,1)):(M=qm(Z),M.c(),A(M,1),M.m(i,o)):M&&(re(),P(M,1,1,()=>{M=null}),ae()),Z[2].$isAuth?D?(D.p(Z,ee),ee[0]&4&&A(D,1)):(D=jm(Z),D.c(),A(D,1),D.m(i,r)):D&&(re(),P(D,1,1,()=>{D=null}),ae()),ee[0]&262145&&(I=Z[18],re(),a=kt(a,ee,L,1,Z,I,u,i,Kt,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(),$=kt($,ee,Y,1,Z,q,T,k,Kt,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(D);for(let ee=0;ee<I.length;ee+=1)A(a[ee]);A(F),A(R);for(let ee=0;ee<q.length;ee+=1)A($[ee]);C=!0}},o(Z){P(M),P(D);for(let ee=0;ee<a.length;ee+=1)P(a[ee]);P(F),P(R);for(let ee=0;ee<$.length;ee+=1)P($[ee]);C=!1},d(Z){Z&&w(e),O&&O.d(),M&&M.d(),D&&D.d();for(let ee=0;ee<a.length;ee+=1)a[ee].d();F&&F.d(),R&&R.d(),N&&N.d();for(let ee=0;ee<$.length;ee+=1)$[ee].d();B&&B.d()}}}function ih(n){let e,t;return e=new Hn({props:{class:"dropdown dropdown-right dropdown-nowrap columns-dropdown",trigger:n[14],$$slots:{default:[eE]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&16384&&(l.trigger=i[14]),s[0]&32896|s[2]&2&&(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){V(e,i)}}}function xD(n){let e,t,i,s,l,o=n[51].name+"",r,a,u,f,d;function p(...m){return n[27](n[51],...m)}return{c(){e=y("input"),s=E(),l=y("label"),r=U(o),u=E(),h(e,"type","checkbox"),h(e,"id",t=n[54]),e.checked=i=!n[7].includes(n[51].id),h(l,"for",a=n[54])},m(m,_){S(m,e,_),S(m,s,_),S(m,l,_),v(l,r),S(m,u,_),f||(d=J(e,"change",p),f=!0)},p(m,_){n=m,_[1]&8388608&&t!==(t=n[54])&&h(e,"id",t),_[0]&32896&&i!==(i=!n[7].includes(n[51].id))&&(e.checked=i),_[0]&32768&&o!==(o=n[51].name+"")&&le(r,o),_[1]&8388608&&a!==(a=n[54])&&h(l,"for",a)},d(m){m&&w(e),m&&w(s),m&&w(l),m&&w(u),f=!1,d()}}}function sh(n,e){let t,i,s;return i=new de({props:{class:"form-field form-field-sm form-field-toggle m-0 p-5",$$slots:{default:[xD,({uniqueId:l})=>({54:l}),({uniqueId:l})=>[0,l?8388608:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Se(),H(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),j(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),V(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<r.length;u+=1){let f=Fm(n,r,u),d=a(f);s.set(d,i[u]=sh(d,f))}return{c(){e=y("div"),e.textContent="Toggle columns",t=E();for(let u=0;u<i.length;u+=1)i[u].c();l=Se(),h(e,"class","txt-hint txt-sm p-5 m-b-5")},m(u,f){S(u,e,f),S(u,t,f);for(let d=0;d<i.length;d+=1)i[d]&&i[d].m(u,f);S(u,l,f),o=!0},p(u,f){f[0]&32896|f[1]&8388608&&(r=u[15],re(),i=kt(i,f,a,1,u,r,s,l.parentNode,Kt,sh,l,Fm),ae())},i(u){if(!o){for(let f=0;f<r.length;f+=1)A(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)P(i[f]);o=!1},d(u){u&&w(e),u&&w(t);for(let f=0;f<i.length;f+=1)i[f].d(u);u&&w(l)}}}function tE(n){let e,t,i=n[14]&&ih(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[14]?i?(i.p(s,l),l[0]&16384&&A(i,1)):(i=ih(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 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='<span class="txt">Reset</span>',d=E(),p=y("div"),m=E(),_=y("button"),_.innerHTML='<span class="txt">Delete selected</span>',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&&tt(()=>{b&&(g||(g=Ve(e,ni,{duration:150,y:5},!0)),g.run(1))}),b=!0)},o(T){T&&(g||(g=Ve(e,ni,{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(){H(e.$$.fragment),t=E(),r&&r.c(),i=E(),a&&a.c(),s=E(),u&&u.c(),l=Se()},m(f,d){j(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){V(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=wt();let{collection:p}=e,{sort:m=""}=e,{filter:_=""}=e,g=[],b=1,k=0,$={},T=!0,C=!1,O=0,M,D=[],I=[];function L(){p!=null&&p.id&&localStorage.setItem((p==null?void 0:p.id)+"@hiddenCollumns",JSON.stringify(D))}function F(){if(t(7,D=[]),!!(p!=null&&p.id))try{const $e=localStorage.getItem(p.id+"@hiddenCollumns");$e&&t(7,D=JSON.parse($e)||[])}catch{}}async function R(){const $e=b;for(let Xe=1;Xe<=$e;Xe++)(Xe===1||o)&&await N(Xe,!1)}async function N($e=1,Xe=!0){var vt,En;if(!(p!=null&&p.id))return;t(12,T=!0);let ke=m;const Pe=ke.match(iE),nt=Pe?s.find(rt=>rt.name===Pe[2]):null;if(Pe&&((En=(vt=nt==null?void 0:nt.options)==null?void 0:vt.displayFields)==null?void 0:En.length)>0){const rt=[];for(const Zn of nt.options.displayFields)rt.push((Pe[1]||"")+Pe[2]+"."+Zn);ke=rt.join(",")}return he.collection(p.id).getList($e,30,{sort:ke,filter:_,expand:s.map(rt=>rt.name).join(","),$cancelKey:"records_list"}).then(async rt=>{if($e<=1&&q(),t(12,T=!1),t(11,b=rt.page),t(5,k=rt.totalItems),d("load",g.concat(rt.items)),Xe){const Zn=++O;for(;rt.items.length&&O==Zn;)t(4,g=g.concat(rt.items.splice(0,15))),await z.yieldToMain()}else t(4,g=g.concat(rt.items))}).catch(rt=>{rt!=null&&rt.isAbort||(t(12,T=!1),console.warn(rt),q(),he.errorResponseHandler(rt,!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(){_n(`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 Xe of Object.keys($))$e.push(he.collection(p.id).delete(Xe));return t(13,C=!0),Promise.all($e).then(()=>{Yt(`Successfully deleted the selected ${r===1?"record":"records"}.`),B()}).catch(Xe=>{he.errorResponseHandler(Xe)}).finally(()=>(t(13,C=!1),R()))}function fe($e){pe.call(this,n,$e)}const G=($e,Xe)=>{Xe.target.checked?z.removeByValue(D,$e.id):z.pushUnique(D,$e.id),t(7,D)},ce=()=>Y();function ge($e){m=$e,t(0,m)}function Me($e){m=$e,t(0,m)}function je($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 ht=$e=>ee($e),Ze=$e=>d("select",$e),We=($e,Xe)=>{Xe.code==="Enter"&&(Xe.preventDefault(),d("select",$e))},te=()=>t(1,_=""),Re=()=>d("new"),Qe=()=>N(b+1),Jt=()=>B(),Ne=()=>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=>!D.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&&D!==-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,$,D,r,f,u,b,T,C,M,I,a,o,l,d,Y,B,ee,ie,R,i,fe,G,ce,ge,Me,je,He,we,Ce,Je,ht,Ze,We,te,Re,Qe,Jt,Ne]}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 Dn({props:{$$slots:{default:[uE]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(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){V(e,l),l&&w(t),V(i,l)}}}function rE(n){let e,t;return e=new Dn({props:{center:!0,$$slots:{default:[dE]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function aE(n){let e,t;return e=new Dn({props:{center:!0,$$slots:{default:[pE]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function ah(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',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=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,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,O,M,D,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]),O=new lE({props:B}),n[20](O),se.push(()=>me(O,"filter",q)),se.push(()=>me(O,"sort",Y)),O.$on("select",n[23]),O.$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(),H(d.$$.fragment),p=E(),m=y("div"),_=y("button"),_.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,g=E(),N&&N.c(),b=E(),H(k.$$.fragment),$=E(),T=y("div"),C=E(),H(O.$$.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),j(d,u,null),v(e,p),v(e,m),v(m,_),v(m,g),N&&N.m(m,null),S(Z,b,ee),j(k,Z,ee),S(Z,$,ee),S(Z,T,ee),S(Z,C,ee),j(O,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],ye(()=>M=!1)),!D&&ee[0]&2&&(D=!0,X.sort=Z[1],ye(()=>D=!1)),O.$set(X)},i(Z){I||(A(d.$$.fragment,Z),A(k.$$.fragment,Z),A(O.$$.fragment,Z),I=!0)},o(Z){P(d.$$.fragment,Z),P(k.$$.fragment,Z),P(O.$$.fragment,Z),I=!1},d(Z){Z&&w(e),R&&R.d(),V(d),N&&N.d(),Z&&w(b),V(k,Z),Z&&w($),Z&&w(T),Z&&w(C),n[20](null),V(O,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=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,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 class="ri-database-2-line"></i>',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=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,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(),H(s.$$.fragment),l=E(),H(o.$$.fragment),r=E(),H(a.$$.fragment),u=E(),H(f.$$.fragment)},m(T,C){m[e].m(T,C),S(T,i,C),j(s,T,C),S(T,l,C),j(o,T,C),S(T,r,C),j(a,T,C),S(T,u,C),j(f,T,C),d=!0},p(T,C){let O=e;e=_(T),e===O?m[e].p(T,C):(re(),P(m[O],1,1,()=>{m[O]=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 D={};o.$set(D);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),V(s,T),T&&w(l),n[26](null),V(o,T),T&&w(r),n[27](null),V(a,T),T&&w(u),n[30](null),V(f,T)}}}function hE(n,e,t){let i,s,l,o,r,a,u;Ke(n,hi,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,ii,G=>t(9,a=G)),Ke(n,Ms,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&&!z.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}p$($);const C=()=>d==null?void 0:d.show(),O=()=>d==null?void 0:d.show(s),M=()=>g==null?void 0:g.load(),D=()=>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();Ii("/collections?"+G)}n.$$.dirty[0]&4&&tn(Lt,l=(s==null?void 0:s.name)||"Collections",l)},[b,k,s,o,d,p,m,_,g,a,u,$,i,r,C,O,M,D,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,O,M,D,I,L;return{c(){e=y("aside"),t=y("div"),i=y("div"),i.textContent="System",s=E(),l=y("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=E(),r=y("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=E(),u=y("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=E(),d=y("div"),d.innerHTML='<span class="txt">Sync</span>',p=E(),m=y("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,_=E(),g=y("a"),g.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,b=E(),k=y("div"),k.textContent="Authentication",$=E(),T=y("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,C=E(),O=y("a"),O.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,M=E(),D=y("a"),D.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,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(O,"href","/settings/tokens"),h(O,"class","sidebar-list-item"),h(D,"href","/settings/admins"),h(D,"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,O),v(t,M),v(t,D),I||(L=[Ee(Un.call(null,l,{path:"/settings"})),Ee(ln.call(null,l)),Ee(Un.call(null,r,{path:"/settings/mail/?.*"})),Ee(ln.call(null,r)),Ee(Un.call(null,u,{path:"/settings/storage/?.*"})),Ee(ln.call(null,u)),Ee(Un.call(null,m,{path:"/settings/export-collections/?.*"})),Ee(ln.call(null,m)),Ee(Un.call(null,g,{path:"/settings/import-collections/?.*"})),Ee(ln.call(null,g)),Ee(Un.call(null,T,{path:"/settings/auth-providers/?.*"})),Ee(ln.call(null,T)),Ee(Un.call(null,O,{path:"/settings/tokens/?.*"})),Ee(ln.call(null,O)),Ee(Un.call(null,D,{path:"/settings/admins/?.*"})),Ee(ln.call(null,D))],I=!0)},p:Q,i:Q,o:Q,d(F){F&&w(e),I=!1,De(L)}}}class Fi 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(){H(e.$$.fragment)},m(i,s){j(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){V(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",z.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&&zt(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(),Cn(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",z.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(){H(e.$$.fragment)},m(i,s){j(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){V(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"),H(s.$$.fragment),l=E(),o=y("div"),H(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),j(s,i,null),v(t,l),v(t,o),j(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&&tt(()=>{u&&(a||(a=Ve(t,St,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Ve(t,St,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),V(s),V(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(),H(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 O=0;O<10;O+=1)b[O]&&b[O].m(o,null);v(e,r),j(a,e,null),v(e,u),k&&k.m(e,null),v(e,f),$&&$.m(e,null),d=!0,p||(m=J(e,"submit",ct(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 D=fh(T,g,M);b[M]?b[M].p(D,C):(b[M]=dh(D),b[M].c(),b[M].m(o,null))}for(;M<10;M+=1)b[M].d(1)}const O={};C[0]&536870920|C[1]&4&&(O.$$scope={dirty:C,ctx:T}),a.$set(O),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(),pt(b,T),V(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 Hn({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(),H(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),j(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),V(o),f&&w(r),f&&w(a)}}}function TE(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,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 cn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){H(e.$$.fragment)},m(s,l){j(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),V(e,s)}}}function OE(n,e,t){let i;const s=wt(),l="admin_"+z.randomString(5);let o,r=new ts,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 ts),$()}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=""),fn({})}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=he.admins.create(Z):ee=he.admins.update(r.id,Z),ee.then(async ie=>{var X;t(7,u=!1),b(),Yt(r.$isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ie),((X=he.authStore.model)==null?void 0:X.id)===ie.id&&he.authStore.save(he.authStore.token,ie)}).catch(ie=>{he.errorResponseHandler(ie)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&_n("Do you really want to delete the selected admin?",()=>he.admins.delete(r.id).then(()=>{t(7,u=!1),b(),Yt("Successfully deleted admin."),s("delete",r)}).catch(Z=>{he.errorResponseHandler(Z)}))}const O=()=>C(),M=()=>b(),D=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?(_n("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,O,M,D,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",z.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",z.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",z.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",z.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=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},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='<span class="txt">Clear filters</span>',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,O,M,D,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 mi({props:{date:e[24].created}}),R=new mi({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"),H(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(),D=y("td"),H(I.$$.fragment),L=E(),F=y("td"),H(R.$$.fragment),N=E(),q=y("td"),q.innerHTML='<i class="ri-arrow-right-line"></i>',Y=E(),Cn(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",O=e[24].email),h(k,"class","col-type-email col-field-email"),h(D,"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),j(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,D),j(I,D,null),v(t,L),v(t,F),j(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&&!Cn(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&&O!==(O=e[24].email))&&h($,"title",O);const Me={};ce&16&&(Me.date=e[24].created),I.$set(Me);const je={};ce&16&&(je.date=e[24].updated),R.$set(je)},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),V(f),ie&&ie.d(),V(I),V(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,O=[],M=new Map,D;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 xt({props:L}),se.push(()=>me(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 xt({props:R}),se.push(()=>me(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 xt({props:q}),se.push(()=>me(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 xt({props:B}),se.push(()=>me(g,"sort",Y));let Z=n[4];const ee=X=>X[24].id;for(let X=0;X<Z.length;X+=1){let fe=_h(n,Z,X),G=ee(fe);M.set(G,O[X]=yh(G,fe))}let ie=null;return Z.length||(ie=gh(n)),{c(){e=y("table"),t=y("thead"),i=y("tr"),s=y("th"),l=E(),H(o.$$.fragment),a=E(),H(u.$$.fragment),d=E(),H(p.$$.fragment),_=E(),H(g.$$.fragment),k=E(),$=y("th"),T=E(),C=y("tbody");for(let X=0;X<O.length;X+=1)O[X].c();ie&&ie.c(),h(s,"class","min-width"),h($,"class","col-type-action min-width"),h(e,"class","table"),x(e,"table-loading",n[5])},m(X,fe){S(X,e,fe),v(e,t),v(t,i),v(i,s),v(i,l),j(o,i,null),v(i,a),j(u,i,null),v(i,d),j(p,i,null),v(i,_),j(g,i,null),v(i,k),v(i,$),v(e,T),v(e,C);for(let G=0;G<O.length;G+=1)O[G]&&O[G].m(C,null);ie&&ie.m(C,null),D=!0},p(X,fe){const G={};fe&134217728&&(G.$$scope={dirty:fe,ctx:X}),!r&&fe&4&&(r=!0,G.sort=X[2],ye(()=>r=!1)),o.$set(G);const ce={};fe&134217728&&(ce.$$scope={dirty:fe,ctx:X}),!f&&fe&4&&(f=!0,ce.sort=X[2],ye(()=>f=!1)),u.$set(ce);const ge={};fe&134217728&&(ge.$$scope={dirty:fe,ctx:X}),!m&&fe&4&&(m=!0,ge.sort=X[2],ye(()=>m=!1)),p.$set(ge);const Me={};fe&134217728&&(Me.$$scope={dirty:fe,ctx:X}),!b&&fe&4&&(b=!0,Me.sort=X[2],ye(()=>b=!1)),g.$set(Me),fe&186&&(Z=X[4],re(),O=kt(O,fe,ee,1,X,Z,M,C,Kt,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))),(!D||fe&32)&&x(e,"table-loading",X[5])},i(X){if(!D){A(o.$$.fragment,X),A(u.$$.fragment,X),A(p.$$.fragment,X),A(g.$$.fragment,X);for(let fe=0;fe<Z.length;fe+=1)A(O[fe]);D=!0}},o(X){P(o.$$.fragment,X),P(u.$$.fragment,X),P(p.$$.fragment,X),P(g.$$.fragment,X);for(let fe=0;fe<O.length;fe+=1)P(O[fe]);D=!1},d(X){X&&w(e),V(o),V(u),V(p),V(g);for(let fe=0;fe<O.length;fe+=1)O[fe].d();ie&&ie.d()}}}function kh(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=y("small"),t=U("Showing "),s=U(i),l=U(" of "),r=U(o),h(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){S(a,e,u),v(e,t),v(e,s),v(e,l),v(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&le(s,i),u&16&&o!==(o=a[4].length+"")&&le(r,o)},d(a){a&&w(e)}}}function RE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O,M,D;a=new Pa({}),a.$on("refresh",n[8]),_=new Ko({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),_.$on("submit",n[10]),$=new La({props:{class:"table-wrapper",$$slots:{default:[FE]},$$scope:{ctx:n}}});let I=n[4].length&&kh(n);return{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[6]),r=E(),H(a.$$.fragment),u=E(),f=y("div"),d=E(),p=y("button"),p.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New admin</span>`,m=E(),H(_.$$.fragment),g=E(),b=y("div"),k=E(),H($.$$.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),j(a,e,null),v(e,u),v(e,f),v(e,d),v(e,p),S(L,m,F),j(_,L,F),S(L,g,F),S(L,b,F),S(L,k,F),j($,L,F),S(L,T,F),I&&I.m(L,F),S(L,C,F),O=!0,M||(D=J(p,"click",n[9]),M=!0)},p(L,F){(!O||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){O||(A(a.$$.fragment,L),A(_.$$.fragment,L),A($.$$.fragment,L),O=!0)},o(L){P(a.$$.fragment,L),P(_.$$.fragment,L),P($.$$.fragment,L),O=!1},d(L){L&&w(e),V(a),L&&w(m),V(_,L),L&&w(g),L&&w(b),L&&w(k),V($,L),L&&w(T),I&&I.d(L),L&&w(C),M=!1,D()}}}function qE(n){let e,t,i,s,l,o;e=new Fi({}),i=new Dn({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(){H(e.$$.fragment),t=E(),H(i.$$.fragment),s=E(),H(l.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),S(a,s,u),j(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){V(e,a),a&&w(t),V(i,a),a&&w(s),n[18](null),V(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)),tn(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(){return t(5,u=!0),t(4,a=[]),he.admins.getFullList(100,{sort:d||"-created",filter:f}).then(R=>{t(4,a=R),t(5,u=!1)}).catch(R=>{R!=null&&R.isAbort||(t(5,u=!1),console.warn(R),m(),he.errorResponseHandler(R,!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 O=R=>r==null?void 0:r.show(R),M=(R,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(R))},D=()=>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();Ii("/settings/admins?"+R),p()}},[p,f,d,r,a,u,s,l,_,g,b,k,$,T,C,O,M,D,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(ln.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="<h4>Admin sign in</h4>",i=E(),H(s.$$.fragment),l=E(),H(o.$$.fragment),r=E(),a=y("button"),a.innerHTML=`<span class="txt">Login</span>
<i class="ri-arrow-right-line"></i>`,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),j(s,e,null),v(e,l),j(o,e,null),v(e,r),v(e,a),u=!0,f||(d=J(e,"submit",ct(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),V(s),V(o),f=!1,d()}}}function UE(n){let e,t;return e=new e1({props:{$$slots:{default:[BE]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(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){V(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),he.admins.authWithPassword(l,o).then(()=>{Ea(),Ii("/")}).catch(()=>{ml("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,O;i=new de({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[ZE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[GE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[XE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[QE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&wh(n);return{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=E(),l=y("div"),H(o.$$.fragment),r=E(),H(a.$$.fragment),u=E(),H(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(D,I){S(D,e,I),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),v(e,r),j(a,e,null),v(e,u),j(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||(O=J(b,"click",n[13]),C=!0)},p(D,I){const L={};I&1572865&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const F={};I&1572865&&(F.$$scope={dirty:I,ctx:D}),o.$set(F);const R={};I&1572865&&(R.$$scope={dirty:I,ctx:D}),a.$set(R);const N={};I&1572865&&(N.$$scope={dirty:I,ctx:D}),f.$set(N),D[3]?M?M.p(D,I):(M=wh(D),M.c(),M.m(p,g)):M&&(M.d(1),M=null),(!T||I&12&&$!==($=!D[3]||D[2]))&&(b.disabled=$),(!T||I&4)&&x(b,"btn-loading",D[2])},i(D){T||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(a.$$.fragment,D),A(f.$$.fragment,D),T=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(a.$$.fragment,D),P(f.$$.fragment,D),T=!1},d(D){D&&w(e),V(i),V(o),V(a),V(f),M&&M.d(),C=!1,O()}}}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&&gt(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=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Application</div></nav>`,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",ct(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 eA(n){let e,t,i,s;return e=new Fi({}),i=new Dn({props:{$$slots:{default:[xE]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(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){V(e,l),l&&w(t),V(i,l)}}}function tA(n,e,t){let i,s,l,o;Ke(n,Ms,M=>t(14,s=M)),Ke(n,wo,M=>t(15,l=M)),Ke(n,Lt,M=>t(16,o=M)),tn(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 he.settings.getAll()||{};_(M)}catch(M){he.errorResponseHandler(M)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const M=await he.settings.update(z.filterRedactedProps(a));_(M),Yt("Successfully saved application settings.")}catch(M){he.errorResponseHandler(M)}t(2,f=!1)}}function _(M={}){var D,I;tn(wo,l=(D=M==null?void 0:M.meta)==null?void 0:D.appName,l),tn(Ms,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=gt(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>g(),O=()=>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,O]}class nA extends ve{constructor(e){super(),be(this,e,tA,eA,_e,{})}}function iA(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=qe(l,s[o]);return{c(){e=y("input"),ti(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),ue(e,n[0]),t||(i=J(e,"input",n[8]),t=!0)},p(o,r){ti(e,l=$t(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&ue(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function sA(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=qe(a,r[u]);return{c(){e=y("div"),t=y("button"),t.innerHTML='<i class="ri-key-line"></i>',i=E(),s=y("input"),h(t,"type","button"),h(t,"class","btn btn-transparent btn-circle"),h(e,"class","form-field-addon"),ti(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){ti(s,a=$t(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 lA(n){let e;function t(l,o){return l[3]?sA:iA}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 oA(n,e,t){const i=["value","mask"];let s=Ge(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await un(),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=qe(qe({},e),Ut(m)),t(5,s=Ge(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,oA,lA,_e,{value:0,mask:1})}}function rA(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 aA(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 uA(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 fA(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(()=>me(e,"value",l))),{c(){e&&H(e.$$.fragment),i=Se()},m(a,u){e&&j(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,ye(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{V(d,1)}),ae()}o?(e=Pt(o,r(a)),se.push(()=>me(e,"value",l)),H(e.$$.fragment),A(e.$$.fragment,1),j(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&&V(e,a)}}}function cA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C;const O=[fA,uA],M=[];function D(I,L){return I[4]&&!I[5]?0:1}return l=D(n),o=M[l]=O[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}
`,m=U(`,
`),_=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=D(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]=O[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 dA(n){let e,t,i,s,l,o;return e=new de({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[rA,({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:[aA,({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:[cA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=E(),H(i.$$.fragment),s=E(),H(l.$$.fragment)},m(r,a){j(e,r,a),S(r,t,a),j(i,r,a),S(r,s,a),j(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){V(e,r),r&&w(t),V(i,r),r&&w(s),V(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&&tt(()=>{i&&(t||(t=Ve(e,Ht,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Ht,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function pA(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 mA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[pA],default:[dA]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=qe(s,i[l]);return e=new po({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){H(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){const r=o[0]&256?$t(i,[Wt(l[8])]):{};o[0]&119|o[1]&2&&(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[26](null),V(e,l)}}}let $h;function hA(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Ge(e,s),o;Ke(n,_i,X=>t(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 at(()=>import("./CodeEditor-462b7ad0.js"),["./CodeEditor-462b7ad0.js","./index-6f704b4c.js"],import.meta.url)).default),$h=d,t(5,p=!1))}function k(X){z.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 O(){u.actionUrl=this.value,t(0,u)}const M=()=>k("{APP_NAME}"),D=()=>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=qe(qe({},e),Ut(X)),t(8,l=Ge(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=!z.isEmpty(z.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Di(r))},[u,r,a,f,d,p,i,k,l,m,_,g,o,$,T,C,O,M,D,I,L,F,R,N,q,Y,B,Z,ee,ie]}class Fr extends ve{constructor(e){super(),be(this,e,hA,mA,_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 _A(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[21].value;for(let o=0;o<s.length;o+=1){let r=Th(n,s,o),a=l(r);t.set(a,e[o]=Ch(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r&1048708&&(s=o[7],e=kt(e,r,l,1,o,s,t,i.parentNode,is,Ch,i,Th))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function gA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("To email address"),s=E(),l=y("input"),h(e,"for",i=n[20]),h(l,"type","email"),h(l,"id",o=n[20]),l.autofocus=!0,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]),l.focus(),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&h(e,"for",i),f&1048576&&o!==(o=u[20])&&h(l,"id",o),f&2&&l.value!==u[1]&&ue(l,u[1])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function bA(n){let e,t,i,s,l,o,r;return t=new de({props:{class:"form-field required",name:"template",$$slots:{default:[_A,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new de({props:{class:"form-field required m-0",name:"email",$$slots:{default:[gA,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),H(t.$$.fragment),i=E(),H(s.$$.fragment),h(e,"id",n[6]),h(e,"autocomplete","off")},m(a,u){S(a,e,u),j(t,e,null),v(e,i),j(s,e,null),l=!0,o||(r=J(e,"submit",ct(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),V(t),V(s),o=!1,r()}}}function vA(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 yA(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 kA(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:[yA],header:[vA],default:[bA]},$$scope:{ctx:n}};return e=new cn({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){H(e.$$.fragment)},m(s,l){j(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),V(e,s)}}}const Rr="last_email_test",Mh="email_test_request";function wA(n,e,t){let i;const s=wt(),l="email_test_"+z.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(D="",I=""){t(1,a=D||localStorage.getItem(Rr)),t(2,u=I||o[0].value),fn({}),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(()=>{he.cancelRequest(Mh),ml("Test email send timeout.")},3e4);try{await he.settings.testEmail(a,u,{$cancelKey:Mh}),Yt("Successfully sent test email."),s("submit"),t(4,f=!1),await un(),m()}catch(D){t(4,f=!1),he.errorResponseHandler(D)}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(D){se[D?"unshift":"push"](()=>{r=D,t(3,r)})}function O(D){pe.call(this,n,D)}function M(D){pe.call(this,n,D)}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,O,M]}class SA extends ve{constructor(e){super(),be(this,e,wA,kA,_e,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function $A(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O,M,D,I,L,F;i=new de({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[CA,({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:[MA,({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(()=>me(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(()=>me(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(()=>me(g,"config",B)),C=new de({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[OA,({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]?FA:NA}let X=ie(n),fe=X(n);return{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=E(),l=y("div"),H(o.$$.fragment),r=E(),a=y("div"),H(u.$$.fragment),d=E(),H(p.$$.fragment),_=E(),H(g.$$.fragment),k=E(),$=y("hr"),T=E(),H(C.$$.fragment),O=E(),ee&&ee.c(),M=E(),D=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(D,"class","flex")},m(G,ce){S(G,e,ce),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),S(G,r,ce),S(G,a,ce),j(u,a,null),v(a,d),j(p,a,null),v(a,_),j(g,a,null),S(G,k,ce),S(G,$,ce),S(G,T,ce),j(C,G,ce),S(G,O,ce),ee&&ee.m(G,ce),S(G,M,ce),S(G,D,ce),v(D,I),v(D,L),fe.m(D,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 je={};!f&&ce[0]&1&&(f=!0,je.config=G[0].meta.verificationTemplate,ye(()=>f=!1)),u.$set(je);const He={};!m&&ce[0]&1&&(m=!0,He.config=G[0].meta.resetPasswordTemplate,ye(()=>m=!1)),p.$set(He);const we={};!b&&ce[0]&1&&(b=!0,we.config=G[0].meta.confirmEmailChangeTemplate,ye(()=>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(D,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),V(i),V(o),G&&w(r),G&&w(a),V(u),V(p),V(g),G&&w(k),G&&w($),G&&w(T),V(C,G),G&&w(O),ee&&ee.d(G),G&&w(M),G&&w(D),fe.d()}}}function TA(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 CA(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 MA(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 OA(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 <strong>(recommended)</strong>",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,O,M;return i=new de({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[DA,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[EA,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[AA,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),p=new de({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[IA,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field",name:"smtp.username",$$slots:{default:[PA,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),$=new de({props:{class:"form-field",name:"smtp.password",$$slots:{default:[LA,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=E(),l=y("div"),H(o.$$.fragment),r=E(),a=y("div"),H(u.$$.fragment),f=E(),d=y("div"),H(p.$$.fragment),m=E(),_=y("div"),H(g.$$.fragment),b=E(),k=y("div"),H($.$$.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(D,I){S(D,e,I),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),v(e,r),v(e,a),j(u,a,null),v(e,f),v(e,d),j(p,d,null),v(e,m),v(e,_),j(g,_,null),v(e,b),v(e,k),j($,k,null),v(e,T),v(e,C),M=!0},p(D,I){const L={};I[0]&1|I[1]&3&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const F={};I[0]&1|I[1]&3&&(F.$$scope={dirty:I,ctx:D}),o.$set(F);const R={};I[0]&1|I[1]&3&&(R.$$scope={dirty:I,ctx:D}),u.$set(R);const N={};I[0]&1|I[1]&3&&(N.$$scope={dirty:I,ctx:D}),p.$set(N);const q={};I[0]&1|I[1]&3&&(q.$$scope={dirty:I,ctx:D}),g.$set(q);const Y={};I[0]&1|I[1]&3&&(Y.$$scope={dirty:I,ctx:D}),$.$set(Y)},i(D){M||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(u.$$.fragment,D),A(p.$$.fragment,D),A(g.$$.fragment,D),A($.$$.fragment,D),D&&tt(()=>{M&&(O||(O=Ve(e,St,{duration:150},!0)),O.run(1))}),M=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(p.$$.fragment,D),P(g.$$.fragment,D),P($.$$.fragment,D),D&&(O||(O=Ve(e,St,{duration:150},!1)),O.run(0)),M=!1},d(D){D&&w(e),V(i),V(o),V(u),V(p),V(g),V($),D&&O&&O.end()}}}function DA(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 EA(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&&gt(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 AA(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 Ni({props:u}),se.push(()=>me(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("TLS encryption"),s=E(),H(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),j(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,ye(()=>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),V(l,f)}}}function IA(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 Ni({props:u}),se.push(()=>me(l,"keyOfSelected",a)),{c(){e=y("label"),t=U("AUTH method"),s=E(),H(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),j(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,ye(()=>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),V(l,f)}}}function PA(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 LA(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(()=>me(l,"value",a)),{c(){e=y("label"),t=U("Password"),s=E(),H(l.$$.fragment),h(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),j(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,ye(()=>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),V(l,f)}}}function NA(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send test email</span>`,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 FA(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 RA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[TA,$A],$=[];function T(C,O){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="<p>Configure common settings for sending emails.</p>",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,O){S(C,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,O),S(C,a,O),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",ct(n[27])),g=!0)},p(C,O){(!_||O[0]&32)&&le(o,C[5]);let M=p;p=T(C),p===M?$[p].p(C,O):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(C,O):(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 qA(n){let e,t,i,s,l,o;e=new Fi({}),i=new Dn({props:{$$slots:{default:[RA]},$$scope:{ctx:n}}});let r={};return l=new SA({props:r}),n[28](l),{c(){H(e.$$.fragment),t=E(),H(i.$$.fragment),s=E(),H(l.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),S(a,s,u),j(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){V(e,a),a&&w(t),V(i,a),a&&w(s),n[28](null),V(l,a)}}}function jA(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"}];tn(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 he.settings.getAll()||{};g(ie)}catch(ie){he.errorResponseHandler(ie)}t(2,d=!1)}async function _(){if(!(p||!s)){t(3,p=!0);try{const ie=await he.settings.update(z.filterRedactedProps(f));g(ie),fn({}),Yt("Successfully saved mail settings.")}catch(ie){he.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 O(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 D(){f.smtp.host=this.value,t(0,f)}function I(){f.smtp.port=gt(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,O,M,D,I,L,F,R,N,q,Y,B,Z,ee]}class VA extends ve{constructor(e){super(),be(this,e,jA,qA,_e,{},null,[-1,-1])}}function HA(n){var C,O;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:[BA,({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),$=((O=n[1].s3)==null?void 0:O.enabled)&&!n[6]&&!n[3]&&Ah(n),T=n[6]&&Ih(n);return{c(){H(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,D){j(e,M,D),S(M,t,D),b&&b.m(M,D),S(M,i,D),k&&k.m(M,D),S(M,s,D),S(M,l,D),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,D){var L,F;const I={};D&100663298&&(I.$$scope={dirty:D,ctx:M}),e.$set(I),((L=M[0].s3)==null?void 0:L.enabled)!=M[1].s3.enabled?b?(b.p(M,D),D&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,D),D&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,D):($=Ah(M),$.c(),$.m(l,a)):$&&($.d(1),$=null),M[6]?T?T.p(M,D):(T=Ih(M),T.c(),T.m(l,u)):T&&(T.d(1),T=null),(!m||D&72&&p!==(p=!M[6]||M[3]))&&(f.disabled=p),(!m||D&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){V(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 zA(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 BA(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,O,M,D,I;return{c(){e=y("div"),t=y("div"),i=y("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',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
`),d=y("strong"),m=U(p),_=U(`.
`),g=y("br"),b=U(`
There are numerous command line tools that can help you, such as:
`),k=y("a"),k.textContent=`rclone
`,$=U(`,
`),T=y("a"),T.textContent=`s5cmd
`,C=U(", etc."),O=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,O),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&&tt(()=>{I&&(D||(D=Ve(e,St,{duration:150},!0)),D.run(1))}),I=!0)},o(F){F&&(D||(D=Ve(e,St,{duration:150},!1)),D.run(0)),I=!1},d(F){F&&w(e),F&&D&&D.end()}}}function Eh(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O,M;return i=new de({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[UA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[WA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"s3.region",$$slots:{default:[YA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),p=new de({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[KA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[JA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),$=new de({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[ZA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=E(),l=y("div"),H(o.$$.fragment),r=E(),a=y("div"),H(u.$$.fragment),f=E(),d=y("div"),H(p.$$.fragment),m=E(),_=y("div"),H(g.$$.fragment),b=E(),k=y("div"),H($.$$.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(D,I){S(D,e,I),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),v(e,r),v(e,a),j(u,a,null),v(e,f),v(e,d),j(p,d,null),v(e,m),v(e,_),j(g,_,null),v(e,b),v(e,k),j($,k,null),v(e,T),v(e,C),M=!0},p(D,I){const L={};I&100663298&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const F={};I&100663298&&(F.$$scope={dirty:I,ctx:D}),o.$set(F);const R={};I&100663298&&(R.$$scope={dirty:I,ctx:D}),u.$set(R);const N={};I&100663298&&(N.$$scope={dirty:I,ctx:D}),p.$set(N);const q={};I&100663298&&(q.$$scope={dirty:I,ctx:D}),g.$set(q);const Y={};I&100663298&&(Y.$$scope={dirty:I,ctx:D}),$.$set(Y)},i(D){M||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(u.$$.fragment,D),A(p.$$.fragment,D),A(g.$$.fragment,D),A($.$$.fragment,D),D&&tt(()=>{M&&(O||(O=Ve(e,St,{duration:150},!0)),O.run(1))}),M=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(p.$$.fragment,D),P(g.$$.fragment,D),P($.$$.fragment,D),D&&(O||(O=Ve(e,St,{duration:150},!1)),O.run(0)),M=!1},d(D){D&&w(e),V(i),V(o),V(u),V(p),V(g),V($),D&&O&&O.end()}}}function UA(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 WA(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 YA(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 KA(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 JA(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(()=>me(l,"value",a)),{c(){e=y("label"),t=U("Secret"),s=E(),H(l.$$.fragment),h(e,"for",i=n[25])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),j(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,ye(()=>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),V(l,f)}}}function ZA(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]?QA:l[5]?XA:GA}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 GA(n){let e;return{c(){e=y("div"),e.innerHTML=`<i class="ri-checkbox-circle-line txt-success"></i>
<span class="txt">S3 connected successfully</span>`,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 XA(n){let e,t,i,s;return{c(){e=y("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,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&&zt(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 QA(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 xA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[zA,HA],$=[];function T(C,O){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=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,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,O){S(C,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,O),S(C,a,O),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",ct(n[20])),g=!0)},p(C,O){(!_||O&128)&&le(o,C[7]);let M=p;p=T(C),p===M?$[p].p(C,O):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(C,O):(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 e6(n){let e,t,i,s;return e=new Fi({}),i=new Dn({props:{$$slots:{default:[xA]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(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){V(e,l),l&&w(t),V(i,l)}}}const oo="s3_test_request";function t6(n,e,t){let i,s,l;Ke(n,Lt,N=>t(7,l=N)),tn(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 he.settings.getAll()||{};g(N)}catch(N){he.errorResponseHandler(N)}t(2,a=!1)}async function _(){if(!(u||!s)){t(3,u=!0);try{he.cancelRequest(oo);const N=await he.settings.update(z.filterRedactedProps(r));fn({}),await g(N),Ea(),d?uy("Successfully saved but failed to establish S3 connection."):Yt("Successfully saved files storage settings.")}catch(N){he.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){he.cancelRequest(oo),clearTimeout(p),p=setTimeout(()=>{he.cancelRequest(oo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await he.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 O(){r.s3.region=this.value,t(1,r)}function M(){r.s3.accessKey=this.value,t(1,r)}function D(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function 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,O,M,D,I,L,F,R]}class n6 extends ve{constructor(e){super(),be(this,e,t6,e6,_e,{})}}function i6(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 s6(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 l6(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(()=>me(l,"value",a)),{c(){e=y("label"),t=U("Client secret"),s=E(),H(l.$$.fragment),h(e,"for",i=n[20])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),j(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,ye(()=>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),V(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(()=>me(t,"config",l))),{c(){e=y("div"),t&&H(t.$$.fragment),h(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&j(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],ye(()=>i=!1)),u&8&&o!==(o=a[3].optionsComponent)){if(t){re();const d=t;P(d.$$.fragment,1,0,()=>{V(d,1)}),ae()}o?(t=Pt(o,r(a)),se.push(()=>me(t,"config",l)),H(t.$$.fragment),A(t.$$.fragment,1),j(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&&V(t)}}}function o6(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:[i6,({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:[s6,({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:[l6,({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"),H(i.$$.fragment),s=E(),l=y("button"),l.innerHTML='<span class="txt">Clear all fields</span>',o=E(),H(r.$$.fragment),a=E(),H(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),j(i,t,null),v(t,s),v(t,l),v(e,o),j(r,e,null),v(e,a),j(u,e,null),v(e,f),_&&_.m(e,null),d=!0,p||(m=[J(l,"click",n[8]),J(e,"submit",ct(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),V(i),V(r),V(u),_&&_.d(),p=!1,De(m)}}}function r6(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 a6(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 u6(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[a6],header:[r6],default:[o6]},$$scope:{ctx:n}};return e=new cn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){H(e.$$.fragment)},m(s,l){j(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),V(e,s)}}}function f6(n,e,t){let i;const s=wt(),l="provider_popup_"+z.randomString(5);let o,r={},a={},u=!1,f="";function d(D,I){fn({}),t(3,r=Object.assign({},D)),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 D={};D[r.key]=z.filterRedactedProps(a);const I=await he.settings.update(D);fn({}),Yt("Successfully updated provider settings."),s("submit",I),p()}catch(D){he.errorResponseHandler(D)}t(4,u=!1)}function _(){for(let D in a)t(1,a[D]="",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(D){n.$$.not_equal(a.clientSecret,D)&&(a.clientSecret=D,t(1,a))}function $(D){a=D,t(1,a)}const T=()=>m();function C(D){se[D?"unshift":"push"](()=>{o=D,t(2,o)})}function O(D){pe.call(this,n,D)}function M(D){pe.call(this,n,D)}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,O,M]}class c6 extends ve{constructor(e){super(),be(this,e,f6,u6,_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"),Cn(e.src,t=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&&!Cn(e.src,t=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 d6(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,O=n[1].logo&&Lh(n),M=n[0].enabled&&Nh(),D={};return k=new c6({props:D}),n[4](k),k.$on("submit",n[5]),{c(){e=y("div"),t=y("figure"),O&&O.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='<i class="ri-settings-4-line"></i>',b=E(),H(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),O&&O.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),j(k,I,L),$=!0,T||(C=J(g,"click",n[3]),T=!0)},p(I,[L]){I[1].logo?O?O.p(I,L):(O=Lh(I),O.c(),O.m(t,null)):O&&(O.d(1),O=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),O&&O.d(),M&&M.d(),I&&w(b),n[4](null),V(k,I),T=!1,C()}}}function p6(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,p6,d6,_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 m6(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;g<f.length;g+=1){let b=Rh(n,f,g),k=d(b);i.set(k,t[g]=qh(k,b))}let p=n[3].length>0&&n[2].length>0&&jh(),m=n[2];const _=g=>g[9].key;for(let g=0;g<m.length;g+=1){let b=Fh(n,m,g),k=_(b);a.set(k,r[g]=Vh(k,b))}return{c(){e=y("div");for(let g=0;g<t.length;g+=1)t[g].c();s=E(),p&&p.c(),l=E(),o=y("div");for(let g=0;g<r.length;g+=1)r[g].c();h(e,"class","grid grid-sm"),h(o,"class","grid grid-sm")},m(g,b){S(g,e,b);for(let k=0;k<t.length;k+=1)t[k]&&t[k].m(e,null);S(g,s,b),p&&p.m(g,b),S(g,l,b),S(g,o,b);for(let k=0;k<r.length;k+=1)r[k]&&r[k].m(o,null);u=!0},p(g,b){b&9&&(f=g[3],re(),t=kt(t,b,d,1,g,f,i,e,Kt,qh,null,Rh),ae()),g[3].length>0&&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=kt(r,b,_,1,g,m,a,o,Kt,Vh,null,Fh),ae())},i(g){if(!u){for(let b=0;b<f.length;b+=1)A(t[b]);for(let b=0;b<m.length;b+=1)A(r[b]);u=!0}},o(g){for(let b=0;b<t.length;b+=1)P(t[b]);for(let b=0;b<r.length;b+=1)P(r[b]);u=!1},d(g){g&&w(e);for(let b=0;b<t.length;b+=1)t[b].d();g&&w(s),p&&p.d(g),g&&w(l),g&&w(o);for(let b=0;b<r.length;b+=1)r[b].d()}}}function h6(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 qh(n,e){let t,i,s,l,o;function r(u){e[5](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(()=>me(i,"config",r)),{key:n,first:null,c(){t=y("div"),H(i.$$.fragment),l=E(),h(t,"class","col-lg-6"),this.first=t},m(u,f){S(u,t,f),j(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],ye(()=>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),V(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(()=>me(i,"config",r)),{key:n,first:null,c(){t=y("div"),H(i.$$.fragment),l=E(),h(t,"class","col-lg-6"),this.first=t},m(u,f){S(u,t,f),j(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],ye(()=>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),V(i)}}}function _6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_;const g=[h6,m6],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 g6(n){let e,t,i,s;return e=new Fi({}),i=new Dn({props:{$$slots:{default:[_6]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(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){V(e,l),l&&w(t),V(i,l)}}}function b6(n,e,t){let i,s,l;Ke(n,Lt,p=>t(4,l=p)),tn(Lt,l="Auth providers",l);let o=!1,r={};a();async function a(){t(1,o=!0);try{const p=await he.settings.getAll()||{};u(p)}catch(p){he.errorResponseHandler(p)}t(1,o=!1)}function u(p){p=p||{},t(0,r={});for(const m of ul)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=ul.filter(p=>{var m;return(m=r[p.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,s=ul.filter(p=>{var m;return!((m=r[p.key])!=null&&m.enabled)}))},[r,o,s,i,l,f,d]}class v6 extends ve{constructor(e){super(),be(this,e,b6,g6,_e,{})}}function y6(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&&gt(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 k6(n){let e,t;return e=new de({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[y6,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function w6(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=gt(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=z.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,w6,k6,_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 S6(n){let e,t,i=[],s=new Map,l,o,r,a,u,f=[],d=new Map,p,m,_,g,b,k,$,T,C,O,M,D=n[5];const I=N=>N[19].key;for(let N=0;N<D.length;N+=1){let q=zh(n,D,N),Y=I(q);s.set(Y,i[N]=Bh(Y,q))}let L=n[6];const F=N=>N[19].key;for(let N=0;N<L.length;N+=1){let q=Hh(n,L,N),Y=F(q);d.set(Y,f[N]=Uh(Y,q))}let R=n[3]&&Wh(n);return{c(){e=y("h3"),e.textContent="Record tokens",t=E();for(let N=0;N<i.length;N+=1)i[N].c();l=E(),o=y("hr"),r=E(),a=y("h3"),a.textContent="Admin tokens",u=E();for(let N=0;N<f.length;N+=1)f[N].c();p=E(),m=y("div"),_=y("div"),g=E(),R&&R.c(),b=E(),k=y("button"),$=y("span"),$.textContent="Save changes",h(e,"class","section-title"),h(a,"class","section-title"),h(_,"class","flex-fill"),h($,"class","txt"),h(k,"type","submit"),h(k,"class","btn btn-expanded"),k.disabled=T=!n[3]||n[2],x(k,"btn-loading",n[2]),h(m,"class","flex")},m(N,q){S(N,e,q),S(N,t,q);for(let Y=0;Y<i.length;Y+=1)i[Y]&&i[Y].m(N,q);S(N,l,q),S(N,o,q),S(N,r,q),S(N,a,q),S(N,u,q);for(let Y=0;Y<f.length;Y+=1)f[Y]&&f[Y].m(N,q);S(N,p,q),S(N,m,q),v(m,_),v(m,g),R&&R.m(m,null),v(m,b),v(m,k),v(k,$),C=!0,O||(M=J(k,"click",n[16]),O=!0)},p(N,q){q&33&&(D=N[5],re(),i=kt(i,q,I,1,N,D,s,l.parentNode,Kt,Bh,l,zh),ae()),q&65&&(L=N[6],re(),f=kt(f,q,F,1,N,L,d,p.parentNode,Kt,Uh,p,Hh),ae()),N[3]?R?R.p(N,q):(R=Wh(N),R.c(),R.m(m,b)):R&&(R.d(1),R=null),(!C||q&12&&T!==(T=!N[3]||N[2]))&&(k.disabled=T),(!C||q&4)&&x(k,"btn-loading",N[2])},i(N){if(!C){for(let q=0;q<D.length;q+=1)A(i[q]);for(let q=0;q<L.length;q+=1)A(f[q]);C=!0}},o(N){for(let q=0;q<i.length;q+=1)P(i[q]);for(let q=0;q<f.length;q+=1)P(f[q]);C=!1},d(N){N&&w(e),N&&w(t);for(let q=0;q<i.length;q+=1)i[q].d(N);N&&w(l),N&&w(o),N&&w(r),N&&w(a),N&&w(u);for(let q=0;q<f.length;q+=1)f[q].d(N);N&&w(p),N&&w(m),R&&R.d(),O=!1,M()}}}function $6(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 Bh(n,e){let t,i,s,l,o;function r(f){e[11](f,e[19])}function a(f){e[12](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(()=>me(i,"duration",r)),se.push(()=>me(i,"secret",a)),{key:n,first:null,c(){t=Se(),H(i.$$.fragment),this.first=t},m(f,d){S(f,t,d),j(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,ye(()=>s=!1)),!l&&d&33&&(l=!0,p.secret=e[0][e[19].key].secret,ye(()=>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),V(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(()=>me(i,"duration",r)),se.push(()=>me(i,"secret",a)),{key:n,first:null,c(){t=Se(),H(i.$$.fragment),this.first=t},m(f,d){S(f,t,d),j(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,ye(()=>s=!1)),!l&&d&65&&(l=!0,p.secret=e[0][e[19].key].secret,ye(()=>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),V(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 T6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b;const k=[$6,S6],$=[];function T(C,O){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="<p>Adjust common token options.</p>",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,O){S(C,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(C,r,O),S(C,a,O),v(a,u),v(u,f),v(u,d),$[p].m(u,null),_=!0,g||(b=J(u,"submit",ct(n[7])),g=!0)},p(C,O){(!_||O&16)&&le(o,C[4]);let M=p;p=T(C),p===M?$[p].p(C,O):(re(),P($[M],1,1,()=>{$[M]=null}),ae(),m=$[p],m?m.p(C,O):(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 C6(n){let e,t,i,s;return e=new Fi({}),i=new Dn({props:{$$slots:{default:[T6]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(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){V(e,l),l&&w(t),V(i,l)}}}function M6(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"}];tn(Lt,l="Token options",l);let a={},u={},f=!1,d=!1;p();async function p(){t(1,f=!0);try{const M=await he.settings.getAll()||{};_(M)}catch(M){he.errorResponseHandler(M)}t(1,f=!1)}async function m(){if(!(d||!s)){t(2,d=!0);try{const M=await he.settings.update(z.filterRedactedProps(u));_(M),Yt("Successfully saved tokens options.")}catch(M){he.errorResponseHandler(M)}t(2,d=!1)}}function _(M){var I;M=M||{},t(0,u={});const D=o.concat(r);for(const L of D)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,D){n.$$.not_equal(u[D.key].duration,M)&&(u[D.key].duration=M,t(0,u))}function k(M,D){n.$$.not_equal(u[D.key].secret,M)&&(u[D.key].secret=M,t(0,u))}function $(M,D){n.$$.not_equal(u[D.key].duration,M)&&(u[D.key].duration=M,t(0,u))}function T(M,D){n.$$.not_equal(u[D.key].secret,M)&&(u[D.key].secret=M,t(0,u))}const C=()=>g(),O=()=>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,O]}class O6 extends ve{constructor(e){super(),be(this,e,M6,C6,_e,{})}}function D6(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=`<p>Below you&#39;ll find your current collections configuration that you could import in
another PocketBase environment.</p>`,t=E(),i=y("div"),s=y("button"),s.innerHTML='<span class="txt">Copy</span>',l=E(),H(o.$$.fragment),r=E(),a=y("div"),u=y("div"),f=E(),d=y("button"),d.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,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),j(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),V(o),n[8](null),g&&w(r),g&&w(a),m=!1,De(_)}}}function E6(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 A6(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[E6,D6],_=[];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 I6(n){let e,t,i,s;return e=new Fi({}),i=new Dn({props:{$$slots:{default:[A6]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=E(),H(i.$$.fragment)},m(l,o){j(e,l,o),S(l,t,o),j(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){V(e,l),l&&w(t),V(i,l)}}}function P6(n,e,t){let i,s;Ke(n,Lt,b=>t(3,s=b)),tn(Lt,s="Export collections",s);const l="export_"+z.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await he.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let b of r)delete b.created,delete b.updated}catch(b){he.errorResponseHandler(b)}t(1,a=!1)}function f(){z.downloadJson(r,"pb_schema")}function d(){z.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 L6 extends ve{constructor(e){super(),be(this,e,P6,I6,_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 N6(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 F6(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 R6(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,O,M,D;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]&&mn(($=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]&&mn((C=n[0])==null?void 0:C[n[30]],(O=n[1])==null?void 0:O[n[30]])),x(p,"changed-none-col",n[5]),h(e,"class","svelte-lmkr38"),x(e,"txt-primary",mn((M=n[0])==null?void 0:M[n[30]],(D=n[1])==null?void 0:D[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,O,M,D,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]&&mn((O=$[0])==null?void 0:O[$[30]],(M=$[1])==null?void 0:M[$[30]])),T[0]&1024&&x(r,"changed-none-col",$[10]),T[0]&2&&_!==(_=$[12]((D=$[1])==null?void 0:D[$[30]])+"")&&le(g,_),T[0]&2083&&x(p,"changed-new-col",!$[5]&&mn((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",mn((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;s<t.length;s+=1)i[s]=s_(Gh(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&4160){t=s[6];let o;for(o=0;o<t.length;o+=1){const r=Gh(s,t,o);i[o]?i[o].p(r,l):(i[o]=s_(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){pt(i,s),s&&w(e)}}}function i_(n){let e,t,i=n[17]+"",s,l,o,r,a=n[12](n[18])+"",u,f,d,p;return{c(){e=y("tr"),t=y("td"),s=U(i),l=E(),o=y("td"),r=y("pre"),u=U(a),f=E(),d=y("td"),p=E(),h(t,"class","min-width field-key-col svelte-lmkr38"),h(r,"class","txt"),h(o,"class","changed-old-col svelte-lmkr38"),h(d,"class","changed-none-col svelte-lmkr38"),h(e,"class","txt-primary svelte-lmkr38")},m(m,_){S(m,e,_),v(e,t),v(t,s),v(e,l),v(e,o),v(o,r),v(r,u),v(e,f),v(e,d),v(e,p)},p(m,_){_[0]&64&&i!==(i=m[17]+"")&&le(s,i),_[0]&64&&a!==(a=m[12](m[18])+"")&&le(u,a)},d(m){m&&w(e)}}}function s_(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,d,p,m=n[14].name+"",_,g,b,k,$=Object.entries(n[14]),T=[];for(let C=0;C<$.length;C+=1)T[C]=i_(Xh(n,$,C));return{c(){e=y("tr"),t=y("th"),i=y("span"),s=U("field: "),o=U(l),r=E(),a=y("span"),u=U("Deleted - "),f=y("small"),d=U("All stored data related to "),p=y("strong"),_=U(m),g=U(" will be deleted!"),b=E();for(let C=0;C<T.length;C+=1)T[C].c();k=Se(),h(i,"class","txt"),h(a,"class","label label-danger m-l-5 svelte-lmkr38"),h(t,"class","min-width svelte-lmkr38"),h(t,"colspan","3"),h(e,"class","svelte-lmkr38")},m(C,O){S(C,e,O),v(e,t),v(t,i),v(i,s),v(i,o),v(t,r),v(t,a),v(a,u),v(a,f),v(f,d),v(f,p),v(p,_),v(f,g),S(C,b,O);for(let M=0;M<T.length;M+=1)T[M]&&T[M].m(C,O);S(C,k,O)},p(C,O){if(O[0]&64&&l!==(l=C[14].name+"")&&le(o,l),O[0]&64&&m!==(m=C[14].name+"")&&le(_,m),O[0]&4160){$=Object.entries(C[14]);let M;for(M=0;M<$.length;M+=1){const D=Xh(C,$,M);T[M]?T[M].p(D,O):(T[M]=i_(D),T[M].c(),T[M].m(k.parentNode,k))}for(;M<T.length;M+=1)T[M].d(1);T.length=$.length}},d(C){C&&w(e),C&&w(b),pt(T,C),C&&w(k)}}}function l_(n){let e;return{c(){e=y("span"),e.textContent="Changed",h(e,"class","label label-warning m-l-5 svelte-lmkr38")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function o_(n){var g;let e,t,i=n[17]+"",s,l,o,r,a=n[12]((g=Nn(n[3],n[14].id))==null?void 0:g[n[17]])+"",u,f,d,p,m=n[12](n[23])+"",_;return{c(){var b,k,$;e=y("tr"),t=y("td"),s=U(i),l=E(),o=y("td"),r=y("pre"),u=U(a),f=E(),d=y("td"),p=y("pre"),_=U(m),h(t,"class","min-width field-key-col svelte-lmkr38"),h(r,"class","txt"),h(o,"class","svelte-lmkr38"),x(o,"changed-old-col",mn((b=Nn(n[3],n[14].id))==null?void 0:b[n[17]],n[23])),h(p,"class","txt"),h(d,"class","svelte-lmkr38"),x(d,"changed-new-col",mn((k=Nn(n[3],n[14].id))==null?void 0:k[n[17]],n[23])),h(e,"class","svelte-lmkr38"),x(e,"txt-primary",mn(($=Nn(n[3],n[14].id))==null?void 0:$[n[17]],n[23]))},m(b,k){S(b,e,k),v(e,t),v(t,s),v(e,l),v(e,o),v(o,r),v(r,u),v(e,f),v(e,d),v(d,p),v(p,_)},p(b,k){var $,T,C,O;k[0]&128&&i!==(i=b[17]+"")&&le(s,i),k[0]&136&&a!==(a=b[12](($=Nn(b[3],b[14].id))==null?void 0:$[b[17]])+"")&&le(u,a),k[0]&136&&x(o,"changed-old-col",mn((T=Nn(b[3],b[14].id))==null?void 0:T[b[17]],b[23])),k[0]&128&&m!==(m=b[12](b[23])+"")&&le(_,m),k[0]&136&&x(d,"changed-new-col",mn((C=Nn(b[3],b[14].id))==null?void 0:C[b[17]],b[23])),k[0]&136&&x(e,"txt-primary",mn((O=Nn(b[3],b[14].id))==null?void 0:O[b[17]],b[23]))},d(b){b&&w(e)}}}function r_(n){let e,t,i,s,l=n[14].name+"",o,r,a=mn(Nn(n[3],n[14].id),Nn(n[4],n[14].id)),u,f,d=a&&l_(),p=Object.entries(n[14]),m=[];for(let _=0;_<p.length;_+=1)m[_]=o_(Zh(n,p,_));return{c(){e=y("tr"),t=y("th"),i=y("span"),s=U("field: "),o=U(l),r=E(),d&&d.c(),u=E();for(let _=0;_<m.length;_+=1)m[_].c();f=Se(),h(i,"class","txt"),h(t,"class","min-width svelte-lmkr38"),h(t,"colspan","3"),h(e,"class","svelte-lmkr38")},m(_,g){S(_,e,g),v(e,t),v(t,i),v(i,s),v(i,o),v(t,r),d&&d.m(t,null),S(_,u,g);for(let b=0;b<m.length;b+=1)m[b]&&m[b].m(_,g);S(_,f,g)},p(_,g){if(g[0]&128&&l!==(l=_[14].name+"")&&le(o,l),g[0]&152&&(a=mn(Nn(_[3],_[14].id),Nn(_[4],_[14].id))),a?d||(d=l_(),d.c(),d.m(t,null)):d&&(d.d(1),d=null),g[0]&4232){p=Object.entries(_[14]);let b;for(b=0;b<p.length;b+=1){const k=Zh(_,p,b);m[b]?m[b].p(k,g):(m[b]=o_(k),m[b].c(),m[b].m(f.parentNode,f))}for(;b<m.length;b+=1)m[b].d(1);m.length=p.length}},d(_){_&&w(e),d&&d.d(),_&&w(u),pt(m,_),_&&w(f)}}}function a_(n){let e,t,i=n[17]+"",s,l,o,r,a,u,f=n[12](n[18])+"",d,p;return{c(){e=y("tr"),t=y("td"),s=U(i),l=E(),o=y("td"),r=E(),a=y("td"),u=y("pre"),d=U(f),p=E(),h(t,"class","min-width field-key-col svelte-lmkr38"),h(o,"class","changed-none-col svelte-lmkr38"),h(u,"class","txt"),h(a,"class","changed-new-col svelte-lmkr38"),h(e,"class","txt-primary svelte-lmkr38")},m(m,_){S(m,e,_),v(e,t),v(t,s),v(e,l),v(e,o),v(e,r),v(e,a),v(a,u),v(u,d),v(e,p)},p(m,_){_[0]&256&&i!==(i=m[17]+"")&&le(s,i),_[0]&256&&f!==(f=m[12](m[18])+"")&&le(d,f)},d(m){m&&w(e)}}}function u_(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,d=Object.entries(n[14]),p=[];for(let m=0;m<d.length;m+=1)p[m]=a_(Kh(n,d,m));return{c(){e=y("tr"),t=y("th"),i=y("span"),s=U("field: "),o=U(l),r=E(),a=y("span"),a.textContent="Added",u=E();for(let m=0;m<p.length;m+=1)p[m].c();f=Se(),h(i,"class","txt"),h(a,"class","label label-success m-l-5 svelte-lmkr38"),h(t,"class","min-width svelte-lmkr38"),h(t,"colspan","3"),h(e,"class","svelte-lmkr38")},m(m,_){S(m,e,_),v(e,t),v(t,i),v(i,s),v(i,o),v(t,r),v(t,a),S(m,u,_);for(let g=0;g<p.length;g+=1)p[g]&&p[g].m(m,_);S(m,f,_)},p(m,_){if(_[0]&256&&l!==(l=m[14].name+"")&&le(o,l),_[0]&4352){d=Object.entries(m[14]);let g;for(g=0;g<d.length;g+=1){const b=Kh(m,d,g);p[g]?p[g].p(b,_):(p[g]=a_(b),p[g].c(),p[g].m(f.parentNode,f))}for(;g<p.length;g+=1)p[g].d(1);p.length=d.length}},d(m){m&&w(e),m&&w(u),pt(p,m),m&&w(f)}}}function q6(n){let e,t,i,s,l,o,r,a,u;function f(C,O){var M,D;return(M=C[0])!=null&&M.id?(D=C[1])!=null&&D.id?N6:F6:R6}let d=f(n),p=d(n),m=n[11],_=[];for(let C=0;C<m.length;C+=1)_[C]=t_(Qh(n,m,C));let g=(n[2]||n[5])&&n_(n),b=n[7],k=[];for(let C=0;C<b.length;C+=1)k[C]=r_(Jh(n,b,C));let $=n[8],T=[];for(let C=0;C<$.length;C+=1)T[C]=u_(Yh(n,$,C));return{c(){e=y("div"),p.c(),t=E(),i=y("table"),s=y("thead"),s.innerHTML=`<tr class="svelte-lmkr38"><th class="svelte-lmkr38">Props</th>
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,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<k.length;C+=1)k[C].c();u=E();for(let C=0;C<T.length;C+=1)T[C].c();h(e,"class","section-title"),h(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(C,O){S(C,e,O),p.m(e,null),S(C,t,O),S(C,i,O),v(i,s),v(i,l),v(i,o);for(let M=0;M<_.length;M+=1)_[M]&&_[M].m(o,null);v(o,r),g&&g.m(o,null),v(o,a);for(let M=0;M<k.length;M+=1)k[M]&&k[M].m(o,null);v(o,u);for(let M=0;M<T.length;M+=1)T[M]&&T[M].m(o,null)},p(C,O){if(d===(d=f(C))&&p?p.p(C,O):(p.d(1),p=d(C),p&&(p.c(),p.m(e,null))),O[0]&7203){m=C[11];let M;for(M=0;M<m.length;M+=1){const D=Qh(C,m,M);_[M]?_[M].p(D,O):(_[M]=t_(D),_[M].c(),_[M].m(o,r))}for(;M<_.length;M+=1)_[M].d(1);_.length=m.length}if(C[2]||C[5]?g?g.p(C,O):(g=n_(C),g.c(),g.m(o,a)):g&&(g.d(1),g=null),O[0]&4248){b=C[7];let M;for(M=0;M<b.length;M+=1){const D=Jh(C,b,M);k[M]?k[M].p(D,O):(k[M]=r_(D),k[M].c(),k[M].m(o,u))}for(;M<k.length;M+=1)k[M].d(1);k.length=b.length}if(O[0]&4352){$=C[8];let M;for(M=0;M<$.length;M+=1){const D=Yh(C,$,M);T[M]?T[M].p(D,O):(T[M]=u_(D),T[M].c(),T[M].m(o,null))}for(;M<T.length;M+=1)T[M].d(1);T.length=$.length}},i:Q,o:Q,d(C){C&&w(e),p.d(),C&&w(t),C&&w(i),pt(_,C),g&&g.d(),pt(k,C),pt(T,C)}}}function Nn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function mn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function j6(n,e,t){let i,s,l,{collectionA:o=new bn}=e,{collectionB:r=new bn}=e,{deleteMissing:a=!1}=e,u=[],f=[],d=[],p=[],m=[];const _=Object.keys(new bn().$export()).filter(k=>!["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"?"":z.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=z.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,d,p,m,l,s,_,b]}class V6 extends ve{constructor(e){super(),be(this,e,j6,q6,_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 V6({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){H(e.$$.fragment)},m(i,s){j(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){V(e,i)}}}function H6(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=c_(f_(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Se()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=f_(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=c_(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){pt(s,o),o&&w(e)}}}function z6(n){let e;return{c(){e=y("h4"),e.textContent="Side-by-side diff",h(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:Q,d(t){t&&w(e)}}}function B6(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("span"),l.textContent="Confirm and import",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[4],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-expanded"),s.disabled=n[4],x(s,"btn-loading",n[4])},m(a,u){S(a,e,u),v(e,t),S(a,i,u),S(a,s,u),v(s,l),o||(r=[J(e,"click",n[0]),J(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&x(s,"btn-loading",a[4])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,De(r)}}}function U6(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[B6],header:[z6],default:[H6]},$$scope:{ctx:n}};return e=new cn({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){H(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&1048604&&(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[11](null),V(e,s)}}}function W6(n,e,t){const i=wt();let s,l=[],o=[],r=[],a=!1,u=!1;function f(C,O,M=!1){t(7,l=C),t(8,o=O),t(3,a=M),s==null||s.show()}function d(){return s==null?void 0:s.hide()}function p(){t(2,r=[]);for(const C of l){const O=z.findByKey(o,"id",C.id)||null;(a&&!(O!=null&&O.id)||O!=null&&O.id&&z.hasCollectionChanges(C,O,a))&&r.push({old:C,new:O})}for(const C of o){const O=z.findByKey(l,"id",C.id)||null;O!=null&&O.id||r.push({old:O,new:C})}}function m(){const C=[];if(a)for(const O of l){const M=z.findByKey(o,"id",O.id);if(!M)C.push(O.name+".*");else{const D=Array.isArray(O.schema)?O.schema:[];for(const I of D)z.findByKey(M.schema,"id",I.id)||C.push(`${O.name}.${I.name} (${I.id})`)}}C.length?_n(`Do you really want to delete the following collection fields and their related records data:
- ${C.join(`
- `)}`,()=>{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await he.collections.import(o,a),Yt("Successfully imported collections configuration."),i("submit")}catch(C){he.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 Y6 extends ve{constructor(e){super(),be(this,e,W6,U6,_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 K6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,g,b,k,$,T,C,O,M,D;a=new de({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[Z6,({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='<span class="txt">Load from JSON file</span>',r=E(),H(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),j(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),O=!0,M||(D=[J(e,"change",n[20]),J(o,"click",n[21]),J($,"click",n[26])],M=!0)},p(q,Y){(!O||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),(!O||Y[0]&16384&&C!==(C=!q[14]))&&($.disabled=C)},i(q){O||(A(a.$$.fragment,q),A(I),O=!0)},o(q){P(a.$$.fragment,q),P(I),O=!1},d(q){q&&w(e),n[19](null),q&&w(t),q&&w(i),q&&w(r),V(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(D)}}}function J6(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 Z6(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=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,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;o<s.length;o+=1){let r=m_(n,s,o),a=l(r);t.set(a,e[o]=y_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=kt(e,r,l,1,o,s,t,i.parentNode,is,y_,i,m_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function v_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function y_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&v_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Deleted",s=E(),l=y("strong"),r=U(o),a=E(),f&&f.c(),u=E(),h(i,"class","label label-danger list-label svelte-1jx20fl"),h(t,"class","list-item"),this.first=t},m(d,p){S(d,t,p),v(t,i),v(t,s),v(t,l),v(l,r),v(t,a),f&&f.m(t,null),v(t,u)},p(d,p){e=d,p[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,p):(f=v_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(d){d&&w(t),f&&f.d()}}}function k_(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=p_(n,s,o),a=l(r);t.set(a,e[o]=$_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=kt(e,r,l,1,o,s,t,i.parentNode,is,$_,i,p_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function w_(n){let e,t=n[35].old.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]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function S_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function $_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,d,p=e[35].old.name!==e[35].new.name&&w_(e),m=e[35].new.id&&S_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Changed",s=E(),l=y("div"),p&&p.c(),o=E(),r=y("strong"),u=U(a),f=E(),m&&m.c(),d=E(),h(i,"class","label label-warning list-label svelte-1jx20fl"),h(l,"class","inline-flex flex-gap-5"),h(t,"class","list-item"),this.first=t},m(_,g){S(_,t,g),v(t,i),v(t,s),v(t,l),p&&p.m(l,null),v(l,o),v(l,r),v(r,u),v(l,f),m&&m.m(l,null),v(t,d)},p(_,g){e=_,e[35].old.name!==e[35].new.name?p?p.p(e,g):(p=w_(e),p.c(),p.m(l,o)):p&&(p.d(1),p=null),g[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?m?m.p(e,g):(m=S_(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(_){_&&w(t),p&&p.d(),m&&m.d()}}}function T_(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=d_(n,s,o),a=l(r);t.set(a,e[o]=M_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=kt(e,r,l,1,o,s,t,i.parentNode,is,M_,i,d_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function C_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function M_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&C_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Added",s=E(),l=y("strong"),r=U(o),a=E(),f&&f.c(),u=E(),h(i,"class","label label-success list-label svelte-1jx20fl"),h(t,"class","list-item"),this.first=t},m(d,p){S(d,t,p),v(t,i),v(t,s),v(t,l),v(l,r),v(t,a),f&&f.m(t,null),v(t,u)},p(d,p){e=d,p[0]&256&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,p):(f=C_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(d){d&&w(t),f&&f.d()}}}function O_(n){let e,t,i,s,l,o,r,a;return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=E(),s=y("div"),s.innerHTML=`<string>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.</string>`,l=E(),o=y("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',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='<span class="txt">Clear</span>',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 G6(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[J6,K6],_=[];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 X6(n){let e,t,i,s,l,o;e=new Fi({}),i=new Dn({props:{$$slots:{default:[G6]},$$scope:{ctx:n}}});let r={};return l=new Y6({props:r}),n[27](l),l.$on("submit",n[28]),{c(){H(e.$$.fragment),t=E(),H(i.$$.fragment),s=E(),H(l.$$.fragment)},m(a,u){j(e,a,u),S(a,t,u),j(i,a,u),S(a,s,u),j(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){V(e,a),a&&w(t),V(i,a),a&&w(s),n[27](null),V(l,a)}}}function Q6(n,e,t){let i,s,l,o,r,a,u;Ke(n,Lt,X=>t(15,u=X)),tn(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 he.collections.getFullList(200));for(let X of g)delete X.created,delete X.updated}catch(X){he.errorResponseHandler(X)}t(5,$=!1)}function C(){if(t(4,k=[]),!!i)for(let X of _){const fe=z.findByKey(g,"id",X.id);!(fe!=null&&fe.id)||!z.hasCollectionChanges(fe,X,b)||k.push({new:X,old:fe})}}function O(){t(1,_=[]);try{t(1,_=JSON.parse(p))}catch{}Array.isArray(_)?t(1,_=z.filterDuplicatesByKey(_)):t(1,_=[]);for(let X of _)delete X.created,delete X.updated,X.schema=z.filterDuplicatesByKey(X.schema)}function M(){var X,fe;for(let G of _){const ce=z.findByKey(g,"name",G.name)||z.findByKey(g,"id",G.id);if(!ce)continue;const ge=G.id,Me=ce.id;G.id=Me;const je=Array.isArray(ce.schema)?ce.schema:[],He=Array.isArray(G.schema)?G.schema:[];for(const we of He){const Ce=z.findByKey(je,"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 D(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 un(),_.length||(ml("Invalid collections configuration."),I())},fe.onerror=G=>{console.warn(G),ml("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),fn({})}function L(X){se[X?"unshift":"push"](()=>{f=X,t(10,f)})}const F=()=>{f.files.length&&D(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"&&O(),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&&!z.findByKey(_,"id",X.id))),n.$$.dirty[0]&70&&t(8,l=_.filter(X=>i&&!z.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=z.findByKey(g,"name",X.name)||z.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(z.findByKey(G,"id",ge.id))continue;const je=z.findByKey(G,"name",ge.name);if(je&&ge.id!=je.id)return!0}return!1}))},[p,_,g,b,k,$,i,o,l,s,f,d,m,a,r,u,M,D,I,L,F,R,N,q,Y,B,Z,ee,ie]}class x6 extends ve{constructor(e){super(),be(this,e,Q6,X6,_e,{},null,[-1,-1])}}const qt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Ii("/"):!0}],eI={"/login":Ft({component:YE,conditions:qt.concat([n=>!he.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Ft({asyncComponent:()=>at(()=>import("./PageAdminRequestPasswordReset-5492dbdb.js"),[],import.meta.url),conditions:qt.concat([n=>!he.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Ft({asyncComponent:()=>at(()=>import("./PageAdminConfirmPasswordReset-137c6b4a.js"),[],import.meta.url),conditions:qt.concat([n=>!he.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Ft({component:_E,conditions:qt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Ft({component:u$,conditions:qt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Ft({component:nA,conditions:qt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Ft({component:VE,conditions:qt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Ft({component:VA,conditions:qt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Ft({component:n6,conditions:qt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Ft({component:v6,conditions:qt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Ft({component:O6,conditions:qt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Ft({component:L6,conditions:qt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Ft({component:x6,conditions:qt.concat([n=>he.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Ft({asyncComponent:()=>at(()=>import("./PageRecordConfirmPasswordReset-16742fdd.js"),[],import.meta.url),conditions:qt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Ft({asyncComponent:()=>at(()=>import("./PageRecordConfirmPasswordReset-16742fdd.js"),[],import.meta.url),conditions:qt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Ft({asyncComponent:()=>at(()=>import("./PageRecordConfirmVerification-2f7ec2dd.js"),[],import.meta.url),conditions:qt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Ft({asyncComponent:()=>at(()=>import("./PageRecordConfirmVerification-2f7ec2dd.js"),[],import.meta.url),conditions:qt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Ft({asyncComponent:()=>at(()=>import("./PageRecordConfirmEmailChange-0307ca05.js"),[],import.meta.url),conditions:qt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Ft({asyncComponent:()=>at(()=>import("./PageRecordConfirmEmailChange-0307ca05.js"),[],import.meta.url),conditions:qt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":Ft({asyncComponent:()=>at(()=>import("./PageOAuth2Redirect-0ed6174e.js"),[],import.meta.url),conditions:qt,userData:{showAppSidebar:!1}}),"*":Ft({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:zt(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(O,M){return O[2].type==="info"?lI:O[2].type==="success"?sI:O[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='<i class="ri-close-line"></i>',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(O,M){S(O,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",ct(C)),g=!0)},p(O,M){e=O,$!==($=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(O){_||(tt(()=>{_&&(d||(d=Ve(t,yo,{duration:150},!0)),d.run(1))}),_=!0)},o(O){d||(d=Ve(t,yo,{duration:150},!1)),d.run(0),_=!1},d(O){O&&w(t),T.d(),O&&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;r<l.length;r+=1){let a=E_(n,l,r),u=o(a);i.set(u,t[r]=A_(u,a))}return{c(){e=y("div");for(let r=0;r<t.length;r+=1)t[r].c();h(e,"class","toasts-wrapper")},m(r,a){S(r,e,a);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(e,null);s=!0},p(r,[a]){if(a&1){l=r[0],re();for(let u=0;u<t.length;u+=1)t[u].r();t=kt(t,a,o,1,r,l,i,e,Rb,A_,null,E_);for(let u=0;u<t.length;u+=1)t[u].a();ae()}},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&w(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function rI(n,e,t){let i;return Ke(n,Uo,l=>t(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 cn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){H(e.$$.fragment)},m(s,l){j(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),V(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 un(),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 Hn({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='<img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=E(),s=y("nav"),l=y("a"),l.innerHTML='<i class="ri-database-2-line"></i>',o=E(),r=y("a"),r.innerHTML='<i class="ri-line-chart-line"></i>',a=E(),u=y("a"),u.innerHTML='<i class="ri-tools-line"></i>',f=E(),d=y("figure"),p=y("img"),_=E(),H(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"),Cn(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,_),j(g,d,null),b=!0,k||($=[Ee(ln.call(null,t)),Ee(ln.call(null,l)),Ee(Un.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ee(Ue.call(null,l,{text:"Collections",position:"right"})),Ee(ln.call(null,r)),Ee(Un.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ee(Ue.call(null,r,{text:"Logs",position:"right"})),Ee(ln.call(null,u)),Ee(Un.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&&!Cn(p.src,m="./images/avatars/avatar"+(((M=T[0])==null?void 0:M.avatar)||0)+".svg"))&&h(p,"src",m);const O={};C&4096&&(O.$$scope={dirty:C,ctx:T}),g.$set(O)},i(T){b||(A(g.$$.fragment,T),b=!0)},o(T){P(g.$$.fragment,T),b=!1},d(T){T&&w(e),V(g),k=!1,De($)}}}function mI(n){let e,t,i,s,l,o,r;return{c(){e=y("a"),e.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Manage admins</span>`,t=E(),i=y("hr"),s=E(),l=y("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,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(ln.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:z.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=y("div"),H(t.$$.fragment),h(e,"class","tinymce-preloader hidden")},m(s,l){S(s,e,l),j(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),V(t)}}}function hI(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,m;document.title=e=z.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"),H(o.$$.fragment),r=E(),H(a.$$.fragment),u=E(),H(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),j(o,l,null),v(l,r),j(a,l,null),S(k,u,$),j(f,k,$),S(k,d,$),g&&g.m(k,$),S(k,p,$),m=!0},p(k,[$]){var T;(!m||$&24)&&e!==(e=z.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(),V(o),V(a),k&&w(u),V(f,k),k&&w(d),g&&g.d(k),k&&w(p)}}}function _I(n,e,t){let i,s,l,o;Ke(n,Ms,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,tn(Lt,o="",o),fn({}),nb())}function d(){Ii("/")}async function p(){var g,b;if(l!=null&&l.id)try{const k=await he.settings.getAll({$cancelKey:"initialAppSettings"});tn(wo,s=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",s),tn(Ms,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(){he.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,Yt as B,z as C,Ii as D,Se as E,e1 as F,X_ as G,Xt as H,Ke as I,ii as J,wt as K,se as L,x1 as M,kt as N,is as O,Kt as P,pt as Q,bn as R,ve as S,qr as T,Vo as _,P as a,E as b,H as c,V as d,y as e,h as f,S as g,v as h,be as i,Ee as j,re as k,ln as l,j as m,ae as n,w as o,he as p,de as q,x as r,_e as s,A as t,J as u,ct as v,U as w,le as x,Q as y,ue as z};