1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-04-17 14:06:24 +02:00
pocketbase/ui/dist/assets/index.502fcf04.js

662 lines
845 KiB
JavaScript

(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 se(){}const $l=n=>n;function ut(n,e){for(const t in e)n[t]=e[t];return n}function Rm(n){return n()}function iu(){return Object.create(null)}function Je(n){n.forEach(Rm)}function Nn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let jl;function ti(n,e){return jl||(jl=document.createElement("a")),jl.href=e,n===jl.href}function hb(n){return Object.keys(n).length===0}function Hm(n,...e){if(n==null)return se;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function at(n,e,t){n.$$.on_destroy.push(Hm(e,t))}function $n(n,e,t,i){if(n){const s=jm(n,e,t,i);return n[0](s)}}function jm(n,e,t,i){return n[1]&&i?ut(t.ctx.slice(),n[1](i(e))):t.ctx}function Sn(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 Cn(n,e,t,i,s,l){if(s){const o=jm(e,t,i,l);n.p(o,s)}}function Mn(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 li(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Bt(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 su(n){return n==null?"":n}function nn(n,e,t){return n.set(t),e}function Ye(n){return n&&Nn(n.destroy)?n.destroy:se}const qm=typeof window<"u";let Ro=qm?()=>window.performance.now():()=>Date.now(),ma=qm?n=>requestAnimationFrame(n):se;const ks=new Set;function Vm(n){ks.forEach(e=>{e.c(n)||(ks.delete(e),e.f())}),ks.size!==0&&ma(Vm)}function Ho(n){let e;return ks.size===0&&ma(Vm),{promise:new Promise(t=>{ks.add(e={c:n,f:t})}),abort(){ks.delete(e)}}}function m(n,e){n.appendChild(e)}function zm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function mb(n){const e=_("style");return gb(zm(n),e),e.sheet}function gb(n,e){return m(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function Yt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function N(n){return document.createTextNode(n)}function D(){return N(" ")}function We(){return N("")}function J(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Wt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function ni(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Bm(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function mi(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function Pt(n){return n===""?null:+n}function _b(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Se(n,e){n.value=e==null?"":e}function lu(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function te(n,e,t){n.classList[t?"add":"remove"](e)}function Um(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const mo=new Map;let go=0;function bb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function vb(n,e){const t={stylesheet:mb(e),rules:{}};return mo.set(n,t),t}function cl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${bb(f)}_${r}`,d=zm(n),{stylesheet:h,rules:g}=mo.get(d)||vb(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,go+=1,c}function dl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),go-=s,go||yb())}function yb(){ma(()=>{go||(mo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),mo.clear())})}function kb(n,e,t,i){if(!e)return se;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return se;const{delay:l=0,duration:o=300,easing:r=$l,start:a=Ro()+l,end:u=a+o,tick:f=se,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function v(){c&&(g=cl(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&dl(n,g),d=!1}return Ho(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const $=y-a,C=0+1*r($/o);f(C,1-C)}return!0}),v(),f(0,1),b}function wb(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,Wm(n,s)}}function Wm(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let pl;function nl(n){pl=n}function jo(){if(!pl)throw new Error("Function called outside component initialization");return pl}function Fn(n){jo().$$.on_mount.push(n)}function $b(n){jo().$$.after_update.push(n)}function Sb(n){jo().$$.on_destroy.push(n)}function xt(){const n=jo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Um(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function tt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Xs=[],me=[],ao=[],Rr=[],Ym=Promise.resolve();let Hr=!1;function Km(){Hr||(Hr=!0,Ym.then(Jm))}function Zn(){return Km(),Ym}function Tt(n){ao.push(n)}function je(n){Rr.push(n)}const lr=new Set;let ql=0;function Jm(){const n=pl;do{for(;ql<Xs.length;){const e=Xs[ql];ql++,nl(e),Cb(e.$$)}for(nl(null),Xs.length=0,ql=0;me.length;)me.pop()();for(let e=0;e<ao.length;e+=1){const t=ao[e];lr.has(t)||(lr.add(t),t())}ao.length=0}while(Xs.length);for(;Rr.length;)Rr.pop()();Hr=!1,lr.clear(),nl(n)}function Cb(n){if(n.fragment!==null){n.update(),Je(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Tt)}}let js;function ga(){return js||(js=Promise.resolve(),js.then(()=>{js=null})),js}function ns(n,e,t){n.dispatchEvent(Um(`${e?"intro":"outro"}${t}`))}const uo=new Set;let ci;function Ae(){ci={r:0,c:[],p:ci}}function Pe(){ci.r||Je(ci.c),ci=ci.p}function A(n,e){n&&n.i&&(uo.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(uo.has(n))return;uo.add(n),ci.c.push(()=>{uo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const _a={duration:0};function Zm(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&dl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=$l,tick:g=se,css:v}=i||_a;v&&(l=cl(n,0,1,d,c,h,v,r++)),g(0,1);const b=Ro()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>ns(n,!0,"start")),o=Ho($=>{if(s){if($>=y)return g(1,0),ns(n,!0,"end"),a(),s=!1;if($>=b){const C=h(($-b)/d);g(C,1-C)}}return s})}let f=!1;return{start(){f||(f=!0,dl(n),Nn(i)?(i=i(),ga().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Gm(n,e,t){let i=e(n,t),s=!0,l;const o=ci;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=$l,tick:c=se,css:d}=i||_a;d&&(l=cl(n,1,0,u,a,f,d));const h=Ro()+a,g=h+u;Tt(()=>ns(n,!1,"start")),Ho(v=>{if(s){if(v>=g)return c(0,1),ns(n,!1,"end"),--o.r||Je(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Nn(i)?ga().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&dl(n,l),s=!1)}}}function st(n,e,t,i){let s=e(n,t),l=i?0:1,o=null,r=null,a=null;function u(){a&&dl(n,a)}function f(d,h){const g=d.b-l;return h*=Math.abs(g),{a:l,b:d.b,d:g,duration:h,start:d.start,end:d.start+h,group:d.group}}function c(d){const{delay:h=0,duration:g=300,easing:v=$l,tick:b=se,css:y}=s||_a,$={start:Ro()+h,b:d};d||($.group=ci,ci.r+=1),o||r?r=$:(y&&(u(),a=cl(n,l,d,g,h,v,y)),d&&b(0,1),o=f($,g),Tt(()=>ns(n,d,"start")),Ho(C=>{if(r&&C>r.start&&(o=f(r,g),r=null,ns(n,o.b,"start"),y&&(u(),a=cl(n,l,o.b,o.duration,0,v,s.css))),o){if(C>=o.end)b(l=o.b,1-l),ns(n,o.b,"end"),r||(o.b?u():--o.group.r||Je(o.group.c)),o=null;else if(C>=o.start){const S=C-o.start;l=o.a+o.d*v(S/o.duration),b(l,1-l)}}return!!(o||r)}))}return{run(d){Nn(s)?ga().then(()=>{s=s(),c(d)}):c(d)},end(){u(),o=r=null}}}function bn(n,e){n.d(1),e.delete(n.key)}function Gt(n,e){L(n,1,1,()=>{e.delete(n.key)})}function Mb(n,e){n.f(),Gt(n,e)}function _t(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,g=d;const v={};for(;g--;)v[n[g].key]=g;const b=[],y=new Map,$=new Map;for(g=h;g--;){const M=c(s,l,g),O=t(M);let E=o.get(O);E?i&&E.p(M,e):(E=u(O,M),E.c()),y.set(O,b[g]=E),O in v&&$.set(O,Math.abs(g-v[O]))}const C=new Set,S=new Set;function T(M){A(M,1),M.m(r,f),o.set(M.key,M),f=M.first,h--}for(;d&&h;){const M=b[h-1],O=n[d-1],E=M.key,P=O.key;M===O?(f=M.first,d--,h--):y.has(P)?!o.has(E)||C.has(E)?T(M):S.has(P)?d--:$.get(E)>$.get(P)?(S.add(E),T(M)):(C.add(P),d--):(a(O,o),d--)}for(;d--;){const M=n[d];y.has(M.key)||a(M,o)}for(;h;)T(b[h-1]);return b}function pn(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 oi(n){return typeof n=="object"&&n!==null?n:{}}function Re(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function q(n){n&&n.c()}function H(n,e,t,i){const{fragment:s,on_mount:l,on_destroy:o,after_update:r}=n.$$;s&&s.m(e,t),i||Tt(()=>{const a=l.map(Rm).filter(Nn);o?o.push(...a):Je(a),n.$$.on_mount=[]}),r.forEach(Tt)}function j(n,e){const t=n.$$;t.fragment!==null&&(Je(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Tb(n,e){n.$$.dirty[0]===-1&&(Xs.push(n),Km(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Oe(n,e,t,i,s,l,o,r=[-1]){const a=pl;nl(n);const u=n.$$={fragment:null,ctx:null,props:l,update:se,not_equal:s,bound:iu(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:iu(),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||{},(c,d,...h)=>{const g=h.length?h[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&Tb(n,c)),d}):[],u.update(),f=!0,Je(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=_b(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),H(n,e.target,e.anchor,e.customElement),Jm()}nl(a)}class Ee{$destroy(){j(this,1),this.$destroy=se}$on(e,t){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&&!hb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function tn(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 gs=[];function Xm(n,e){return{subscribe:Gn(n,e).subscribe}}function Gn(n,e=se){let t;const i=new Set;function s(r){if(De(n,r)&&(n=r,t)){const a=!gs.length;for(const u of i)u[1](),gs.push(u,n);if(a){for(let u=0;u<gs.length;u+=2)gs[u][0](gs[u+1]);gs.length=0}}}function l(r){s(r(n))}function o(r,a=se){const u=[r,a];return i.add(u),i.size===1&&(t=e(s)||se),r(n),()=>{i.delete(u),i.size===0&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function Qm(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return Xm(t,o=>{let r=!1;const a=[];let u=0,f=se;const c=()=>{if(u)return;f();const h=e(i?a[0]:a,o);l?o(h):f=Nn(h)?h:se},d=s.map((h,g)=>Hm(h,v=>{a[g]=v,u&=~(1<<g),r&&c()},()=>{u|=1<<g}));return r=!0,c(),function(){Je(d),f()}})}function xm(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 Db(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=ut(a,s[u]);return{props:a}}return l&&(e=new l(o()),e.$on("routeEvent",n[7])),{c(){e&&q(e.$$.fragment),t=We()},m(r,a){e&&H(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a&4?pn(s,[oi(r[2])]):{};if(l!==(l=r[0])){if(e){Ae();const f=e;L(f.$$.fragment,1,0,()=>{j(f,1)}),Pe()}l?(e=new l(o()),e.$on("routeEvent",r[7]),q(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&j(e,r)}}}function Ob(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=ut(a,s[u]);return{props:a}}return l&&(e=new l(o()),e.$on("routeEvent",n[6])),{c(){e&&q(e.$$.fragment),t=We()},m(r,a){e&&H(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a&6?pn(s,[a&2&&{params:r[1]},a&4&&oi(r[2])]):{};if(l!==(l=r[0])){if(e){Ae();const f=e;L(f.$$.fragment,1,0,()=>{j(f,1)}),Pe()}l?(e=new l(o()),e.$on("routeEvent",r[6]),q(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&j(e,r)}}}function Eb(n){let e,t,i,s;const l=[Ob,Db],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=We()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(Ae(),L(o[f],1,1,()=>{o[f]=null}),Pe(),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){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function ou(){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 qo=Xm(null,function(e){e(ou());const t=()=>{e(ou())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Qm(qo,n=>n.location);const Vo=Qm(qo,n=>n.querystring),ru=Gn(void 0);async function Ci(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Zn();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 mn(n,e){if(e=uu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return au(n,e),{update(t){t=uu(t),au(n,t)}}}function Ab(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function au(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||Pb(i.currentTarget.getAttribute("href"))})}function uu(n){return n&&typeof n=="string"?{href:n}:n||{}}function Pb(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Lb(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(T,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!T||typeof T=="string"&&(T.length<1||T.charAt(0)!="/"&&T.charAt(0)!="*")||typeof T=="object"&&!(T instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:E}=xm(T);this.path=T,typeof M=="object"&&M._sveltesparouter===!0?(this.component=M.component,this.conditions=M.conditions||[],this.userData=M.userData,this.props=M.props||{}):(this.component=()=>Promise.resolve(M),this.conditions=[],this.props={}),this._pattern=O,this._keys=E}match(T){if(s){if(typeof s=="string")if(T.startsWith(s))T=T.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const P=T.match(s);if(P&&P[0])T=T.substr(P[0].length)||"/";else return null}}const M=this._pattern.exec(T);if(M===null)return null;if(this._keys===!1)return M;const O={};let E=0;for(;E<this._keys.length;){try{O[this._keys[E]]=decodeURIComponent(M[E+1]||"")||null}catch{O[this._keys[E]]=null}E++}return O}async checkConditions(T){for(let M=0;M<this.conditions.length;M++)if(!await this.conditions[M](T))return!1;return!0}}const r=[];i instanceof Map?i.forEach((S,T)=>{r.push(new o(T,S))}):Object.keys(i).forEach(S=>{r.push(new o(S,i[S]))});let a=null,u=null,f={};const c=xt();async function d(S,T){await Zn(),c(S,T)}let h=null,g=null;l&&(g=S=>{S.state&&(S.state.__svelte_spa_router_scrollY||S.state.__svelte_spa_router_scrollX)?h=S.state:h=null},window.addEventListener("popstate",g),$b(()=>{Ab(h)}));let v=null,b=null;const y=qo.subscribe(async S=>{v=S;let T=0;for(;T<r.length;){const M=r[T].match(S.location);if(!M){T++;continue}const O={route:r[T].path,location:S.location,querystring:S.querystring,userData:r[T].userData,params:M&&typeof M=="object"&&Object.keys(M).length?M:null};if(!await r[T].checkConditions(O)){t(0,a=null),b=null,d("conditionsFailed",O);return}d("routeLoading",Object.assign({},O));const E=r[T].component;if(b!=E){E.loading?(t(0,a=E.loading),b=E,t(1,u=E.loadingParams),t(2,f={}),d("routeLoaded",Object.assign({},O,{component:a,name:a.name,params:u}))):(t(0,a=null),b=null);const P=await E();if(S!=v)return;t(0,a=P&&P.default||P),b=E}M&&typeof M=="object"&&Object.keys(M).length?t(1,u=M):t(1,u=null),t(2,f=r[T].props),d("routeLoaded",Object.assign({},O,{component:a,name:a.name,params:u})).then(()=>{ru.set(u)});return}t(0,a=null),b=null,ru.set(void 0)});Sb(()=>{y(),g&&window.removeEventListener("popstate",g)});function $(S){tt.call(this,n,S)}function C(S){tt.call(this,n,S)}return n.$$set=S=>{"routes"in S&&t(3,i=S.routes),"prefix"in S&&t(4,s=S.prefix),"restoreScrollState"in S&&t(5,l=S.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,$,C]}class Ib extends Ee{constructor(e){super(),Oe(this,e,Lb,Eb,De,{routes:3,prefix:4,restoreScrollState:5})}}const fo=[];let eg;function tg(n){const e=n.pattern.test(eg);fu(n,n.className,e),fu(n,n.inactiveClassName,!e)}function fu(n,e,t){(e||"").split(" ").forEach(i=>{!i||(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qo.subscribe(n=>{eg=n.location+(n.querystring?"?"+n.querystring:""),fo.map(tg)});function Vn(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"?xm(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return fo.push(i),tg(i),{destroy(){fo.splice(fo.indexOf(i),1)}}}const Nb="modulepreload",Fb=function(n,e){return new URL(n,e).href},cu={},Pi=function(e,t,i){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=Fb(s,i),s in cu)return;cu[s]=!0;const l=s.endsWith(".css"),o=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${o}`))return;const r=document.createElement("link");if(r.rel=l?"stylesheet":Nb,l||(r.as="script",r.crossOrigin=""),r.href=s,document.head.appendChild(r),l)return new Promise((a,u)=>{r.addEventListener("load",a),r.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e())};var jr=function(n,e){return jr=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])},jr(n,e)};function ln(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}jr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var qr=function(){return qr=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++)for(var s in e=arguments[t])Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s]);return n},qr.apply(this,arguments)};function is(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){var f;u.done?s(u.value):(f=u.value,f instanceof t?f:new t(function(c){c(f)})).then(o,r)}a((i=i.apply(n,e||[])).next())})}function ss(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(f){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,i&&(s=2&f[0]?i.return:f[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,f[1])).done)return s;switch(i=0,s&&(f=[2&f[0],s.value]),f[0]){case 0:case 1:s=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,i=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!((s=s.length>0&&s[s.length-1])||f[0]!==6&&f[0]!==2)){o=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]<s[3])){o.label=f[1];break}if(f[0]===6&&o.label<s[1]){o.label=s[1],s=f;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(f);break}s[2]&&o.ops.pop(),o.trys.pop();continue}f=e.call(n,o)}catch(c){f=[6,c],i=0}finally{t=s=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([a,u])}}}var ng,du=function(n){function e(t){var i,s=this;return(s=n.call(this,"ClientResponseError")||this).url="",s.status=0,s.data={},s.isAbort=!1,s.originalError=null,Object.setPrototypeOf(s,e.prototype),t instanceof e||(s.originalError=t),t!==null&&typeof t=="object"&&(s.url=typeof t.url=="string"?t.url:"",s.status=typeof t.status=="number"?t.status:0,s.data=t.data!==null&&typeof t.data=="object"?t.data:{}),typeof DOMException<"u"&&t instanceof DOMException&&(s.isAbort=!0),s.name="ClientResponseError "+s.status,s.message=((i=s.data)===null||i===void 0?void 0:i.message)||"Something went wrong while processing your request.",s}return ln(e,n),e.prototype.toJSON=function(){return qr({},this)},e}(Error),Vl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function pu(n,e,t){var i=Object.assign({},t||{}),s=i.encode||Hb;if(!Vl.test(n))throw new TypeError("argument name is invalid");var l=s(e);if(l&&!Vl.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(!Vl.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain="+i.domain}if(i.path){if(!Vl.test(i.path))throw new TypeError("option path is invalid");o+="; Path="+i.path}if(i.expires){if(!function(a){return Object.prototype.toString.call(a)==="[object Date]"||a 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 Rb(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function Hb(n){return encodeURIComponent(n)}function hu(n){if(n)try{var e=decodeURIComponent(ng(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}ng=typeof atob=="function"?atob:function(n){return Buffer.from(n,"base64").toString("binary")};var Ls=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(e){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.id||this.id==="00000000-0000-0000-0000-000000000000"},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new this.constructor(JSON.parse(JSON.stringify(this)))},n.prototype.export=function(){return Object.assign({},this)},n}(),_o=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t);for(var i=0,s=Object.entries(t);i<s.length;i++){var l=s[i],o=l[0],r=l[1];this[o]=r}this["@collectionId"]=t["@collectionId"]!==void 0?t["@collectionId"]:"",this["@collectionName"]=t["@collectionName"]!==void 0?t["@collectionName"]:"",this["@expand"]=t["@expand"]!==void 0?t["@expand"]:{}},e}(Ls),Ms=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.email=typeof t.email=="string"?t.email:"",this.verified=!!t.verified,this.lastResetSentAt=typeof t.lastResetSentAt=="string"?t.lastResetSentAt:"",this.lastVerificationSentAt=typeof t.lastVerificationSentAt=="string"?t.lastVerificationSentAt:"",this.profile=t.profile?new _o(t.profile):null},e}(Ls),as=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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:"",this.lastResetSentAt=typeof t.lastResetSentAt=="string"?t.lastResetSentAt:""},e}(Ls),jb=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!function(e,t){t===void 0&&(t=0);var i=hu(e);return!(Object.keys(i).length>0&&(!i.exp||i.exp-t>Date.now()/1e3))}(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this.baseToken=e||"",this.baseModel=t!==null&&typeof t=="object"?(t==null?void 0:t.verified)!=="undefined"?new Ms(t):new as(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(l,o){var r={};if(typeof l!="string")return r;for(var a=Object.assign({},o||{}).decode||Rb,u=0;u<l.length;){var f=l.indexOf("=",u);if(f===-1)break;var c=l.indexOf(";",u);if(c===-1)c=l.length;else if(c<f){u=l.lastIndexOf(";",f-1)+1;continue}var d=l.slice(u,f).trim();if(r[d]===void 0){var h=l.slice(f+1,c).trim();h.charCodeAt(0)===34&&(h=h.slice(1,-1));try{r[d]=a(h)}catch{r[d]=h}}u=c+1}return r}(e||"")[t]||"",s={};try{(typeof(s=JSON.parse(i))===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||{})},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=hu(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=pu(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 Ms&&(a.model.verified=this.model.verified),u=pu(t,JSON.stringify(a),e)),u},n.prototype.onChange=function(e){var t=this;return this._onChangeCallbacks.push(e),function(){for(var i=t._onChangeCallbacks.length-1;i>=0;i--)if(t._onChangeCallbacks[i]==e)return delete t._onChangeCallbacks[i],void t._onChangeCallbacks.splice(i,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}(),ig=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 ln(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.verified)!==void 0?new Ms(i.model):new as(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){var i;if(typeof window<"u"&&(window==null?void 0:window.localStorage)){var s=((i=window==null?void 0:window.localStorage)===null||i===void 0?void 0:i.getItem(t))||"";try{return JSON.parse(s)}catch{return s}}return this.storageFallback[t]},e.prototype._storageSet=function(t,i){var s;if(typeof window<"u"&&(window==null?void 0:window.localStorage)){var l=i;typeof i!="string"&&(l=JSON.stringify(i)),(s=window==null?void 0:window.localStorage)===null||s===void 0||s.setItem(t,l)}else this.storageFallback[t]=i},e.prototype._storageRemove=function(t){var i;typeof window<"u"&&((i=window==null?void 0:window.localStorage)===null||i===void 0||i.removeItem(t)),delete this.storageFallback[t]},e}(jb),zo=function(n){this.client=n},qb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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}(zo),sg=function(n,e,t,i,s){this.page=n>0?n:1,this.perPage=e>=0?e:0,this.totalItems=t>=0?t:0,this.totalPages=i>=0?i:0,this.items=s||[]},lg=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=100),s===void 0&&(s={});var o=[],r=function(a){return is(l,void 0,void 0,function(){return ss(this,function(u){return[2,this._getList(t,a,i,s).then(function(f){var c=f,d=c.items,h=c.totalItems;return o=o.concat(d),d.length&&h>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 c=f[u];a.push(o.decode(c))}}return new sg((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._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}(zo),ba=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.getFullList=function(t,i){return t===void 0&&(t=100),i===void 0&&(i={}),this._getFullList(this.baseCrudPath(),t,i)},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.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}(lg),Vb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.decode=function(t){return new as(t)},e.prototype.baseCrudPath=function(){return"/api/admins"},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.admin)||{});return(t==null?void 0:t.token)&&(t==null?void 0:t.admin)&&this.client.authStore.save(t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:i})},e.prototype.authViaEmail=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({email:t,password:i},s),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:l,body:s,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.refresh=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCrudPath()+"/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(this.authResponse.bind(this))},e}(ba),zb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.userId=typeof t.userId=="string"?t.userId:"",this.provider=typeof t.provider=="string"?t.provider:"",this.providerId=typeof t.providerId=="string"?t.providerId:""},e}(Ls),Bb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.decode=function(t){return new Ms(t)},e.prototype.baseCrudPath=function(){return"/api/users"},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.user)||{});return(t==null?void 0:t.token)&&(t==null?void 0:t.user)&&this.client.authStore.save(t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",user:i})},e.prototype.listAuthMethods=function(t){return t===void 0&&(t={}),this.client.send(this.baseCrudPath()+"/auth-methods",{method:"GET",params:t}).then(function(i){return Object.assign({},i,{emailPassword:!!(i!=null&&i.emailPassword),authProviders:Array.isArray(i==null?void 0:i.authProviders)?i==null?void 0:i.authProviders:[]})})},e.prototype.authViaEmail=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({email:t,password:i},s),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:l,body:s,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.authViaOAuth2=function(t,i,s,l,o,r){return o===void 0&&(o={}),r===void 0&&(r={}),o=Object.assign({provider:t,code:i,codeVerifier:s,redirectUrl:l},o),this.client.send(this.baseCrudPath()+"/auth-via-oauth2",{method:"POST",params:r,body:o,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.refresh=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCrudPath()+"/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(this.authResponse.bind(this))},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.baseCrudPath()+"/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.baseCrudPath()+"/confirm-verification",{method:"POST",params:s,body:i}).then(this.authResponse.bind(this))},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.baseCrudPath()+"/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.baseCrudPath()+"/confirm-email-change",{method:"POST",params:l,body:s}).then(this.authResponse.bind(this))},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 zb(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}(ba),Dn=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(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.unique=!!e.unique,this.options=typeof e.options=="object"&&e.options!==null?e.options:{}},n}(),dn=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.name=typeof t.name=="string"?t.name:"",this.system=!!t.system,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 Dn(l))}},e}(Ls),Ub=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.decode=function(t){return new dn(t)},e.prototype.baseCrudPath=function(){return"/api/collections"},e.prototype.import=function(t,i,s){return i===void 0&&(i=!1),s===void 0&&(s={}),is(this,void 0,void 0,function(){return ss(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}(ba),Wb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.decode=function(t){return new _o(t)},e.prototype.baseCrudPath=function(t){return"/api/collections/"+encodeURIComponent(t)+"/records"},e.prototype.getFileUrl=function(t,i,s){s===void 0&&(s={});var l=[];l.push(this.client.baseUrl.replace(/\/+$/gm,"")),l.push("api"),l.push("files"),l.push(t["@collectionId"]),l.push(t.id),l.push(i);var o=l.join("/");if(Object.keys(s).length){var r=new URLSearchParams(s);o+=(o.includes("?")?"&":"?")+r}return o},e}(function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.getFullList=function(t,i,s){return i===void 0&&(i=100),s===void 0&&(s={}),this._getFullList(this.baseCrudPath(t),i,s)},e.prototype.getList=function(t,i,s,l){return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),this._getList(this.baseCrudPath(t),i,s,l)},e.prototype.getOne=function(t,i,s){return s===void 0&&(s={}),this._getOne(this.baseCrudPath(t),i,s)},e.prototype.create=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),this._create(this.baseCrudPath(t),i,s)},e.prototype.update=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),this._update(this.baseCrudPath(t),i,s,l)},e.prototype.delete=function(t,i,s){return s===void 0&&(s={}),this._delete(this.baseCrudPath(t),i,s)},e}(lg)),Vr=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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}(Ls),Yb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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 Vr(u))}}return new sg((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 Vr(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}(zo),Kb=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.clientId="",t.eventSource=null,t.subscriptions={},t}return ln(e,n),e.prototype.subscribe=function(t,i){var s;return is(this,void 0,void 0,function(){return ss(this,function(l){switch(l.label){case 0:if(!t)throw new Error("subscription must be set.");return this.subscriptions[t]&&((s=this.eventSource)===null||s===void 0||s.removeEventListener(t,this.subscriptions[t])),this.subscriptions[t]=function(o){var r,a=o;try{r=JSON.parse(a==null?void 0:a.data)}catch{}i(r||{})},this.eventSource?[3,1]:(this.connect(),[3,3]);case 1:return this.clientId?[4,this.submitSubscriptions()]:[3,3];case 2:l.sent(),l.label=3;case 3:return[2]}})})},e.prototype.unsubscribe=function(t){var i;return is(this,void 0,void 0,function(){return ss(this,function(s){switch(s.label){case 0:if(t){if(!this.subscriptions[t])return[2];(i=this.eventSource)===null||i===void 0||i.removeEventListener(t,this.subscriptions[t]),delete this.subscriptions[t]}else this.removeSubscriptionListeners(),this.subscriptions={};return this.clientId?[4,this.submitSubscriptions()]:[3,2];case 1:s.sent(),s.label=2;case 2:return Object.keys(this.subscriptions).length||this.disconnect(),[2]}})})},e.prototype.submitSubscriptions=function(){return is(this,void 0,void 0,function(){return ss(this,function(t){return this.addSubscriptionListeners(),[2,this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:Object.keys(this.subscriptions)}}).then(function(){return!0})]})})},e.prototype.addSubscriptionListeners=function(){if(this.eventSource)for(var t in this.removeSubscriptionListeners(),this.subscriptions)this.eventSource.addEventListener(t,this.subscriptions[t])},e.prototype.removeSubscriptionListeners=function(){if(this.eventSource)for(var t in this.subscriptions)this.eventSource.removeEventListener(t,this.subscriptions[t])},e.prototype.connectHandler=function(t){var i=t;this.clientId=i==null?void 0:i.lastEventId,this.submitSubscriptions()},e.prototype.connect=function(){var t=this;this.disconnect(),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.addEventListener("PB_CONNECT",function(i){return t.connectHandler(i)})},e.prototype.disconnect=function(){var t,i,s=this;this.removeSubscriptionListeners(),(t=this.eventSource)===null||t===void 0||t.removeEventListener("PB_CONNECT",function(l){return s.connectHandler(l)}),(i=this.eventSource)===null||i===void 0||i.close(),this.eventSource=null,this.clientId=""},e}(zo),va=function(){function n(e,t,i){e===void 0&&(e="/"),t===void 0&&(t="en-US"),this.cancelControllers={},this.baseUrl=e,this.lang=t,this.authStore=i||new ig,this.admins=new Vb(this),this.users=new Bb(this),this.records=new Wb(this),this.collections=new Ub(this),this.logs=new Yb(this),this.settings=new qb(this),this.realtime=new Kb(this)}return Object.defineProperty(n.prototype,"AuthStore",{get:function(){return this.authStore},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Settings",{get:function(){return this.settings},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Admins",{get:function(){return this.admins},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Users",{get:function(){return this.users},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Collections",{get:function(){return this.collections},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Records",{get:function(){return this.records},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Logs",{get:function(){return this.logs},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Realtime",{get:function(){return this.realtime},enumerable:!1,configurable:!0}),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,c;return is(this,void 0,void 0,function(){var d,h,g,v,b,y,$=this;return ss(this,function(C){return(d=Object.assign({method:"GET"},t)).body&&d.body.constructor.name!=="FormData"&&(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?void 0:l.token)&&((o=d==null?void 0:d.headers)===null||o===void 0?void 0:o.Authorization)===void 0&&(h="Admin",((r=this.authStore.model)===null||r===void 0?void 0:r.verified)!==void 0&&(h="User"),d.headers=Object.assign({},d.headers,{Authorization:h+" "+this.authStore.token})),((a=d.params)===null||a===void 0?void 0:a.$autoCancel)!==!1&&(g=((u=d.params)===null||u===void 0?void 0:u.$cancelKey)||(d.method||"GET")+e,this.cancelRequest(g),v=new AbortController,this.cancelControllers[g]=v,d.signal=v.signal),(f=d.params)===null||f===void 0||delete f.$autoCancel,(c=d.params)===null||c===void 0||delete c.$cancelKey,b=this.buildUrl(e),d.params!==void 0&&((y=this.serializeQueryParams(d.params))&&(b+=(b.includes("?")?"&":"?")+y),delete d.params),this.beforeSend&&(d=Object.assign({},this.beforeSend(b,d))),[2,fetch(b,d).then(function(S){return is($,void 0,void 0,function(){var T;return ss(this,function(M){switch(M.label){case 0:T={},M.label=1;case 1:return M.trys.push([1,3,,4]),[4,S.json()];case 2:return T=M.sent(),[3,4];case 3:return M.sent(),[3,4];case 4:if(this.afterSend&&(T=this.afterSend(S,T)),S.status>=400)throw new du({url:S.url,status:S.status,data:T});return[2,T]}})})}).catch(function(S){throw new du(S)})]})})},n.prototype.buildUrl=function(e){var t=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return e&&(t+=e.startsWith("/")?e.substring(1):e),t},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 cs extends Error{}class Jb extends cs{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Zb extends cs{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Gb extends cs{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Qs extends cs{}class og extends cs{constructor(e){super(`Invalid unit ${e}`)}}class Bn extends cs{}class Oi extends cs{constructor(){super("Zone is an abstract class")}}const Ve="numeric",ii="short",In="long",zr={year:Ve,month:Ve,day:Ve},rg={year:Ve,month:ii,day:Ve},Xb={year:Ve,month:ii,day:Ve,weekday:ii},ag={year:Ve,month:In,day:Ve},ug={year:Ve,month:In,day:Ve,weekday:In},fg={hour:Ve,minute:Ve},cg={hour:Ve,minute:Ve,second:Ve},dg={hour:Ve,minute:Ve,second:Ve,timeZoneName:ii},pg={hour:Ve,minute:Ve,second:Ve,timeZoneName:In},hg={hour:Ve,minute:Ve,hourCycle:"h23"},mg={hour:Ve,minute:Ve,second:Ve,hourCycle:"h23"},gg={hour:Ve,minute:Ve,second:Ve,hourCycle:"h23",timeZoneName:ii},_g={hour:Ve,minute:Ve,second:Ve,hourCycle:"h23",timeZoneName:In},bg={year:Ve,month:Ve,day:Ve,hour:Ve,minute:Ve},vg={year:Ve,month:Ve,day:Ve,hour:Ve,minute:Ve,second:Ve},yg={year:Ve,month:ii,day:Ve,hour:Ve,minute:Ve},kg={year:Ve,month:ii,day:Ve,hour:Ve,minute:Ve,second:Ve},Qb={year:Ve,month:ii,day:Ve,weekday:ii,hour:Ve,minute:Ve},wg={year:Ve,month:In,day:Ve,hour:Ve,minute:Ve,timeZoneName:ii},$g={year:Ve,month:In,day:Ve,hour:Ve,minute:Ve,second:Ve,timeZoneName:ii},Sg={year:Ve,month:In,day:Ve,weekday:In,hour:Ve,minute:Ve,timeZoneName:In},Cg={year:Ve,month:In,day:Ve,weekday:In,hour:Ve,minute:Ve,second:Ve,timeZoneName:In};function vt(n){return typeof n>"u"}function ls(n){return typeof n=="number"}function Bo(n){return typeof n=="number"&&n%1===0}function xb(n){return typeof n=="string"}function e1(n){return Object.prototype.toString.call(n)==="[object Date]"}function Mg(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function t1(n){return Array.isArray(n)?n:[n]}function mu(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 n1(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ts(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ki(n,e,t){return Bo(n)&&n>=e&&n<=t}function i1(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 Ai(n){if(!(vt(n)||n===null||n===""))return parseInt(n,10)}function Wi(n){if(!(vt(n)||n===null||n===""))return parseFloat(n)}function ya(n){if(!(vt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ka(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Sl(n){return n%4===0&&(n%100!==0||n%400===0)}function il(n){return Sl(n)?366:365}function bo(n,e){const t=i1(e-1,12)+1,i=n+(e-t)/12;return t===2?Sl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function wa(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 vo(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 Br(n){return n>99?n:n>60?1900+n:2e3+n}function Tg(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 Uo(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 Dg(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Bn(`Invalid unit value ${n}`);return e}function yo(n,e){const t={};for(const i in n)if(Ts(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=Dg(s)}return t}function sl(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 Wo(n){return n1(n,["hour","minute","second","millisecond"])}const Og=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,s1=["January","February","March","April","May","June","July","August","September","October","November","December"],Eg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],l1=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ag(n){switch(n){case"narrow":return[...l1];case"short":return[...Eg];case"long":return[...s1];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 Pg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Lg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],o1=["M","T","W","T","F","S","S"];function Ig(n){switch(n){case"narrow":return[...o1];case"short":return[...Lg];case"long":return[...Pg];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ng=["AM","PM"],r1=["Before Christ","Anno Domini"],a1=["BC","AD"],u1=["B","A"];function Fg(n){switch(n){case"narrow":return[...u1];case"short":return[...a1];case"long":return[...r1];default:return null}}function f1(n){return Ng[n.hour<12?0:1]}function c1(n,e){return Ig(e)[n.weekday-1]}function d1(n,e){return Ag(e)[n.month-1]}function p1(n,e){return Fg(e)[n.year<0?0:1]}function h1(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function gu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const m1={D:zr,DD:rg,DDD:ag,DDDD:ug,t:fg,tt:cg,ttt:dg,tttt:pg,T:hg,TT:mg,TTT:gg,TTTT:_g,f:bg,ff:yg,fff:wg,ffff:Sg,F:vg,FF:kg,FFF:$g,FFFF:Cg};class wn{static create(e,t={}){return new wn(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 m1[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=(h,g)=>this.loc.extract(e,h,g),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?f1(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,g)=>i?d1(e,h):l(g?{month:h}:{month:h,day:"numeric"},"month"),u=(h,g)=>i?c1(e,h):l(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const g=wn.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(e,g):h},c=h=>i?p1(e,h):l({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(h)}};return gu(wn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=wn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return gu(l,s(r))}}class xn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Cl{get type(){throw new Oi}get name(){throw new Oi}get ianaName(){return this.name}get isUniversal(){throw new Oi}offsetName(e,t){throw new Oi}formatOffset(e,t){throw new Oi}offset(e){throw new Oi}equals(e){throw new Oi}get isValid(){throw new Oi}}let or=null;class $a extends Cl{static get instance(){return or===null&&(or=new $a),or}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Tg(e,t,i)}formatOffset(e,t){return sl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let co={};function g1(n){return co[n]||(co[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"})),co[n]}const _1={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function b1(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 v1(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s<t.length;s++){const{type:l,value:o}=t[s],r=_1[l];l==="era"?i[r]=o:vt(r)||(i[r]=parseInt(o,10))}return i}let zl={};class $i extends Cl{static create(e){return zl[e]||(zl[e]=new $i(e)),zl[e]}static resetCache(){zl={},co={}}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=$i.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Tg(e,t,i,this.name)}formatOffset(e,t){return sl(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=g1(this.name);let[s,l,o,r,a,u,f]=i.formatToParts?v1(i,t):b1(i,t);r==="BC"&&(s=-Math.abs(s)+1);const d=wa({year:s,month:l,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let h=+t;const g=h%1e3;return h-=g>=0?g:1e3+g,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let rr=null;class gn extends Cl{static get utcInstance(){return rr===null&&(rr=new gn(0)),rr}static instance(e){return e===0?gn.utcInstance:new gn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new gn(Uo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${sl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${sl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return sl(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 y1 extends Cl{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 Li(n,e){if(vt(n)||n===null)return e;if(n instanceof Cl)return n;if(xb(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?gn.utcInstance:gn.parseSpecifier(t)||$i.create(n)}else return ls(n)?gn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new y1(n)}let _u=()=>Date.now(),bu="system",vu=null,yu=null,ku=null,wu;class Qt{static get now(){return _u}static set now(e){_u=e}static set defaultZone(e){bu=e}static get defaultZone(){return Li(bu,$a.instance)}static get defaultLocale(){return vu}static set defaultLocale(e){vu=e}static get defaultNumberingSystem(){return yu}static set defaultNumberingSystem(e){yu=e}static get defaultOutputCalendar(){return ku}static set defaultOutputCalendar(e){ku=e}static get throwOnInvalid(){return wu}static set throwOnInvalid(e){wu=e}static resetCaches(){Rt.resetCache(),$i.resetCache()}}let $u={};function k1(n,e={}){const t=JSON.stringify([n,e]);let i=$u[t];return i||(i=new Intl.ListFormat(n,e),$u[t]=i),i}let Ur={};function Wr(n,e={}){const t=JSON.stringify([n,e]);let i=Ur[t];return i||(i=new Intl.DateTimeFormat(n,e),Ur[t]=i),i}let Yr={};function w1(n,e={}){const t=JSON.stringify([n,e]);let i=Yr[t];return i||(i=new Intl.NumberFormat(n,e),Yr[t]=i),i}let Kr={};function $1(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Kr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Kr[s]=l),l}let xs=null;function S1(){return xs||(xs=new Intl.DateTimeFormat().resolvedOptions().locale,xs)}function C1(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Wr(n).resolvedOptions()}catch{t=Wr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function M1(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function T1(n){const e=[];for(let t=1;t<=12;t++){const i=Qe.utc(2016,t,1);e.push(n(i))}return e}function D1(n){const e=[];for(let t=1;t<=7;t++){const i=Qe.utc(2016,11,13+t);e.push(n(i))}return e}function Bl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function O1(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 E1{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=w1(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):ka(e,3);return Jt(t,this.padTo)}}}class A1{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&&$i.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:Qe.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Wr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class P1{constructor(e,t,i){this.opts={style:"long",...i},!t&&Mg()&&(this.rtf=$1(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):h1(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Rt{static fromOpts(e){return Rt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Qt.defaultLocale,o=l||(s?"en-US":S1()),r=t||Qt.defaultNumberingSystem,a=i||Qt.defaultOutputCalendar;return new Rt(o,r,a,l)}static resetCache(){xs=null,Ur={},Yr={},Kr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Rt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=C1(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=M1(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=O1(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:Rt.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 Bl(this,e,i,Ag,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=T1(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Bl(this,e,i,Ig,()=>{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]=D1(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Bl(this,void 0,e,()=>Ng,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Qe.utc(2016,11,13,9),Qe.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Bl(this,e,t,Fg,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Qe.utc(-40,1,1),Qe.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new E1(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new A1(e,this.intl,t)}relFormatter(e={}){return new P1(this.intl,this.isEnglish(),e)}listFormatter(e={}){return k1(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 Is(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ns(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Fs(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function Rg(...n){return(e,t)=>{const i={};let s;for(s=0;s<n.length;s++)i[n[s]]=Ai(e[t+s]);return[i,null,t+s]}}const Hg=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,L1=`(?:${Hg.source}?(?:\\[(${Og.source})\\])?)?`,Sa=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,jg=RegExp(`${Sa.source}${L1}`),Ca=RegExp(`(?:T${jg.source})?`),I1=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,N1=/(\d{4})-?W(\d\d)(?:-?(\d))?/,F1=/(\d{4})-?(\d{3})/,R1=Rg("weekYear","weekNumber","weekDay"),H1=Rg("year","ordinal"),j1=/(\d{4})-(\d\d)-(\d\d)/,qg=RegExp(`${Sa.source} ?(?:${Hg.source}|(${Og.source}))?`),q1=RegExp(`(?: ${qg.source})?`);function ws(n,e,t){const i=n[e];return vt(i)?t:Ai(i)}function V1(n,e){return[{year:ws(n,e),month:ws(n,e+1,1),day:ws(n,e+2,1)},null,e+3]}function Rs(n,e){return[{hours:ws(n,e,0),minutes:ws(n,e+1,0),seconds:ws(n,e+2,0),milliseconds:ya(n[e+3])},null,e+4]}function Ml(n,e){const t=!n[e]&&!n[e+1],i=Uo(n[e+1],n[e+2]),s=t?null:gn.instance(i);return[{},s,e+3]}function Tl(n,e){const t=n[e]?$i.create(n[e]):null;return[{},t,e+1]}const z1=RegExp(`^T?${Sa.source}$`),B1=/^-?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 U1(n){const[e,t,i,s,l,o,r,a,u]=n,f=e[0]==="-",c=a&&a[0]==="-",d=(h,g=!1)=>h!==void 0&&(g||h&&f)?-h:h;return[{years:d(Wi(t)),months:d(Wi(i)),weeks:d(Wi(s)),days:d(Wi(l)),hours:d(Wi(o)),minutes:d(Wi(r)),seconds:d(Wi(a),a==="-0"),milliseconds:d(ya(u),c)}]}const W1={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 Ma(n,e,t,i,s,l,o){const r={year:e.length===2?Br(Ai(e)):Ai(e),month:Eg.indexOf(t)+1,day:Ai(i),hour:Ai(s),minute:Ai(l)};return o&&(r.second=Ai(o)),n&&(r.weekday=n.length>3?Pg.indexOf(n)+1:Lg.indexOf(n)+1),r}const Y1=/^(?:(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 K1(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Ma(e,s,i,t,l,o,r);let h;return a?h=W1[a]:u?h=0:h=Uo(f,c),[d,new gn(h)]}function J1(n){return n.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Z1=/^(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$/,G1=/^(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$/,X1=/^(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 Su(n){const[,e,t,i,s,l,o,r]=n;return[Ma(e,s,i,t,l,o,r),gn.utcInstance]}function Q1(n){const[,e,t,i,s,l,o,r]=n;return[Ma(e,r,t,i,s,l,o),gn.utcInstance]}const x1=Is(I1,Ca),e0=Is(N1,Ca),t0=Is(F1,Ca),n0=Is(jg),Vg=Ns(V1,Rs,Ml,Tl),i0=Ns(R1,Rs,Ml,Tl),s0=Ns(H1,Rs,Ml,Tl),l0=Ns(Rs,Ml,Tl);function o0(n){return Fs(n,[x1,Vg],[e0,i0],[t0,s0],[n0,l0])}function r0(n){return Fs(J1(n),[Y1,K1])}function a0(n){return Fs(n,[Z1,Su],[G1,Su],[X1,Q1])}function u0(n){return Fs(n,[B1,U1])}const f0=Ns(Rs);function c0(n){return Fs(n,[z1,f0])}const d0=Is(j1,q1),p0=Is(qg),h0=Ns(Rs,Ml,Tl);function m0(n){return Fs(n,[d0,Vg],[p0,h0])}const g0="Invalid Duration",zg={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}},_0={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},...zg},Rn=146097/400,_s=146097/4800,b0={years:{quarters:4,months:12,weeks:Rn/7,days:Rn,hours:Rn*24,minutes:Rn*24*60,seconds:Rn*24*60*60,milliseconds:Rn*24*60*60*1e3},quarters:{months:3,weeks:Rn/28,days:Rn/4,hours:Rn*24/4,minutes:Rn*24*60/4,seconds:Rn*24*60*60/4,milliseconds:Rn*24*60*60*1e3/4},months:{weeks:_s/7,days:_s,hours:_s*24,minutes:_s*24*60,seconds:_s*24*60*60,milliseconds:_s*24*60*60*1e3},...zg},Xi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],v0=Xi.slice(0).reverse();function Yi(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 wt(i)}function y0(n){return n<0?Math.floor(n):Math.ceil(n)}function Bg(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?y0(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function k0(n,e){v0.reduce((t,i)=>vt(e[i])?t:(t&&Bg(n,e,t,e,i),i),null)}class wt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Rt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?b0:_0,this.isLuxonDuration=!0}static fromMillis(e,t){return wt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Bn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new wt({values:yo(e,wt.normalizeUnit),loc:Rt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(ls(e))return wt.fromMillis(e);if(wt.isDuration(e))return e;if(typeof e=="object")return wt.fromObject(e);throw new Bn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=u0(e);return i?wt.fromObject(i,t):wt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=c0(e);return i?wt.fromObject(i,t):wt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Bn("need to specify a reason the Duration is invalid");const i=e instanceof xn?e:new xn(e,t);if(Qt.throwOnInvalid)throw new Gb(i);return new wt({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 og(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?wn.create(this.loc,i).formatDurationFromString(this,e):g0}toHuman(e={}){const t=Xi.map(i=>{const s=this.values[i];return vt(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+=ka(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=wt.fromDurationLike(e),i={};for(const s of Xi)(Ts(t.values,s)||Ts(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=wt.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]=Dg(e(this.values[i],i));return Yi(this,{values:t},!0)}get(e){return this[wt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...yo(e,wt.normalizeUnit)};return Yi(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),Yi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return k0(this.matrix,e),Yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>wt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Xi)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;ls(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)Xi.indexOf(u)>Xi.indexOf(o)&&Bg(this.matrix,s,u,t,o)}else ls(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 Yi(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 Yi(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 Xi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const qs="Invalid Interval";function w0(n,e){return!n||!n.isValid?qt.invalid("missing or invalid start"):!e||!e.isValid?qt.invalid("missing or invalid end"):e<n?qt.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 qt{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 Bn("need to specify a reason the Interval is invalid");const i=e instanceof xn?e:new xn(e,t);if(Qt.throwOnInvalid)throw new Zb(i);return new qt({invalid:i})}static fromDateTimes(e,t){const i=Bs(e),s=Bs(t),l=w0(i,s);return l==null?new qt({start:i,end:s}):l}static after(e,t){const i=wt.fromDurationLike(t),s=Bs(e);return qt.fromDateTimes(s,s.plus(i))}static before(e,t){const i=wt.fromDurationLike(t),s=Bs(e);return qt.fromDateTimes(s.minus(i),s)}static fromISO(e,t){const[i,s]=(e||"").split("/",2);if(i&&s){let l,o;try{l=Qe.fromISO(i,t),o=l.isValid}catch{o=!1}let r,a;try{r=Qe.fromISO(s,t),a=r.isValid}catch{a=!1}if(o&&a)return qt.fromDateTimes(l,r);if(o){const u=wt.fromISO(s,t);if(u.isValid)return qt.after(l,u)}else if(a){const u=wt.fromISO(i,t);if(u.isValid)return qt.before(r,u)}}return qt.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?qt.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(qt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=wt.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(qt.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:qt.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 qt.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(qt.fromDateTimes(t,a.time)),t=null);return qt.merge(s)}difference(...e){return qt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:qs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:qs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:qs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:qs}toFormat(e,{separator:t=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:qs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):wt.invalid(this.invalidReason)}mapEndpoints(e){return qt.fromDateTimes(e(this.s),e(this.e))}}class Ul{static hasDST(e=Qt.defaultZone){const t=Qe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return $i.isValidZone(e)}static normalizeZone(e){return Li(e,Qt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Rt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Rt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Rt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Rt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Rt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Rt.create(t,null,"gregory").eras(e)}static features(){return{relative:Mg()}}}function Cu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(wt.fromMillis(i).as("days"))}function $0(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=Cu(r,a);return(u-u%7)/7}],["days",Cu]],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 S0(n,e,t,i){let[s,l,o,r]=$0(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o<e&&(o=s.plus({[r]:1})),o!==s&&(l[r]=(l[r]||0)+a/(o-s)));const f=wt.fromObject(l,i);return u.length>0?wt.fromMillis(a,i).shiftTo(...u).plus(f):f}const Ta={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},Mu={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},C0=Ta.hanidec.replace(/[\[|\]]/g,"").split("");function M0(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(Ta.hanidec)!==-1)e+=C0.indexOf(n[t]);else for(const s in Mu){const[l,o]=Mu[s];i>=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Xn({numberingSystem:n},e=""){return new RegExp(`${Ta[n||"latn"]}${e}`)}const T0="missing Intl.DateTimeFormat.formatToParts support";function $t(n,e=t=>t){return{regex:n,deser:([t])=>e(M0(t))}}const D0=String.fromCharCode(160),Ug=`[ ${D0}]`,Wg=new RegExp(Ug,"g");function O0(n){return n.replace(/\./g,"\\.?").replace(Wg,Ug)}function Tu(n){return n.replace(/\./g,"").replace(Wg," ").toLowerCase()}function Qn(n,e){return n===null?null:{regex:RegExp(n.map(O0).join("|")),deser:([t])=>n.findIndex(i=>Tu(t)===Tu(i))+e}}function Du(n,e){return{regex:n,deser:([,t,i])=>Uo(t,i),groups:e}}function ar(n){return{regex:n,deser:([e])=>e}}function E0(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A0(n,e){const t=Xn(e),i=Xn(e,"{2}"),s=Xn(e,"{3}"),l=Xn(e,"{4}"),o=Xn(e,"{6}"),r=Xn(e,"{1,2}"),a=Xn(e,"{1,3}"),u=Xn(e,"{1,6}"),f=Xn(e,"{1,9}"),c=Xn(e,"{2,4}"),d=Xn(e,"{4,6}"),h=b=>({regex:RegExp(E0(b.val)),deser:([y])=>y,literal:!0}),v=(b=>{if(n.literal)return h(b);switch(b.val){case"G":return Qn(e.eras("short",!1),0);case"GG":return Qn(e.eras("long",!1),0);case"y":return $t(u);case"yy":return $t(c,Br);case"yyyy":return $t(l);case"yyyyy":return $t(d);case"yyyyyy":return $t(o);case"M":return $t(r);case"MM":return $t(i);case"MMM":return Qn(e.months("short",!0,!1),1);case"MMMM":return Qn(e.months("long",!0,!1),1);case"L":return $t(r);case"LL":return $t(i);case"LLL":return Qn(e.months("short",!1,!1),1);case"LLLL":return Qn(e.months("long",!1,!1),1);case"d":return $t(r);case"dd":return $t(i);case"o":return $t(a);case"ooo":return $t(s);case"HH":return $t(i);case"H":return $t(r);case"hh":return $t(i);case"h":return $t(r);case"mm":return $t(i);case"m":return $t(r);case"q":return $t(r);case"qq":return $t(i);case"s":return $t(r);case"ss":return $t(i);case"S":return $t(a);case"SSS":return $t(s);case"u":return ar(f);case"uu":return ar(r);case"uuu":return $t(t);case"a":return Qn(e.meridiems(),0);case"kkkk":return $t(l);case"kk":return $t(c,Br);case"W":return $t(r);case"WW":return $t(i);case"E":case"c":return $t(t);case"EEE":return Qn(e.weekdays("short",!1,!1),1);case"EEEE":return Qn(e.weekdays("long",!1,!1),1);case"ccc":return Qn(e.weekdays("short",!0,!1),1);case"cccc":return Qn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Du(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Du(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return ar(/[a-z_+-/]{1,256}?/i);default:return h(b)}})(n)||{invalidReason:T0};return v.token=n,v}const P0={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 L0(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=P0[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function I0(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function N0(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Ts(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 F0(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 vt(n.z)||(t=$i.create(n.z)),vt(n.Z)||(t||(t=new gn(n.Z)),i=n.Z),vt(n.q)||(n.M=(n.q-1)*3+1),vt(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),vt(n.u)||(n.S=ya(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let ur=null;function R0(){return ur||(ur=Qe.fromMillis(1555555555555)),ur}function H0(n,e){if(n.literal)return n;const t=wn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=wn.create(e,t).formatDateTimeParts(R0()).map(o=>L0(o,e,t));return l.includes(void 0)?n:l}function j0(n,e){return Array.prototype.concat(...n.map(t=>H0(t,e)))}function Yg(n,e,t){const i=j0(wn.parseFormat(t),n),s=i.map(o=>A0(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=I0(s),a=RegExp(o,"i"),[u,f]=N0(e,a,r),[c,d,h]=f?F0(f):[null,null,void 0];if(Ts(f,"a")&&Ts(f,"H"))throw new Qs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:h}}}function q0(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=Yg(n,e,t);return[i,s,l,o]}const Kg=[0,31,59,90,120,151,181,212,243,273,304,334],Jg=[0,31,60,91,121,152,182,213,244,274,305,335];function Wn(n,e){return new xn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Zg(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 Gg(n,e,t){return t+(Sl(n)?Jg:Kg)[e-1]}function Xg(n,e){const t=Sl(n)?Jg:Kg,i=t.findIndex(l=>l<e),s=e-t[i];return{month:i+1,day:s}}function Jr(n){const{year:e,month:t,day:i}=n,s=Gg(e,t,i),l=Zg(e,t,i);let o=Math.floor((s-l+10)/7),r;return o<1?(r=e-1,o=vo(r)):o>vo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Wo(n)}}function Ou(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Zg(e,1,4),l=il(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=il(r)):o>l?(r=e+1,o-=il(e)):r=e;const{month:a,day:u}=Xg(r,o);return{year:r,month:a,day:u,...Wo(n)}}function fr(n){const{year:e,month:t,day:i}=n,s=Gg(e,t,i);return{year:e,ordinal:s,...Wo(n)}}function Eu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Xg(e,t);return{year:e,month:i,day:s,...Wo(n)}}function V0(n){const e=Bo(n.weekYear),t=ki(n.weekNumber,1,vo(n.weekYear)),i=ki(n.weekday,1,7);return e?t?i?!1:Wn("weekday",n.weekday):Wn("week",n.week):Wn("weekYear",n.weekYear)}function z0(n){const e=Bo(n.year),t=ki(n.ordinal,1,il(n.year));return e?t?!1:Wn("ordinal",n.ordinal):Wn("year",n.year)}function Qg(n){const e=Bo(n.year),t=ki(n.month,1,12),i=ki(n.day,1,bo(n.year,n.month));return e?t?i?!1:Wn("day",n.day):Wn("month",n.month):Wn("year",n.year)}function xg(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ki(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ki(t,0,59),r=ki(i,0,59),a=ki(s,0,999);return l?o?r?a?!1:Wn("millisecond",s):Wn("second",i):Wn("minute",t):Wn("hour",e)}const cr="Invalid DateTime",Au=864e13;function Wl(n){return new xn("unsupported zone",`the zone "${n.name}" is not supported`)}function dr(n){return n.weekData===null&&(n.weekData=Jr(n.c)),n.weekData}function Vs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Qe({...t,...e,old:t})}function e_(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function Pu(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function po(n,e,t){return e_(wa(n),e,t)}function Lu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,bo(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=wt.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=wa(l);let[a,u]=e_(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=Qe.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Qe.invalid(new xn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Yl(n,e,t=!0){return n.isValid?wn.create(Rt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function pr(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 Iu(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 t_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},B0={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},U0={ordinal:1,hour:0,minute:0,second:0,millisecond:0},n_=["year","month","day","hour","minute","second","millisecond"],W0=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Y0=["year","ordinal","hour","minute","second","millisecond"];function Nu(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 og(n);return e}function Fu(n,e){const t=Li(e.zone,Qt.defaultZone),i=Rt.fromObject(e),s=Qt.now();let l,o;if(vt(n.year))l=s;else{for(const u of n_)vt(n[u])&&(n[u]=t_[u]);const r=Qg(n)||xg(n);if(r)return Qe.invalid(r);const a=t.offset(s);[l,o]=po(n,a,t)}return new Qe({ts:l,zone:t,loc:i,o})}function Ru(n,e,t){const i=vt(t.round)?!0:t.round,s=(o,r)=>(o=ka(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 Hu(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class Qe{constructor(e){const t=e.zone||Qt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new xn("invalid input"):null)||(t.isValid?null:Wl(t));this.ts=vt(e.ts)?Qt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=Pu(this.ts,r),i=Number.isNaN(s.year)?new xn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Rt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Qe({})}static local(){const[e,t]=Hu(arguments),[i,s,l,o,r,a,u]=t;return Fu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Hu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=gn.utcInstance,Fu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=e1(e)?e.valueOf():NaN;if(Number.isNaN(i))return Qe.invalid("invalid input");const s=Li(t.zone,Qt.defaultZone);return s.isValid?new Qe({ts:i,zone:s,loc:Rt.fromObject(t)}):Qe.invalid(Wl(s))}static fromMillis(e,t={}){if(ls(e))return e<-Au||e>Au?Qe.invalid("Timestamp out of range"):new Qe({ts:e,zone:Li(t.zone,Qt.defaultZone),loc:Rt.fromObject(t)});throw new Bn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(ls(e))return new Qe({ts:e*1e3,zone:Li(t.zone,Qt.defaultZone),loc:Rt.fromObject(t)});throw new Bn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Li(t.zone,Qt.defaultZone);if(!i.isValid)return Qe.invalid(Wl(i));const s=Qt.now(),l=vt(t.specificOffset)?i.offset(s):t.specificOffset,o=yo(e,Nu),r=!vt(o.ordinal),a=!vt(o.year),u=!vt(o.month)||!vt(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=Rt.fromObject(t);if((f||r)&&c)throw new Qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Qs("Can't mix ordinal dates with month/day");const h=c||o.weekday&&!f;let g,v,b=Pu(s,l);h?(g=W0,v=B0,b=Jr(b)):r?(g=Y0,v=U0,b=fr(b)):(g=n_,v=t_);let y=!1;for(const E of g){const P=o[E];vt(P)?y?o[E]=v[E]:o[E]=b[E]:y=!0}const $=h?V0(o):r?z0(o):Qg(o),C=$||xg(o);if(C)return Qe.invalid(C);const S=h?Ou(o):r?Eu(o):o,[T,M]=po(S,l,i),O=new Qe({ts:T,zone:i,o:M,loc:d});return o.weekday&&f&&e.weekday!==O.weekday?Qe.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,s]=o0(e);return zs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=r0(e);return zs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=a0(e);return zs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(vt(e)||vt(t))throw new Bn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Rt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=q0(o,e,t);return f?Qe.invalid(f):zs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Qe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=m0(e);return zs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Bn("need to specify a reason the DateTime is invalid");const i=e instanceof xn?e:new xn(e,t);if(Qt.throwOnInvalid)throw new Jb(i);return new Qe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?dr(this).weekYear:NaN}get weekNumber(){return this.isValid?dr(this).weekNumber:NaN}get weekday(){return this.isValid?dr(this).weekday:NaN}get ordinal(){return this.isValid?fr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ul.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ul.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ul.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ul.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 Sl(this.year)}get daysInMonth(){return bo(this.year,this.month)}get daysInYear(){return this.isValid?il(this.year):NaN}get weeksInWeekYear(){return this.isValid?vo(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=wn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(gn.instance(e),t)}toLocal(){return this.setZone(Qt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Li(e,Qt.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]=po(o,l,e)}return Vs(this,{ts:s,zone:e})}else return Qe.invalid(Wl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Vs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=yo(e,Nu),i=!vt(t.weekYear)||!vt(t.weekNumber)||!vt(t.weekday),s=!vt(t.ordinal),l=!vt(t.year),o=!vt(t.month)||!vt(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Qs("Can't mix ordinal dates with month/day");let u;i?u=Ou({...Jr(this.c),...t}):vt(t.ordinal)?(u={...this.toObject(),...t},vt(t.day)&&(u.day=Math.min(bo(u.year,u.month),u.day))):u=Eu({...fr(this.c),...t});const[f,c]=po(u,this.o,this.zone);return Vs(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=wt.fromDurationLike(e);return Vs(this,Lu(this,t))}minus(e){if(!this.isValid)return this;const t=wt.fromDurationLike(e).negate();return Vs(this,Lu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=wt.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?wn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):cr}toLocaleString(e=zr,t={}){return this.isValid?wn.create(this.loc.clone(t),e).formatDateTime(this):cr}toLocaleParts(e={}){return this.isValid?wn.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=pr(this,o);return r+="T",r+=Iu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?pr(this,e==="extended"):null}toISOWeekDate(){return Yl(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":"")+Iu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Yl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Yl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?pr(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")),Yl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():cr}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 wt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=t1(t).map(wt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=S0(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Qe.now(),e,t)}until(e){return this.isValid?qt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Qe.fromObject({},{zone:this.zone}),i=e.padding?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),Ru(t,this.plus(i),{...e,numeric:"always",units:s,unit:l})}toRelativeCalendar(e={}){return this.isValid?Ru(e.base||Qe.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Qe.isDateTime))throw new Bn("min requires all arguments be DateTimes");return mu(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(Qe.isDateTime))throw new Bn("max requires all arguments be DateTimes");return mu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Rt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return Yg(o,e,t)}static fromStringExplain(e,t,i={}){return Qe.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return zr}static get DATE_MED(){return rg}static get DATE_MED_WITH_WEEKDAY(){return Xb}static get DATE_FULL(){return ag}static get DATE_HUGE(){return ug}static get TIME_SIMPLE(){return fg}static get TIME_WITH_SECONDS(){return cg}static get TIME_WITH_SHORT_OFFSET(){return dg}static get TIME_WITH_LONG_OFFSET(){return pg}static get TIME_24_SIMPLE(){return hg}static get TIME_24_WITH_SECONDS(){return mg}static get TIME_24_WITH_SHORT_OFFSET(){return gg}static get TIME_24_WITH_LONG_OFFSET(){return _g}static get DATETIME_SHORT(){return bg}static get DATETIME_SHORT_WITH_SECONDS(){return vg}static get DATETIME_MED(){return yg}static get DATETIME_MED_WITH_SECONDS(){return kg}static get DATETIME_MED_WITH_WEEKDAY(){return Qb}static get DATETIME_FULL(){return wg}static get DATETIME_FULL_WITH_SECONDS(){return $g}static get DATETIME_HUGE(){return Sg}static get DATETIME_HUGE_WITH_SECONDS(){return Cg}}function Bs(n){if(Qe.isDateTime(n))return n;if(n&&n.valueOf&&ls(n.valueOf()))return Qe.fromJSDate(n);if(n&&typeof n=="object")return Qe.fromObject(n);throw new Bn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}class B{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01T00:00:00Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||B.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 B.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!B.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e:(t||!B.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){B.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]=B.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(!B.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(!B.isObject(e)&&!Array.isArray(e)){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)(!B.isObject(l)&&!Array.isArray(l)||!B.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)(!B.isObject(s)&&!Array.isArray(s)||!B.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):B.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||B.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||B.isObject(e)&&Object.keys(e).length>0)&&B.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 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(),B.isEmpty(l)||s.push(l);return s}static joinNonEmpty(e,t=", "){const i=[];for(let s of e)s=typeof s=="string"?s.trim():"",B.isEmpty(s)||i.push(s);return i.join(t)}static getDateTime(e){if(typeof e=="string"){const t="yyyy-MM-dd HH:mm:ss",i="yyyy-MM-dd HH:mm:ss.SSS",s=e.length===i.length?i:t;return Qe.fromFormat(e,s,{zone:"UTC"})}return Qe.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return B.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return B.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/\.jpg|\.jpeg|\.png|\.svg|\.gif|\.webp|\.avif$/.test(e)}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(B.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)B.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):B.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static dummyCollectionRecord(e){var s,l,o,r,a;const t=(e==null?void 0:e.schema)||[],i={"@collectionId":e==null?void 0:e.id,"@collectionName":e==null?void 0:e.name,id:"RECORD_ID",created:"2022-01-01 01:00:00",updated:"2022-01-01 23:59:59"};for(const u of t){let f=null;u.type==="number"?f=123:u.type==="date"?f="2022-01-01 10:00:00":u.type==="bool"?f=!0:u.type==="email"?f="test@example.com":u.type==="url"?f="https://example.com":u.type==="json"?f="JSON (array/object)":u.type==="file"?(f="filename.jpg",((s=u.options)==null?void 0:s.maxSelect)>1&&(f=[f])):u.type==="select"?(f=(o=(l=u.options)==null?void 0:l.values)==null?void 0:o[0],((r=u.options)==null?void 0:r.maxSelect)>1&&(f=[f])):u.type==="relation"||u.type==="user"?(f="RELATION_RECORD_ID",((a=u.options)==null?void 0:a.maxSelect)>1&&(f=[f])):f="test",i[u.name]=f}return i}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"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=e||{},e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":case"user":return((t=e.options)==null?void 0:t.maxSelect)>1?"Array<String>":"String";default:return"String"}}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)&&!B.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!B.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=B.isObject(u)&&B.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}}const Yo=Gn([]);function i_(n,e=4e3){return Ko(n,"info",e)}function sn(n,e=3e3){return Ko(n,"success",e)}function hl(n,e=4500){return Ko(n,"error",e)}function K0(n,e=4500){return Ko(n,"warning",e)}function Ko(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{s_(i)},t)};Yo.update(s=>(Da(s,i.message),B.pushOrReplaceByKey(s,i,"message"),s))}function s_(n){Yo.update(e=>(Da(e,n),e))}function J0(){Yo.update(n=>{for(let e of n)Da(n,e);return[]})}function Da(n,e){let t;typeof e=="string"?t=B.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),B.removeByKey(n,"message",t.message))}const Vi=Gn({});function ri(n){Vi.set(n||{})}function Oa(n){Vi.update(e=>(B.deleteByPath(e,n),e))}const Ea=Gn({});function Zr(n){Ea.set(n||{})}va.prototype.logout=function(n=!0){this.authStore.clear(),n&&Ci("/login")};va.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&hl(l)}if(B.isEmpty(s.data)||ri(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Ci("/")};class Z0 extends ig{save(e,t){super.save(e,t),t instanceof as&&Zr(t)}clear(){super.clear(),Zr(null)}}const ye=new va("../","en-US",new Z0("pb_admin_auth"));ye.authStore.model instanceof as&&Zr(ye.authStore.model);function G0(n){let e,t,i,s,l,o,r,a;const u=n[3].default,f=$n(u,n,n[2],null);return{c(){e=_("div"),t=_("main"),f&&f.c(),i=D(),s=_("footer"),l=_("a"),o=_("span"),o.textContent="PocketBase v0.7.4",p(t,"class","page-content"),p(o,"class","txt"),p(l,"href","https://github.com/pocketbase/pocketbase/releases"),p(l,"class","inline-flex flex-gap-5"),p(l,"target","_blank"),p(l,"rel","noopener"),p(l,"title","Releases"),p(s,"class","page-footer"),p(e,"class",r="page-wrapper "+n[1]),te(e,"center-content",n[0])},m(c,d){w(c,e,d),m(e,t),f&&f.m(t,null),m(e,i),m(e,s),m(s,l),m(l,o),a=!0},p(c,[d]){f&&f.p&&(!a||d&4)&&Cn(f,u,c,c[2],a?Sn(u,c[2],d,null):Mn(c[2]),null),(!a||d&2&&r!==(r="page-wrapper "+c[1]))&&p(e,"class",r),(!a||d&3)&&te(e,"center-content",c[0])},i(c){a||(A(f,c),a=!0)},o(c){L(f,c),a=!1},d(c){c&&k(e),f&&f.d(c)}}}function X0(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 On extends Ee{constructor(e){super(),Oe(this,e,X0,G0,De,{center:0,class:1})}}function ju(n){let e,t,i;return{c(){e=_("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=D(),i=_("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function Q0(n){let e,t,i,s=!n[0]&&ju();const l=n[1].default,o=$n(l,n,n[2],null);return{c(){e=_("div"),s&&s.c(),t=D(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),m(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=ju(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Cn(o,l,r,r[2],i?Sn(l,r[2],a,null):Mn(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function x0(n){let e,t;return e=new On({props:{class:"full-page",center:!0,$$slots:{default:[Q0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ev(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 l_ extends Ee{constructor(e){super(),Oe(this,e,ev,x0,De,{nobranding:0})}}function qu(n,e,t){const i=n.slice();return i[11]=e[t],i}const tv=n=>({}),Vu=n=>({uniqueId:n[3]});function nv(n){let e=(n[11]||ko)+"",t;return{c(){t=N(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||ko)+"")&&ue(t,e)},d(i){i&&k(t)}}}function iv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||ko)+"",i;return{c(){e=_("pre"),i=N(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||ko)+"")&&ue(i,t)},d(o){o&&k(e)}}}function zu(n){let e,t;function i(o,r){return typeof o[11]=="object"?iv:nv}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=D(),p(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),m(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&&k(e),l.d()}}}function sv(n){let e,t,i,s,l;const o=n[7].default,r=$n(o,n,n[6],Vu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=zu(qu(n,a,f));return{c(){e=_("div"),r&&r.c(),t=D();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),te(e,"error",n[2].length)},m(f,c){w(f,e,c),r&&r.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=J(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Cn(r,o,f,f[6],i?Sn(o,f[6],c,tv):Mn(f[6]),Vu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=qu(f,a,d);u[d]?u[d].p(h,c):(u[d]=zu(h),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),(!i||c&5)&&te(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){L(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),Yt(u,f),n[9](null),s=!1,l()}}}const ko="Invalid value";function lv(n,e,t){let i;at(n,Vi,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+B.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Oa(r)}Fn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){tt.call(this,n,g)}function h(g){me[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=B.toArray(B.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class Ne extends Ee{constructor(e){super(),Oe(this,e,lv,sv,De,{name:4,class:0})}}function ov(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Email"),s=D(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0]),l.focus(),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&Se(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function rv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("Password"),s=D(),l=_("input"),r=D(),a=_("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Se(l,n[1]),w(c,r,d),w(c,a,d),u||(f=J(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&Se(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function av(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Password confirm"),s=D(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[2]),r||(a=J(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&Se(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function uv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new Ne({props:{class:"form-field required",name:"email",$$slots:{default:[ov,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"password",$$slots:{default:[rv,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[av,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=D(),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),f=_("button"),f.innerHTML=`<span class="txt">Create and login</span>
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),te(f,"btn-disabled",n[3]),te(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),H(s,e,null),m(e,l),H(o,e,null),m(e,r),H(a,e,null),m(e,u),m(e,f),c=!0,d||(h=J(e,"submit",Wt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&1540&&($.$$scope={dirty:v,ctx:g}),a.$set($),(!c||v&8)&&te(f,"btn-disabled",g[3]),(!c||v&8)&&te(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){L(s.$$.fragment,g),L(o.$$.fragment,g),L(a.$$.fragment,g),c=!1},d(g){g&&k(e),j(s),j(o),j(a),d=!1,h()}}}function fv(n,e,t){const i=xt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ye.admins.create({email:s,password:l,passwordConfirm:o}),await ye.admins.authViaEmail(s,l),i("submit")}catch(d){ye.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class cv extends Ee{constructor(e){super(),Oe(this,e,fv,uv,De,{})}}function Bu(n){let e,t;return e=new l_({props:{$$slots:{default:[dv]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function dv(n){let e,t;return e=new cv({}),e.$on("submit",n[1]),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p:se,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function pv(n){let e,t,i=n[0]&&Bu(n);return{c(){i&&i.c(),e=We()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Bu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Ae(),L(i,1,1,()=>{i=null}),Pe())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function hv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ye.logout(!1),t(0,i=!0);return}ye.authStore.isValid?Ci("/collections"):ye.logout()}return[i,async()=>{t(0,i=!1),await Zn(),window.location.search=""}]}class mv extends Ee{constructor(e){super(),Oe(this,e,hv,pv,De,{})}}const Nt=Gn(""),wo=Gn(""),us=Gn(!1);function Jo(n){const e=n-1;return e*e*e+1}function $o(n,{delay:e=0,duration:t=400,easing:i=$l}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Yn(n,{delay:e=0,duration:t=400,easing:i=Jo,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);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
opacity: ${a-f*d}`}}function on(n,{delay:e=0,duration:t=400,easing:i=Jo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*o}px;padding-top: ${h*r}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Tn(n,{delay:e=0,duration:t=400,easing:i=Jo,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:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}function gv(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Se(e,n[7]),i||(s=J(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&Se(e,l[7])},i:se,o:se,d(l){l&&k(e),n[13](null),i=!1,s()}}}function _v(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=new o(r(n)),me.push(()=>Re(e,"value",l)),e.$on("submit",n[10])),{c(){e&&q(e.$$.fragment),i=We()},m(a,u){e&&H(e,a,u),w(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],je(()=>t=!1)),o!==(o=a[4])){if(e){Ae();const c=e;L(c.$$.fragment,1,0,()=>{j(c,1)}),Pe()}o?(e=new o(r(a)),me.push(()=>Re(e,"value",l)),e.$on("submit",a[10]),q(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&j(e,a)}}}function Uu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Wu();return{c(){r&&r.c(),e=D(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=J(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Wu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Ae(),L(r,1,1,()=>{r=null}),Pe())},i(a){s||(A(r),a&&Tt(()=>{i||(i=st(t,Yn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){L(r),a&&(i||(i=st(t,Yn,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Wu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=st(e,Yn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=st(e,Yn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function bv(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[_v,gv],h=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Uu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=D(),r.c(),a=D(),v&&v.c(),p(s,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),h[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[J(t,"submit",Wt(n[10])),J(e,"click",ni(n[11]))],f=!0)},p(b,[y]){let $=o;o=g(b),o===$?h[o].p(b,y):(Ae(),L(h[$],1,1,()=>{h[$]=null}),Pe(),r=h[o],r?r.p(b,y):(r=h[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Uu(b),v.c(),A(v,1),v.m(t,null)):v&&(Ae(),L(v,1,1,()=>{v=null}),Pe())},i(b){u||(A(r),A(v),u=!0)},o(b){L(r),L(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Je(c)}}}function vv(n,e,t){const i=xt(),s="search_"+B.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new dn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(T=!0){t(7,d=""),T&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Pi(()=>import("./FilterAutocompleteInput.08e9fa52.js"),["FilterAutocompleteInput.08e9fa52.js","index.2148ad18.js"],import.meta.url)).default),t(5,f=!1))}Fn(()=>{v()});function b(T){tt.call(this,n,T)}function y(T){d=T,t(7,d),t(0,l)}function $(T){me[T?"unshift":"push"](()=>{c=T,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const S=()=>{h(!1),g()};return n.$$set=T=>{"value"in T&&t(0,l=T.value),"placeholder"in T&&t(1,o=T.placeholder),"autocompleteCollection"in T&&t(2,r=T.autocompleteCollection),"extraAutocompleteKeys"in T&&t(3,a=T.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,g,b,y,$,C,S]}class Zo extends Ee{constructor(e){super(),Oe(this,e,vv,bv,De,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let Gr,Ki;const Xr="app-tooltip";function Yu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ri(){return Ki=Ki||document.querySelector("."+Xr),Ki||(Ki=document.createElement("div"),Ki.classList.add(Xr),document.body.appendChild(Ki)),Ki}function o_(n,e){let t=Ri();if(!t.classList.contains("active")||!(e!=null&&e.text)){Qr();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 Qr(){clearTimeout(Gr),Ri().classList.remove("active"),Ri().activeNode=void 0}function yv(n,e){Ri().activeNode=n,clearTimeout(Gr),Gr=setTimeout(()=>{Ri().classList.add("active"),o_(n,e)},isNaN(e.delay)?200:e.delay)}function gt(n,e){let t=Yu(e);function i(){yv(n,t)}function s(){Qr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&B.isFocusable(n))&&n.addEventListener("click",s),Ri(),{update(l){var o,r;t=Yu(l),(r=(o=Ri())==null?void 0:o.activeNode)!=null&&r.contains(n)&&o_(n,t)},destroy(){var l,o;(o=(l=Ri())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Qr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function kv(n){let e,t,i,s;return{c(){e=_("button"),e.innerHTML='<i class="ri-refresh-line svelte-b7gb6q"></i>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-circle svelte-b7gb6q"),te(e,"refreshing",n[1])},m(l,o){w(l,e,o),i||(s=[Ye(t=gt.call(null,e,n[0])),J(e,"click",n[2])],i=!0)},p(l,[o]){t&&Nn(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&te(e,"refreshing",l[1])},i:se,o:se,d(l){l&&k(e),i=!1,Je(s)}}}function wv(n,e,t){const i=xt();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)},200))}return Fn(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class Go extends Ee{constructor(e){super(),Oe(this,e,wv,kv,De,{tooltip:0})}}function $v(n){let e,t,i,s,l;const o=n[6].default,r=$n(o,n,n[5],null);return{c(){e=_("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"class",t="col-sort "+n[1]),te(e,"col-sort-disabled",n[3]),te(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),te(e,"sort-desc",n[0]==="-"+n[2]),te(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(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)&&Cn(r,o,a,a[5],i?Sn(o,a[5],u,null):Mn(a[5]),null),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&te(e,"col-sort-disabled",a[3]),(!i||u&7)&&te(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&te(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&te(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,Je(l)}}}function Sv(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(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class an extends Ee{constructor(e){super(),Oe(this,e,Sv,$v,De,{class:1,name:2,sort:0,disable:3})}}function Cv(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Mv(n){let e,t=B.formatToUTCDate(n[0])+"",i,s,l,o,r;return{c(){e=_("span"),i=N(t),s=N(" UTC"),p(e,"class","txt")},m(a,u){w(a,e,u),m(e,i),m(e,s),o||(r=Ye(l=gt.call(null,e,B.formatToLocalDate(n[0])+" Local")),o=!0)},p(a,u){u&1&&t!==(t=B.formatToUTCDate(a[0])+"")&&ue(i,t),l&&Nn(l.update)&&u&1&&l.update.call(null,B.formatToLocalDate(a[0])+" Local")},d(a){a&&k(e),o=!1,r()}}}function Tv(n){let e;function t(l,o){return l[0]?Mv:Cv}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(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:se,o:se,d(l){s.d(l),l&&k(e)}}}function Dv(n,e,t){let{date:i=""}=e;return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i]}class Si extends Ee{constructor(e){super(),Oe(this,e,Dv,Tv,De,{date:0})}}function Ku(n,e,t){const i=n.slice();return i[21]=e[t],i}function Ov(n){let e;return{c(){e=_("div"),e.innerHTML=`<i class="ri-global-line"></i>
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Ev(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="url",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Av(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="referer",p(t,"class",B.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Pv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="status",p(t,"class",B.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Lv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Ju(n){let e;function t(l,o){return l[6]?Nv:Iv}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(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&&k(e)}}}function Iv(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Zu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Zu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Nv(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Zu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function Gu(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xu(n,e){var oe,Ce,Te;let t,i,s,l=((oe=e[21].method)==null?void 0:oe.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,g,v,b,y,$=(e[21].referer||"N/A")+"",C,S,T,M,O,E=e[21].status+"",P,I,F,z,Q,ne,G,ee,U,Y,Z=(((Ce=e[21].meta)==null?void 0:Ce.errorMessage)||((Te=e[21].meta)==null?void 0:Te.errorData))&&Gu();z=new Si({props:{date:e[21].created}});function de(){return e[16](e[21])}function x(...K){return e[17](e[21],...K)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=N(l),a=D(),u=_("td"),f=_("span"),d=N(c),g=D(),Z&&Z.c(),v=D(),b=_("td"),y=_("span"),C=N($),T=D(),M=_("td"),O=_("span"),P=N(E),I=D(),F=_("td"),q(z.$$.fragment),Q=D(),ne=_("td"),ne.innerHTML='<i class="ri-arrow-right-line"></i>',G=D(),p(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",S=e[21].referer),te(y,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(O,"class","label"),te(O,"label-danger",e[21].status>=400),p(M,"class","col-type-number col-field-status"),p(F,"class","col-type-date col-field-created"),p(ne,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(K,ke){w(K,t,ke),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),Z&&Z.m(u,null),m(t,v),m(t,b),m(b,y),m(y,C),m(t,T),m(t,M),m(M,O),m(O,P),m(t,I),m(t,F),H(z,F,null),m(t,Q),m(t,ne),m(t,G),ee=!0,U||(Y=[J(t,"click",de),J(t,"keydown",x)],U=!0)},p(K,ke){var W,_e,He;e=K,(!ee||ke&8)&&l!==(l=((W=e[21].method)==null?void 0:W.toUpperCase())+"")&&ue(o,l),(!ee||ke&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!ee||ke&8)&&c!==(c=e[21].url+"")&&ue(d,c),(!ee||ke&8&&h!==(h=e[21].url))&&p(f,"title",h),((_e=e[21].meta)==null?void 0:_e.errorMessage)||((He=e[21].meta)==null?void 0:He.errorData)?Z||(Z=Gu(),Z.c(),Z.m(u,null)):Z&&(Z.d(1),Z=null),(!ee||ke&8)&&$!==($=(e[21].referer||"N/A")+"")&&ue(C,$),(!ee||ke&8&&S!==(S=e[21].referer))&&p(y,"title",S),(!ee||ke&8)&&te(y,"txt-hint",!e[21].referer),(!ee||ke&8)&&E!==(E=e[21].status+"")&&ue(P,E),(!ee||ke&8)&&te(O,"label-danger",e[21].status>=400);const ae={};ke&8&&(ae.date=e[21].created),z.$set(ae)},i(K){ee||(A(z.$$.fragment,K),ee=!0)},o(K){L(z.$$.fragment,K),ee=!1},d(K){K&&k(t),Z&&Z.d(),j(z),U=!1,Je(Y)}}}function Qu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&ue(s,i),a&16&&ue(o,r[4])},d(r){r&&k(e)}}}function xu(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),te(t,"btn-loading",n[6]),te(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=J(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c&64&&te(t,"btn-loading",f[6]),c&64&&te(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function Fv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O=[],E=new Map,P,I,F,z;function Q(W){n[11](W)}let ne={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Ov]},$$scope:{ctx:n}};n[1]!==void 0&&(ne.sort=n[1]),l=new an({props:ne}),me.push(()=>Re(l,"sort",Q));function G(W){n[12](W)}let ee={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Ev]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),a=new an({props:ee}),me.push(()=>Re(a,"sort",G));function U(W){n[13](W)}let Y={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Av]},$$scope:{ctx:n}};n[1]!==void 0&&(Y.sort=n[1]),c=new an({props:Y}),me.push(()=>Re(c,"sort",U));function Z(W){n[14](W)}let de={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Pv]},$$scope:{ctx:n}};n[1]!==void 0&&(de.sort=n[1]),g=new an({props:de}),me.push(()=>Re(g,"sort",Z));function x(W){n[15](W)}let oe={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Lv]},$$scope:{ctx:n}};n[1]!==void 0&&(oe.sort=n[1]),y=new an({props:oe}),me.push(()=>Re(y,"sort",x));let Ce=n[3];const Te=W=>W[21].id;for(let W=0;W<Ce.length;W+=1){let _e=Ku(n,Ce,W),He=Te(_e);E.set(He,O[W]=Xu(He,_e))}let K=null;Ce.length||(K=Ju(n));let ke=n[3].length&&Qu(n),ae=n[3].length&&n[7]&&xu(n);return{c(){e=_("div"),t=_("table"),i=_("thead"),s=_("tr"),q(l.$$.fragment),r=D(),q(a.$$.fragment),f=D(),q(c.$$.fragment),h=D(),q(g.$$.fragment),b=D(),q(y.$$.fragment),C=D(),S=_("th"),T=D(),M=_("tbody");for(let W=0;W<O.length;W+=1)O[W].c();K&&K.c(),P=D(),ke&&ke.c(),I=D(),ae&&ae.c(),F=We(),p(S,"class","col-type-action min-width"),p(t,"class","table"),te(t,"table-loading",n[6]),p(e,"class","table-wrapper")},m(W,_e){w(W,e,_e),m(e,t),m(t,i),m(i,s),H(l,s,null),m(s,r),H(a,s,null),m(s,f),H(c,s,null),m(s,h),H(g,s,null),m(s,b),H(y,s,null),m(s,C),m(s,S),m(t,T),m(t,M);for(let He=0;He<O.length;He+=1)O[He].m(M,null);K&&K.m(M,null),w(W,P,_e),ke&&ke.m(W,_e),w(W,I,_e),ae&&ae.m(W,_e),w(W,F,_e),z=!0},p(W,[_e]){const He={};_e&16777216&&(He.$$scope={dirty:_e,ctx:W}),!o&&_e&2&&(o=!0,He.sort=W[1],je(()=>o=!1)),l.$set(He);const Ue={};_e&16777216&&(Ue.$$scope={dirty:_e,ctx:W}),!u&&_e&2&&(u=!0,Ue.sort=W[1],je(()=>u=!1)),a.$set(Ue);const X={};_e&16777216&&(X.$$scope={dirty:_e,ctx:W}),!d&&_e&2&&(d=!0,X.sort=W[1],je(()=>d=!1)),c.$set(X);const ge={};_e&16777216&&(ge.$$scope={dirty:_e,ctx:W}),!v&&_e&2&&(v=!0,ge.sort=W[1],je(()=>v=!1)),g.$set(ge);const ce={};_e&16777216&&(ce.$$scope={dirty:_e,ctx:W}),!$&&_e&2&&($=!0,ce.sort=W[1],je(()=>$=!1)),y.$set(ce),_e&841&&(Ce=W[3],Ae(),O=_t(O,_e,Te,1,W,Ce,E,M,Gt,Xu,null,Ku),Pe(),!Ce.length&&K?K.p(W,_e):Ce.length?K&&(K.d(1),K=null):(K=Ju(W),K.c(),K.m(M,null))),(!z||_e&64)&&te(t,"table-loading",W[6]),W[3].length?ke?ke.p(W,_e):(ke=Qu(W),ke.c(),ke.m(I.parentNode,I)):ke&&(ke.d(1),ke=null),W[3].length&&W[7]?ae?ae.p(W,_e):(ae=xu(W),ae.c(),ae.m(F.parentNode,F)):ae&&(ae.d(1),ae=null)},i(W){if(!z){A(l.$$.fragment,W),A(a.$$.fragment,W),A(c.$$.fragment,W),A(g.$$.fragment,W),A(y.$$.fragment,W);for(let _e=0;_e<Ce.length;_e+=1)A(O[_e]);z=!0}},o(W){L(l.$$.fragment,W),L(a.$$.fragment,W),L(c.$$.fragment,W),L(g.$$.fragment,W),L(y.$$.fragment,W);for(let _e=0;_e<O.length;_e+=1)L(O[_e]);z=!1},d(W){W&&k(e),j(l),j(a),j(c),j(g),j(y);for(let _e=0;_e<O.length;_e+=1)O[_e].d();K&&K.d(),W&&k(P),ke&&ke.d(W),W&&k(I),ae&&ae.d(W),W&&k(F)}}}function Rv(n,e,t){let i;const s=xt(),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,c=0,d=!1;async function h(E=1){return t(6,d=!0),ye.logs.getRequestsList(E,40,{sort:a,filter:[r,o].filter(Boolean).join("&&")}).then(P=>{E<=1&&g(),t(6,d=!1),t(3,u=u.concat(P.items)),t(5,f=P.page),t(4,c=P.totalItems),s("load",u)}).catch(P=>{P!=null&&P.isAbort||(t(6,d=!1),console.warn(P),g(),ye.errorResponseHandler(P,!1))})}function g(){t(3,u=[]),t(5,f=1),t(4,c=0)}function v(E){a=E,t(1,a)}function b(E){a=E,t(1,a)}function y(E){a=E,t(1,a)}function $(E){a=E,t(1,a)}function C(E){a=E,t(1,a)}const S=E=>s("select",E),T=(E,P)=>{P.code==="Enter"&&(P.preventDefault(),s("select",E))},M=()=>t(0,o=""),O=()=>h(f+1);return n.$$set=E=>{"filter"in E&&t(0,o=E.filter),"presets"in E&&t(10,r=E.presets),"sort"in E&&t(1,a=E.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(g(),h(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,h,u,c,f,d,i,s,l,r,v,b,y,$,C,S,T,M,O]}class Hv extends Ee{constructor(e){super(),Oe(this,e,Rv,Fv,De,{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 _i(){}const jv=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function It(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 ht(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Kt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function jn(n,e){return Kt(n)?n:e}function yt(n,e){return typeof n>"u"?e:n}const qv=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,r_=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Vt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Et(n,e,t,i){let s,l,o;if(It(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(ht(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 Co(n){if(It(n))return n.map(Co);if(ht(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=Co(n[t[s]]);return e}return n}function a_(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Vv(n,e,t,i){if(!a_(n))return;const s=e[n],l=t[n];ht(s)&&ht(l)?ml(s,l,i):e[n]=Co(l)}function ml(n,e,t){const i=It(e)?e:[e],s=i.length;if(!ht(n))return n;t=t||{};const l=t.merger||Vv;for(let o=0;o<s;++o){if(e=i[o],!ht(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 ll(n,e){return ml(n,e,{merger:zv})}function zv(n,e,t){if(!a_(n))return;const i=e[n],s=t[n];ht(i)&&ht(s)?ll(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=Co(s))}const ef={"":n=>n,x:n=>n.x,y:n=>n.y};function ji(n,e){return(ef[e]||(ef[e]=Bv(e)))(n)}function Bv(n){const e=Uv(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Uv(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 Aa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Kn=n=>typeof n<"u",qi=n=>typeof n=="function",tf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Wv(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,At=2*Ut,Yv=At+Ut,Mo=Number.POSITIVE_INFINITY,Kv=Ut/180,zt=Ut/2,Us=Ut/4,nf=Ut*2/3,Un=Math.log10,pi=Math.sign;function sf(n){const e=Math.round(n);n=ol(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Un(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Jv(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 Ds(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ol(n,e,t){return Math.abs(n-e)<t}function Zv(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function u_(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 ei(n){return n*(Ut/180)}function Pa(n){return n*(180/Ut)}function lf(n){if(!Kt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function f_(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*Ut&&(l+=At),{angle:l,distance:s}}function xr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Gv(n,e){return(n-e+Yv)%At-Ut}function Pn(n){return(n%At+At)%At}function gl(n,e,t,i){const s=Pn(n),l=Pn(e),o=Pn(t),r=Pn(l-s),a=Pn(o-s),u=Pn(s-l),f=Pn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function cn(n,e,t){return Math.max(e,Math.min(t,n))}function Xv(n){return cn(n,-32768,32767)}function _l(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function La(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 ts=(n,e,t,i)=>La(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Qv=(n,e,t)=>La(n,t,i=>n[i][e]>=t);function xv(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 c_=["push","pop","shift","splice","unshift"];function ey(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),c_.forEach(t=>{const i="_onData"+Aa(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 of(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)&&(c_.forEach(l=>{delete n[l]}),delete n._chartjs)}function d_(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 p_=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function h_(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,p_.call(window,()=>{s=!1,n.apply(e,l)}))}}function ty(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const ny=n=>n==="start"?"left":n==="end"?"right":"center",rf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function m_(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:c,maxDefined:d}=o.getUserBounds();c&&(s=cn(Math.min(ts(r,o.axis,u).lo,t?i:ts(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=cn(Math.max(ts(r,o.axis,f,!0).hi+1,t?0:ts(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function g_(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 Kl=n=>n===0||n===1,af=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*At/t)),uf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*At/t)+1,rl={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*zt)+1,easeOutSine:n=>Math.sin(n*zt),easeInOutSine:n=>-.5*(Math.cos(Ut*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=>Kl(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=>Kl(n)?n:af(n,.075,.3),easeOutElastic:n=>Kl(n)?n:uf(n,.075,.3),easeInOutElastic(n){return Kl(n)?n:n<.5?.5*af(n*2,.1125,.45):.5+.5*uf(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-rl.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?rl.easeInBounce(n*2)*.5:rl.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 Dl(n){return n+.5|0}const Ni=(n,e,t)=>Math.max(Math.min(n,t),e);function el(n){return Ni(Dl(n*2.55),0,255)}function Hi(n){return Ni(Dl(n*255),0,255)}function yi(n){return Ni(Dl(n/2.55)/100,0,1)}function ff(n){return Ni(Dl(n*100),0,100)}const Hn={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},ea=[..."0123456789ABCDEF"],iy=n=>ea[n&15],sy=n=>ea[(n&240)>>4]+ea[n&15],Jl=n=>(n&240)>>4===(n&15),ly=n=>Jl(n.r)&&Jl(n.g)&&Jl(n.b)&&Jl(n.a);function oy(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Hn[n[1]]*17,g:255&Hn[n[2]]*17,b:255&Hn[n[3]]*17,a:e===5?Hn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Hn[n[1]]<<4|Hn[n[2]],g:Hn[n[3]]<<4|Hn[n[4]],b:Hn[n[5]]<<4|Hn[n[6]],a:e===9?Hn[n[7]]<<4|Hn[n[8]]:255})),t}const ry=(n,e)=>n<255?e(n):"";function ay(n){var e=ly(n)?iy:sy;return n?"#"+e(n.r)+e(n.g)+e(n.b)+ry(n.a,e):void 0}const uy=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function __(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 fy(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 cy(n,e,t){const i=__(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 dy(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 Ia(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=dy(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Na(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Hi)}function Fa(n,e,t){return Na(__,n,e,t)}function py(n,e,t){return Na(cy,n,e,t)}function hy(n,e,t){return Na(fy,n,e,t)}function b_(n){return(n%360+360)%360}function my(n){const e=uy.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?el(+e[5]):Hi(+e[5]));const s=b_(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=py(s,l,o):e[1]==="hsv"?i=hy(s,l,o):i=Fa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function gy(n,e){var t=Ia(n);t[0]=b_(t[0]+e),t=Fa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function _y(n){if(!n)return;const e=Ia(n),t=e[0],i=ff(e[1]),s=ff(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const cf={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"},df={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 by(){const n={},e=Object.keys(df),t=Object.keys(cf);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,cf[l]);l=parseInt(df[o],16),n[r]=[l>>16&255,l>>8&255,l&255]}return n}let Zl;function vy(n){Zl||(Zl=by(),Zl.transparent=[0,0,0,0]);const e=Zl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const yy=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ky(n){const e=yy.exec(n);let t=255,i,s,l;if(!!e){if(e[7]!==i){const o=+e[7];t=e[8]?el(o):Ni(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?el(i):Ni(i,0,255)),s=255&(e[4]?el(s):Ni(s,0,255)),l=255&(e[6]?el(l):Ni(l,0,255)),{r:i,g:s,b:l,a:t}}}function wy(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${yi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const hr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,bs=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function $y(n,e,t){const i=bs(yi(n.r)),s=bs(yi(n.g)),l=bs(yi(n.b));return{r:Hi(hr(i+t*(bs(yi(e.r))-i))),g:Hi(hr(s+t*(bs(yi(e.g))-s))),b:Hi(hr(l+t*(bs(yi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Gl(n,e,t){if(n){let i=Ia(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Fa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function v_(n,e){return n&&Object.assign(e||{},n)}function pf(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=Hi(n[3]))):(e=v_(n,{r:0,g:0,b:0,a:1}),e.a=Hi(e.a)),e}function Sy(n){return n.charAt(0)==="r"?ky(n):my(n)}class To{constructor(e){if(e instanceof To)return e;const t=typeof e;let i;t==="object"?i=pf(e):t==="string"&&(i=oy(e)||vy(e)||Sy(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=v_(this._rgb);return e&&(e.a=yi(e.a)),e}set rgb(e){this._rgb=pf(e)}rgbString(){return this._valid?wy(this._rgb):void 0}hexString(){return this._valid?ay(this._rgb):void 0}hslString(){return this._valid?_y(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=$y(this._rgb,e._rgb,t)),this}clone(){return new To(this.rgb)}alpha(e){return this._rgb.a=Hi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Dl(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 Gl(this._rgb,2,e),this}darken(e){return Gl(this._rgb,2,-e),this}saturate(e){return Gl(this._rgb,1,e),this}desaturate(e){return Gl(this._rgb,1,-e),this}rotate(e){return gy(this._rgb,e),this}}function y_(n){return new To(n)}function k_(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function hf(n){return k_(n)?n:y_(n)}function mr(n){return k_(n)?n:y_(n).saturate(.5).darken(.1).hexString()}const fs=Object.create(null),ta=Object.create(null);function al(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 gr(n,e,t){return typeof e=="string"?ml(al(n,e),t):ml(al(n,""),e)}class Cy{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 gr(this,e,t)}get(e){return al(this,e)}describe(e,t){return gr(ta,e,t)}override(e,t){return gr(fs,e,t)}route(e,t,i,s){const l=al(this,e),o=al(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 ht(a)?Object.assign({},u,a):yt(a,u)},set(a){this[r]=a}}})}}var kt=new Cy({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function My(n){return!n||Mt(n.size)||Mt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Do(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 Ty(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,c,d;for(a=0;a<r;a++)if(c=t[a],c!=null&&It(c)!==!0)o=Do(n,s,l,o,c);else if(It(c))for(u=0,f=c.length;u<f;u++)d=c[u],d!=null&&!It(d)&&(o=Do(n,s,l,o,d));n.restore();const h=l.length/2;if(h>t.length){for(a=0;a<h;a++)delete s[l[a]];l.splice(0,h)}return o}function Ji(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 mf(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function na(n,e,t,i){Dy(n,e,t,i,null)}function Dy(n,e,t,i,s){let l,o,r,a,u,f;const c=e.pointStyle,d=e.rotation,h=e.radius;let g=(d||0)*Kv;if(c&&typeof c=="object"&&(l=c.toString(),l==="[object HTMLImageElement]"||l==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),n.restore();return}if(!(isNaN(h)||h<=0)){switch(n.beginPath(),c){default:s?n.ellipse(t,i,s/2,h,0,0,At):n.arc(t,i,h,0,At),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(g)*h,i-Math.cos(g)*h),g+=nf,n.lineTo(t+Math.sin(g)*h,i-Math.cos(g)*h),g+=nf,n.lineTo(t+Math.sin(g)*h,i-Math.cos(g)*h),n.closePath();break;case"rectRounded":u=h*.516,a=h-u,o=Math.cos(g+Us)*a,r=Math.sin(g+Us)*a,n.arc(t-o,i-r,u,g-Ut,g-zt),n.arc(t+r,i-o,u,g-zt,g),n.arc(t+o,i+r,u,g,g+zt),n.arc(t-r,i+o,u,g+zt,g+Ut),n.closePath();break;case"rect":if(!d){a=Math.SQRT1_2*h,f=s?s/2:a,n.rect(t-f,i-a,2*f,2*a);break}g+=Us;case"rectRot":o=Math.cos(g)*h,r=Math.sin(g)*h,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":g+=Us;case"cross":o=Math.cos(g)*h,r=Math.sin(g)*h,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(g)*h,r=Math.sin(g)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o),g+=Us,o=Math.cos(g)*h,r=Math.sin(g)*h,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(g)*h,r=Math.sin(g)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(g)*h,i+Math.sin(g)*h);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 Ra(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Ha(n){n.restore()}function Oy(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 Ey(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=It(e)?e:[e],r=l.strokeWidth>0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,Ay(n,l),a=0;a<o.length;++a)u=o[a],r&&(l.strokeColor&&(n.strokeStyle=l.strokeColor),Mt(l.strokeWidth)||(n.lineWidth=l.strokeWidth),n.strokeText(u,t,i,l.maxWidth)),n.fillText(u,t,i,l.maxWidth),Py(n,t,i,u,l),i+=s.lineHeight;n.restore()}function Ay(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),Mt(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 Py(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 Eo(n,e){const{x:t,y:i,w:s,h:l,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,-zt,Ut,!0),n.lineTo(t,i+l-o.bottomLeft),n.arc(t+o.bottomLeft,i+l-o.bottomLeft,o.bottomLeft,Ut,zt,!0),n.lineTo(t+s-o.bottomRight,i+l),n.arc(t+s-o.bottomRight,i+l-o.bottomRight,o.bottomRight,zt,0,!0),n.lineTo(t+s,i+o.topRight),n.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-zt,!0),n.lineTo(t+o.topLeft,i)}const Ly=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Iy=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Ny(n,e){const t=(""+n).match(Ly);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 Fy=n=>+n||0;function ja(n,e){const t={},i=ht(e),s=i?Object.keys(e):e,l=ht(n)?i?o=>yt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=Fy(l(o));return t}function w_(n){return ja(n,{top:"y",right:"x",bottom:"y",left:"x"})}function $s(n){return ja(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Jn(n){const e=w_(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ln(n,e){n=n||{},e=e||kt.font;let t=yt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=yt(n.style,e.style);i&&!(""+i).match(Iy)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:yt(n.family,e.family),lineHeight:Ny(yt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:yt(n.weight,e.weight),string:""};return s.string=My(s),s}function Xl(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&&It(r)&&(r=r[t%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function Ry(n,e,t){const{min:i,max:s}=n,l=r_(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 zi(n,e){return Object.assign(Object.create(n),e)}function qa(n,e=[""],t=n,i,s=()=>n[0]){Kn(i)||(i=M_("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>qa([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 S_(o,r,()=>Wy(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return _f(o).includes(r)},ownKeys(o){return _f(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Os(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:$_(n,i),setContext:l=>Os(n,l,t,i),override:l=>Os(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 S_(l,o,()=>jy(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 $_(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:qi(t)?t:()=>t,isIndexable:qi(i)?i:()=>i}}const Hy=(n,e)=>n?n+Aa(e):e,Va=(n,e)=>ht(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function S_(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function jy(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return qi(r)&&o.isScriptable(e)&&(r=qy(e,r,n,t)),It(r)&&r.length&&(r=Vy(e,r,n,o.isIndexable)),Va(e,r)&&(r=Os(r,s,l&&l[e],o)),r}function qy(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),Va(n,e)&&(e=za(s._scopes,s,n,e)),e}function Vy(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Kn(l.index)&&i(n))e=e[l.index%e.length];else if(ht(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=za(u,s,n,f);e.push(Os(c,l,o&&o[n],r))}}return e}function C_(n,e,t){return qi(n)?n(e,t):n}const zy=(n,e)=>n===!0?e:typeof n=="string"?ji(e,n):void 0;function By(n,e,t,i,s){for(const l of e){const o=zy(t,l);if(o){n.add(o);const r=C_(o._fallback,t,s);if(Kn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Kn(i)&&t!==i)return null}return!1}function za(n,e,t,i){const s=e._rootScopes,l=C_(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=gf(r,o,t,l||t,i);return a===null||Kn(l)&&l!==t&&(a=gf(r,o,l,a,i),a===null)?!1:qa(Array.from(r),[""],s,l,()=>Uy(e,t,i))}function gf(n,e,t,i,s){for(;t;)t=By(n,e,t,i,s);return t}function Uy(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return It(s)&&ht(t)?t:s}function Wy(n,e,t,i){let s;for(const l of e)if(s=M_(Hy(l,n),t),Kn(s))return Va(n,s)?za(t,i,n,s):s}function M_(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Kn(i))return i}}function _f(n){let e=n._keys;return e||(e=n._keys=Yy(n._scopes)),e}function Yy(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 T_(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(ji(f,l),u)};return o}const Ky=Number.EPSILON||1e-14,Es=(n,e)=>e<n.length&&!n[e].skip&&n[e],D_=n=>n==="x"?"y":"x";function Jy(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=xr(l,s),a=xr(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function Zy(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(ol(e[f],0,Ky)){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 Gy(n,e,t="x"){const i=D_(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],c=r[i];o&&(l=(f-o[t])/3,r[`cp1${t}`]=f-l,r[`cp1${i}`]=c-l*e[u]),a&&(l=(a[t]-f)/3,r[`cp2${t}`]=f+l,r[`cp2${i}`]=c+l*e[u])}}function Xy(n,e="x"){const t=D_(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?pi(s[o-1])!==pi(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Zy(n,s,l),Gy(n,l,e)}function Ql(n,e,t){return Math.max(Math.min(n,t),e)}function Qy(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=Ql(s.cp1x,e.left,e.right),s.cp1y=Ql(s.cp1y,e.top,e.bottom)),r&&(s.cp2x=Ql(s.cp2x,e.left,e.right),s.cp2y=Ql(s.cp2y,e.top,e.bottom)))}function xy(n,e,t,i,s){let l,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")Xy(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=Jy(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&&Qy(n,t)}function O_(){return typeof window<"u"&&typeof document<"u"}function Ba(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Ao(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 Xo=n=>window.getComputedStyle(n,null);function ek(n,e){return Xo(n).getPropertyValue(e)}const tk=["top","right","bottom","left"];function os(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=tk[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const nk=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function ik(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(nk(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 Qi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Xo(t),l=s.boxSizing==="border-box",o=os(s,"padding"),r=os(s,"border","width"),{x:a,y:u,box:f}=ik(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:h,height:g}=e;return l&&(h-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-c)/h*t.width/i),y:Math.round((u-d)/g*t.height/i)}}function sk(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Ba(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Xo(l),a=os(r,"border","width"),u=os(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Ao(r.maxWidth,l,"clientWidth"),s=Ao(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||Mo,maxHeight:s||Mo}}const _r=n=>Math.round(n*10)/10;function lk(n,e,t,i){const s=Xo(n),l=os(s,"margin"),o=Ao(s.maxWidth,n,"clientWidth")||Mo,r=Ao(s.maxHeight,n,"clientHeight")||Mo,a=sk(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=os(s,"border","width"),d=os(s,"padding");u-=d.width+c.width,f-=d.height+c.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 bf(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const ok=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function vf(n,e){const t=ek(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function xi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function rk(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 ak(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=xi(n,s,t),r=xi(s,l,t),a=xi(l,e,t),u=xi(o,r,t),f=xi(r,a,t);return xi(u,f,t)}const yf=new Map;function uk(n,e){e=e||{};const t=n+JSON.stringify(e);let i=yf.get(t);return i||(i=new Intl.NumberFormat(n,e),yf.set(t,i)),i}function Ol(n,e,t){return uk(e,t).format(n)}const fk=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}}},ck=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function br(n,e,t){return n?fk(e,t):ck()}function dk(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 pk(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function E_(n){return n==="angle"?{between:gl,compare:Gv,normalize:Pn}:{between:_l,compare:(e,t)=>e-t,normalize:e=>e}}function kf({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 hk(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=E_(i),a=e.length;let{start:u,end:f,loop:c}=n,d,h;if(c){for(u+=a,f+=a,d=0,h=a;d<h&&o(r(e[u%a][i]),s,l);++d)u--,f--;u%=a,f%=a}return f<u&&(f+=a),{start:u,end:f,loop:c,style:n.style}}function A_(n,e,t){if(!t)return[n];const{property:i,start:s,end:l}=t,o=e.length,{compare:r,between:a,normalize:u}=E_(i),{start:f,end:c,loop:d,style:h}=hk(n,e,t),g=[];let v=!1,b=null,y,$,C;const S=()=>a(s,C,y)&&r(s,C)!==0,T=()=>r(l,y)===0||a(l,C,y),M=()=>v||S(),O=()=>!v||T();for(let E=f,P=f;E<=c;++E)$=e[E%o],!$.skip&&(y=u($[i]),y!==C&&(v=a(y,s,l),b===null&&M()&&(b=r(y,s)===0?E:P),b!==null&&O()&&(g.push(kf({start:b,end:E,loop:d,count:o,style:h})),b=null),P=E,C=y));return b!==null&&g.push(kf({start:b,end:c,loop:d,count:o,style:h})),g}function P_(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const l=A_(i[s],n.points,e);l.length&&t.push(...l)}return t}function mk(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 gk(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 _k(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=mk(t,s,l,i);if(i===!0)return wf(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 wf(n,gk(t,o,a,u),t,e)}function wf(n,e,t,i){return!i||!i.setContext||!t?e:bk(n,e,t,i)}function bk(n,e,t,i){const s=n._chart.getContext(),l=$f(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=l,c=e[0].start,d=c;function h(g,v,b,y){const $=r?-1:1;if(g!==v){for(g+=a;t[g%a].skip;)g-=$;for(;t[v%a].skip;)v+=$;g%a!==v%a&&(u.push({start:g%a,end:v%a,loop:b,style:y}),f=y,c=v%a)}}for(const g of e){c=r?c:g.start;let v=t[c%a],b;for(d=c+1;d<=g.end;d++){const y=t[d%a];b=$f(i.setContext(zi(s,{type:"segment",p0:v,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),vk(b,f)&&h(c,d-1,g.loop,f),v=y,f=b}c<d-1&&h(c,d-1,g.loop,f)}return u}function $f(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 yk{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=p_.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 bi=new yk;const Sf="transparent",kk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=hf(n||Sf),s=i.valid&&hf(e||Sf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class wk{constructor(e,t,i,s){const l=t[i];s=Xl([e.to,s,l,e.from]);const o=Xl([e.from,l,s]);this._active=!0,this._fn=e.fn||kk[e.type||typeof o],this._easing=rl[e.easing]||rl.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=Xl([e.to,t,s,e.from]),this._from=Xl([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 $k=["x","y","borderWidth","radius","tension"],Sk=["color","borderColor","backgroundColor"];kt.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 Ck=Object.keys(kt.animation);kt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});kt.set("animations",{colors:{type:"color",properties:Sk},numbers:{type:"number",properties:$k}});kt.describe("animations",{_fallback:"animation"});kt.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 L_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!ht(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!ht(s))return;const l={};for(const o of Ck)l[o]=s[o];(It(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Tk(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&Mk(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 c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new wk(d,e,u,f),s.push(c)}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 bi.add(this._chart,i),!0}}function Mk(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 Tk(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 Cf(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 Dk(n,e,t){if(t===!1)return!1;const i=Cf(n,t),s=Cf(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Ok(n){let e,t,i,s;return ht(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 I_(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 Mf(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],Kt(u)&&(l||e===0||pi(e)===pi(u))&&(e+=u)}return e}}function Ek(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 Tf(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function Ak(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function Pk(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 Lk(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function Df(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 Of(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=Ak(l,o,i),c=e.length;let d;for(let h=0;h<c;++h){const g=e[h],{[a]:v,[u]:b}=g,y=g._stacks||(g._stacks={});d=y[u]=Lk(s,f,v),d[r]=b,d._top=Df(d,o,!0,i.type),d._bottom=Df(d,o,!1,i.type)}}function vr(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function Ik(n,e){return zi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Nk(n,e,t){return zi(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 yr=n=>n==="reset"||n==="none",Ef=(n,e)=>e?n:Object.assign({},n),Fk=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:I_(t,!0),values:null};class ai{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=Tf(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=(c,d,h,g)=>c==="x"?d:c==="r"?g:h,l=t.xAxisID=yt(i.xAxisID,vr(e,"x")),o=t.yAxisID=yt(i.yAxisID,vr(e,"y")),r=t.rAxisID=yt(i.rAxisID,vr(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&&of(this._data,this),e._stacked&&Ws(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(ht(t))this._data=Ek(t);else if(i!==t){if(i){of(i,this);const s=this._cachedMeta;Ws(s),s._parsed=[]}t&&Object.isExtensible(t)&&ey(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=Tf(t.vScale,t),t.stack!==i.stack&&(s=!0,Ws(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&Of(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,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{It(s[e])?d=this.parseArrayData(i,s,e,t):ht(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const h=()=>c[r]===null||u&&c[r]<u[r];for(f=0;f<t;++f)i._parsed[f+e]=c=d[f],a&&(h()&&(a=!1),u=c);i._sorted=a}o&&Of(this,d)}parsePrimitiveData(e,t,i,s){const{iScale:l,vScale:o}=e,r=l.axis,a=o.axis,u=l.getLabels(),f=l===o,c=new Array(s);let d,h,g;for(d=0,h=s;d<h;++d)g=d+i,c[d]={[r]:f||l.parse(u[g],g),[a]:o.parse(t[g],g)};return c}parseArrayData(e,t,i,s){const{xScale:l,yScale:o}=e,r=new Array(s);let a,u,f,c;for(a=0,u=s;a<u;++a)f=a+i,c=t[f],r[a]={x:l.parse(c[0],f),y:o.parse(c[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,c,d,h;for(f=0,c=s;f<c;++f)d=f+i,h=t[d],u[f]={x:l.parse(ji(h,r),d),y:o.parse(ji(h,a),d)};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:I_(s,!0),values:t._stacks[e.axis]};return Mf(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=Mf(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=Fk(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=Pk(r);let d,h;function g(){h=s[d];const v=h[r.axis];return!Kt(h[e.axis])||f>v||c<v}for(d=0;d<o&&!(!g()&&(this.updateRangeFromParsed(u,e,h,a),l));++d);if(l){for(d=o-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(u,e,h,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],Kt(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=Ok(yt(this.options.clip,Dk(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 c=s[f];c.hidden||(c.active&&u?o.push(c):c.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=Nk(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=Ik(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&&Kn(i);if(r)return Ef(r,a);const u=this.chart.config,f=u.datasetElementScopeKeys(this._type,e),c=s?[`${e}Hover`,"hover",e,""]:[e,""],d=u.getOptionScopes(this.getDataset(),f),h=Object.keys(kt.elements[e]),g=()=>this.getContext(i,s),v=u.resolveNamedOptions(d,h,g,c);return v.$shared&&(v.$shared=a,l[o]=Object.freeze(Ef(v,a))),v}_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,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new L_(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||yr(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){yr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!yr(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])}}ai.defaults={};ai.prototype.datasetElementType=null;ai.prototype.dataElementType=null;function Rk(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=d_(i.sort((s,l)=>s-l))}return n._cache.$bar}function Hk(n){const e=n.iScale,t=Rk(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Kn(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 jk(n,e,t,i){const s=t.barThickness;let l,o;return Mt(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 qk(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 Vk(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 N_(n,e,t,i){return It(n)?Vk(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Af(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u<f;++u)d=e[u],c={},c[s.axis]=r||s.parse(o[u],u),a.push(N_(d,c,l,u));return a}function kr(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function zk(n,e,t){return n!==0?pi(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Bk(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 Uk(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}=Bk(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=u:(t._bottom||0)===i?s=f:(l[Pf(f,o,r,a)]=!0,s=u)),l[Pf(s,o,r,a)]=!0,n.borderSkipped=l}function Pf(n,e,t,i){return i?(n=Wk(n,e,t),n=Lf(n,t,e)):n=Lf(n,e,t),n}function Wk(n,e,t){return n===e?t:n===t?e:n}function Lf(n,e,t){return n==="start"?e:n==="end"?t:n}function Yk(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class Ua extends ai{parsePrimitiveData(e,t,i,s){return Af(e,t,i,s)}parseArrayData(e,t,i,s){return Af(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,c=[];let d,h,g,v;for(d=i,h=i+s;d<h;++d)v=t[d],g={},g[l.axis]=l.parse(ji(v,u),d),c.push(N_(ji(v,f),g,o,d));return c}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=kr(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:c,includeOptions:d}=this._getSharedOptions(t,s);for(let h=t;h<t+i;h++){const g=this.getParsed(h),v=l||Mt(g[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(h),b=this._calculateBarIndexPixels(h,f),y=(g._stacks||{})[r.axis],$={horizontal:u,base:v.base,enableBorderRadius:!y||kr(g._custom)||o===y._top||o===y._bottom,x:u?v.head:b.center,y:u?b.center:v.head,height:u?b.size:Math.abs(v.size),width:u?Math.abs(v.size):b.size};d&&($.options=c||this.resolveDataElementOptions(h,e[h].active?"active":s));const C=$.options||e[h].options;Uk($,C,y,o),Yk($,C,f.ratio),this.updateElement(e[h],h,$,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(Mt(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||Hk(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=kr(a);let f=r[t.axis],c=0,d=i?this.applyStack(t,r,i):f,h,g;d!==f&&(c=d-f,d=f),u&&(f=a.barStart,d=a.barEnd-a.barStart,f!==0&&pi(f)!==pi(a.barEnd)&&(c=0),c+=f);const v=!Mt(s)&&!u?s:c;let b=t.getPixelForValue(v);if(this.chart.getDataVisibility(e)?h=t.getPixelForValue(c+d):h=b,g=h-b,Math.abs(g)<l){g=zk(g,t,o)*l,f===o&&(b-=g/2);const y=t.getPixelForDecimal(0),$=t.getPixelForDecimal(1),C=Math.min(y,$),S=Math.max(y,$);b=Math.max(Math.min(b,S),C),h=b+g}if(b===t.getPixelForValue(o)){const y=pi(g)*t.getLineWidthForValue(o)/2;b+=y,g-=y}return{size:g,base:b,head:h,center:h+g/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,l=s.skipNull,o=yt(s.maxBarThickness,1/0);let r,a;if(t.grouped){const u=l?this._getStackCount(e):t.stackCount,f=s.barThickness==="flex"?qk(e,t,s,u):jk(e,t,s,u),c=this._getStackIndex(this.index,this._cachedMeta.stack,l?e:void 0);r=f.start+f.chunk*c+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)}}Ua.id="bar";Ua.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};Ua.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Wa extends ai{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=yt(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=yt(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,c=r.axis;for(let d=t;d<t+i;d++){const h=e[d],g=!l&&this.getParsed(d),v={},b=v[f]=l?o.getPixelForDecimal(.5):o.getPixelForValue(g[f]),y=v[c]=l?r.getBasePixel():r.getPixelForValue(g[c]);v.skip=isNaN(b)||isNaN(y),u&&(v.options=a||this.resolveDataElementOptions(d,h.active?"active":s),l&&(v.options.radius=0)),this.updateElement(h,d,v,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+=yt(i&&i._custom,l),s}}Wa.id="bubble";Wa.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Wa.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function Kk(n,e,t){let i=1,s=1,l=0,o=0;if(e<At){const r=n,a=r+e,u=Math.cos(r),f=Math.sin(r),c=Math.cos(a),d=Math.sin(a),h=(C,S,T)=>gl(C,r,a,!0)?1:Math.max(S,S*t,T,T*t),g=(C,S,T)=>gl(C,r,a,!0)?-1:Math.min(S,S*t,T,T*t),v=h(0,u,c),b=h(zt,f,d),y=g(Ut,u,c),$=g(Ut+zt,f,d);i=(v-y)/2,s=(b-$)/2,l=-(v+y)/2,o=-(b+$)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class El extends ai{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(ht(i[e])){const{key:a="value"}=this._parsing;l=u=>+ji(i[u],a)}let o,r;for(o=e,r=e+t;o<r;++o)s._parsed[o]=l(o)}}_getRotation(){return ei(this.options.rotation-90)}_getCircumference(){return ei(this.options.circumference)}_getRotationExtents(){let e=At,t=-At;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(qv(this.options.cutout,r),1),u=this._getRingWeight(this.index),{circumference:f,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:h,offsetX:g,offsetY:v}=Kk(c,f,a),b=(i.width-o)/d,y=(i.height-o)/h,$=Math.max(Math.min(b,y)/2,0),C=r_(this.options.radius,$),S=Math.max(C*a,0),T=(C-S)/this._getVisibleDatasetWeightTotal();this.offsetX=g*C,this.offsetY=v*C,s.total=this.calculateTotal(),this.outerRadius=C-T*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-T*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/At)}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,c=(r.top+r.bottom)/2,d=l&&u.animateScale,h=d?0:this.innerRadius,g=d?0:this.outerRadius,{sharedOptions:v,includeOptions:b}=this._getSharedOptions(t,s);let y=this._getRotation(),$;for($=0;$<t;++$)y+=this._circumference($,l);for($=t;$<t+i;++$){const C=this._circumference($,l),S=e[$],T={x:f+this.offsetX,y:c+this.offsetY,startAngle:y,endAngle:y+C,circumference:C,outerRadius:g,innerRadius:h};b&&(T.options=v||this.resolveDataElementOptions($,S.active?"active":s)),y+=C,this.updateElement(S,$,T,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)?At*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Ol(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(yt(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}El.id="doughnut";El.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"};El.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};El.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 It(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Qo extends ai{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}=m_(t,s,o);this._drawStart=r,this._drawCount=a,g_(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:c}=this._getSharedOptions(t,s),d=o.axis,h=r.axis,{spanGaps:g,segment:v}=this.options,b=Ds(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let $=t>0&&this.getParsed(t-1);for(let C=t;C<t+i;++C){const S=e[C],T=this.getParsed(C),M=y?S:{},O=Mt(T[h]),E=M[d]=o.getPixelForValue(T[d],C),P=M[h]=l||O?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,T,a):T[h],C);M.skip=isNaN(E)||isNaN(P)||O,M.stop=C>0&&Math.abs(T[d]-$[d])>b,v&&(M.parsed=T,M.raw=u.data[C]),c&&(M.options=f||this.resolveDataElementOptions(C,S.active?"active":s)),y||this.updateElement(S,C,M,s),$=T}}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()}}Qo.id="line";Qo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Qo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ya extends ai{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=Ol(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return T_.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,c=u.yCenter,d=u.getIndexAngle(0)-.5*Ut;let h=d,g;const v=360/this.countVisibleElements();for(g=0;g<t;++g)h+=this._computeAngle(g,s,v);for(g=t;g<t+i;g++){const b=e[g];let y=h,$=h+this._computeAngle(g,s,v),C=o.getDataVisibility(g)?u.getDistanceFromCenterForValue(this.getParsed(g).r):0;h=$,l&&(a.animateScale&&(C=0),a.animateRotate&&(y=$=d));const S={x:f,y:c,innerRadius:0,outerRadius:C,startAngle:y,endAngle:$,options:this.resolveDataElementOptions(g,b.active?"active":s)};this.updateElement(b,g,S,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)?ei(this.resolveDataElementOptions(e,t).angle||i):0}}Ya.id="polarArea";Ya.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ya.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 F_ extends El{}F_.id="pie";F_.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Ka extends ai{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 T_.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),c=o?l.xCenter:f.x,d=o?l.yCenter:f.y,h={x:c,y:d,angle:f.angle,skip:isNaN(c)||isNaN(d),options:u};this.updateElement(a,r,h,s)}}}Ka.id="radar";Ka.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Ka.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class Mi{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 Ds(this.x)&&Ds(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}}Mi.defaults={};Mi.defaultRoutes=void 0;const R_={values(n){return It(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=Jk(n,t)}const o=Un(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),Ol(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Un(n)));return i===1||i===2||i===5?R_.numeric.call(this,n,e,t):""}};function Jk(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 xo={formatters:R_};kt.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:xo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});kt.route("scale.ticks","color","","color");kt.route("scale.grid","color","","borderColor");kt.route("scale.grid","borderColor","","borderColor");kt.route("scale.title","color","","color");kt.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});kt.describe("scales",{_fallback:"scale"});kt.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function Zk(n,e){const t=n.options.ticks,i=t.maxTicksLimit||Gk(n),s=t.major.enabled?Qk(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return xk(e,a,s,l/i),a;const u=Xk(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(xl(e,a,u,Mt(d)?0:o-d,o),f=0,c=l-1;f<c;f++)xl(e,a,u,s[f],s[f+1]);return xl(e,a,u,r,Mt(d)?e.length:r+d),a}return xl(e,a,u),a}function Gk(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 Xk(n,e,t){const i=e2(n),s=e.length/t;if(!i)return Math.max(s,1);const l=Jv(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 Qk(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function xk(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=yt(i,0),o=Math.min(yt(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 e2(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 t2=n=>n==="left"?"right":n==="right"?"left":n,If=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Nf(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 n2(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 i2(n,e){Et(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 Ff(n,e){if(!n.display)return 0;const t=Ln(n.font,e),i=Jn(n.padding);return(It(n.text)?n.text.length:1)*t.lineHeight+i.height}function s2(n,e){return zi(n,{scale:e,type:"scale"})}function l2(n,e,t){return zi(n,{tick:t,index:e,type:"tick"})}function o2(n,e,t){let i=ny(n);return(t&&e!=="right"||!t&&e==="right")&&(i=t2(i)),i}function r2(n,e,t,i){const{top:s,left:l,bottom:o,right:r,chart:a}=n,{chartArea:u,scales:f}=a;let c=0,d,h,g;const v=o-s,b=r-l;if(n.isHorizontal()){if(h=rf(i,l,r),ht(t)){const y=Object.keys(t)[0],$=t[y];g=f[y].getPixelForValue($)+v-e}else t==="center"?g=(u.bottom+u.top)/2+v-e:g=If(n,t,e);d=r-l}else{if(ht(t)){const y=Object.keys(t)[0],$=t[y];h=f[y].getPixelForValue($)-b+e}else t==="center"?h=(u.left+u.right)/2-b+e:h=If(n,t,e);g=rf(i,o,s),c=t==="left"?-zt:zt}return{titleX:h,titleY:g,maxWidth:d,rotation:c}}class ds extends Mi{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=jn(e,Number.POSITIVE_INFINITY),t=jn(t,Number.NEGATIVE_INFINITY),i=jn(i,Number.POSITIVE_INFINITY),s=jn(s,Number.NEGATIVE_INFINITY),{min:jn(e,i),max:jn(t,s),minDefined:Kt(e),maxDefined:Kt(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:jn(t,jn(i,t)),max:jn(i,jn(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(){Vt(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=Ry(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?Nf(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Zk(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(){Vt(this.options.afterUpdate,[this])}beforeSetDimensions(){Vt(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(){Vt(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Vt(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Vt(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=Vt(t.callback,[l.value,i,e],this)}afterTickToLabelConversion(){Vt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Vt(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(),c=f.widest.width,d=f.highest.height,h=cn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:h/(i-1),c+6>r&&(r=h/(i-(e.offset?.5:1)),a=this.maxHeight-Ys(e.grid)-t.padding-Ff(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=Pa(Math.min(Math.asin(cn((f.highest.height+6)/r,-1,1)),Math.asin(cn(a/u,-1,1))-Math.asin(cn(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){Vt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Vt(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=Ff(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:c,highest:d}=this._getLabelSizes(),h=i.padding*2,g=ei(this.labelRotation),v=Math.cos(g),b=Math.sin(g);if(r){const y=i.mirror?0:b*c.width+v*d.height;e.height=Math.min(this.maxHeight,e.height+y+h)}else{const y=i.mirror?0:v*c.width+b*d.height;e.width=Math.min(this.maxWidth,e.width+y+h)}this._calculatePadding(u,f,b,v)}}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,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;a?u?(d=s*e.width,h=i*t.height):(d=i*e.height,h=s*t.width):l==="start"?h=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((h-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+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(){Vt(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++)Mt(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=Nf(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,c,d,h,g,v,b,y,$,C;for(u=0;u<t;++u){if(d=e[u].label,h=this._resolveTickFontOptions(u),i.font=g=h.string,v=s[g]=s[g]||{data:{},gc:[]},b=h.lineHeight,y=$=0,!Mt(d)&&!It(d))y=Do(i,v.data,v.gc,y,d),$=b;else if(It(d))for(f=0,c=d.length;f<c;++f)C=d[f],!Mt(C)&&!It(C)&&(y=Do(i,v.data,v.gc,y,C),$+=b);l.push(y),o.push($),r=Math.max(y,r),a=Math.max($,a)}i2(s,t);const S=l.indexOf(r),T=o.indexOf(a),M=O=>({width:l[O]||0,height:o[O]||0});return{first:M(0),last:M(t-1),widest:M(S),highest:M(T),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 Xv(this._alignToPixels?Ji(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=l2(this.getContext(),e,i))}return this.$context||(this.$context=s2(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=ei(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),c=Ys(l),d=[],h=l.setContext(this.getContext()),g=h.drawBorder?h.borderWidth:0,v=g/2,b=function(G){return Ji(i,G,g)};let y,$,C,S,T,M,O,E,P,I,F,z;if(o==="top")y=b(this.bottom),M=this.bottom-c,E=y-v,I=b(e.top)+v,z=e.bottom;else if(o==="bottom")y=b(this.top),I=e.top,z=b(e.bottom)-v,M=y+v,E=this.top+c;else if(o==="left")y=b(this.right),T=this.right-c,O=y-v,P=b(e.left)+v,F=e.right;else if(o==="right")y=b(this.left),P=e.left,F=b(e.right)-v,T=y+v,O=this.left+c;else if(t==="x"){if(o==="center")y=b((e.top+e.bottom)/2+.5);else if(ht(o)){const G=Object.keys(o)[0],ee=o[G];y=b(this.chart.scales[G].getPixelForValue(ee))}I=e.top,z=e.bottom,M=y+v,E=M+c}else if(t==="y"){if(o==="center")y=b((e.left+e.right)/2);else if(ht(o)){const G=Object.keys(o)[0],ee=o[G];y=b(this.chart.scales[G].getPixelForValue(ee))}T=y-v,O=T-c,P=e.left,F=e.right}const Q=yt(s.ticks.maxTicksLimit,f),ne=Math.max(1,Math.ceil(f/Q));for($=0;$<f;$+=ne){const G=l.setContext(this.getContext($)),ee=G.lineWidth,U=G.color,Y=G.borderDash||[],Z=G.borderDashOffset,de=G.tickWidth,x=G.tickColor,oe=G.tickBorderDash||[],Ce=G.tickBorderDashOffset;C=n2(this,$,r),C!==void 0&&(S=Ji(i,C,ee),a?T=O=P=F=S:M=E=I=z=S,d.push({tx1:T,ty1:M,tx2:O,ty2:E,x1:P,y1:I,x2:F,y2:z,width:ee,color:U,borderDash:Y,borderDashOffset:Z,tickWidth:de,tickColor:x,tickBorderDash:oe,tickBorderDashOffset:Ce}))}return this._ticksLength=f,this._borderValue=y,d}_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:c}=l,d=Ys(i.grid),h=d+f,g=c?-f:h,v=-ei(this.labelRotation),b=[];let y,$,C,S,T,M,O,E,P,I,F,z,Q="middle";if(s==="top")M=this.bottom-g,O=this._getXAxisLabelAlignment();else if(s==="bottom")M=this.top+g,O=this._getXAxisLabelAlignment();else if(s==="left"){const G=this._getYAxisLabelAlignment(d);O=G.textAlign,T=G.x}else if(s==="right"){const G=this._getYAxisLabelAlignment(d);O=G.textAlign,T=G.x}else if(t==="x"){if(s==="center")M=(e.top+e.bottom)/2+h;else if(ht(s)){const G=Object.keys(s)[0],ee=s[G];M=this.chart.scales[G].getPixelForValue(ee)+h}O=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")T=(e.left+e.right)/2-h;else if(ht(s)){const G=Object.keys(s)[0],ee=s[G];T=this.chart.scales[G].getPixelForValue(ee)}O=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?Q="top":a==="end"&&(Q="bottom"));const ne=this._getLabelSizes();for(y=0,$=r.length;y<$;++y){C=r[y],S=C.label;const G=l.setContext(this.getContext(y));E=this.getPixelForTick(y)+l.labelOffset,P=this._resolveTickFontOptions(y),I=P.lineHeight,F=It(S)?S.length:1;const ee=F/2,U=G.color,Y=G.textStrokeColor,Z=G.textStrokeWidth;let de=O;o?(T=E,O==="inner"&&(y===$-1?de=this.options.reverse?"left":"right":y===0?de=this.options.reverse?"right":"left":de="center"),s==="top"?u==="near"||v!==0?z=-F*I+I/2:u==="center"?z=-ne.highest.height/2-ee*I+I:z=-ne.highest.height+I/2:u==="near"||v!==0?z=I/2:u==="center"?z=ne.highest.height/2-ee*I:z=ne.highest.height-F*I,c&&(z*=-1)):(M=E,z=(1-F)*I/2);let x;if(G.showLabelBackdrop){const oe=Jn(G.backdropPadding),Ce=ne.heights[y],Te=ne.widths[y];let K=M+z-oe.top,ke=T-oe.left;switch(Q){case"middle":K-=Ce/2;break;case"bottom":K-=Ce;break}switch(O){case"center":ke-=Te/2;break;case"right":ke-=Te;break}x={left:ke,top:K,width:Te+oe.width,height:Ce+oe.height,color:G.backdropColor}}b.push({rotation:v,label:S,font:P,color:U,strokeColor:Y,strokeWidth:Z,textOffset:z,textAlign:de,textBaseline:Q,translation:[T,M],backdrop:x})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-ei(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,c;this.isHorizontal()?(a=Ji(e,this.left,l)-l/2,u=Ji(e,this.right,o)+o/2,f=c=r):(f=Ji(e,this.top,l)-l/2,c=Ji(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,c),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Ra(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 c=a.textOffset;Oo(i,f,0,c,u,a)}s&&Ha(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const l=Ln(i.font),o=Jn(i.padding),r=i.align;let a=l.lineHeight/2;t==="bottom"||t==="center"||ht(t)?(a+=o.bottom,It(i.text)&&(a+=l.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=r2(this,a,t,r);Oo(e,i.text,0,0,l,{color:i.color,maxWidth:c,rotation:d,textAlign:o2(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=yt(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==ds.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 Ln(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class eo{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;f2(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,a2(e,o,i),this.override&&kt.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 kt[s]&&(delete kt[s][i],this.override&&delete fs[i])}}function a2(n,e,t){const i=ml(Object.create(null),[t?kt.get(t):{},kt.get(e),n.defaults]);kt.set(e,i),n.defaultRoutes&&u2(e,n.defaultRoutes),n.descriptors&&kt.describe(e,n.descriptors)}function u2(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(".");kt.route(l,s,a,r)})}function f2(n){return"id"in n&&"defaults"in n}class c2{constructor(){this.controllers=new eo(ai,"datasets",!0),this.elements=new eo(Mi,"elements"),this.plugins=new eo(Object,"plugins"),this.scales=new eo(ds,"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):Et(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Aa(e);Vt(i["before"+s],[],i),t[e](i),Vt(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 di=new c2;class Ja extends ai{update(e){const t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled;let{start:l,count:o}=m_(t,i,s);if(this._drawStart=l,this._drawCount=o,g_(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=di.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),c=this.getSharedOptions(f),d=this.includeOptions(s,c),h=o.axis,g=r.axis,{spanGaps:v,segment:b}=this.options,y=Ds(v)?v:Number.POSITIVE_INFINITY,$=this.chart._animationsDisabled||l||s==="none";let C=t>0&&this.getParsed(t-1);for(let S=t;S<t+i;++S){const T=e[S],M=this.getParsed(S),O=$?T:{},E=Mt(M[g]),P=O[h]=o.getPixelForValue(M[h],S),I=O[g]=l||E?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,M,a):M[g],S);O.skip=isNaN(P)||isNaN(I)||E,O.stop=S>0&&Math.abs(M[h]-C[h])>y,b&&(O.parsed=M,O.raw=u.data[S]),d&&(O.options=c||this.resolveDataElementOptions(S,T.active?"active":s)),$||this.updateElement(T,S,O,s),C=M}this.updateSharedOptions(c,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}}Ja.id="scatter";Ja.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ja.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Zi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ia{constructor(e){this.options=e||{}}init(e){}formats(){return Zi()}parse(e,t){return Zi()}format(e,t){return Zi()}add(e,t,i){return Zi()}diff(e,t,i){return Zi()}startOf(e,t,i){return Zi()}endOf(e,t){return Zi()}}ia.override=function(n){Object.assign(ia.prototype,n)};var H_={_date:ia};function d2(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?Qv:ts;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Al(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:c,hi:d}=d2(l[r],e,o,s);for(let h=c;h<=d;++h){const g=f[h];g.skip||i(g,u,h)}}}function p2(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 wr(n,e,t,i,s){const l=[];return!s&&!n.isPointInArea(e)||Al(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 h2(n,e,t,i){let s=[];function l(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=f_(o,{x:e.x,y:e.y});gl(c,u,f)&&s.push({element:o,datasetIndex:r,index:a})}return Al(n,t,e,l),s}function m2(n,e,t,i,s,l){let o=[];const r=p2(t);let a=Number.POSITIVE_INFINITY;function u(f,c,d){const h=f.inRange(e.x,e.y,s);if(i&&!h)return;const g=f.getCenterPoint(s);if(!(!!l||n.isPointInArea(g))&&!h)return;const b=r(e,g);b<a?(o=[{element:f,datasetIndex:c,index:d}],a=b):b===a&&o.push({element:f,datasetIndex:c,index:d})}return Al(n,t,e,u),o}function $r(n,e,t,i,s,l){return!l&&!n.isPointInArea(e)?[]:t==="r"&&!i?h2(n,e,t,s):m2(n,e,t,i,s,l)}function Rf(n,e,t,i,s){const l=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return Al(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 g2={evaluateInteractionItems:Al,modes:{index(n,e,t,i){const s=Qi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?wr(n,s,l,i,o):$r(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Qi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?wr(n,s,l,i,o):$r(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=Qi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return wr(n,s,l,i,o)},nearest(n,e,t,i){const s=Qi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return $r(n,s,l,t.intersect,i,o)},x(n,e,t,i){const s=Qi(e,n);return Rf(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=Qi(e,n);return Rf(n,s,"y",t.intersect,i)}}};const j_=["left","top","right","bottom"];function Ks(n,e){return n.filter(t=>t.pos===e)}function Hf(n,e){return n.filter(t=>j_.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 _2(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 b2(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:l}=t;if(!i||!j_.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 v2(n,e){const t=b2(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 y2(n){const e=_2(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=Hf(e,"x"),a=Hf(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 q_(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 k2(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!ht(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&q_(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 w2(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 $2(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function tl(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l<o;++l){r=n[l],a=r.box,a.update(r.width||e.w,r.height||e.h,$2(r.horizontal,e));const{same:c,other:d}=k2(e,t,r,i);u|=c&&s.length,f=f||d,a.fullSize||s.push(r)}return u&&tl(s,e,t,i)||f}function to(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 qf(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 c=e.w*f,d=u.size||a.height;Kn(u.start)&&(o=u.start),a.fullSize?to(a,s.left,o,t.outerWidth-s.right-s.left,d):to(a,e.left+u.placed,o,c,d),u.start=o,u.placed+=c,o=a.bottom}else{const c=e.h*f,d=u.size||a.width;Kn(u.start)&&(l=u.start),a.fullSize?to(a,l,s.top,d,t.outerHeight-s.bottom-s.top):to(a,l,e.top+u.placed,d,c),u.start=l,u.placed+=c,l=a.right}}e.x=l,e.y=o}kt.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var no={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=Jn(n.options.layout.padding),l=Math.max(e-s.width,0),o=Math.max(t-s.height,0),r=y2(n.boxes),a=r.vertical,u=r.horizontal;Et(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const f=a.reduce((v,b)=>b.box.options&&b.box.options.display===!1?v:v+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);q_(d,Jn(i));const h=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),g=v2(a.concat(u),c);tl(r.fullSize,h,c,g),tl(a,h,c,g),tl(u,h,c,g)&&tl(a,h,c,g),w2(h),qf(r.leftAndTop,h,c,g),h.x+=h.w,h.y+=h.h,qf(r.rightAndBottom,h,c,g),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Et(r.chartArea,v=>{const b=v.box;Object.assign(b,n.chartArea),b.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class V_{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 S2 extends V_{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ho="$chartjs",C2={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vf=n=>n===null||n==="";function M2(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ho]={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",Vf(s)){const l=vf(n,"width");l!==void 0&&(n.width=l)}if(Vf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=vf(n,"height");l!==void 0&&(n.height=l)}return n}const z_=ok?{passive:!0}:!1;function T2(n,e,t){n.addEventListener(e,t,z_)}function D2(n,e,t){n.canvas.removeEventListener(e,t,z_)}function O2(n,e){const t=C2[n.type]||n.type,{x:i,y:s}=Qi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Po(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function E2(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Po(r.addedNodes,i),o=o&&!Po(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function A2(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Po(r.removedNodes,i),o=o&&!Po(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const vl=new Map;let zf=0;function B_(){const n=window.devicePixelRatio;n!==zf&&(zf=n,vl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function P2(n,e){vl.size||window.addEventListener("resize",B_),vl.set(n,e)}function L2(n){vl.delete(n),vl.size||window.removeEventListener("resize",B_)}function I2(n,e,t){const i=n.canvas,s=i&&Ba(i);if(!s)return;const l=h_((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),P2(n,l),o}function Sr(n,e,t){t&&t.disconnect(),e==="resize"&&L2(n)}function N2(n,e,t){const i=n.canvas,s=h_(l=>{n.ctx!==null&&t(O2(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return T2(i,e,s),s}class F2 extends V_{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(M2(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[ho])return!1;const i=t[ho].initial;["height","width"].forEach(l=>{const o=i[l];Mt(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[ho],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:E2,detach:A2,resize:I2}[t]||N2;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]||D2)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return lk(e,t,i,s)}isAttached(e){const t=Ba(e);return!!(t&&t.isConnected)}}function R2(n){return!O_()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?S2:F2}class H2{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(Vt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Mt(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=yt(i.options&&i.options.plugins,{}),l=j2(i);return s===!1&&!t?[]:V2(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 j2(n){const e={},t=[],i=Object.keys(di.plugins.items);for(let l=0;l<i.length;l++)t.push(di.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 q2(n,e){return!e&&n===!1?null:n===!0?{}:n}function V2(n,{plugins:e,localIds:t},i,s){const l=[],o=n.getContext();for(const r of e){const a=r.id,u=q2(i[a],s);u!==null&&l.push({plugin:r,options:z2(n.config,{plugin:r,local:t[a]},u,o)})}return l}function z2(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 sa(n,e){const t=kt.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function B2(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function U2(n,e){return n===e?"_index_":"_value_"}function W2(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function la(n,e){return n==="x"||n==="y"?n:e.axis||W2(e.position)||n.charAt(0).toLowerCase()}function Y2(n,e){const t=fs[n.type]||{scales:{}},i=e.scales||{},s=sa(n.type,e),l=Object.create(null),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!ht(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=la(r,a),f=U2(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=ll(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||sa(a,e),c=(fs[a]||{}).scales||{};Object.keys(c).forEach(d=>{const h=B2(d,u),g=r[h+"AxisID"]||l[h]||h;o[g]=o[g]||Object.create(null),ll(o[g],[{axis:h},i[g],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];ll(a,[kt.scales[a.type],kt.scale])}),o}function U_(n){const e=n.options||(n.options={});e.plugins=yt(e.plugins,{}),e.scales=Y2(n,e)}function W_(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function K2(n){return n=n||{},n.data=W_(n.data),U_(n),n}const Bf=new Map,Y_=new Set;function io(n,e){let t=Bf.get(n);return t||(t=e(),Bf.set(n,t),Y_.add(t)),t}const Zs=(n,e,t)=>{const i=ji(e,t);i!==void 0&&n.add(i)};class J2{constructor(e){this._config=K2(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=W_(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(),U_(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return io(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return io(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return io(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return io(`${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(c=>Zs(a,e,c))),f.forEach(c=>Zs(a,s,c)),f.forEach(c=>Zs(a,fs[l]||{},c)),f.forEach(c=>Zs(a,kt,c)),f.forEach(c=>Zs(a,ta,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Y_.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,fs[t]||{},kt.datasets[t]||{},{type:t},kt,ta]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Uf(this._resolverCache,e,s);let a=o;if(G2(o,t)){l.$shared=!1,i=qi(i)?i():i;const u=this.createResolver(e,i,r);a=Os(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Uf(this._resolverCache,e,i);return ht(t)?Os(l,t,void 0,s):l}}function Uf(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:qa(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const Z2=n=>ht(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||qi(n[t]),!1);function G2(n,e){const{isScriptable:t,isIndexable:i}=$_(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(qi(r)||Z2(r))||o&&It(r))return!0}return!1}var X2="3.9.1";const Q2=["top","bottom","left","right","chartArea"];function Wf(n,e){return n==="top"||n==="bottom"||Q2.indexOf(n)===-1&&e==="x"}function Yf(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Kf(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Vt(t&&t.onComplete,[n],e)}function x2(n){const e=n.chart,t=e.options.animation;Vt(t&&t.onProgress,[n],e)}function K_(n){return O_()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Lo={},J_=n=>{const e=K_(n);return Object.values(Lo).filter(t=>t.canvas===e).pop()};function ew(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 tw(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Io{constructor(e,t){const i=this.config=new J2(t),s=K_(e),l=J_(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||R2(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=jv(),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 H2,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ty(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Lo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}bi.listen(this,"complete",Kf),bi.listen(this,"progress",x2),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return Mt(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():bf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return mf(this.canvas,this.ctx),this}stop(){return bi.stop(this),this}resize(e,t){bi.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,bf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Vt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};Et(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=la(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),Et(l,o=>{const r=o.options,a=r.id,u=la(a,r),f=yt(r.type,o.dtype);(r.position===void 0||Wf(r.position,u)!==Wf(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=di.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),Et(s,(o,r)=>{o||delete i[r]}),Et(i,o=>{no.configure(this,o,o.options),no.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(Yf("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||sa(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=di.getController(r),{datasetElementType:u,dataElementType:f}=kt.datasets[r];Object.assign(a.prototype,{dataElementType:di.getElement(f),datasetElementType:u&&di.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){Et(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:c}=this.getDatasetMeta(u),d=!s&&l.indexOf(c)===-1;c.buildOrUpdateElements(d),o=Math.max(+c.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||Et(l,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Yf("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){Et(this.scales,e=>{no.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!tf(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;ew(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(!tf(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;no.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],Et(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,qi(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&&(bi.has(this)?this.attached&&!bi.running(this)&&bi.start(this):(this.draw(),Kf({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&&Ra(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&&Ha(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return bl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=g2.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=zi(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);Kn(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(),bi.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(),mf(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Lo[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)};Et(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(){Et(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Et(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(c=>f.datasetIndex===c.datasetIndex&&f.index===c.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=Wv(e),u=tw(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Vt(l.onHover,[e,r,this],this),a&&Vt(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 Jf=()=>Et(Io.instances,n=>n._plugins.invalidate()),Ei=!0;Object.defineProperties(Io,{defaults:{enumerable:Ei,value:kt},instances:{enumerable:Ei,value:Lo},overrides:{enumerable:Ei,value:fs},registry:{enumerable:Ei,value:di},version:{enumerable:Ei,value:X2},getChart:{enumerable:Ei,value:J_},register:{enumerable:Ei,value:(...n)=>{di.add(...n),Jf()}},unregister:{enumerable:Ei,value:(...n)=>{di.remove(...n),Jf()}}});function Z_(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+zt,i-zt),n.closePath(),n.clip()}function nw(n){return ja(n,["outerStart","outerEnd","innerStart","innerEnd"])}function iw(n,e,t,i){const s=nw(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 cn(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:cn(s.innerStart,0,o),innerEnd:cn(s.innerEnd,0,o)}}function vs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function oa(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let h=0;const g=s-a;if(i){const G=f>0?f-i:0,ee=c>0?c-i:0,U=(G+ee)/2,Y=U!==0?g*U/(U+i):g;h=(g-Y)/2}const v=Math.max(.001,g*c-t/Ut)/c,b=(g-v)/2,y=a+b+h,$=s-b-h,{outerStart:C,outerEnd:S,innerStart:T,innerEnd:M}=iw(e,d,c,$-y),O=c-C,E=c-S,P=y+C/O,I=$-S/E,F=d+T,z=d+M,Q=y+T/F,ne=$-M/z;if(n.beginPath(),l){if(n.arc(o,r,c,P,I),S>0){const U=vs(E,I,o,r);n.arc(U.x,U.y,S,I,$+zt)}const G=vs(z,$,o,r);if(n.lineTo(G.x,G.y),M>0){const U=vs(z,ne,o,r);n.arc(U.x,U.y,M,$+zt,ne+Math.PI)}if(n.arc(o,r,d,$-M/d,y+T/d,!0),T>0){const U=vs(F,Q,o,r);n.arc(U.x,U.y,T,Q+Math.PI,y-zt)}const ee=vs(O,y,o,r);if(n.lineTo(ee.x,ee.y),C>0){const U=vs(O,P,o,r);n.arc(U.x,U.y,C,y-zt,P)}}else{n.moveTo(o,r);const G=Math.cos(P)*c+o,ee=Math.sin(P)*c+r;n.lineTo(G,ee);const U=Math.cos(I)*c+o,Y=Math.sin(I)*c+r;n.lineTo(U,Y)}n.closePath()}function sw(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){oa(n,e,t,i,o+At,s);for(let u=0;u<l;++u)n.fill();isNaN(r)||(a=o+r%At,r%At===0&&(a+=At))}return oa(n,e,t,i,a,s),n.fill(),a}function lw(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&&Z_(n,e,l+At),n.beginPath(),n.arc(i,s,u,l+At,l,!0),f=0;f<r;++f)n.stroke();for(n.beginPath(),n.arc(i,s,a,l,l+At),f=0;f<r;++f)n.stroke()}function ow(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&&lw(n,e,u),u&&Z_(n,e,s),oa(n,e,t,i,s,l),n.stroke())}class Za extends Mi{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}=f_(s,{x:e,y:t}),{startAngle:r,endAngle:a,innerRadius:u,outerRadius:f,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,g=yt(c,a-r)>=At||gl(l,r,a),v=_l(o,u+d,f+d);return g&&v}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,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}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>At?Math.floor(i/At):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>=Ut&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=sw(e,this,r,l,o);ow(e,this,r,l,a,o),e.restore()}}Za.id="arc";Za.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Za.defaultRoutes={backgroundColor:"backgroundColor"};function G_(n,e,t=e){n.lineCap=yt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(yt(t.borderDash,e.borderDash)),n.lineDashOffset=yt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=yt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=yt(t.borderWidth,e.borderWidth),n.strokeStyle=yt(t.borderColor,e.borderColor)}function rw(n,e,t){n.lineTo(t.x,t.y)}function aw(n){return n.stepped?Oy:n.tension||n.cubicInterpolationMode==="monotone"?Ey:rw}function X_(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 uw(n,e,t,i){const{points:s,options:l}=e,{count:o,start:r,loop:a,ilen:u}=X_(s,t,i),f=aw(l);let{move:c=!0,reverse:d}=i||{},h,g,v;for(h=0;h<=u;++h)g=s[(r+(d?u-h:h))%o],!g.skip&&(c?(n.moveTo(g.x,g.y),c=!1):f(n,v,g,d,l.stepped),v=g);return a&&(g=s[(r+(d?u:0))%o],f(n,v,g,d,l.stepped)),!!a}function fw(n,e,t,i){const s=e.points,{count:l,start:o,ilen:r}=X_(s,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,h,g,v,b,y;const $=S=>(o+(u?r-S:S))%l,C=()=>{v!==b&&(n.lineTo(f,b),n.lineTo(f,v),n.lineTo(f,y))};for(a&&(h=s[$(0)],n.moveTo(h.x,h.y)),d=0;d<=r;++d){if(h=s[$(d)],h.skip)continue;const S=h.x,T=h.y,M=S|0;M===g?(T<v?v=T:T>b&&(b=T),f=(c*f+S)/++c):(C(),n.lineTo(S,T),g=M,c=0,v=b=T),y=T}C()}function ra(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?fw:uw}function cw(n){return n.stepped?rk:n.tension||n.cubicInterpolationMode==="monotone"?ak:xi}function dw(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),G_(n,e.options),n.stroke(s)}function pw(n,e,t,i){const{segments:s,options:l}=e,o=ra(e);for(const r of s)G_(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const hw=typeof Path2D=="function";function mw(n,e,t,i){hw&&!e.options.segment?dw(n,e,t,i):pw(n,e,t,i)}class Bi extends Mi{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;xy(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=_k(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=P_(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=cw(i);let u,f;for(u=0,f=o.length;u<f;++u){const{start:c,end:d}=o[u],h=l[c],g=l[d];if(h===g){r.push(h);continue}const v=Math.abs((s-h[t])/(g[t]-h[t])),b=a(h,g,v,i.stepped);b[t]=e[t],r.push(b)}return r.length===1?r[0]:r}pathSegment(e,t,i){return ra(this)(e,this,t,i)}path(e,t,i){const s=this.segments,l=ra(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(),mw(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Bi.id="line";Bi.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};Bi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Bi.descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"};function Zf(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l)<s.radius+s.hitRadius}class er extends Mi{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 Zf(this,e,"x",t)}inYRange(e,t){return Zf(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,na(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}er.id="point";er.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};er.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function Q_(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,c;return n.horizontal?(c=o/2,r=Math.min(t,s),a=Math.max(t,s),u=i-c,f=i+c):(c=l/2,r=t-c,a=t+c,u=Math.min(i,s),f=Math.max(i,s)),{left:r,top:u,right:a,bottom:f}}function Fi(n,e,t,i){return n?0:cn(e,t,i)}function gw(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,l=w_(i);return{t:Fi(s.top,l.top,0,t),r:Fi(s.right,l.right,0,e),b:Fi(s.bottom,l.bottom,0,t),l:Fi(s.left,l.left,0,e)}}function _w(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,l=$s(s),o=Math.min(e,t),r=n.borderSkipped,a=i||ht(s);return{topLeft:Fi(!a||r.top||r.left,l.topLeft,0,o),topRight:Fi(!a||r.top||r.right,l.topRight,0,o),bottomLeft:Fi(!a||r.bottom||r.left,l.bottomLeft,0,o),bottomRight:Fi(!a||r.bottom||r.right,l.bottomRight,0,o)}}function bw(n){const e=Q_(n),t=e.right-e.left,i=e.bottom-e.top,s=gw(n,t/2,i/2),l=_w(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 Cr(n,e,t,i){const s=e===null,l=t===null,r=n&&!(s&&l)&&Q_(n,i);return r&&(s||_l(e,r.left,r.right))&&(l||_l(t,r.top,r.bottom))}function vw(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function yw(n,e){n.rect(e.x,e.y,e.w,e.h)}function Mr(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 Ga extends Mi{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}=bw(this),r=vw(o.radius)?Eo:yw;e.save(),(o.w!==l.w||o.h!==l.h)&&(e.beginPath(),r(e,Mr(o,t,l)),e.clip(),r(e,Mr(l,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,Mr(l,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return Cr(this,e,t,i)}inXRange(e,t){return Cr(this,e,null,t)}inYRange(e,t){return Cr(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}}Ga.id="bar";Ga.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Ga.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function kw(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=Xa(a,u,s);const f=aa(t,s[a],s[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:s[a],end:s[u]});continue}const c=P_(e,f);for(const d of c){const h=aa(t,l[d.start],l[d.end],d.loop),g=A_(r,s,h);for(const v of g)o.push({source:v,target:d,start:{[t]:Gf(f,h,"start",Math.max)},end:{[t]:Gf(f,h,"end",Math.min)}})}}return o}function aa(n,e,t,i){if(i)return;let s=e[n],l=t[n];return n==="angle"&&(s=Pn(s),l=Pn(l)),{property:n,start:s,end:l}}function ww(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,l=[];return e.segments.forEach(({start:o,end:r})=>{r=Xa(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 Xa(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Gf(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function x_(n,e){let t=[],i=!1;return It(n)?(i=!0,t=n):t=ww(n,e),t.length?new Bi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function Xf(n){return n&&n.fill!==!1}function $w(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(!Kt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function Sw(n,e,t){const i=Dw(n);if(ht(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Kt(s)&&Math.floor(s)===s?Cw(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Cw(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function Mw(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:ht(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function Tw(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:ht(n)?i=n.value:i=e.getBaseValue(),i}function Dw(n){const e=n.options,t=e.fill;let i=yt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Ow(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=Ew(e,t);r.push(x_({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++)Aw(s,o[f],r)}return new Bi({points:s,options:{}})}function Ew(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 Aw(n,e,t){const i=[];for(let s=0;s<t.length;s++){const l=t[s],{first:o,last:r,point:a}=Pw(l,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function Pw(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],c=o[f.start][t],d=o[f.end][t];if(_l(s,c,d)){r=s===c,a=s===d;break}}return{first:r,last:a,point:i}}class eb{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:At},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 Lw(n){const{chart:e,fill:t,line:i}=n;if(Kt(t))return Iw(e,t);if(t==="stack")return Ow(n);if(t==="shape")return!0;const s=Nw(n);return s instanceof eb?s:x_(s,i)}function Iw(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function Nw(n){return(n.scale||{}).getPointPositionForValue?Rw(n):Fw(n)}function Fw(n){const{scale:e={},fill:t}=n,i=Mw(t,e);if(Kt(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Rw(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,l=i.reverse?e.max:e.min,o=Tw(t,e,l),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,l);return new eb({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 Tr(n,e,t){const i=Lw(e),{line:s,scale:l,axis:o}=e,r=s.options,a=r.fill,u=r.backgroundColor,{above:f=u,below:c=u}=a||{};i&&s.points.length&&(Ra(n,t),Hw(n,{line:s,target:i,above:f,below:c,area:t,scale:l,axis:o}),Ha(n))}function Hw(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&&(Qf(n,i,o.top),xf(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore(),n.save(),Qf(n,i,o.bottom)),xf(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore()}function Qf(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],c=s[Xa(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(c.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function xf(n,e){const{line:t,target:i,property:s,color:l,scale:o}=e,r=kw(t,i,s);for(const{source:a,target:u,start:f,end:c}of r){const{style:{backgroundColor:d=l}={}}=a,h=i!==!0;n.save(),n.fillStyle=d,jw(n,o,h&&aa(s,f,c)),n.beginPath();const g=!!t.pathSegment(n,a);let v;if(h){g?n.closePath():ec(n,i,c,s);const b=!!i.pathSegment(n,u,{move:g,reverse:!0});v=g&&b,v||ec(n,i,f,s)}n.closePath(),n.fill(v?"evenodd":"nonzero"),n.restore()}}function jw(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 ec(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var qw={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 Bi&&(a={visible:n.isDatasetVisible(o),index:o,fill:Sw(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=$w(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&&Tr(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;Xf(l)&&Tr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!Xf(i)||t.drawTime!=="beforeDatasetDraw"||Tr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ul={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=xr(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 fi(n,e){return e&&(It(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function vi(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-1?n.split(`
`):n}function Vw(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 tc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Ln(e.bodyFont),u=Ln(e.titleFont),f=Ln(e.footerFont),c=l.length,d=s.length,h=i.length,g=Jn(e.padding);let v=g.height,b=0,y=i.reduce((S,T)=>S+T.before.length+T.lines.length+T.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const S=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*S+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let $=0;const C=function(S){b=Math.max(b,t.measureText(S).width+$)};return t.save(),t.font=u.string,Et(n.title,C),t.font=a.string,Et(n.beforeBody.concat(n.afterBody),C),$=e.displayColors?o+2+e.boxPadding:0,Et(i,S=>{Et(S.before,C),Et(S.lines,C),Et(S.after,C)}),$=0,t.font=f.string,Et(n.footer,C),t.restore(),b+=g.width,{width:b,height:v}}function zw(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function Bw(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 Uw(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"),Bw(u,n,e,t)&&(u="center"),u}function nc(n,e,t){const i=t.yAlign||e.yAlign||zw(n,t);return{xAlign:t.xAlign||e.xAlign||Uw(n,e,t,i),yAlign:i}}function Ww(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function Yw(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function ic(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=$s(o);let g=Ww(e,r);const v=Yw(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,h)+s),{x:cn(g,0,i.width-e.width),y:cn(v,0,i.height-e.height)}}function so(n,e,t){const i=Jn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function sc(n){return fi([],vi(n))}function Kw(n,e,t){return zi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function lc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ua extends Mi{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 L_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=Kw(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=fi(r,vi(s)),r=fi(r,vi(l)),r=fi(r,vi(o)),r}getBeforeBody(e,t){return sc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Et(e,l=>{const o={before:[],lines:[],after:[]},r=lc(i,l);fi(o.before,vi(r.beforeLabel.call(this,l))),fi(o.lines,r.label.call(this,l)),fi(o.after,vi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return sc(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=fi(r,vi(s)),r=fi(r,vi(l)),r=fi(r,vi(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(Vw(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),Et(r,f=>{const c=lc(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.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=ul[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=tc(this,i),u=Object.assign({},r,a),f=nc(this.chart,i,u),c=ic(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.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:c}=$s(r),{x:d,y:h}=e,{width:g,height:v}=t;let b,y,$,C,S,T;return l==="center"?(S=h+v/2,s==="left"?(b=d,y=b-o,C=S+o,T=S-o):(b=d+g,y=b+o,C=S-o,T=S+o),$=b):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+g-Math.max(u,c)-o:y=this.caretX,l==="top"?(C=h,S=C-o,b=y-o,$=y+o):(C=h+v,S=C+o,b=y+o,$=y-o),T=C),{x1:b,x2:y,x3:$,y1:C,y2:S,y3:T}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=br(i.rtl,this.x,this.width);for(e.x=so(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Ln(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,c=Ln(l.bodyFont),d=so(this,"left",l),h=s.x(d),g=a<c.lineHeight?(c.lineHeight-a)/2:0,v=t.y+g;if(l.usePointStyle){const b={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},y=s.leftForLtr(h,u)+u/2,$=v+a/2;e.strokeStyle=l.multiKeyBackground,e.fillStyle=l.multiKeyBackground,na(e,b,y,$),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,na(e,b,y,$)}else{e.lineWidth=ht(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(h,u-f),y=s.leftForLtr(s.xPlus(h,1),u-f-2),$=$s(o.borderRadius);Object.values($).some(C=>C!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Eo(e,{x:b,y:v,w:u,h:a,radius:$}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Eo(e,{x:y,y:v+1,w:u-2,h:a-2,radius:$}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,v,u,a),e.strokeRect(b,v,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,v+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,c=Ln(i.bodyFont);let d=c.lineHeight,h=0;const g=br(i.rtl,this.x,this.width),v=function(E){t.fillText(E,g.x(e.x+h),e.y+d/2),e.y+=d+l},b=g.textAlign(o);let y,$,C,S,T,M,O;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=so(this,b,i),t.fillStyle=i.bodyColor,Et(this.beforeBody,v),h=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,S=0,M=s.length;S<M;++S){for(y=s[S],$=this.labelTextColors[S],t.fillStyle=$,Et(y.before,v),C=y.lines,r&&C.length&&(this._drawColorBox(t,e,S,g,i),d=Math.max(c.lineHeight,a)),T=0,O=C.length;T<O;++T)v(C[T]),d=c.lineHeight;Et(y.after,v)}h=0,d=c.lineHeight,Et(this.afterBody,v),e.y-=l}drawFooter(e,t,i){const s=this.footer,l=s.length;let o,r;if(l){const a=br(i.rtl,this.x,this.width);for(e.x=so(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",o=Ln(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:c,topRight:d,bottomLeft:h,bottomRight:g}=$s(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(r+c,a),o==="top"&&this.drawCaret(e,t,i,s),t.lineTo(r+u-d,a),t.quadraticCurveTo(r+u,a,r+u,a+d),o==="center"&&l==="right"&&this.drawCaret(e,t,i,s),t.lineTo(r+u,a+f-g),t.quadraticCurveTo(r+u,a+f,r+u-g,a+f),o==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(r+h,a+f),t.quadraticCurveTo(r,a+f,r,a+f-h),o==="center"&&l==="left"&&this.drawCaret(e,t,i,s),t.lineTo(r,a+c),t.quadraticCurveTo(r,a,r+c,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=ul[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=tc(this,e),a=Object.assign({},o,this._size),u=nc(t,e,a),f=ic(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=Jn(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),dk(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),pk(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=ul[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ua.positioners=ul;var Jw={id:"tooltip",_element:ua,positioners:ul,afterInit(n,e,t){t&&(n.tooltip=new ua({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:_i,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:_i,beforeBody:_i,beforeLabel:_i,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 Mt(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:_i,afterBody:_i,beforeFooter:_i,footer:_i,afterFooter:_i}},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 Zw=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function Gw(n,e,t,i){const s=n.indexOf(e);if(s===-1)return Zw(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const Xw=(n,e)=>n===null?null:cn(Math.round(n),0,e);class fa extends ds{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(Mt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:Gw(i,e,yt(t,e),this._addedLabels),Xw(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}}fa.id="category";fa.defaults={ticks:{callback:fa.prototype.getLabelForValue}};function Qw(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,h=l||1,g=f-1,{min:v,max:b}=e,y=!Mt(o),$=!Mt(r),C=!Mt(u),S=(b-v)/(c+1);let T=sf((b-v)/g/h)*h,M,O,E,P;if(T<1e-14&&!y&&!$)return[{value:v},{value:b}];P=Math.ceil(b/T)-Math.floor(v/T),P>g&&(T=sf(P*T/g/h)*h),Mt(a)||(M=Math.pow(10,a),T=Math.ceil(T*M)/M),s==="ticks"?(O=Math.floor(v/T)*T,E=Math.ceil(b/T)*T):(O=v,E=b),y&&$&&l&&Zv((r-o)/l,T/1e3)?(P=Math.round(Math.min((r-o)/T,f)),T=(r-o)/P,O=o,E=r):C?(O=y?o:O,E=$?r:E,P=u-1,T=(E-O)/P):(P=(E-O)/T,ol(P,Math.round(P),T/1e3)?P=Math.round(P):P=Math.ceil(P));const I=Math.max(lf(T),lf(O));M=Math.pow(10,Mt(a)?I:a),O=Math.round(O*M)/M,E=Math.round(E*M)/M;let F=0;for(y&&(d&&O!==o?(t.push({value:o}),O<o&&F++,ol(Math.round((O+F*T)*M)/M,o,oc(o,S,n))&&F++):O<o&&F++);F<P;++F)t.push({value:Math.round((O+F*T)*M)/M});return $&&d&&E!==r?t.length&&ol(t[t.length-1].value,r,oc(r,S,n))?t[t.length-1].value=r:t.push({value:r}):(!$||E===r)&&t.push({value:E}),t}function oc(n,e,{horizontal:t,minRotation:i}){const s=ei(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class No extends ds{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 Mt(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=pi(s),u=pi(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=Qw(s,l);return e.bounds==="ticks"&&u_(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 Ol(e,this.chart.options.locale,this.options.ticks.format)}}class Qa extends No{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Kt(e)?e:0,this.max=Kt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=ei(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}}Qa.id="linear";Qa.defaults={ticks:{callback:xo.formatters.numeric}};function rc(n){return n/Math.pow(10,Math.floor(Un(n)))===1}function xw(n,e){const t=Math.floor(Un(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=jn(n.min,Math.pow(10,Math.floor(Un(e.min)))),o=Math.floor(Un(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:rc(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=jn(n.max,l);return s.push({value:u,major:rc(l)}),s}class tb extends ds{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=No.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return Kt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Kt(e)?Math.max(0,e):null,this.max=Kt(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(Un(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=xw(t,this);return e.bounds==="ticks"&&u_(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":Ol(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Un(e),this._valueRange=Un(this.max)-Un(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Un(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}tb.id="logarithmic";tb.defaults={ticks:{callback:xo.formatters.logarithmic,major:{enabled:!0}}};function ca(n){const e=n.ticks;if(e.display&&n.display){const t=Jn(e.backdropPadding);return yt(e.font&&e.font.size,kt.font.size)+t.height}return 0}function e$(n,e,t){return t=It(t)?t:[t],{w:Ty(n,e.string,t),h:t.length*e.lineHeight}}function ac(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 t$(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?Ut/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),c=Ln(u.font),d=e$(n.ctx,c,n._pointLabels[a]);i[a]=d;const h=Pn(n.getIndexAngle(a)+r),g=Math.round(Pa(h)),v=ac(g,f.x,d.w,0,180),b=ac(g,f.y,d.h,90,270);n$(t,e,h,v,b)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=i$(n,i,s)}function n$(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 i$(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=ca(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Ut/s:0;for(let u=0;u<s;u++){const f=n.getPointPosition(u,r+o+t[u],a),c=Math.round(Pa(Pn(f.angle+zt))),d=e[u],h=o$(f.y,d.h,c),g=s$(c),v=l$(f.x,d.w,g);i.push({x:f.x,y:h,textAlign:g,left:v,top:h,right:v+d.w,bottom:h+d.h})}return i}function s$(n){return n===0||n===180?"center":n<180?"left":"right"}function l$(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function o$(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function r$(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=Ln(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:h}=n._pointLabelItems[s],{backdropColor:g}=l;if(!Mt(g)){const v=$s(l.borderRadius),b=Jn(l.backdropPadding);t.fillStyle=g;const y=f-b.left,$=c-b.top,C=d-f+b.width,S=h-c+b.height;Object.values(v).some(T=>T!==0)?(t.beginPath(),Eo(t,{x:y,y:$,w:C,h:S,radius:v}),t.fill()):t.fillRect(y,$,C,S)}Oo(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function nb(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,At);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 a$(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(),nb(n,t,l,i),s.closePath(),s.stroke(),s.restore())}function u$(n,e,t){return zi(n,{label:t,index:e,type:"pointLabel"})}class tr extends No{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=Jn(ca(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=Kt(e)&&!isNaN(e)?e:0,this.max=Kt(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ca(this.options))}generateTickLabels(e){No.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const s=Vt(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?t$(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=At/(this._pointLabels.length||1),i=this.options.startAngle||0;return Pn(e*t+ei(i))}getDistanceFromCenterForValue(e){if(Mt(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(Mt(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 u$(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const s=this.getIndexAngle(e)-zt+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(),nb(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&&r$(this,l),s.display&&this.ticks.forEach((u,f)=>{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));a$(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,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=Ln(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 c=Jn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Oo(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}tr.id="radialLinear";tr.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:xo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};tr.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};tr.descriptors={angleLines:{_fallback:"grid"}};const nr={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}},kn=Object.keys(nr);function f$(n,e){return n-e}function uc(n,e){if(Mt(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)),Kt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ds(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function fc(n,e,t,i){const s=kn.length;for(let l=kn.indexOf(n);l<s-1;++l){const o=nr[kn[l]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return kn[l]}return kn[s-1]}function c$(n,e,t,i,s){for(let l=kn.length-1;l>=kn.indexOf(t);l--){const o=kn[l];if(nr[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return kn[t?kn.indexOf(t):0]}function d$(n){for(let e=kn.indexOf(n)+1,t=kn.length;e<t;++e)if(nr[kn[e]].common)return kn[e]}function cc(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=La(t,e),l=t[i]>=e?t[i]:t[s];n[l]=!0}}function p$(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 dc(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:p$(n,i,s,t)}class Pl extends ds{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 H_._date(e.adapters.date);s.init(t),ll(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:uc(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=Kt(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),l=Kt(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=xv(s,l,o);return this._unit=t.unit||(i.autoSkip?fc(t.minUnit,this.min,this.max,this._getLabelCapacity(l)):c$(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:d$(this._unit),this.initOffsets(s),e.reverse&&r.reverse(),dc(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=cn(t,0,o),i=cn(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||fc(l.minUnit,t,i,this._getLabelCapacity(t)),r=yt(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Ds(a)||a===!0,f={};let c=t,d,h;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,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 g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,h=0;d<i;d=+e.add(d,r,o),h++)cc(f,d,g);return(d===i||s.bounds==="ticks"||h===1)&&cc(f,d,g),Object.keys(f).sort((v,b)=>v-b).map(v=>+v)}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],c=i[t],d=a&&f&&c&&c.major,h=this._adapter.format(e,s||(d?f:u)),g=l.ticks.callback;return g?Vt(g,[h,t,i],this):h}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=ei(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,dc(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(uc(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return d_(e.sort(f$))}}Pl.id="time";Pl.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function lo(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}=ts(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}=ts(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 ib extends Pl{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=lo(t,this.min),this._tableRange=lo(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(lo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return lo(this._table,i*this._tableRange+this._minPos,!0)}}ib.id="timeseries";ib.defaults=Pl.defaults;/*!
* chartjs-adapter-luxon v1.2.0
* https://www.chartjs.org
* (c) 2022 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const h$={datetime:Qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Qe.TIME_WITH_SECONDS,minute:Qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};H_._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return h$},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=Qe.fromFormat(n,e,t):n=Qe.fromISO(n,t):n instanceof Date?n=Qe.fromJSDate(n,t):i==="object"&&!(n instanceof Qe)&&(n=Qe.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 pc(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=st(e,Tn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=st(e,Tn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function m$(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=N(n[1]),t=D(),s=N(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ue(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ue(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function g$(n){let e;return{c(){e=N("Loading...")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function _$(n){let e,t,i,s,l,o=n[2]&&pc();function r(f,c){return f[2]?g$:m$}let a=r(n),u=a(n);return{c(){e=_("div"),o&&o.c(),t=D(),i=_("canvas"),s=D(),l=_("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),lu(i,"height","250px"),lu(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),te(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=pc(),o.c(),A(o,1),o.m(e,t)):o&&(Ae(),L(o,1,1,()=>{o=null}),Pe()),c&4&&te(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){L(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function b$(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),ye.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:B.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ye.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Fn(()=>(Io.register(Bi,er,Qo,Qa,Pl,qw,Jw),t(6,o=new Io(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:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){me[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.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,d]}class v$ extends Ee{constructor(e){super(),Oe(this,e,b$,_$,De,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var hc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},sb={exports:{}};(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 $(C){return C instanceof a?new a(C.type,$(C.content),C.alias):Array.isArray(C)?C.map($):C.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 $(C,S){S=S||{};var T,M;switch(r.util.type(C)){case"Object":if(M=r.util.objId(C),S[M])return S[M];T={},S[M]=T;for(var O in C)C.hasOwnProperty(O)&&(T[O]=$(C[O],S));return T;case"Array":return M=r.util.objId(C),S[M]?S[M]:(T=[],S[M]=T,C.forEach(function(E,P){T[P]=$(E,S)}),T);default:return C}},getLanguage:function($){for(;$;){var C=s.exec($.className);if(C)return C[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,C){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+C)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(T){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(T.stack)||[])[1];if($){var C=document.getElementsByTagName("script");for(var S in C)if(C[S].src==$)return C[S]}return null}},isActive:function($,C,S){for(var T="no-"+C;$;){var M=$.classList;if(M.contains(C))return!0;if(M.contains(T))return!1;$=$.parentElement}return!!S}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,C){var S=r.util.clone(r.languages[$]);for(var T in C)S[T]=C[T];return S},insertBefore:function($,C,S,T){T=T||r.languages;var M=T[$],O={};for(var E in M)if(M.hasOwnProperty(E)){if(E==C)for(var P in S)S.hasOwnProperty(P)&&(O[P]=S[P]);S.hasOwnProperty(E)||(O[E]=M[E])}var I=T[$];return T[$]=O,r.languages.DFS(r.languages,function(F,z){z===I&&F!=$&&(this[F]=O)}),O},DFS:function $(C,S,T,M){M=M||{};var O=r.util.objId;for(var E in C)if(C.hasOwnProperty(E)){S.call(C,E,C[E],T||E);var P=C[E],I=r.util.type(P);I==="Object"&&!M[O(P)]?(M[O(P)]=!0,$(P,S,null,M)):I==="Array"&&!M[O(P)]&&(M[O(P)]=!0,$(P,S,E,M))}}},plugins:{},highlightAll:function($,C){r.highlightAllUnder(document,$,C)},highlightAllUnder:function($,C,S){var T={callback:S,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",T),T.elements=Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)),r.hooks.run("before-all-elements-highlight",T);for(var M=0,O;O=T.elements[M++];)r.highlightElement(O,C===!0,T.callback)},highlightElement:function($,C,S){var T=r.util.getLanguage($),M=r.languages[T];r.util.setLanguage($,T);var O=$.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,T);var E=$.textContent,P={element:$,language:T,grammar:M,code:E};function I(z){P.highlightedCode=z,r.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,r.hooks.run("after-highlight",P),r.hooks.run("complete",P),S&&S.call(P.element)}if(r.hooks.run("before-sanity-check",P),O=P.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!P.code){r.hooks.run("complete",P),S&&S.call(P.element);return}if(r.hooks.run("before-highlight",P),!P.grammar){I(r.util.encode(P.code));return}if(C&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(z){I(z.data)},F.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else I(r.highlight(P.code,P.grammar,P.language))},highlight:function($,C,S){var T={code:$,grammar:C,language:S};if(r.hooks.run("before-tokenize",T),!T.grammar)throw new Error('The language "'+T.language+'" has no grammar.');return T.tokens=r.tokenize(T.code,T.grammar),r.hooks.run("after-tokenize",T),a.stringify(r.util.encode(T.tokens),T.language)},tokenize:function($,C){var S=C.rest;if(S){for(var T in S)C[T]=S[T];delete C.rest}var M=new c;return d(M,M.head,$),f($,M,C,M.head,0),g(M)},hooks:{all:{},add:function($,C){var S=r.hooks.all;S[$]=S[$]||[],S[$].push(C)},run:function($,C){var S=r.hooks.all[$];if(!(!S||!S.length))for(var T=0,M;M=S[T++];)M(C)}},Token:a};i.Prism=r;function a($,C,S,T){this.type=$,this.content=C,this.alias=S,this.length=(T||"").length|0}a.stringify=function $(C,S){if(typeof C=="string")return C;if(Array.isArray(C)){var T="";return C.forEach(function(I){T+=$(I,S)}),T}var M={type:C.type,content:$(C.content,S),tag:"span",classes:["token",C.type],attributes:{},language:S},O=C.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(M.classes,O):M.classes.push(O)),r.hooks.run("wrap",M);var E="";for(var P in M.attributes)E+=" "+P+'="'+(M.attributes[P]||"").replace(/"/g,"&quot;")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+E+">"+M.content+"</"+M.tag+">"};function u($,C,S,T){$.lastIndex=C;var M=$.exec(S);if(M&&T&&M[1]){var O=M[1].length;M.index+=O,M[0]=M[0].slice(O)}return M}function f($,C,S,T,M,O){for(var E in S)if(!(!S.hasOwnProperty(E)||!S[E])){var P=S[E];P=Array.isArray(P)?P:[P];for(var I=0;I<P.length;++I){if(O&&O.cause==E+","+I)return;var F=P[I],z=F.inside,Q=!!F.lookbehind,ne=!!F.greedy,G=F.alias;if(ne&&!F.pattern.global){var ee=F.pattern.toString().match(/[imsuy]*$/)[0];F.pattern=RegExp(F.pattern.source,ee+"g")}for(var U=F.pattern||F,Y=T.next,Z=M;Y!==C.tail&&!(O&&Z>=O.reach);Z+=Y.value.length,Y=Y.next){var de=Y.value;if(C.length>$.length)return;if(!(de instanceof a)){var x=1,oe;if(ne){if(oe=u(U,Z,$,Q),!oe||oe.index>=$.length)break;var ke=oe.index,Ce=oe.index+oe[0].length,Te=Z;for(Te+=Y.value.length;ke>=Te;)Y=Y.next,Te+=Y.value.length;if(Te-=Y.value.length,Z=Te,Y.value instanceof a)continue;for(var K=Y;K!==C.tail&&(Te<Ce||typeof K.value=="string");K=K.next)x++,Te+=K.value.length;x--,de=$.slice(Z,Te),oe.index-=Z}else if(oe=u(U,0,de,Q),!oe)continue;var ke=oe.index,ae=oe[0],W=de.slice(0,ke),_e=de.slice(ke+ae.length),He=Z+de.length;O&&He>O.reach&&(O.reach=He);var Ue=Y.prev;W&&(Ue=d(C,Ue,W),Z+=W.length),h(C,Ue,x);var X=new a(E,z?r.tokenize(ae,z):ae,G,ae);if(Y=d(C,Ue,X),_e&&d(C,Y,_e),x>1){var ge={cause:E+","+I,reach:He};f($,C,S,Y.prev,Z,ge),O&&ge.reach>O.reach&&(O.reach=ge.reach)}}}}}}function c(){var $={value:null,prev:null,next:null},C={value:null,prev:$,next:null};$.next=C,this.head=$,this.tail=C,this.length=0}function d($,C,S){var T=C.next,M={value:S,prev:C,next:T};return C.next=M,T.prev=M,$.length++,M}function h($,C,S){for(var T=C.next,M=0;M<S&&T!==$.tail;M++)T=T.next;C.next=T,T.prev=C,$.length-=M}function g($){for(var C=[],S=$.head.next;S!==$.tail;)C.push(S.value),S=S.next;return C}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function($){var C=JSON.parse($.data),S=C.language,T=C.code,M=C.immediateClose;i.postMessage(r.highlight(T,r.languages[S],S)),M&&i.close()},!1)),r;var v=r.util.currentScript();v&&(r.filename=v.src,v.hasAttribute("data-manual")&&(r.manual=!0));function b(){r.manual||r.highlightAll()}if(!r.manual){var y=document.readyState;y==="loading"||y==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",b):window.requestAnimationFrame?window.requestAnimationFrame(b):window.setTimeout(b,16)}return r}(e);n.exports&&(n.exports=t),typeof hc<"u"&&(hc.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\u2026",s=function(v,b){return"\u2716 Error "+v+" while fetching file: "+b},l="\u2716 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",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(v,b,y){var $=new XMLHttpRequest;$.open("GET",v,!0),$.onreadystatechange=function(){$.readyState==4&&($.status<400&&$.responseText?b($.responseText):$.status>=400?y(s($.status,$.statusText)):y(l))},$.send(null)}function h(v){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(b){var y=Number(b[1]),$=b[2],C=b[3];return $?C?[y,Number(C)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(v){v.selector+=", "+c}),t.hooks.add("before-sanity-check",function(v){var b=v.element;if(b.matches(c)){v.code="",b.setAttribute(r,a);var y=b.appendChild(document.createElement("CODE"));y.textContent=i;var $=b.getAttribute("data-src"),C=v.language;if(C==="none"){var S=(/\.(\w+)$/.exec($)||[,"none"])[1];C=o[S]||S}t.util.setLanguage(y,C),t.util.setLanguage(b,C);var T=t.plugins.autoloader;T&&T.loadLanguages(C),d($,function(M){b.setAttribute(r,u);var O=h(b.getAttribute("data-range"));if(O){var E=M.split(/\r\n?|\n/g),P=O[0],I=O[1]==null?E.length:O[1];P<0&&(P+=E.length),P=Math.max(0,Math.min(P-1,E.length)),I<0&&(I+=E.length),I=Math.max(0,Math.min(I,E.length)),M=E.slice(P,I).join(`
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(P+1))}y.textContent=M,t.highlightElement(y)},function(M){b.setAttribute(r,f),y.textContent=M})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),$=0,C;C=y[$++];)t.highlightElement(C)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(sb);const Gs=sb.exports;var y$={exports:{}};(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),c=0,d=0;d<f.length;++d){var h=s(f[d]);c+=h,c>r&&(f[d]=`
`+f[d],c=h)}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 c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,h="",g="",v=!1,b=0;b<d.length;++b){var y=d[b];y==o.element?v=!0:y.nodeName==="#text"&&(v?g+=y.nodeValue:h+=y.nodeValue,a.removeChild(y),--b)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=h+o.code+g,o.code=r.normalize(o.code,o.settings);else{var $=h+o.element.innerHTML+g;o.element.innerHTML=r.normalize($,o.settings),o.code=o.element.textContent}}}})})()})(y$);(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 k$(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){w(s,e,l),m(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-1ua9m3i")&&p(e,"class",i)},i:se,o:se,d(s){s&&k(e)}}}function w$(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 _n extends Ee{constructor(e){super(),Oe(this,e,w$,k$,De,{class:0,content:2,language:3})}}const $$=n=>({}),mc=n=>({}),S$=n=>({}),gc=n=>({});function _c(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C=n[4]&&!n[2]&&bc(n);const S=n[18].header,T=$n(S,n,n[17],gc);let M=n[4]&&n[2]&&vc(n);const O=n[18].default,E=$n(O,n,n[17],null),P=n[18].footer,I=$n(P,n,n[17],mc);return{c(){e=_("div"),t=_("div"),s=D(),l=_("div"),o=_("div"),C&&C.c(),r=D(),T&&T.c(),a=D(),M&&M.c(),u=D(),f=_("div"),E&&E.c(),c=D(),d=_("div"),I&&I.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),te(l,"popup",n[2]),p(e,"class","overlay-panel-container"),te(e,"padded",n[2]),te(e,"active",n[0])},m(F,z){w(F,e,z),m(e,t),m(e,s),m(e,l),m(l,o),C&&C.m(o,null),m(o,r),T&&T.m(o,null),m(o,a),M&&M.m(o,null),m(l,u),m(l,f),E&&E.m(f,null),n[20](f),m(l,c),m(l,d),I&&I.m(d,null),b=!0,y||($=[J(t,"click",Wt(n[19])),J(f,"scroll",n[21])],y=!0)},p(F,z){n=F,n[4]&&!n[2]?C?C.p(n,z):(C=bc(n),C.c(),C.m(o,r)):C&&(C.d(1),C=null),T&&T.p&&(!b||z&131072)&&Cn(T,S,n,n[17],b?Sn(S,n[17],z,S$):Mn(n[17]),gc),n[4]&&n[2]?M?M.p(n,z):(M=vc(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),E&&E.p&&(!b||z&131072)&&Cn(E,O,n,n[17],b?Sn(O,n[17],z,null):Mn(n[17]),null),I&&I.p&&(!b||z&131072)&&Cn(I,P,n,n[17],b?Sn(P,n[17],z,$$):Mn(n[17]),mc),(!b||z&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),(!b||z&262)&&te(l,"popup",n[2]),(!b||z&4)&&te(e,"padded",n[2]),(!b||z&1)&&te(e,"active",n[0])},i(F){b||(Tt(()=>{i||(i=st(t,$o,{duration:ys,opacity:0},!0)),i.run(1)}),A(T,F),A(E,F),A(I,F),Tt(()=>{v&&v.end(1),g=Zm(l,Yn,n[2]?{duration:ys,y:-10}:{duration:ys,x:50}),g.start()}),b=!0)},o(F){i||(i=st(t,$o,{duration:ys,opacity:0},!1)),i.run(0),L(T,F),L(E,F),L(I,F),g&&g.invalidate(),v=Gm(l,Yn,n[2]?{duration:ys,y:10}:{duration:ys,x:50}),b=!1},d(F){F&&k(e),F&&i&&i.end(),C&&C.d(),T&&T.d(F),M&&M.d(),E&&E.d(F),n[20](null),I&&I.d(F),F&&v&&v.end(),y=!1,Je($)}}}function bc(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=J(e,"click",Wt(n[5])),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function vc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=J(e,"click",Wt(n[5])),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function C$(n){let e,t,i,s,l=n[0]&&_c(n);return{c(){e=_("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper")},m(o,r){w(o,e,r),l&&l.m(e,null),n[22](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&1&&A(l,1)):(l=_c(o),l.c(),A(l,1),l.m(e,null)):l&&(Ae(),L(l,1,1,()=>{l=null}),Pe())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[22](null),i=!1,Je(s)}}}let Gi;function lb(){return Gi=Gi||document.querySelector(".overlays"),Gi||(Gi=document.createElement("div"),Gi.classList.add("overlays"),document.body.appendChild(Gi)),Gi}let ys=150;function yc(){return 1e3+lb().querySelectorAll(".overlay-panel-container.active").length}function M$(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:c=void 0}=e,{beforeHide:d=void 0}=e;const h=xt();let g,v,b,y,$="";function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function S(){typeof d=="function"&&d()===!1||t(0,o=!1)}function T(){return o}async function M(G){G?(b=document.activeElement,g==null||g.focus(),h("show")):(clearTimeout(y),b==null||b.focus(),h("hide")),await Zn(),O()}function O(){!g||(o?t(6,g.style.zIndex=yc(),g):t(6,g.style="",g))}function E(G){o&&f&&G.code=="Escape"&&!B.isInput(G.target)&&g&&g.style.zIndex==yc()&&(G.preventDefault(),S())}function P(G){o&&I(v)}function I(G,ee){ee&&t(8,$=""),G&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!G)return;if(G.scrollHeight-G.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}G.scrollTop==0?t(8,$+=" scroll-top-reached"):G.scrollTop+G.offsetHeight==G.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100)))}Fn(()=>(lb().appendChild(g),()=>{var G;clearTimeout(y),(G=g==null?void 0:g.classList)==null||G.add("hidden")}));const F=()=>a?S():!0;function z(G){me[G?"unshift":"push"](()=>{v=G,t(7,v)})}const Q=G=>I(G.target);function ne(G){me[G?"unshift":"push"](()=>{g=G,t(6,g)})}return n.$$set=G=>{"class"in G&&t(1,l=G.class),"active"in G&&t(0,o=G.active),"popup"in G&&t(2,r=G.popup),"overlayClose"in G&&t(3,a=G.overlayClose),"btnClose"in G&&t(4,u=G.btnClose),"escClose"in G&&t(12,f=G.escClose),"beforeOpen"in G&&t(13,c=G.beforeOpen),"beforeHide"in G&&t(14,d=G.beforeHide),"$$scope"in G&&t(17,s=G.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&M(o),n.$$.dirty&128&&I(v,!0),n.$$.dirty&64&&g&&O()},[o,l,r,a,u,S,g,v,$,E,P,I,f,c,d,C,T,s,i,F,z,Q,ne]}class ui extends Ee{constructor(e){super(),Oe(this,e,M$,C$,De,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16})}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function T$(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function D$(n){let e,t=n[2].referer+"",i,s;return{c(){e=_("a"),i=N(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),m(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&ue(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function O$(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function E$(n){let e,t;return e=new _n({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.content=JSON.stringify(i[2].meta,null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function A$(n){var le;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,h,g,v=n[2].status+"",b,y,$,C,S,T,M=((le=n[2].method)==null?void 0:le.toUpperCase())+"",O,E,P,I,F,z,Q=n[2].auth+"",ne,G,ee,U,Y,Z,de=n[2].url+"",x,oe,Ce,Te,K,ke,ae,W,_e,He,Ue,X=n[2].remoteIp+"",ge,ce,we,Ge,et,Ke,nt=n[2].userIp+"",Me,ze,Xe,it,ct,be,Fe=n[2].userAgent+"",dt,Dt,pt,lt,Lt,bt,Ft,Ot,Ze,$e,Be,ot,rt,Ht,Ct,ft;function en(pe,ve){return pe[2].referer?D$:T$}let R=en(n),V=R(n);const ie=[E$,O$],re=[];function Le(pe,ve){return ve&4&&(Ft=null),Ft==null&&(Ft=!B.isEmpty(pe[2].meta)),Ft?0:1}return Ot=Le(n,-1),Ze=re[Ot]=ie[Ot](n),Ct=new Si({props:{date:n[2].created}}),{c(){e=_("table"),t=_("tbody"),i=_("tr"),s=_("td"),s.textContent="ID",l=D(),o=_("td"),a=N(r),u=D(),f=_("tr"),c=_("td"),c.textContent="Status",d=D(),h=_("td"),g=_("span"),b=N(v),y=D(),$=_("tr"),C=_("td"),C.textContent="Method",S=D(),T=_("td"),O=N(M),E=D(),P=_("tr"),I=_("td"),I.textContent="Auth",F=D(),z=_("td"),ne=N(Q),G=D(),ee=_("tr"),U=_("td"),U.textContent="URL",Y=D(),Z=_("td"),x=N(de),oe=D(),Ce=_("tr"),Te=_("td"),Te.textContent="Referer",K=D(),ke=_("td"),V.c(),ae=D(),W=_("tr"),_e=_("td"),_e.textContent="Remote IP",He=D(),Ue=_("td"),ge=N(X),ce=D(),we=_("tr"),Ge=_("td"),Ge.textContent="User IP",et=D(),Ke=_("td"),Me=N(nt),ze=D(),Xe=_("tr"),it=_("td"),it.textContent="UserAgent",ct=D(),be=_("td"),dt=N(Fe),Dt=D(),pt=_("tr"),lt=_("td"),lt.textContent="Meta",Lt=D(),bt=_("td"),Ze.c(),$e=D(),Be=_("tr"),ot=_("td"),ot.textContent="Created",rt=D(),Ht=_("td"),q(Ct.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(g,"class","label"),te(g,"label-danger",n[2].status>=400),p(C,"class","min-width txt-hint txt-bold"),p(I,"class","min-width txt-hint txt-bold"),p(U,"class","min-width txt-hint txt-bold"),p(Te,"class","min-width txt-hint txt-bold"),p(_e,"class","min-width txt-hint txt-bold"),p(Ge,"class","min-width txt-hint txt-bold"),p(it,"class","min-width txt-hint txt-bold"),p(lt,"class","min-width txt-hint txt-bold"),p(ot,"class","min-width txt-hint txt-bold"),p(e,"class","table-compact table-border")},m(pe,ve){w(pe,e,ve),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,a),m(t,u),m(t,f),m(f,c),m(f,d),m(f,h),m(h,g),m(g,b),m(t,y),m(t,$),m($,C),m($,S),m($,T),m(T,O),m(t,E),m(t,P),m(P,I),m(P,F),m(P,z),m(z,ne),m(t,G),m(t,ee),m(ee,U),m(ee,Y),m(ee,Z),m(Z,x),m(t,oe),m(t,Ce),m(Ce,Te),m(Ce,K),m(Ce,ke),V.m(ke,null),m(t,ae),m(t,W),m(W,_e),m(W,He),m(W,Ue),m(Ue,ge),m(t,ce),m(t,we),m(we,Ge),m(we,et),m(we,Ke),m(Ke,Me),m(t,ze),m(t,Xe),m(Xe,it),m(Xe,ct),m(Xe,be),m(be,dt),m(t,Dt),m(t,pt),m(pt,lt),m(pt,Lt),m(pt,bt),re[Ot].m(bt,null),m(t,$e),m(t,Be),m(Be,ot),m(Be,rt),m(Be,Ht),H(Ct,Ht,null),ft=!0},p(pe,ve){var Ie;(!ft||ve&4)&&r!==(r=pe[2].id+"")&&ue(a,r),(!ft||ve&4)&&v!==(v=pe[2].status+"")&&ue(b,v),(!ft||ve&4)&&te(g,"label-danger",pe[2].status>=400),(!ft||ve&4)&&M!==(M=((Ie=pe[2].method)==null?void 0:Ie.toUpperCase())+"")&&ue(O,M),(!ft||ve&4)&&Q!==(Q=pe[2].auth+"")&&ue(ne,Q),(!ft||ve&4)&&de!==(de=pe[2].url+"")&&ue(x,de),R===(R=en(pe))&&V?V.p(pe,ve):(V.d(1),V=R(pe),V&&(V.c(),V.m(ke,null))),(!ft||ve&4)&&X!==(X=pe[2].remoteIp+"")&&ue(ge,X),(!ft||ve&4)&&nt!==(nt=pe[2].userIp+"")&&ue(Me,nt),(!ft||ve&4)&&Fe!==(Fe=pe[2].userAgent+"")&&ue(dt,Fe);let fe=Ot;Ot=Le(pe,ve),Ot===fe?re[Ot].p(pe,ve):(Ae(),L(re[fe],1,1,()=>{re[fe]=null}),Pe(),Ze=re[Ot],Ze?Ze.p(pe,ve):(Ze=re[Ot]=ie[Ot](pe),Ze.c()),A(Ze,1),Ze.m(bt,null));const he={};ve&4&&(he.date=pe[2].created),Ct.$set(he)},i(pe){ft||(A(Ze),A(Ct.$$.fragment,pe),ft=!0)},o(pe){L(Ze),L(Ct.$$.fragment,pe),ft=!1},d(pe){pe&&k(e),V.d(),re[Ot].d(),j(Ct)}}}function P$(n){let e;return{c(){e=_("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function L$(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[4]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function I$(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[L$],header:[P$],default:[A$]},$$scope:{ctx:n}};return e=new ui({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){q(e.$$.fragment)},m(s,l){H(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){L(e.$$.fragment,s),t=!1},d(s){n[5](null),j(e,s)}}}function N$(n,e,t){let i,s=new Vr;function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){me[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){tt.call(this,n,c)}function f(c){tt.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class F$ extends Ee{constructor(e){super(),Oe(this,e,N$,I$,De,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function R$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[0],w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function kc(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 v$({props:l}),me.push(()=>Re(e,"filter",s)),{c(){q(e.$$.fragment)},m(o,r){H(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],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function wc(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 Hv({props:l}),me.push(()=>Re(e,"filter",s)),e.$on("select",n[12]),{c(){q(e.$$.fragment)},m(o,r){H(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],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function H$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$=n[3],C,S=n[3],T,M;r=new Go({}),r.$on("refresh",n[7]),d=new Ne({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[R$,({uniqueId:P})=>({14:P}),({uniqueId:P})=>P?16384:0]},$$scope:{ctx:n}}}),g=new Zo({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","remoteIp","userIp","referer","status","auth","userAgent"]}}),g.$on("submit",n[9]);let O=kc(n),E=wc(n);return{c(){e=_("div"),t=_("header"),i=_("nav"),s=_("div"),l=N(n[5]),o=D(),q(r.$$.fragment),a=D(),u=_("div"),f=D(),c=_("div"),q(d.$$.fragment),h=D(),q(g.$$.fragment),v=D(),b=_("div"),y=D(),O.c(),C=D(),E.c(),T=We(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(b,"class","clearfix m-b-xs"),p(e,"class","page-header-wrapper m-b-0")},m(P,I){w(P,e,I),m(e,t),m(t,i),m(i,s),m(s,l),m(t,o),H(r,t,null),m(t,a),m(t,u),m(t,f),m(t,c),H(d,c,null),m(e,h),H(g,e,null),m(e,v),m(e,b),m(e,y),O.m(e,null),w(P,C,I),E.m(P,I),w(P,T,I),M=!0},p(P,I){(!M||I&32)&&ue(l,P[5]);const F={};I&49153&&(F.$$scope={dirty:I,ctx:P}),d.$set(F);const z={};I&4&&(z.value=P[2]),g.$set(z),I&8&&De($,$=P[3])?(Ae(),L(O,1,1,se),Pe(),O=kc(P),O.c(),A(O,1),O.m(e,null)):O.p(P,I),I&8&&De(S,S=P[3])?(Ae(),L(E,1,1,se),Pe(),E=wc(P),E.c(),A(E,1),E.m(T.parentNode,T)):E.p(P,I)},i(P){M||(A(r.$$.fragment,P),A(d.$$.fragment,P),A(g.$$.fragment,P),A(O),A(E),M=!0)},o(P){L(r.$$.fragment,P),L(d.$$.fragment,P),L(g.$$.fragment,P),L(O),L(E),M=!1},d(P){P&&k(e),j(r),j(d),j(g),O.d(P),P&&k(C),P&&k(T),E.d(P)}}}function j$(n){let e,t,i,s;e=new On({props:{$$slots:{default:[H$]},$$scope:{ctx:n}}});let l={};return i=new F$({props:l}),n[13](i),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(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){L(e.$$.fragment,o),L(i.$$.fragment,o),s=!1},d(o){j(e,o),o&&k(t),n[13](null),j(i,o)}}}const $c="includeAdminLogs";function q$(n,e,t){var y;let i,s;at(n,Nt,$=>t(5,s=$)),nn(Nt,s="Request logs",s);let l,o="",r=((y=window.localStorage)==null?void 0:y.getItem($c))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function c(){r=this.checked,t(0,r)}const d=$=>t(2,o=$.detail);function h($){o=$,t(2,o)}function g($){o=$,t(2,o)}const v=$=>l==null?void 0:l.show($==null?void 0:$.detail);function b($){me[$?"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($c,r<<0)},[r,l,o,a,i,s,u,f,c,d,h,g,v,b]}class V$ extends Ee{constructor(e){super(),Oe(this,e,q$,j$,De,{})}}const As=Gn([]),hi=Gn({}),da=Gn(!1);function z$(n){hi.update(e=>B.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),As.update(e=>(B.pushOrReplaceByKey(e,n,"id"),e))}function B$(n){As.update(e=>(B.removeByKey(e,"id",n.id),hi.update(t=>t.id===n.id?e.find(i=>i.name!="profiles")||{}:t),e))}async function U$(n=null){return da.set(!0),hi.set({}),As.set([]),ye.collections.getFullList(200,{sort:"+created"}).then(e=>{As.set(e);const t=n&&B.findByKey(e,"id",n);if(t)hi.set(t);else if(e.length){const i=e.find(s=>s.name!="profiles");i&&hi.set(i)}}).catch(e=>{ye.errorResponseHandler(e)}).finally(()=>{da.set(!1)})}const xa=Gn({});function si(n,e,t){xa.set({text:n,yesCallback:e,noCallback:t})}function ob(){xa.set({})}function Sc(n){let e,t,i,s;const l=n[13].default,o=$n(l,n,n[12],null);return{c(){e=_("div"),o&&o.c(),p(e,"class",n[1]),te(e,"active",n[0])},m(r,a){w(r,e,a),o&&o.m(e,null),s=!0},p(r,a){o&&o.p&&(!s||a&4096)&&Cn(o,l,r,r[12],s?Sn(l,r[12],a,null):Mn(r[12]),null),(!s||a&2)&&p(e,"class",r[1]),(!s||a&3)&&te(e,"active",r[0])},i(r){s||(A(o,r),r&&Tt(()=>{i&&i.end(1),t=Zm(e,Yn,{duration:150,y:-5}),t.start()}),s=!0)},o(r){L(o,r),t&&t.invalidate(),r&&(i=Gm(e,Yn,{duration:150,y:2})),s=!1},d(r){r&&k(e),o&&o.d(r),r&&i&&i.end()}}}function W$(n){let e,t,i,s,l=n[0]&&Sc(n);return{c(){e=_("div"),l&&l.c(),p(e,"class","toggler-container")},m(o,r){w(o,e,r),l&&l.m(e,null),n[14](e),t=!0,i||(s=[J(window,"click",n[3]),J(window,"keydown",n[4]),J(window,"focusin",n[5])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=Sc(o),l.c(),A(l,1),l.m(e,null)):l&&(Ae(),L(l,1,1,()=>{l=null}),Pe())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[14](null),i=!1,Je(s)}}}function Y$(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{closableClass:a="closable"}=e,{class:u=""}=e,f;const c=xt();function d(){t(0,o=!1)}function h(){t(0,o=!0)}function g(){o?d():h()}function v(M){return!f||M.classList.contains(a)||(l==null?void 0:l.contains(M))&&!f.contains(M)||f.contains(M)&&M.closest&&M.closest("."+a)}function b(M){(!o||v(M.target))&&(M.preventDefault(),g())}function y(M){(M.code==="Enter"||M.code==="Space")&&(!o||v(M.target))&&(M.preventDefault(),M.stopPropagation(),g())}function $(M){o&&!(f!=null&&f.contains(M.target))&&!(l!=null&&l.contains(M.target))&&d()}function C(M){o&&r&&M.code=="Escape"&&(M.preventDefault(),d())}function S(M){return $(M)}Fn(()=>(t(6,l=l||f.parentNode),l.addEventListener("click",b),l.addEventListener("keydown",y),()=>{l.removeEventListener("click",b),l.removeEventListener("keydown",y)}));function T(M){me[M?"unshift":"push"](()=>{f=M,t(2,f)})}return n.$$set=M=>{"trigger"in M&&t(6,l=M.trigger),"active"in M&&t(0,o=M.active),"escClose"in M&&t(7,r=M.escClose),"closableClass"in M&&t(8,a=M.closableClass),"class"in M&&t(1,u=M.class),"$$scope"in M&&t(12,s=M.$$scope)},n.$$.update=()=>{var M,O;n.$$.dirty&65&&(o?((M=l==null?void 0:l.classList)==null||M.add("active"),c("show")):((O=l==null?void 0:l.classList)==null||O.remove("active"),c("hide")))},[o,u,f,$,C,S,l,r,a,d,h,g,s,i,T]}class Ti extends Ee{constructor(e){super(),Oe(this,e,Y$,W$,De,{trigger:6,active:0,escClose:7,closableClass:8,class:1,hide:9,show:10,toggle:11})}get hide(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}get toggle(){return this.$$.ctx[11]}}const K$=n=>({active:n&1}),Cc=n=>({active:n[0]});function Mc(n){let e,t,i;const s=n[12].default,l=$n(s,n,n[11],null);return{c(){e=_("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&2048)&&Cn(l,s,o,o[11],i?Sn(s,o[11],r,null):Mn(o[11]),null)},i(o){i||(A(l,o),o&&Tt(()=>{t||(t=st(e,on,{duration:150},!0)),t.run(1)}),i=!0)},o(o){L(l,o),o&&(t||(t=st(e,on,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function J$(n){let e,t,i,s,l,o,r,a;const u=n[12].header,f=$n(u,n,n[11],Cc);let c=n[0]&&Mc(n);return{c(){e=_("div"),t=_("header"),f&&f.c(),i=D(),c&&c.c(),p(t,"class","accordion-header"),te(t,"interactive",n[2]),p(e,"tabindex",s=n[2]?0:-1),p(e,"class",l="accordion "+n[1]),te(e,"active",n[0])},m(d,h){w(d,e,h),m(e,t),f&&f.m(t,null),m(e,i),c&&c.m(e,null),n[14](e),o=!0,r||(a=[J(t,"click",Wt(n[13])),J(e,"keydown",Bm(n[5]))],r=!0)},p(d,[h]){f&&f.p&&(!o||h&2049)&&Cn(f,u,d,d[11],o?Sn(u,d[11],h,K$):Mn(d[11]),Cc),(!o||h&4)&&te(t,"interactive",d[2]),d[0]?c?(c.p(d,h),h&1&&A(c,1)):(c=Mc(d),c.c(),A(c,1),c.m(e,null)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe()),(!o||h&4&&s!==(s=d[2]?0:-1))&&p(e,"tabindex",s),(!o||h&2&&l!==(l="accordion "+d[1]))&&p(e,"class",l),(!o||h&3)&&te(e,"active",d[0])},i(d){o||(A(f,d),A(c),o=!0)},o(d){L(f,d),L(c),o=!1},d(d){d&&k(e),f&&f.d(d),c&&c.d(),n[14](null),r=!1,Je(a)}}}function Z$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=xt();let o,r,{class:a=""}=e,{active:u=!1}=e,{interactive:f=!0}=e,{single:c=!1}=e;function d(){v(),t(0,u=!0),l("expand")}function h(){t(0,u=!1),clearTimeout(r),l("collapse")}function g(){l("toggle"),u?h():d()}function v(){if(c&&o.parentElement){const C=o.parentElement.querySelectorAll(".accordion.active .accordion-header.interactive");for(const S of C)S.click()}}function b(C){!f||(C.code==="Enter"||C.code==="Space")&&(C.preventDefault(),g())}Fn(()=>()=>clearTimeout(r));const y=()=>f&&g();function $(C){me[C?"unshift":"push"](()=>{o=C,t(4,o)})}return n.$$set=C=>{"class"in C&&t(1,a=C.class),"active"in C&&t(0,u=C.active),"interactive"in C&&t(2,f=C.interactive),"single"in C&&t(6,c=C.single),"$$scope"in C&&t(11,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1041&&u&&(clearTimeout(r),t(10,r=setTimeout(()=>{o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},250)))},[u,a,f,g,o,b,c,d,h,v,r,s,i,y,$]}class ir extends Ee{constructor(e){super(),Oe(this,e,Z$,J$,De,{class:1,active:0,interactive:2,single:6,expand:7,collapse:8,toggle:3,collapseSiblings:9})}get expand(){return this.$$.ctx[7]}get collapse(){return this.$$.ctx[8]}get toggle(){return this.$$.ctx[3]}get collapseSiblings(){return this.$$.ctx[9]}}const G$=n=>({}),Tc=n=>({});function Dc(n,e,t){const i=n.slice();return i[45]=e[t],i}const X$=n=>({}),Oc=n=>({});function Ec(n,e,t){const i=n.slice();return i[45]=e[t],i}function Ac(n){let e,t;return{c(){e=_("div"),t=N(n[2]),p(e,"class","txt-placeholder")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&4&&ue(t,i[2])},d(i){i&&k(e)}}}function Q$(n){let e,t=n[45]+"",i;return{c(){e=_("span"),i=N(t),p(e,"class","txt")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&1&&t!==(t=s[45]+"")&&ue(i,t)},i:se,o:se,d(s){s&&k(e)}}}function x$(n){let e,t,i;const s=[{item:n[45]},n[8]];var l=n[7];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=ut(a,s[u]);return{props:a}}return l&&(e=new l(o())),{c(){e&&q(e.$$.fragment),t=We()},m(r,a){e&&H(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a[0]&257?pn(s,[a[0]&1&&{item:r[45]},a[0]&256&&oi(r[8])]):{};if(l!==(l=r[7])){if(e){Ae();const f=e;L(f.$$.fragment,1,0,()=>{j(f,1)}),Pe()}l?(e=new l(o()),q(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&j(e,r)}}}function Pc(n){let e,t,i;function s(){return n[33](n[45])}return{c(){e=_("span"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Ye(gt.call(null,e,"Clear")),J(e,"click",ni(Wt(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Je(i)}}}function Lc(n){let e,t,i,s,l,o;const r=[x$,Q$],a=[];function u(c,d){return c[7]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&Pc(n);return{c(){e=_("div"),i.c(),s=D(),f&&f.c(),l=D(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),m(e,s),f&&f.m(e,null),m(e,l),o=!0},p(c,d){let h=t;t=u(c),t===h?a[t].p(c,d):(Ae(),L(a[h],1,1,()=>{a[h]=null}),Pe(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[6]?f?f.p(c,d):(f=Pc(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){L(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function Ic(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[17],$$slots:{default:[nS]},$$scope:{ctx:n}};return e=new Ti({props:i}),n[38](e),e.$on("show",n[23]),e.$on("hide",n[39]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&131072&&(o.trigger=s[17]),l[0]&806410|l[1]&1024&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[38](null),j(e,s)}}}function Nc(n){let e,t,i,s,l,o,r,a,u=n[14].length&&Fc(n);return{c(){e=_("div"),t=_("label"),i=_("div"),i.innerHTML='<i class="ri-search-line"></i>',s=D(),l=_("input"),o=D(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(t,s),m(t,l),Se(l,n[14]),m(t,o),u&&u.m(t,null),l.focus(),r||(a=J(l,"input",n[35]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&16384&&l.value!==f[14]&&Se(l,f[14]),f[14].length?u?u.p(f,c):(u=Fc(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function Fc(n){let e,t,i,s;return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-close-line"></i>',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-secondary clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),m(e,t),i||(s=J(t,"click",ni(Wt(n[20]))),i=!0)},p:se,d(l){l&&k(e),i=!1,s()}}}function Rc(n){let e,t=n[1]&&Hc(n);return{c(){t&&t.c(),e=We()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=Hc(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function Hc(n){let e,t;return{c(){e=_("div"),t=N(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&2&&ue(t,i[1])},d(i){i&&k(e)}}}function eS(n){let e=n[45]+"",t;return{c(){t=N(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&524288&&e!==(e=i[45]+"")&&ue(t,e)},i:se,o:se,d(i){i&&k(t)}}}function tS(n){let e,t,i;const s=[{item:n[45]},n[10]];var l=n[9];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=ut(a,s[u]);return{props:a}}return l&&(e=new l(o())),{c(){e&&q(e.$$.fragment),t=We()},m(r,a){e&&H(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a[0]&525312?pn(s,[a[0]&524288&&{item:r[45]},a[0]&1024&&oi(r[10])]):{};if(l!==(l=r[9])){if(e){Ae();const f=e;L(f.$$.fragment,1,0,()=>{j(f,1)}),Pe()}l?(e=new l(o()),q(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&j(e,r)}}}function jc(n){let e,t,i,s,l,o,r;const a=[tS,eS],u=[];function f(h,g){return h[9]?0:1}t=f(n),i=u[t]=a[t](n);function c(...h){return n[36](n[45],...h)}function d(...h){return n[37](n[45],...h)}return{c(){e=_("div"),i.c(),s=D(),p(e,"tabindex","0"),p(e,"class","dropdown-item option closable"),te(e,"selected",n[18](n[45]))},m(h,g){w(h,e,g),u[t].m(e,null),m(e,s),l=!0,o||(r=[J(e,"click",c),J(e,"keydown",d)],o=!0)},p(h,g){n=h;let v=t;t=f(n),t===v?u[t].p(n,g):(Ae(),L(u[v],1,1,()=>{u[v]=null}),Pe(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||g[0]&786432)&&te(e,"selected",n[18](n[45]))},i(h){l||(A(i),l=!0)},o(h){L(i),l=!1},d(h){h&&k(e),u[t].d(),o=!1,Je(r)}}}function nS(n){let e,t,i,s,l,o=n[11]&&Nc(n);const r=n[32].beforeOptions,a=$n(r,n,n[41],Oc);let u=n[19],f=[];for(let v=0;v<u.length;v+=1)f[v]=jc(Dc(n,u,v));const c=v=>L(f[v],1,1,()=>{f[v]=null});let d=null;u.length||(d=Rc(n));const h=n[32].afterOptions,g=$n(h,n,n[41],Tc);return{c(){o&&o.c(),e=D(),a&&a.c(),t=D(),i=_("div");for(let v=0;v<f.length;v+=1)f[v].c();d&&d.c(),s=D(),g&&g.c(),p(i,"class","options-list")},m(v,b){o&&o.m(v,b),w(v,e,b),a&&a.m(v,b),w(v,t,b),w(v,i,b);for(let y=0;y<f.length;y+=1)f[y].m(i,null);d&&d.m(i,null),w(v,s,b),g&&g.m(v,b),l=!0},p(v,b){if(v[11]?o?o.p(v,b):(o=Nc(v),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!l||b[1]&1024)&&Cn(a,r,v,v[41],l?Sn(r,v[41],b,X$):Mn(v[41]),Oc),b[0]&7079426){u=v[19];let y;for(y=0;y<u.length;y+=1){const $=Dc(v,u,y);f[y]?(f[y].p($,b),A(f[y],1)):(f[y]=jc($),f[y].c(),A(f[y],1),f[y].m(i,null))}for(Ae(),y=u.length;y<f.length;y+=1)c(y);Pe(),!u.length&&d?d.p(v,b):u.length?d&&(d.d(1),d=null):(d=Rc(v),d.c(),d.m(i,null))}g&&g.p&&(!l||b[1]&1024)&&Cn(g,h,v,v[41],l?Sn(h,v[41],b,G$):Mn(v[41]),Tc)},i(v){if(!l){A(a,v);for(let b=0;b<u.length;b+=1)A(f[b]);A(g,v),l=!0}},o(v){L(a,v),f=f.filter(Boolean);for(let b=0;b<f.length;b+=1)L(f[b]);L(g,v),l=!1},d(v){o&&o.d(v),v&&k(e),a&&a.d(v),v&&k(t),v&&k(i),Yt(f,v),d&&d.d(),v&&k(s),g&&g.d(v)}}}function iS(n){let e,t,i,s,l,o,r=B.toArray(n[0]),a=[];for(let d=0;d<r.length;d+=1)a[d]=Lc(Ec(n,r,d));const u=d=>L(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Ac(n));let c=!n[5]&&Ic(n);return{c(){e=_("div"),t=_("div");for(let d=0;d<a.length;d+=1)a[d].c();f&&f.c(),s=D(),c&&c.c(),p(t,"tabindex",i=n[5]?"-1":"0"),p(t,"class","selected-container"),te(t,"disabled",n[5]),p(e,"class",l="select "+n[12]),te(e,"multiple",n[4]),te(e,"disabled",n[5])},m(d,h){w(d,e,h),m(e,t);for(let g=0;g<a.length;g+=1)a[g].m(t,null);f&&f.m(t,null),n[34](t),m(e,s),c&&c.m(e,null),n[40](e),o=!0},p(d,h){if(h[0]&8661){r=B.toArray(d[0]);let g;for(g=0;g<r.length;g+=1){const v=Ec(d,r,g);a[g]?(a[g].p(v,h),A(a[g],1)):(a[g]=Lc(v),a[g].c(),A(a[g],1),a[g].m(t,null))}for(Ae(),g=r.length;g<a.length;g+=1)u(g);Pe(),!r.length&&f?f.p(d,h):r.length?f&&(f.d(1),f=null):(f=Ac(d),f.c(),f.m(t,null))}(!o||h[0]&32&&i!==(i=d[5]?"-1":"0"))&&p(t,"tabindex",i),(!o||h[0]&32)&&te(t,"disabled",d[5]),d[5]?c&&(Ae(),L(c,1,1,()=>{c=null}),Pe()):c?(c.p(d,h),h[0]&32&&A(c,1)):(c=Ic(d),c.c(),A(c,1),c.m(e,null)),(!o||h[0]&4096&&l!==(l="select "+d[12]))&&p(e,"class",l),(!o||h[0]&4112)&&te(e,"multiple",d[4]),(!o||h[0]&4128)&&te(e,"disabled",d[5])},i(d){if(!o){for(let h=0;h<r.length;h+=1)A(a[h]);A(c),o=!0}},o(d){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)L(a[h]);L(c),o=!1},d(d){d&&k(e),Yt(a,d),f&&f.d(),n[34](null),c&&c.d(),n[40](null)}}}function sS(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 lS(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:c=[]}=e,{multiple:d=!1}=e,{disabled:h=!1}=e,{selected:g=d?[]:void 0}=e,{toggle:v=!1}=e,{labelComponent:b=void 0}=e,{labelComponentProps:y={}}=e,{optionComponent:$=void 0}=e,{optionComponentProps:C={}}=e,{searchable:S=!1}=e,{searchFunc:T=void 0}=e,{class:M=""}=e,O,E="",P,I;function F(X){if(B.isEmpty(g))return;let ge=B.toArray(g);B.inArray(ge,X)&&(B.removeByValue(ge,X),t(0,g=ge)),P==null||P.dispatchEvent(new CustomEvent("change",{detail:g,bubbles:!0}))}function z(X){if(d){let ge=B.toArray(g);B.inArray(ge,X)||t(0,g=[...ge,X])}else t(0,g=X);P==null||P.dispatchEvent(new CustomEvent("change",{detail:g,bubbles:!0}))}function Q(X){return s(X)?F(X):z(X)}function ne(){t(0,g=d?[]:void 0)}function G(){O!=null&&O.show&&(O==null||O.show())}function ee(){O!=null&&O.hide&&(O==null||O.hide())}function U(){if(B.isEmpty(g)||B.isEmpty(c))return;let X=B.toArray(g),ge=[];for(const ce of X)B.inArray(c,ce)||ge.push(ce);if(ge.length){for(const ce of ge)B.removeByValue(X,ce);t(0,g=d?X:X[0])}}function Y(){t(14,E="")}function Z(X,ge){X=X||[];const ce=T||sS;return X.filter(we=>ce(we,ge))||[]}function de(X,ge){X.preventDefault(),v&&d?Q(ge):z(ge)}function x(X,ge){(X.code==="Enter"||X.code==="Space")&&de(X,ge)}function oe(){Y(),setTimeout(()=>{const X=P==null?void 0:P.querySelector(".dropdown-item.option.selected");X&&(X.focus(),X.scrollIntoView({block:"nearest"}))},0)}function Ce(X){X.stopPropagation(),!h&&(O==null||O.toggle())}Fn(()=>{const X=document.querySelectorAll(`label[for="${r}"]`);for(const ge of X)ge.addEventListener("click",Ce);return()=>{for(const ge of X)ge.removeEventListener("click",Ce)}});const Te=X=>F(X);function K(X){me[X?"unshift":"push"](()=>{I=X,t(17,I)})}function ke(){E=this.value,t(14,E)}const ae=(X,ge)=>de(ge,X),W=(X,ge)=>x(ge,X);function _e(X){me[X?"unshift":"push"](()=>{O=X,t(15,O)})}function He(X){tt.call(this,n,X)}function Ue(X){me[X?"unshift":"push"](()=>{P=X,t(16,P)})}return n.$$set=X=>{"id"in X&&t(24,r=X.id),"noOptionsText"in X&&t(1,a=X.noOptionsText),"selectPlaceholder"in X&&t(2,u=X.selectPlaceholder),"searchPlaceholder"in X&&t(3,f=X.searchPlaceholder),"items"in X&&t(25,c=X.items),"multiple"in X&&t(4,d=X.multiple),"disabled"in X&&t(5,h=X.disabled),"selected"in X&&t(0,g=X.selected),"toggle"in X&&t(6,v=X.toggle),"labelComponent"in X&&t(7,b=X.labelComponent),"labelComponentProps"in X&&t(8,y=X.labelComponentProps),"optionComponent"in X&&t(9,$=X.optionComponent),"optionComponentProps"in X&&t(10,C=X.optionComponentProps),"searchable"in X&&t(11,S=X.searchable),"searchFunc"in X&&t(26,T=X.searchFunc),"class"in X&&t(12,M=X.class),"$$scope"in X&&t(41,o=X.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&c&&(U(),Y()),n.$$.dirty[0]&33570816&&t(19,i=Z(c,E)),n.$$.dirty[0]&1&&t(18,s=function(X){let ge=B.toArray(g);return B.inArray(ge,X)})},[g,a,u,f,d,h,v,b,y,$,C,S,M,F,E,O,P,I,s,i,Y,de,x,oe,r,c,T,z,Q,ne,G,ee,l,Te,K,ke,ae,W,_e,He,Ue,o]}class rb extends Ee{constructor(e){super(),Oe(this,e,lS,iS,De,{id:24,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:25,multiple:4,disabled:5,selected:0,toggle:6,labelComponent:7,labelComponentProps:8,optionComponent:9,optionComponentProps:10,searchable:11,searchFunc:26,class:12,deselectItem:13,selectItem:27,toggleItem:28,reset:29,showDropdown:30,hideDropdown:31},null,[-1,-1])}get deselectItem(){return this.$$.ctx[13]}get selectItem(){return this.$$.ctx[27]}get toggleItem(){return this.$$.ctx[28]}get reset(){return this.$$.ctx[29]}get showDropdown(){return this.$$.ctx[30]}get hideDropdown(){return this.$$.ctx[31]}}function qc(n){let e,t;return{c(){e=_("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function oS(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&&qc(n);return{c(){l&&l.c(),e=D(),t=_("span"),s=N(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),m(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=qc(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)+"")&&ue(s,i)},i:se,o:se,d(o){l&&l.d(o),o&&k(e),o&&k(t)}}}function rS(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Vc extends Ee{constructor(e){super(),Oe(this,e,rS,oS,De,{item:0})}}const aS=n=>({}),zc=n=>({});function uS(n){let e;const t=n[8].afterOptions,i=$n(t,n,n[12],zc);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Cn(i,t,s,s[12],e?Sn(t,s[12],l,aS):Mn(s[12]),zc)},i(s){e||(A(i,s),e=!0)},o(s){L(i,s),e=!1},d(s){i&&i.d(s)}}}function fS(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:[uS]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=ut(o,s[r]);return n[0]!==void 0&&(o.selected=n[0]),e=new rb({props:o}),me.push(()=>Re(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){q(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&62?pn(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&oi(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],je(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function cS(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Bt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Vc}=e,{optionComponent:c=Vc}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function g(C){C=B.toArray(C,!0);let S=[];for(let T of r)B.inArray(C,T[d])&&S.push(T);C.length&&!S.length||t(0,u=a?S:S[0])}async function v(C){let S=B.toArray(C,!0).map(T=>T[d]);!r.length||t(6,h=a?S:S[0])}function b(C){u=C,t(0,u)}function y(C){tt.call(this,n,C)}function $(C){tt.call(this,n,C)}return n.$$set=C=>{e=ut(ut({},e),li(C)),t(5,s=Bt(e,i)),"items"in C&&t(1,r=C.items),"multiple"in C&&t(2,a=C.multiple),"selected"in C&&t(0,u=C.selected),"labelComponent"in C&&t(3,f=C.labelComponent),"optionComponent"in C&&t(4,c=C.optionComponent),"selectionKey"in C&&t(7,d=C.selectionKey),"keyOfSelected"in C&&t(6,h=C.keyOfSelected),"$$scope"in C&&t(12,o=C.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(h),n.$$.dirty&1&&v(u)},[u,r,a,f,c,s,h,d,l,b,y,$,o]}class ps extends Ee{constructor(e){super(),Oe(this,e,cS,fS,De,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function dS(n){let e,t,i;const s=[{class:"field-type-select "+n[1]},{searchable:!0},{items:n[2]},n[3]];function l(r){n[4](r)}let o={};for(let r=0;r<s.length;r+=1)o=ut(o,s[r]);return n[0]!==void 0&&(o.keyOfSelected=n[0]),e=new ps({props:o}),me.push(()=>Re(e,"keyOfSelected",l)),{c(){q(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&14?pn(s,[a&2&&{class:"field-type-select "+r[1]},s[1],a&4&&{items:r[2]},a&8&&oi(r[3])]):{};!t&&a&1&&(t=!0,u.keyOfSelected=r[0],je(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function pS(n,e,t){const i=["value","class"];let s=Bt(e,i),{value:l="text"}=e,{class:o=""}=e;const r=[{label:"Text",value:"text",icon:B.getFieldTypeIcon("text")},{label:"Number",value:"number",icon:B.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:B.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:B.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:B.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:B.getFieldTypeIcon("date")},{label:"Multiple choices",value:"select",icon:B.getFieldTypeIcon("select")},{label:"JSON",value:"json",icon:B.getFieldTypeIcon("json")},{label:"File",value:"file",icon:B.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:B.getFieldTypeIcon("relation")},{label:"User",value:"user",icon:B.getFieldTypeIcon("user")}];function a(u){l=u,t(0,l)}return n.$$set=u=>{e=ut(ut({},e),li(u)),t(3,s=Bt(e,i)),"value"in u&&t(0,l=u.value),"class"in u&&t(1,o=u.class)},[l,o,r,s,a]}class hS extends Ee{constructor(e){super(),Oe(this,e,pS,dS,De,{value:0,class:1})}}function mS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Min length"),s=D(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].min),r||(a=J(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].min&&Se(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function gS(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=N("Max length"),s=D(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min",r=n[0].min||0)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Se(l,n[0].max),a||(u=J(l,"input",n[3]),a=!0)},p(f,c){c&32&&i!==(i=f[5])&&p(e,"for",i),c&32&&o!==(o=f[5])&&p(l,"id",o),c&1&&r!==(r=f[0].min||0)&&p(l,"min",r),c&1&&Pt(l.value)!==f[0].max&&Se(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function _S(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("Regex pattern"),s=D(),l=_("input"),r=D(),a=_("div"),a.innerHTML="Valid Go regular expression, eg. <code>^\\w+$</code>.",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Se(l,n[0].pattern),w(c,r,d),w(c,a,d),u||(f=J(l,"input",n[4]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&p(e,"for",i),d&32&&o!==(o=c[5])&&p(l,"id",o),d&1&&l.value!==c[0].pattern&&Se(l,c[0].pattern)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function bS(n){let e,t,i,s,l,o,r,a,u,f;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[mS,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[gS,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[_S,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),f=!0},p(c,[d]){const h={};d&2&&(h.name="schema."+c[1]+".options.min"),d&97&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&97&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const v={};d&2&&(v.name="schema."+c[1]+".options.pattern"),d&97&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(o.$$.fragment,c),L(u.$$.fragment,c),f=!1},d(c){c&&k(e),j(i),j(o),j(u)}}}function vS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=Pt(this.value),t(0,s)}function o(){s.max=Pt(this.value),t(0,s)}function r(){s.pattern=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"options"in a&&t(0,s=a.options)},[s,i,l,o,r]}class yS extends Ee{constructor(e){super(),Oe(this,e,vS,bS,De,{key:1,options:0})}}function kS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Min"),s=D(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].min),r||(a=J(l,"input",n[2]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].min&&Se(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function wS(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=N("Max"),s=D(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"min",r=n[0].min)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Se(l,n[0].max),a||(u=J(l,"input",n[3]),a=!0)},p(f,c){c&16&&i!==(i=f[4])&&p(e,"for",i),c&16&&o!==(o=f[4])&&p(l,"id",o),c&1&&r!==(r=f[0].min)&&p(l,"min",r),c&1&&Pt(l.value)!==f[0].max&&Se(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function $S(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[kS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[wS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),j(i),j(o)}}}function SS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=Pt(this.value),t(0,s)}function o(){s.max=Pt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class CS extends Ee{constructor(e){super(),Oe(this,e,SS,$S,De,{key:1,options:0})}}function MS(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class TS extends Ee{constructor(e){super(),Oe(this,e,MS,null,De,{key:0,options:1})}}function DS(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=ut(o,l[r]);return{c(){e=_("input"),mi(e,o)},m(r,a){w(r,e,a),e.value=o.value,e.autofocus&&e.focus(),i||(s=J(e,"input",n[4]),i=!0)},p(r,[a]){mi(e,o=pn(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:se,o:se,d(r){r&&k(e),i=!1,s()}}}function OS(n,e,t){let i;const s=["value","separator"];let l=Bt(e,s),{value:o=[]}=e,{separator:r=","}=e;const a=u=>{t(0,o=B.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=ut(ut({},e),li(u)),t(3,l=Bt(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 hs extends Ee{constructor(e){super(),Oe(this,e,OS,DS,De,{value:0,separator:1})}}function ES(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[2](b)}let v={id:n[4],disabled:!B.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),r=new hs({props:v}),me.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(gt.call(null,s,{text:`List of domains that are NOT allowed.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&p(e,"for",l);const $={};y&16&&($.id=b[4]),y&1&&($.disabled=!B.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,je(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function AS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new hs({props:v}),me.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(gt.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const $={};y&16&&($.id=b[4]+".options.onlyDomains"),y&1&&($.disabled=!B.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,je(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function PS(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[ES,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[AS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),j(i),j(o)}}}function LS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class ab extends Ee{constructor(e){super(),Oe(this,e,LS,PS,De,{key:1,options:0})}}function IS(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new ab({props:r}),me.push(()=>Re(e,"key",l)),me.push(()=>Re(e,"options",o)),{c(){q(e.$$.fragment)},m(a,u){H(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],je(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],je(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){L(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function NS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class FS extends Ee{constructor(e){super(),Oe(this,e,NS,IS,De,{key:0,options:1})}}var Dr=["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},vn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},qn=function(n){return n===!0?1:0};function Bc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Or=function(n){return n instanceof Array?n:[n]};function hn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function St(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 oo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function ub(n,e){if(e(n))return n;if(n.parentNode)return ub(n.parentNode,e)}function ro(n,e){var t=St("div","numInputWrapper"),i=St("input","numInput "+n),s=St("span","arrowUp"),l=St("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 En(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]},RS={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*qn(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))}},es={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})"},fl={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[fl.w(n,e,t)]},F:function(n,e,t){return Fo(fl.n(n,e,t)-1,!1,e)},G:function(n,e,t){return vn(fl.h(n,e,t))},H:function(n){return vn(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[qn(n.getHours()>11)]},M:function(n,e){return Fo(n.getMonth(),!0,e)},S:function(n){return vn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return vn(n.getFullYear(),4)},d:function(n){return vn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return vn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return vn(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)}},fb=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(c,d,h){return fl[c]&&h[d-1]!=="\\"?fl[c](r,f,t):c!=="\\"?c:""}).join("")}},pa=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,c=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 d=o||(t||Ss).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var g=void 0,v=[],b=0,y=0,$="";b<d.length;b++){var C=d[b],S=C==="\\",T=d[b-1]==="\\"||S;if(es[C]&&!T){$+=es[C];var M=new RegExp($).exec(l);M&&(g=!0)&&v[C!=="Y"?"push":"unshift"]({fn:RS[C],val:M[++y]})}else S||($+=".")}f=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),v.forEach(function(O){var E=O.fn,P=O.val;return f=E(f,P,u)||f}),f=g?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){t.errorHandler(new Error("Invalid date provided: "+c));return}return r===!0&&f.setHours(0,0,0,0),f}}};function An(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 HS=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},jS=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},qS={DAY:864e5};function Pr(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 fn=globalThis&&globalThis.__assign||function(){return fn=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},fn.apply(this,arguments)},Uc=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},VS=300;function zS(n,e){var t={config:fn(fn({},Ss),Zt.defaultConfig),l10n:yl};t.parseDate=pa({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=v,t._setHoursFromDate=d,t._positionCalendar=nt,t.changeMonth=x,t.changeYear=ae,t.clear=oe,t.close=Ce,t.onMouseOver=X,t._createElement=St,t.createDay=M,t.destroy=Te,t.isEnabled=W,t.jumpToDate=$,t.updateValue=Ct,t.open=ce,t.redraw=Xe,t.set=Fe,t.setDate=Dt,t.toggle=Ot;function i(){t.utils={getDaysInMonth:function(R,V){return R===void 0&&(R=t.currentMonth),V===void 0&&(V=t.currentYear),R===1&&(V%4===0&&V%100!==0||V%400===0)?29:t.l10n.daysInMonth[R]}}}function s(){t.element=t.input=n,t.isOpen=!1,Ge(),Ke(),Lt(),lt(),i(),t.isMobile||T(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),Ct(!1)),r();var R=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&R&&nt(),Ze("onReady")}function l(){var R;return((R=t.calendarContainer)===null||R===void 0?void 0:R.getRootNode()).activeElement||document.activeElement}function o(R){return R.bind(t)}function r(){var R=t.config;R.weekNumbers===!1&&R.showMonths===1||R.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 V=(t.days.offsetWidth+1)*R.showMonths;t.daysContainer.style.width=V+"px",t.calendarContainer.style.width=V+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(R){if(t.selectedDates.length===0){var V=t.config.minDate===void 0||An(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),ie=Pr(t.config);V.setHours(ie.hours,ie.minutes,ie.seconds,V.getMilliseconds()),t.selectedDates=[V],t.latestSelectedDateObj=V}R!==void 0&&R.type!=="blur"&&en(R);var re=t._input.value;c(),Ct(),t._input.value!==re&&t._debouncedChange()}function u(R,V){return R%12+12*qn(V===t.l10n.amPM[1])}function f(R){switch(R%24){case 0:case 12:return 12;default:return R%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var R=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,V=(parseInt(t.minuteElement.value,10)||0)%60,ie=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(R=u(R,t.amPM.textContent));var re=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&An(t.latestSelectedDateObj,t.config.minDate,!0)===0,Le=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&An(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 le=Ar(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),pe=Ar(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),ve=Ar(R,V,ie);if(ve>pe&&ve<le){var fe=jS(le);R=fe[0],V=fe[1],ie=fe[2]}}else{if(Le){var he=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;R=Math.min(R,he.getHours()),R===he.getHours()&&(V=Math.min(V,he.getMinutes())),V===he.getMinutes()&&(ie=Math.min(ie,he.getSeconds()))}if(re){var Ie=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;R=Math.max(R,Ie.getHours()),R===Ie.getHours()&&V<Ie.getMinutes()&&(V=Ie.getMinutes()),V===Ie.getMinutes()&&(ie=Math.max(ie,Ie.getSeconds()))}}h(R,V,ie)}}function d(R){var V=R||t.latestSelectedDateObj;V&&V instanceof Date&&h(V.getHours(),V.getMinutes(),V.getSeconds())}function h(R,V,ie){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(R%24,V,ie||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=vn(t.config.time_24hr?R:(12+R)%12+12*qn(R%12===0)),t.minuteElement.value=vn(V),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[qn(R>=12)]),t.secondElement!==void 0&&(t.secondElement.value=vn(ie)))}function g(R){var V=En(R),ie=parseInt(V.value)+(R.delta||0);(ie/1e3>1||R.key==="Enter"&&!/[^\d]/.test(ie.toString()))&&ae(ie)}function v(R,V,ie,re){if(V instanceof Array)return V.forEach(function(Le){return v(R,Le,ie,re)});if(R instanceof Array)return R.forEach(function(Le){return v(Le,V,ie,re)});R.addEventListener(V,ie,re),t._handlers.push({remove:function(){return R.removeEventListener(V,ie,re)}})}function b(){Ze("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ie){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ie+"]"),function(re){return v(re,"click",t[ie])})}),t.isMobile){Ft();return}var R=Bc(ge,50);if(t._debouncedChange=Bc(b,VS),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&v(t.daysContainer,"mouseover",function(ie){t.config.mode==="range"&&X(En(ie))}),v(t._input,"keydown",Ue),t.calendarContainer!==void 0&&v(t.calendarContainer,"keydown",Ue),!t.config.inline&&!t.config.static&&v(window,"resize",R),window.ontouchstart!==void 0?v(window.document,"touchstart",ke):v(window.document,"mousedown",ke),v(window.document,"focus",ke,{capture:!0}),t.config.clickOpens===!0&&(v(t._input,"focus",t.open),v(t._input,"click",t.open)),t.daysContainer!==void 0&&(v(t.monthNav,"click",ft),v(t.monthNav,["keyup","increment"],g),v(t.daysContainer,"click",ct)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var V=function(ie){return En(ie).select()};v(t.timeContainer,["increment"],a),v(t.timeContainer,"blur",a,{capture:!0}),v(t.timeContainer,"click",C),v([t.hourElement,t.minuteElement],["focus","click"],V),t.secondElement!==void 0&&v(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&v(t.amPM,"click",function(ie){a(ie)})}t.config.allowInput&&v(t._input,"blur",He)}function $(R,V){var ie=R!==void 0?t.parseDate(R):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),re=t.currentYear,Le=t.currentMonth;try{ie!==void 0&&(t.currentYear=ie.getFullYear(),t.currentMonth=ie.getMonth())}catch(le){le.message="Invalid date supplied: "+ie,t.config.errorHandler(le)}V&&t.currentYear!==re&&(Ze("onYearChange"),Q()),V&&(t.currentYear!==re||t.currentMonth!==Le)&&Ze("onMonthChange"),t.redraw()}function C(R){var V=En(R);~V.className.indexOf("arrow")&&S(R,V.classList.contains("arrowUp")?1:-1)}function S(R,V,ie){var re=R&&En(R),Le=ie||re&&re.parentNode&&re.parentNode.firstChild,le=$e("increment");le.delta=V,Le&&Le.dispatchEvent(le)}function T(){var R=window.document.createDocumentFragment();if(t.calendarContainer=St("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(R.appendChild(ee()),t.innerContainer=St("div","flatpickr-innerContainer"),t.config.weekNumbers){var V=de(),ie=V.weekWrapper,re=V.weekNumbers;t.innerContainer.appendChild(ie),t.weekNumbers=re,t.weekWrapper=ie}t.rContainer=St("div","flatpickr-rContainer"),t.rContainer.appendChild(Y()),t.daysContainer||(t.daysContainer=St("div","flatpickr-days"),t.daysContainer.tabIndex=-1),z(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),R.appendChild(t.innerContainer)}t.config.enableTime&&R.appendChild(U()),hn(t.calendarContainer,"rangeMode",t.config.mode==="range"),hn(t.calendarContainer,"animate",t.config.animate===!0),hn(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(R);var Le=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&&(!Le&&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 le=St("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(le,t.element),le.appendChild(t.element),t.altInput&&le.appendChild(t.altInput),le.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(R,V,ie,re){var Le=W(V,!0),le=St("span",R,V.getDate().toString());return le.dateObj=V,le.$i=re,le.setAttribute("aria-label",t.formatDate(V,t.config.ariaDateFormat)),R.indexOf("hidden")===-1&&An(V,t.now)===0&&(t.todayDateElem=le,le.classList.add("today"),le.setAttribute("aria-current","date")),Le?(le.tabIndex=-1,Be(V)&&(le.classList.add("selected"),t.selectedDateElem=le,t.config.mode==="range"&&(hn(le,"startRange",t.selectedDates[0]&&An(V,t.selectedDates[0],!0)===0),hn(le,"endRange",t.selectedDates[1]&&An(V,t.selectedDates[1],!0)===0),R==="nextMonthDay"&&le.classList.add("inRange")))):le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&ot(V)&&!Be(V)&&le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&R!=="prevMonthDay"&&re%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(V)+"</span>"),Ze("onDayCreate",le),le}function O(R){R.focus(),t.config.mode==="range"&&X(R)}function E(R){for(var V=R>0?0:t.config.showMonths-1,ie=R>0?t.config.showMonths:-1,re=V;re!=ie;re+=R)for(var Le=t.daysContainer.children[re],le=R>0?0:Le.children.length-1,pe=R>0?Le.children.length:-1,ve=le;ve!=pe;ve+=R){var fe=Le.children[ve];if(fe.className.indexOf("hidden")===-1&&W(fe.dateObj))return fe}}function P(R,V){for(var ie=R.className.indexOf("Month")===-1?R.dateObj.getMonth():t.currentMonth,re=V>0?t.config.showMonths:-1,Le=V>0?1:-1,le=ie-t.currentMonth;le!=re;le+=Le)for(var pe=t.daysContainer.children[le],ve=ie-t.currentMonth===le?R.$i+V:V<0?pe.children.length-1:0,fe=pe.children.length,he=ve;he>=0&&he<fe&&he!=(V>0?fe:-1);he+=Le){var Ie=pe.children[he];if(Ie.className.indexOf("hidden")===-1&&W(Ie.dateObj)&&Math.abs(R.$i-he)>=Math.abs(V))return O(Ie)}t.changeMonth(Le),I(E(Le),0)}function I(R,V){var ie=l(),re=_e(ie||document.body),Le=R!==void 0?R:re?ie:t.selectedDateElem!==void 0&&_e(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&_e(t.todayDateElem)?t.todayDateElem:E(V>0?1:-1);Le===void 0?t._input.focus():re?P(Le,V):O(Le)}function F(R,V){for(var ie=(new Date(R,V,1).getDay()-t.l10n.firstDayOfWeek+7)%7,re=t.utils.getDaysInMonth((V-1+12)%12,R),Le=t.utils.getDaysInMonth(V,R),le=window.document.createDocumentFragment(),pe=t.config.showMonths>1,ve=pe?"prevMonthDay hidden":"prevMonthDay",fe=pe?"nextMonthDay hidden":"nextMonthDay",he=re+1-ie,Ie=0;he<=re;he++,Ie++)le.appendChild(M("flatpickr-day "+ve,new Date(R,V-1,he),he,Ie));for(he=1;he<=Le;he++,Ie++)le.appendChild(M("flatpickr-day",new Date(R,V,he),he,Ie));for(var mt=Le+1;mt<=42-ie&&(t.config.showMonths===1||Ie%7!==0);mt++,Ie++)le.appendChild(M("flatpickr-day "+fe,new Date(R,V+1,mt%Le),mt,Ie));var un=St("div","dayContainer");return un.appendChild(le),un}function z(){if(t.daysContainer!==void 0){oo(t.daysContainer),t.weekNumbers&&oo(t.weekNumbers);for(var R=document.createDocumentFragment(),V=0;V<t.config.showMonths;V++){var ie=new Date(t.currentYear,t.currentMonth,1);ie.setMonth(t.currentMonth+V),R.appendChild(F(ie.getFullYear(),ie.getMonth()))}t.daysContainer.appendChild(R),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&X()}}function Q(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var R=function(re){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&re<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&re>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var V=0;V<12;V++)if(!!R(V)){var ie=St("option","flatpickr-monthDropdown-month");ie.value=new Date(t.currentYear,V).getMonth().toString(),ie.textContent=Fo(V,t.config.shorthandCurrentMonth,t.l10n),ie.tabIndex=-1,t.currentMonth===V&&(ie.selected=!0),t.monthsDropdownContainer.appendChild(ie)}}}function ne(){var R=St("div","flatpickr-month"),V=window.document.createDocumentFragment(),ie;t.config.showMonths>1||t.config.monthSelectorType==="static"?ie=St("span","cur-month"):(t.monthsDropdownContainer=St("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),v(t.monthsDropdownContainer,"change",function(pe){var ve=En(pe),fe=parseInt(ve.value,10);t.changeMonth(fe-t.currentMonth),Ze("onMonthChange")}),Q(),ie=t.monthsDropdownContainer);var re=ro("cur-year",{tabindex:"-1"}),Le=re.getElementsByTagName("input")[0];Le.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Le.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Le.setAttribute("max",t.config.maxDate.getFullYear().toString()),Le.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var le=St("div","flatpickr-current-month");return le.appendChild(ie),le.appendChild(re),V.appendChild(le),R.appendChild(V),{container:R,yearElement:Le,monthElement:ie}}function G(){oo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var R=t.config.showMonths;R--;){var V=ne();t.yearElements.push(V.yearElement),t.monthElements.push(V.monthElement),t.monthNav.appendChild(V.container)}t.monthNav.appendChild(t.nextMonthNav)}function ee(){return t.monthNav=St("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=St("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=St("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,G(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(R){t.__hidePrevMonthArrow!==R&&(hn(t.prevMonthNav,"flatpickr-disabled",R),t.__hidePrevMonthArrow=R)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(R){t.__hideNextMonthArrow!==R&&(hn(t.nextMonthNav,"flatpickr-disabled",R),t.__hideNextMonthArrow=R)}}),t.currentYearElement=t.yearElements[0],rt(),t.monthNav}function U(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var R=Pr(t.config);t.timeContainer=St("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var V=St("span","flatpickr-time-separator",":"),ie=ro("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ie.getElementsByTagName("input")[0];var re=ro("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=re.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?R.hours:f(R.hours)),t.minuteElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():R.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(ie),t.timeContainer.appendChild(V),t.timeContainer.appendChild(re),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Le=ro("flatpickr-second");t.secondElement=Le.getElementsByTagName("input")[0],t.secondElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():R.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(St("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Le)}return t.config.time_24hr||(t.amPM=St("span","flatpickr-am-pm",t.l10n.amPM[qn((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 Y(){t.weekdayContainer?oo(t.weekdayContainer):t.weekdayContainer=St("div","flatpickr-weekdays");for(var R=t.config.showMonths;R--;){var V=St("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(V)}return Z(),t.weekdayContainer}function Z(){if(!!t.weekdayContainer){var R=t.l10n.firstDayOfWeek,V=Uc(t.l10n.weekdays.shorthand);R>0&&R<V.length&&(V=Uc(V.splice(R,V.length),V.splice(0,R)));for(var ie=t.config.showMonths;ie--;)t.weekdayContainer.children[ie].innerHTML=`
<span class='flatpickr-weekday'>
`+V.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function de(){t.calendarContainer.classList.add("hasWeeks");var R=St("div","flatpickr-weekwrapper");R.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var V=St("div","flatpickr-weeks");return R.appendChild(V),{weekWrapper:R,weekNumbers:V}}function x(R,V){V===void 0&&(V=!0);var ie=V?R:R-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ze("onYearChange"),Q()),z(),Ze("onMonthChange"),rt())}function oe(R,V){if(R===void 0&&(R=!0),V===void 0&&(V=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,V===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Pr(t.config),re=ie.hours,Le=ie.minutes,le=ie.seconds;h(re,Le,le)}t.redraw(),R&&Ze("onChange")}function Ce(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ze("onClose")}function Te(){t.config!==void 0&&Ze("onDestroy");for(var R=t._handlers.length;R--;)t._handlers[R].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 V=t.calendarContainer.parentNode;if(V.lastChild&&V.removeChild(V.lastChild),V.parentNode){for(;V.firstChild;)V.parentNode.insertBefore(V.firstChild,V);V.parentNode.removeChild(V)}}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(ie){try{delete t[ie]}catch{}})}function K(R){return t.calendarContainer.contains(R)}function ke(R){if(t.isOpen&&!t.config.inline){var V=En(R),ie=K(V),re=V===t.input||V===t.altInput||t.element.contains(V)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Le=!re&&!ie&&!K(R.relatedTarget),le=!t.config.ignoredFocusElements.some(function(pe){return pe.contains(V)});Le&&le&&(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 ae(R){if(!(!R||t.config.minDate&&R<t.config.minDate.getFullYear()||t.config.maxDate&&R>t.config.maxDate.getFullYear())){var V=R,ie=t.currentYear!==V;t.currentYear=V||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)),ie&&(t.redraw(),Ze("onYearChange"),Q())}}function W(R,V){var ie;V===void 0&&(V=!0);var re=t.parseDate(R,void 0,V);if(t.config.minDate&&re&&An(re,t.config.minDate,V!==void 0?V:!t.minDateHasTime)<0||t.config.maxDate&&re&&An(re,t.config.maxDate,V!==void 0?V:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(re===void 0)return!1;for(var Le=!!t.config.enable,le=(ie=t.config.enable)!==null&&ie!==void 0?ie:t.config.disable,pe=0,ve=void 0;pe<le.length;pe++){if(ve=le[pe],typeof ve=="function"&&ve(re))return Le;if(ve instanceof Date&&re!==void 0&&ve.getTime()===re.getTime())return Le;if(typeof ve=="string"){var fe=t.parseDate(ve,void 0,!0);return fe&&fe.getTime()===re.getTime()?Le:!Le}else if(typeof ve=="object"&&re!==void 0&&ve.from&&ve.to&&re.getTime()>=ve.from.getTime()&&re.getTime()<=ve.to.getTime())return Le}return!Le}function _e(R){return t.daysContainer!==void 0?R.className.indexOf("hidden")===-1&&R.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(R):!1}function He(R){var V=R.target===t._input,ie=t._input.value.trimEnd()!==Ht();V&&ie&&!(R.relatedTarget&&K(R.relatedTarget))&&t.setDate(t._input.value,!0,R.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ue(R){var V=En(R),ie=t.config.wrap?n.contains(V):V===t._input,re=t.config.allowInput,Le=t.isOpen&&(!re||!ie),le=t.config.inline&&ie&&!re;if(R.keyCode===13&&ie){if(re)return t.setDate(t._input.value,!0,V===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),V.blur();t.open()}else if(K(V)||Le||le){var pe=!!t.timeContainer&&t.timeContainer.contains(V);switch(R.keyCode){case 13:pe?(R.preventDefault(),a(),it()):ct(R);break;case 27:R.preventDefault(),it();break;case 8:case 46:ie&&!t.config.allowInput&&(R.preventDefault(),t.clear());break;case 37:case 39:if(!pe&&!ie){R.preventDefault();var ve=l();if(t.daysContainer!==void 0&&(re===!1||ve&&_e(ve))){var fe=R.keyCode===39?1:-1;R.ctrlKey?(R.stopPropagation(),x(fe),I(E(1),0)):I(void 0,fe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:R.preventDefault();var he=R.keyCode===40?1:-1;t.daysContainer&&V.$i!==void 0||V===t.input||V===t.altInput?R.ctrlKey?(R.stopPropagation(),ae(t.currentYear-he),I(E(1),0)):pe||I(void 0,he*7):V===t.currentYearElement?ae(t.currentYear-he):t.config.enableTime&&(!pe&&t.hourElement&&t.hourElement.focus(),a(R),t._debouncedChange());break;case 9:if(pe){var Ie=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(jt){return jt}),mt=Ie.indexOf(V);if(mt!==-1){var un=Ie[mt+(R.shiftKey?-1:1)];R.preventDefault(),(un||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(V)&&R.shiftKey&&(R.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&V===t.amPM)switch(R.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Ct();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Ct();break}(ie||K(V))&&Ze("onKeyDown",R)}function X(R,V){if(V===void 0&&(V="flatpickr-day"),!(t.selectedDates.length!==1||R&&(!R.classList.contains(V)||R.classList.contains("flatpickr-disabled")))){for(var ie=R?R.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),re=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Le=Math.min(ie,t.selectedDates[0].getTime()),le=Math.max(ie,t.selectedDates[0].getTime()),pe=!1,ve=0,fe=0,he=Le;he<le;he+=qS.DAY)W(new Date(he),!0)||(pe=pe||he>Le&&he<le,he<re&&(!ve||he>ve)?ve=he:he>re&&(!fe||he<fe)&&(fe=he));var Ie=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+V));Ie.forEach(function(mt){var un=mt.dateObj,jt=un.getTime(),Di=ve>0&&jt<ve||fe>0&&jt>fe;if(Di){mt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(gi){mt.classList.remove(gi)});return}else if(pe&&!Di)return;["startRange","inRange","endRange","notAllowed"].forEach(function(gi){mt.classList.remove(gi)}),R!==void 0&&(R.classList.add(ie<=t.selectedDates[0].getTime()?"startRange":"endRange"),re<ie&&jt===re?mt.classList.add("startRange"):re>ie&&jt===re&&mt.classList.add("endRange"),jt>=ve&&(fe===0||jt<=fe)&&HS(jt,re,ie)&&mt.classList.add("inRange"))})}}function ge(){t.isOpen&&!t.config.static&&!t.config.inline&&nt()}function ce(R,V){if(V===void 0&&(V=t._positionElement),t.isMobile===!0){if(R){R.preventDefault();var ie=En(R);ie&&ie.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Ze("onOpen");return}else if(t._input.disabled||t.config.inline)return;var re=t.isOpen;t.isOpen=!0,re||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Ze("onOpen"),nt(V)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(R===void 0||!t.timeContainer.contains(R.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function we(R){return function(V){var ie=t.config["_"+R+"Date"]=t.parseDate(V,t.config.dateFormat),re=t.config["_"+(R==="min"?"max":"min")+"Date"];ie!==void 0&&(t[R==="min"?"minDateHasTime":"maxDateHasTime"]=ie.getHours()>0||ie.getMinutes()>0||ie.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Le){return W(Le)}),!t.selectedDates.length&&R==="min"&&d(ie),Ct()),t.daysContainer&&(Xe(),ie!==void 0?t.currentYearElement[R]=ie.getFullYear().toString():t.currentYearElement.removeAttribute(R),t.currentYearElement.disabled=!!re&&ie!==void 0&&re.getFullYear()===ie.getFullYear())}}function Ge(){var R=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],V=fn(fn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ie={};t.config.parseDate=V.parseDate,t.config.formatDate=V.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ie){t.config._enable=pt(Ie)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ie){t.config._disable=pt(Ie)}});var re=V.mode==="time";if(!V.dateFormat&&(V.enableTime||re)){var Le=Zt.defaultConfig.dateFormat||Ss.dateFormat;ie.dateFormat=V.noCalendar||re?"H:i"+(V.enableSeconds?":S":""):Le+" H:i"+(V.enableSeconds?":S":"")}if(V.altInput&&(V.enableTime||re)&&!V.altFormat){var le=Zt.defaultConfig.altFormat||Ss.altFormat;ie.altFormat=V.noCalendar||re?"h:i"+(V.enableSeconds?":S K":" K"):le+(" h:i"+(V.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:we("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:we("max")});var pe=function(Ie){return function(mt){t.config[Ie==="min"?"_minTime":"_maxTime"]=t.parseDate(mt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:pe("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:pe("max")}),V.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ie,V);for(var ve=0;ve<R.length;ve++)t.config[R[ve]]=t.config[R[ve]]===!0||t.config[R[ve]]==="true";Dr.filter(function(Ie){return t.config[Ie]!==void 0}).forEach(function(Ie){t.config[Ie]=Or(t.config[Ie]||[]).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 ve=0;ve<t.config.plugins.length;ve++){var fe=t.config.plugins[ve](t)||{};for(var he in fe)Dr.indexOf(he)>-1?t.config[he]=Or(fe[he]).map(o).concat(t.config[he]):typeof V[he]>"u"&&(t.config[he]=fe[he])}V.altInputClass||(t.config.altInputClass=et().className+" "+t.config.altInputClass),Ze("onParseConfig")}function et(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ke(){typeof t.config.locale!="object"&&typeof Zt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=fn(fn({},Zt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Zt.l10ns[t.config.locale]:void 0),es.D="("+t.l10n.weekdays.shorthand.join("|")+")",es.l="("+t.l10n.weekdays.longhand.join("|")+")",es.M="("+t.l10n.months.shorthand.join("|")+")",es.F="("+t.l10n.months.longhand.join("|")+")",es.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var R=fn(fn({},e),JSON.parse(JSON.stringify(n.dataset||{})));R.time_24hr===void 0&&Zt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=fb(t),t.parseDate=pa({config:t.config,l10n:t.l10n})}function nt(R){if(typeof t.config.position=="function")return void t.config.position(t,R);if(t.calendarContainer!==void 0){Ze("onPreCalendarPosition");var V=R||t._positionElement,ie=Array.prototype.reduce.call(t.calendarContainer.children,function(Rl,Hl){return Rl+Hl.offsetHeight},0),re=t.calendarContainer.offsetWidth,Le=t.config.position.split(" "),le=Le[0],pe=Le.length>1?Le[1]:null,ve=V.getBoundingClientRect(),fe=window.innerHeight-ve.bottom,he=le==="above"||le!=="below"&&fe<ie&&ve.top>ie,Ie=window.pageYOffset+ve.top+(he?-ie-2:V.offsetHeight+2);if(hn(t.calendarContainer,"arrowTop",!he),hn(t.calendarContainer,"arrowBottom",he),!t.config.inline){var mt=window.pageXOffset+ve.left,un=!1,jt=!1;pe==="center"?(mt-=(re-ve.width)/2,un=!0):pe==="right"&&(mt-=re-ve.width,jt=!0),hn(t.calendarContainer,"arrowLeft",!un&&!jt),hn(t.calendarContainer,"arrowCenter",un),hn(t.calendarContainer,"arrowRight",jt);var Di=window.document.body.offsetWidth-(window.pageXOffset+ve.right),gi=mt+re>window.document.body.offsetWidth,Ll=Di+re>window.document.body.offsetWidth;if(hn(t.calendarContainer,"rightMost",gi),!t.config.static)if(t.calendarContainer.style.top=Ie+"px",!gi)t.calendarContainer.style.left=mt+"px",t.calendarContainer.style.right="auto";else if(!Ll)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Di+"px";else{var ms=Me();if(ms===void 0)return;var Il=window.document.body.offsetWidth,qe=Math.max(0,Il/2-re/2),xe=".flatpickr-calendar.centerMost:before",Xt=".flatpickr-calendar.centerMost:after",Nl=ms.cssRules.length,Fl="{left:"+ve.left+"px;right:auto;}";hn(t.calendarContainer,"rightMost",!1),hn(t.calendarContainer,"centerMost",!0),ms.insertRule(xe+","+Xt+Fl,Nl),t.calendarContainer.style.left=qe+"px",t.calendarContainer.style.right="auto"}}}}function Me(){for(var R=null,V=0;V<document.styleSheets.length;V++){var ie=document.styleSheets[V];if(!!ie.cssRules){try{ie.cssRules}catch{continue}R=ie;break}}return R!=null?R:ze()}function ze(){var R=document.createElement("style");return document.head.appendChild(R),R.sheet}function Xe(){t.config.noCalendar||t.isMobile||(Q(),rt(),z())}function it(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function ct(R){R.preventDefault(),R.stopPropagation();var V=function(Ie){return Ie.classList&&Ie.classList.contains("flatpickr-day")&&!Ie.classList.contains("flatpickr-disabled")&&!Ie.classList.contains("notAllowed")},ie=ub(En(R),V);if(ie!==void 0){var re=ie,Le=t.latestSelectedDateObj=new Date(re.dateObj.getTime()),le=(Le.getMonth()<t.currentMonth||Le.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=re,t.config.mode==="single")t.selectedDates=[Le];else if(t.config.mode==="multiple"){var pe=Be(Le);pe?t.selectedDates.splice(parseInt(pe),1):t.selectedDates.push(Le)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Le,t.selectedDates.push(Le),An(Le,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ie,mt){return Ie.getTime()-mt.getTime()}));if(c(),le){var ve=t.currentYear!==Le.getFullYear();t.currentYear=Le.getFullYear(),t.currentMonth=Le.getMonth(),ve&&(Ze("onYearChange"),Q()),Ze("onMonthChange")}if(rt(),z(),Ct(),!le&&t.config.mode!=="range"&&t.config.showMonths===1?O(re):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 fe=t.config.mode==="single"&&!t.config.enableTime,he=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(fe||he)&&it()}b()}}var be={locale:[Ke,Z],showMonths:[G,r,Y],minDate:[$],maxDate:[$],positionElement:[bt],clickOpens:[function(){t.config.clickOpens===!0?(v(t._input,"focus",t.open),v(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Fe(R,V){if(R!==null&&typeof R=="object"){Object.assign(t.config,R);for(var ie in R)be[ie]!==void 0&&be[ie].forEach(function(re){return re()})}else t.config[R]=V,be[R]!==void 0?be[R].forEach(function(re){return re()}):Dr.indexOf(R)>-1&&(t.config[R]=Or(V));t.redraw(),Ct(!0)}function dt(R,V){var ie=[];if(R instanceof Array)ie=R.map(function(re){return t.parseDate(re,V)});else if(R instanceof Date||typeof R=="number")ie=[t.parseDate(R,V)];else if(typeof R=="string")switch(t.config.mode){case"single":case"time":ie=[t.parseDate(R,V)];break;case"multiple":ie=R.split(t.config.conjunction).map(function(re){return t.parseDate(re,V)});break;case"range":ie=R.split(t.l10n.rangeSeparator).map(function(re){return t.parseDate(re,V)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(R)));t.selectedDates=t.config.allowInvalidPreload?ie:ie.filter(function(re){return re instanceof Date&&W(re,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(re,Le){return re.getTime()-Le.getTime()})}function Dt(R,V,ie){if(V===void 0&&(V=!1),ie===void 0&&(ie=t.config.dateFormat),R!==0&&!R||R instanceof Array&&R.length===0)return t.clear(V);dt(R,ie),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),$(void 0,V),d(),t.selectedDates.length===0&&t.clear(!1),Ct(V),V&&Ze("onChange")}function pt(R){return R.slice().map(function(V){return typeof V=="string"||typeof V=="number"||V instanceof Date?t.parseDate(V,void 0,!0):V&&typeof V=="object"&&V.from&&V.to?{from:t.parseDate(V.from,void 0),to:t.parseDate(V.to,void 0)}:V}).filter(function(V){return V})}function lt(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var R=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);R&&dt(R,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 Lt(){if(t.input=et(),!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=St(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"),bt()}function bt(){t._positionElement=t.config.positionElement||t._input}function Ft(){var R=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=St("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=R,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=R==="datetime-local"?"Y-m-d\\TH:i:S":R==="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{}v(t.mobileInput,"change",function(V){t.setDate(En(V).value,!1,t.mobileFormatStr),Ze("onChange"),Ze("onClose")})}function Ot(R){if(t.isOpen===!0)return t.close();t.open(R)}function Ze(R,V){if(t.config!==void 0){var ie=t.config[R];if(ie!==void 0&&ie.length>0)for(var re=0;ie[re]&&re<ie.length;re++)ie[re](t.selectedDates,t.input.value,t,V);R==="onChange"&&(t.input.dispatchEvent($e("change")),t.input.dispatchEvent($e("input")))}}function $e(R){var V=document.createEvent("Event");return V.initEvent(R,!0,!0),V}function Be(R){for(var V=0;V<t.selectedDates.length;V++){var ie=t.selectedDates[V];if(ie instanceof Date&&An(ie,R)===0)return""+V}return!1}function ot(R){return t.config.mode!=="range"||t.selectedDates.length<2?!1:An(R,t.selectedDates[0])>=0&&An(R,t.selectedDates[1])<=0}function rt(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(R,V){var ie=new Date(t.currentYear,t.currentMonth,1);ie.setMonth(t.currentMonth+V),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[V].textContent=Fo(ie.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ie.getMonth().toString(),R.value=ie.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 Ht(R){var V=R||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ie){return t.formatDate(ie,V)}).filter(function(ie,re,Le){return t.config.mode!=="range"||t.config.enableTime||Le.indexOf(ie)===re}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Ct(R){R===void 0&&(R=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Ht(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Ht(t.config.altFormat)),R!==!1&&Ze("onValueUpdate")}function ft(R){var V=En(R),ie=t.prevMonthNav.contains(V),re=t.nextMonthNav.contains(V);ie||re?x(ie?-1:1):t.yearElements.indexOf(V)>=0?V.select():V.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):V.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function en(R){R.preventDefault();var V=R.type==="keydown",ie=En(R),re=ie;t.amPM!==void 0&&ie===t.amPM&&(t.amPM.textContent=t.l10n.amPM[qn(t.amPM.textContent===t.l10n.amPM[0])]);var Le=parseFloat(re.getAttribute("min")),le=parseFloat(re.getAttribute("max")),pe=parseFloat(re.getAttribute("step")),ve=parseInt(re.value,10),fe=R.delta||(V?R.which===38?1:-1:0),he=ve+pe*fe;if(typeof re.value<"u"&&re.value.length===2){var Ie=re===t.hourElement,mt=re===t.minuteElement;he<Le?(he=le+he+qn(!Ie)+(qn(Ie)&&qn(!t.amPM)),mt&&S(void 0,-1,t.hourElement)):he>le&&(he=re===t.hourElement?he-le-qn(!t.amPM):Le,mt&&S(void 0,1,t.hourElement)),t.amPM&&Ie&&(pe===1?he+ve===23:Math.abs(he-ve)>pe)&&(t.amPM.textContent=t.l10n.amPM[qn(t.amPM.textContent===t.l10n.amPM[0])]),re.value=vn(he)}}return s(),t}function Cs(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=zS(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 Cs(this,n)},HTMLElement.prototype.flatpickr=function(n){return Cs([this],n)});var Zt=function(n,e){return typeof n=="string"?Cs(window.document.querySelectorAll(n),e):n instanceof Node?Cs([n],e):Cs(n,e)};Zt.defaultConfig={};Zt.l10ns={en:fn({},yl),default:fn({},yl)};Zt.localize=function(n){Zt.l10ns.default=fn(fn({},Zt.l10ns.default),n)};Zt.setDefaults=function(n){Zt.defaultConfig=fn(fn({},Zt.defaultConfig),n)};Zt.parseDate=pa({});Zt.formatDate=fb({});Zt.compareDates=An;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return Cs(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=Zt);function BS(n){let e,t=[n[1]],i={};for(let s=0;s<t.length;s+=1)i=ut(i,t[s]);return{c(){e=_("input"),mi(e,i)},m(s,l){w(s,e,l),e.autofocus&&e.focus(),n[11](e)},p(s,l){mi(e,i=pn(t,[l&2&&s[1]]))},d(s){s&&k(e),n[11](null)}}}function US(n){let e;const t=n[10].default,i=$n(t,n,n[9],null),s=i||BS(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)&&Cn(i,t,l,l[9],e?Sn(t,l[9],o,null):Mn(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){L(s,l),e=!1},d(l){s&&s.d(l)}}}function WS(n){return n.charAt(2).toLowerCase()+n.substring(3)}function YS(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Bt(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a="",formattedValue:u="",element:f=null,dateFormat:c=null}=e,{options:d={}}=e,h=!1,{input:g=void 0,flatpickr:v=void 0}=e;Fn(()=>{const S=f||g,T=y(d);return T.onReady.push(()=>{t(8,h=!0)}),t(3,v=Zt(S,Object.assign(T,f?{wrap:!0}:{}))),()=>{v.destroy()}});const b=xt();function y(S={}){S=Object.assign({},S);for(const T of r){const M=(O,E,P)=>{b(WS(T),[O,E,P])};T in S?(Array.isArray(S[T])||(S[T]=[S[T]]),S[T].push(M)):S[T]=[M]}return S.onChange&&!S.onChange.includes($)&&S.onChange.push($),S}function $(S,T,M){var E,P;const O=(P=(E=M==null?void 0:M.config)==null?void 0:E.mode)!=null?P:"single";t(2,a=O==="single"?S[0]:S),t(4,u=T)}function C(S){me[S?"unshift":"push"](()=>{g=S,t(0,g)})}return n.$$set=S=>{e=ut(ut({},e),li(S)),t(1,s=Bt(e,i)),"value"in S&&t(2,a=S.value),"formattedValue"in S&&t(4,u=S.formattedValue),"element"in S&&t(5,f=S.element),"dateFormat"in S&&t(6,c=S.dateFormat),"options"in S&&t(7,d=S.options),"input"in S&&t(0,g=S.input),"flatpickr"in S&&t(3,v=S.flatpickr),"$$scope"in S&&t(9,o=S.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&v&&h&&v.setDate(a,!1,c),n.$$.dirty&392&&v&&h)for(const[S,T]of Object.entries(y(d)))v.set(S,T)},[g,s,a,v,u,f,c,d,h,o,l,C]}class eu extends Ee{constructor(e){super(),Oe(this,e,YS,US,De,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function KS(n){let e,t,i,s,l,o,r;function a(f){n[2](f)}let u={id:n[4],options:B.defaultFlatpickrOptions(),value:n[0].min};return n[0].min!==void 0&&(u.formattedValue=n[0].min),l=new eu({props:u}),me.push(()=>Re(l,"formattedValue",a)),{c(){e=_("label"),t=N("Min date (UTC)"),s=D(),q(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].min),!o&&c&1&&(o=!0,d.formattedValue=f[0].min,je(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),j(l,f)}}}function JS(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[4],options:B.defaultFlatpickrOptions(),value:n[0].max};return n[0].max!==void 0&&(u.formattedValue=n[0].max),l=new eu({props:u}),me.push(()=>Re(l,"formattedValue",a)),{c(){e=_("label"),t=N("Max date (UTC)"),s=D(),q(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].max),!o&&c&1&&(o=!0,d.formattedValue=f[0].max,je(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),j(l,f)}}}function ZS(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[KS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[JS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),j(i),j(o)}}}function GS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.min,r)&&(s.min=r,t(0,s))}function o(r){n.$$.not_equal(s.max,r)&&(s.max=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class XS extends Ee{constructor(e){super(),Oe(this,e,GS,ZS,De,{key:1,options:0})}}function QS(n){let e,t,i,s,l,o,r,a,u;function f(d){n[2](d)}let c={id:n[4],placeholder:"eg. optionA, optionB",required:!0};return n[0].values!==void 0&&(c.value=n[0].values),l=new hs({props:c}),me.push(()=>Re(l,"value",f)),{c(){e=_("label"),t=N("Choices"),s=D(),q(l.$$.fragment),r=D(),a=_("div"),a.textContent="Use comma as separator.",p(e,"for",i=n[4]),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,s,h),H(l,d,h),w(d,r,h),w(d,a,h),u=!0},p(d,h){(!u||h&16&&i!==(i=d[4]))&&p(e,"for",i);const g={};h&16&&(g.id=d[4]),!o&&h&1&&(o=!0,g.value=d[0].values,je(()=>o=!1)),l.$set(g)},i(d){u||(A(l.$$.fragment,d),u=!0)},o(d){L(l.$$.fragment,d),u=!1},d(d){d&&k(e),d&&k(s),j(l,d),d&&k(r),d&&k(a)}}}function xS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Max select"),s=D(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].maxSelect),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Se(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function e3(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[QS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[xS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.values"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.maxSelect"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),j(i),j(o)}}}function t3(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.values,r)&&(s.values=r,t(0,s))}function o(){s.maxSelect=Pt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(s)&&t(0,s={maxSelect:1,values:[]})},[s,i,l,o]}class n3 extends Ee{constructor(e){super(),Oe(this,e,t3,e3,De,{key:1,options:0})}}function i3(n,e,t){return["",{}]}class s3 extends Ee{constructor(e){super(),Oe(this,e,i3,null,De,{key:0,options:1})}get key(){return this.$$.ctx[0]}get options(){return this.$$.ctx[1]}}function l3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Max file size (bytes)"),s=D(),l=_("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].maxSize),r||(a=J(l,"input",n[2]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSize&&Se(l,u[0].maxSize)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function o3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Max files"),s=D(),l=_("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"step","1"),p(l,"min",""),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].maxSelect),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Se(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function r3(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("div"),e.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',t=D(),i=_("div"),i.innerHTML='<span class="txt">Images (jpg, png, svg, gif)</span>',s=D(),l=_("div"),l.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=D(),r=_("div"),r.innerHTML='<span class="txt">Archives (zip, 7zip, rar)</span>',p(e,"tabindex","0"),p(e,"class","dropdown-item closable"),p(i,"tabindex","0"),p(i,"class","dropdown-item closable"),p(l,"tabindex","0"),p(l,"class","dropdown-item closable"),p(r,"tabindex","0"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[J(e,"click",n[5]),J(i,"click",n[6]),J(l,"click",n[7]),J(r,"click",n[8])],a=!0)},p:se,d(f){f&&k(e),f&&k(t),f&&k(i),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,Je(u)}}}function a3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T;function M(E){n[4](E)}let O={id:n[10],placeholder:"eg. image/png, application/pdf..."};return n[0].mimeTypes!==void 0&&(O.value=n[0].mimeTypes),r=new hs({props:O}),me.push(()=>Re(r,"value",M)),$=new Ti({props:{class:"dropdown dropdown-sm dropdown-nowrap",$$slots:{default:[r3]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Mime types",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=D(),h=_("button"),g=_("span"),g.textContent="Choose presets",v=D(),b=_("i"),y=D(),q($.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,P){w(E,e,P),m(e,t),m(e,i),m(e,s),w(E,o,P),H(r,E,P),w(E,u,P),w(E,f,P),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),H($,h,null),C=!0,S||(T=Ye(gt.call(null,s,{text:`Allow files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,P){(!C||P&1024&&l!==(l=E[10]))&&p(e,"for",l);const I={};P&1024&&(I.id=E[10]),!a&&P&1&&(a=!0,I.value=E[0].mimeTypes,je(()=>a=!1)),r.$set(I);const F={};P&2049&&(F.$$scope={dirty:P,ctx:E}),$.$set(F)},i(E){C||(A(r.$$.fragment,E),A($.$$.fragment,E),C=!0)},o(E){L(r.$$.fragment,E),L($.$$.fragment,E),C=!1},d(E){E&&k(e),E&&k(o),j(r,E),E&&k(u),E&&k(f),j($),S=!1,T()}}}function u3(n){let e;return{c(){e=_("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>`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function f3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T;function M(E){n[9](E)}let O={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(O.value=n[0].thumbs),r=new hs({props:O}),me.push(()=>Re(r,"value",M)),$=new Ti({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[u3]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=D(),h=_("button"),g=_("span"),g.textContent="Supported formats",v=D(),b=_("i"),y=D(),q($.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,P){w(E,e,P),m(e,t),m(e,i),m(e,s),w(E,o,P),H(r,E,P),w(E,u,P),w(E,f,P),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),H($,h,null),C=!0,S||(T=Ye(gt.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"})),S=!0)},p(E,P){(!C||P&1024&&l!==(l=E[10]))&&p(e,"for",l);const I={};P&1024&&(I.id=E[10]),!a&&P&1&&(a=!0,I.value=E[0].thumbs,je(()=>a=!1)),r.$set(I);const F={};P&2048&&(F.$$scope={dirty:P,ctx:E}),$.$set(F)},i(E){C||(A(r.$$.fragment,E),A($.$$.fragment,E),C=!0)},o(E){L(r.$$.fragment,E),L($.$$.fragment,E),C=!1},d(E){E&&k(e),E&&k(o),j(r,E),E&&k(u),E&&k(f),j($),S=!1,T()}}}function c3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[l3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[o3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[a3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[f3,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),f=D(),c=_("div"),q(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),m(e,f),m(e,c),H(d,c,null),h=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&2&&($.name="schema."+g[1]+".options.mimeTypes"),v&3073&&($.$$scope={dirty:v,ctx:g}),u.$set($);const C={};v&2&&(C.name="schema."+g[1]+".options.thumbs"),v&3073&&(C.$$scope={dirty:v,ctx:g}),d.$set(C)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){L(i.$$.fragment,g),L(o.$$.fragment,g),L(u.$$.fragment,g),L(d.$$.fragment,g),h=!1},d(g){g&&k(e),j(i),j(o),j(u),j(d)}}}function d3(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Pt(this.value),t(0,s)}function o(){s.maxSelect=Pt(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,t(0,s))}const a=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},c=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function d(h){n.$$.not_equal(s.thumbs,h)&&(s.thumbs=h,t(0,s))}return n.$$set=h=>{"key"in h&&t(1,i=h.key),"options"in h&&t(0,s=h.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,o,r,a,u,f,c,d]}class p3 extends Ee{constructor(e){super(),Oe(this,e,d3,c3,De,{key:1,options:0})}}function h3(n){let e,t,i,s,l,o,r;function a(f){n[5](f)}let u={searchable:n[3].length>5,selectPlaceholder:n[2]?"Loading...":"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3]};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new ps({props:u}),me.push(()=>Re(l,"keyOfSelected",a)),{c(){e=_("label"),t=N("Collection"),s=D(),q(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&8&&(d.searchable=f[3].length>5),c&4&&(d.selectPlaceholder=f[2]?"Loading...":"Select collection"),c&8&&(d.items=f[3]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,je(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),j(l,f)}}}function m3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Max select"),s=D(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].maxSelect),r||(a=J(l,"input",n[6]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Se(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function g3(n){let e,t,i,s,l,o,r;function a(f){n[7](f)}let u={id:n[9],items:n[4]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new ps({props:u}),me.push(()=>Re(l,"keyOfSelected",a)),{c(){e=_("label"),t=N("Delete record on relation delete"),s=D(),q(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&512&&(d.id=f[9]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,je(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),j(l,f)}}}function _3(n){let e,t,i,s,l,o,r,a,u,f;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[h3,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[m3,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[g3,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),f=!0},p(c,[d]){const h={};d&2&&(h.name="schema."+c[1]+".options.collectionId"),d&1549&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const g={};d&2&&(g.name="schema."+c[1]+".options.maxSelect"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const v={};d&2&&(v.name="schema."+c[1]+".options.cascadeDelete"),d&1537&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(o.$$.fragment,c),L(u.$$.fragment,c),f=!1},d(c){c&&k(e),j(i),j(o),j(u)}}}function b3(n,e,t){let{key:i=""}=e,{options:s={}}=e;const l=[{label:"False",value:!1},{label:"True",value:!0}];let o=!1,r=[];a();function a(){t(2,o=!0),ye.collections.getFullList(200,{sort:"-created"}).then(d=>{t(3,r=d)}).catch(d=>{ye.errorResponseHandler(d)}).finally(()=>{t(2,o=!1)})}function u(d){n.$$.not_equal(s.collectionId,d)&&(s.collectionId=d,t(0,s))}function f(){s.maxSelect=Pt(this.value),t(0,s)}function c(d){n.$$.not_equal(s.cascadeDelete,d)&&(s.cascadeDelete=d,t(0,s))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,s=d.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(s)&&t(0,s={maxSelect:1,collectionId:null,cascadeDelete:!1})},[s,i,o,r,l,u,f,c]}class v3 extends Ee{constructor(e){super(),Oe(this,e,b3,_3,De,{key:1,options:0})}}function y3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Max select"),s=D(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].maxSelect),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Se(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function k3(n){let e,t,i,s,l,o,r;function a(f){n[4](f)}let u={id:n[5],items:n[2]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new ps({props:u}),me.push(()=>Re(l,"keyOfSelected",a)),{c(){e=_("label"),t=N("Delete record on user delete"),s=D(),q(l.$$.fragment),p(e,"for",i=n[5])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&32&&i!==(i=f[5]))&&p(e,"for",i);const d={};c&32&&(d.id=f[5]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,je(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),j(l,f)}}}function w3(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[y3,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[k3,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.maxSelect"),u&97&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.cascadeDelete"),u&97&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),j(i),j(o)}}}function $3(n,e,t){const i=[{label:"False",value:!1},{label:"True",value:!0}];let{key:s=""}=e,{options:l={}}=e;function o(){l.maxSelect=Pt(this.value),t(0,l)}function r(a){n.$$.not_equal(l.cascadeDelete,a)&&(l.cascadeDelete=a,t(0,l))}return n.$$set=a=>{"key"in a&&t(1,s=a.key),"options"in a&&t(0,l=a.options)},n.$$.update=()=>{n.$$.dirty&1&&B.isEmpty(l)&&t(0,l={maxSelect:1,cascadeDelete:!1})},[l,s,i,o,r]}class S3 extends Ee{constructor(e){super(),Oe(this,e,$3,w3,De,{key:1,options:0})}}function C3(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[38],disabled:n[0].id};return n[0].type!==void 0&&(u.value=n[0].type),l=new hS({props:u}),me.push(()=>Re(l,"value",a)),{c(){e=_("label"),t=N("Type"),s=D(),q(l.$$.fragment),p(e,"for",i=n[38])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&128&&i!==(i=f[38]))&&p(e,"for",i);const d={};c[1]&128&&(d.id=f[38]),c[0]&1&&(d.disabled=f[0].id),!o&&c[0]&1&&(o=!0,d.value=f[0].type,je(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),j(l,f)}}}function Wc(n){let e,t,i;return{c(){e=_("span"),e.textContent="Duplicated or invalid name",p(e,"class","txt invalid-name-note svelte-1tpxlm5")},m(s,l){w(s,e,l),i=!0},i(s){i||(Tt(()=>{t||(t=st(e,Yn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=st(e,Yn,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function M3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=!n[5]&&Wc();return{c(){e=_("label"),t=_("span"),t.textContent="Name",i=D(),g&&g.c(),l=D(),o=_("input"),p(t,"class","txt"),p(e,"for",s=n[38]),p(o,"type","text"),p(o,"id",r=n[38]),o.required=!0,o.disabled=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,o.value=f=n[0].name},m(v,b){w(v,e,b),m(e,t),m(e,i),g&&g.m(e,null),w(v,l,b),w(v,o,b),c=!0,n[0].id||o.focus(),d||(h=J(o,"input",n[17]),d=!0)},p(v,b){v[5]?g&&(Ae(),L(g,1,1,()=>{g=null}),Pe()):g?b[0]&32&&A(g,1):(g=Wc(),g.c(),A(g,1),g.m(e,null)),(!c||b[1]&128&&s!==(s=v[38]))&&p(e,"for",s),(!c||b[1]&128&&r!==(r=v[38]))&&p(o,"id",r),(!c||b[0]&1&&a!==(a=v[0].id&&v[0].system))&&(o.disabled=a),(!c||b[0]&1&&u!==(u=!v[0].id))&&(o.autofocus=u),(!c||b[0]&1&&f!==(f=v[0].name)&&o.value!==f)&&(o.value=f)},i(v){c||(A(g),c=!0)},o(v){L(g),c=!1},d(v){v&&k(e),g&&g.d(),v&&k(l),v&&k(o),d=!1,h()}}}function T3(n){let e,t,i;function s(o){n[28](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new S3({props:l}),me.push(()=>Re(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function D3(n){let e,t,i;function s(o){n[27](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new v3({props:l}),me.push(()=>Re(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function O3(n){let e,t,i;function s(o){n[26](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new p3({props:l}),me.push(()=>Re(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function E3(n){let e,t,i;function s(o){n[25](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new s3({props:l}),me.push(()=>Re(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function A3(n){let e,t,i;function s(o){n[24](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new n3({props:l}),me.push(()=>Re(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function P3(n){let e,t,i;function s(o){n[23](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new XS({props:l}),me.push(()=>Re(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function L3(n){let e,t,i;function s(o){n[22](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new FS({props:l}),me.push(()=>Re(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function I3(n){let e,t,i;function s(o){n[21](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new ab({props:l}),me.push(()=>Re(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function N3(n){let e,t,i;function s(o){n[20](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new TS({props:l}),me.push(()=>Re(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function F3(n){let e,t,i;function s(o){n[19](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new CS({props:l}),me.push(()=>Re(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function R3(n){let e,t,i;function s(o){n[18](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new yS({props:l}),me.push(()=>Re(e,"options",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function H3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Required"),p(e,"type","checkbox"),p(e,"id",t=n[38]),p(s,"for",o=n[38])},m(u,f){w(u,e,f),e.checked=n[0].required,w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[29]),r=!0)},p(u,f){f[1]&128&&t!==(t=u[38])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].required),f[1]&128&&o!==(o=u[38])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Yc(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[j3,({uniqueId:i})=>({38:i}),({uniqueId:i})=>[0,i?128:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&384&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function j3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[38]),p(s,"for",o=n[38])},m(u,f){w(u,e,f),e.checked=n[0].unique,w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[30]),r=!0)},p(u,f){f[1]&128&&t!==(t=u[38])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&128&&o!==(o=u[38])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Kc(n){let e,t,i,s,l,o,r,a,u,f;a=new Ti({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[q3]},$$scope:{ctx:n}}});let c=n[8]&&Jc(n);return{c(){e=_("div"),t=_("div"),i=D(),s=_("div"),l=_("button"),o=_("i"),r=D(),q(a.$$.fragment),u=D(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"class","btn btn-circle btn-sm btn-secondary"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),H(a,l,null),m(s,u),c&&c.m(s,null),f=!0},p(d,h){const g={};h[1]&256&&(g.$$scope={dirty:h,ctx:d}),a.$set(g),d[8]?c?c.p(d,h):(c=Jc(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){L(a.$$.fragment,d),f=!1},d(d){d&&k(e),j(a),c&&c.d()}}}function q3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[9]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function Jc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Done</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){w(s,e,l),t||(i=J(e,"click",ni(n[3])),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function V3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M;s=new Ne({props:{class:"form-field required "+(n[0].id?"disabled":""),name:"schema."+n[1]+".type",$$slots:{default:[C3,({uniqueId:z})=>({38:z}),({uniqueId:z})=>[0,z?128:0]]},$$scope:{ctx:n}}}),r=new Ne({props:{class:`
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[M3,({uniqueId:z})=>({38:z}),({uniqueId:z})=>[0,z?128:0]]},$$scope:{ctx:n}}});const O=[R3,F3,N3,I3,L3,P3,A3,E3,O3,D3,T3],E=[];function P(z,Q){return z[0].type==="text"?0:z[0].type==="number"?1:z[0].type==="bool"?2:z[0].type==="email"?3:z[0].type==="url"?4:z[0].type==="date"?5:z[0].type==="select"?6:z[0].type==="json"?7:z[0].type==="file"?8:z[0].type==="relation"?9:z[0].type==="user"?10:-1}~(f=P(n))&&(c=E[f]=O[f](n)),g=new Ne({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[H3,({uniqueId:z})=>({38:z}),({uniqueId:z})=>[0,z?128:0]]},$$scope:{ctx:n}}});let I=n[0].type!=="file"&&Yc(n),F=!n[0].toDelete&&Kc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),q(s.$$.fragment),l=D(),o=_("div"),q(r.$$.fragment),a=D(),u=_("div"),c&&c.c(),d=D(),h=_("div"),q(g.$$.fragment),v=D(),b=_("div"),I&&I.c(),y=D(),F&&F.c(),$=D(),C=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(C,"type","submit"),p(C,"class","hidden"),p(C,"tabindex","-1"),p(e,"class","field-form")},m(z,Q){w(z,e,Q),m(e,t),m(t,i),H(s,i,null),m(t,l),m(t,o),H(r,o,null),m(t,a),m(t,u),~f&&E[f].m(u,null),m(t,d),m(t,h),H(g,h,null),m(t,v),m(t,b),I&&I.m(b,null),m(t,y),F&&F.m(t,null),m(e,$),m(e,C),S=!0,T||(M=J(e,"submit",Wt(n[31])),T=!0)},p(z,Q){const ne={};Q[0]&1&&(ne.class="form-field required "+(z[0].id?"disabled":"")),Q[0]&2&&(ne.name="schema."+z[1]+".type"),Q[0]&1|Q[1]&384&&(ne.$$scope={dirty:Q,ctx:z}),s.$set(ne);const G={};Q[0]&33&&(G.class=`
form-field
required
`+(z[5]?"":"invalid")+`
`+(z[0].id&&z[0].system?"disabled":"")+`
`),Q[0]&2&&(G.name="schema."+z[1]+".name"),Q[0]&33|Q[1]&384&&(G.$$scope={dirty:Q,ctx:z}),r.$set(G);let ee=f;f=P(z),f===ee?~f&&E[f].p(z,Q):(c&&(Ae(),L(E[ee],1,1,()=>{E[ee]=null}),Pe()),~f?(c=E[f],c?c.p(z,Q):(c=E[f]=O[f](z),c.c()),A(c,1),c.m(u,null)):c=null);const U={};Q[0]&1|Q[1]&384&&(U.$$scope={dirty:Q,ctx:z}),g.$set(U),z[0].type!=="file"?I?(I.p(z,Q),Q[0]&1&&A(I,1)):(I=Yc(z),I.c(),A(I,1),I.m(b,null)):I&&(Ae(),L(I,1,1,()=>{I=null}),Pe()),z[0].toDelete?F&&(Ae(),L(F,1,1,()=>{F=null}),Pe()):F?(F.p(z,Q),Q[0]&1&&A(F,1)):(F=Kc(z),F.c(),A(F,1),F.m(t,null))},i(z){S||(A(s.$$.fragment,z),A(r.$$.fragment,z),A(c),A(g.$$.fragment,z),A(I),A(F),S=!0)},o(z){L(s.$$.fragment,z),L(r.$$.fragment,z),L(c),L(g.$$.fragment,z),L(I),L(F),S=!1},d(z){z&&k(e),j(s),j(r),~f&&E[f].d(),j(g),I&&I.d(),F&&F.d(),T=!1,M()}}}function Zc(n){let e,t,i,s,l=n[0].system&&Gc(),o=!n[0].id&&Xc(n),r=n[0].required&&Qc(),a=n[0].unique&&xc();return{c(){e=_("div"),l&&l.c(),t=D(),o&&o.c(),i=D(),r&&r.c(),s=D(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),m(e,t),o&&o.m(e,null),m(e,i),r&&r.m(e,null),m(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Gc(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=Xc(u),o.c(),o.m(e,i)),u[0].required?r||(r=Qc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=xc(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Gc(n){let e;return{c(){e=_("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),te(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&te(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Qc(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xc(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ed(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(gt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=st(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=st(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function td(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=J(e,"click",ni(n[15])),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function z3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,g,v,b,y=!n[0].toDelete&&Zc(n),$=n[7]&&!n[0].system&&ed(),C=n[0].toDelete&&td(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=D(),o=_("strong"),a=N(r),f=D(),y&&y.c(),c=D(),d=_("div"),h=D(),$&&$.c(),g=D(),C&&C.c(),v=We(),p(i,"class",s=su(B.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),te(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w(S,f,T),y&&y.m(S,T),w(S,c,T),w(S,d,T),w(S,h,T),$&&$.m(S,T),w(S,g,T),C&&C.m(S,T),w(S,v,T),b=!0},p(S,T){(!b||T[0]&1&&s!==(s=su(B.getFieldTypeIcon(S[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||T[0]&1)&&r!==(r=(S[0].name||"-")+"")&&ue(a,r),(!b||T[0]&1&&u!==(u=S[0].name))&&p(o,"title",u),(!b||T[0]&1)&&te(o,"txt-strikethrough",S[0].toDelete),S[0].toDelete?y&&(y.d(1),y=null):y?y.p(S,T):(y=Zc(S),y.c(),y.m(c.parentNode,c)),S[7]&&!S[0].system?$?T[0]&129&&A($,1):($=ed(),$.c(),A($,1),$.m(g.parentNode,g)):$&&(Ae(),L($,1,1,()=>{$=null}),Pe()),S[0].toDelete?C?C.p(S,T):(C=td(S),C.c(),C.m(v.parentNode,v)):C&&(C.d(1),C=null)},i(S){b||(A($),b=!0)},o(S){L($),b=!1},d(S){S&&k(e),S&&k(f),y&&y.d(S),S&&k(c),S&&k(d),S&&k(h),$&&$.d(S),S&&k(g),C&&C.d(S),S&&k(v)}}}function B3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion",$$slots:{header:[z3],default:[V3]},$$scope:{ctx:n}};return e=new ir({props:i}),n[32](e),e.$on("expand",n[33]),e.$on("collapse",n[34]),e.$on("toggle",n[35]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&256&&(o.interactive=s[8]),l[0]&5&&(o.class=s[2]||s[0].toDelete||s[0].system?"field-accordion disabled":"field-accordion"),l[0]&483|l[1]&256&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[32](null),j(e,s)}}}function U3(n,e,t){let i,s,l,o,r;at(n,Vi,K=>t(14,r=K));const a=xt();let{key:u="0"}=e,{field:f=new Dn}=e,{disabled:c=!1}=e,{excludeNames:d=[]}=e,h,g=f.type;function v(){h==null||h.expand()}function b(){h==null||h.collapse()}function y(){f.id?t(0,f.toDelete=!0,f):(b(),a("remove"))}function $(K){if(K=(""+K).toLowerCase(),!K)return!1;for(const ke of d)if(ke.toLowerCase()===K)return!1;return!0}function C(K){return B.slugify(K)}Fn(()=>{f.id||v()});const S=()=>{t(0,f.toDelete=!1,f)};function T(K){n.$$.not_equal(f.type,K)&&(f.type=K,t(0,f),t(13,g),t(4,h))}const M=K=>{t(0,f.name=C(K.target.value),f),K.target.value=f.name};function O(K){n.$$.not_equal(f.options,K)&&(f.options=K,t(0,f),t(13,g),t(4,h))}function E(K){n.$$.not_equal(f.options,K)&&(f.options=K,t(0,f),t(13,g),t(4,h))}function P(K){n.$$.not_equal(f.options,K)&&(f.options=K,t(0,f),t(13,g),t(4,h))}function I(K){n.$$.not_equal(f.options,K)&&(f.options=K,t(0,f),t(13,g),t(4,h))}function F(K){n.$$.not_equal(f.options,K)&&(f.options=K,t(0,f),t(13,g),t(4,h))}function z(K){n.$$.not_equal(f.options,K)&&(f.options=K,t(0,f),t(13,g),t(4,h))}function Q(K){n.$$.not_equal(f.options,K)&&(f.options=K,t(0,f),t(13,g),t(4,h))}function ne(K){n.$$.not_equal(f.options,K)&&(f.options=K,t(0,f),t(13,g),t(4,h))}function G(K){n.$$.not_equal(f.options,K)&&(f.options=K,t(0,f),t(13,g),t(4,h))}function ee(K){n.$$.not_equal(f.options,K)&&(f.options=K,t(0,f),t(13,g),t(4,h))}function U(K){n.$$.not_equal(f.options,K)&&(f.options=K,t(0,f),t(13,g),t(4,h))}function Y(){f.required=this.checked,t(0,f),t(13,g),t(4,h)}function Z(){f.unique=this.checked,t(0,f),t(13,g),t(4,h)}const de=()=>{i&&b()};function x(K){me[K?"unshift":"push"](()=>{h=K,t(4,h)})}function oe(K){tt.call(this,n,K)}function Ce(K){tt.call(this,n,K)}function Te(K){tt.call(this,n,K)}return n.$$set=K=>{"key"in K&&t(1,u=K.key),"field"in K&&t(0,f=K.field),"disabled"in K&&t(2,c=K.disabled),"excludeNames"in K&&t(11,d=K.excludeNames)},n.$$.update=()=>{n.$$.dirty[0]&8193&&g!=f.type&&(t(13,g=f.type),t(0,f.options={},f),t(0,f.unique=!1,f)),n.$$.dirty[0]&17&&f.toDelete&&(h&&b(),f.originalName&&f.name!==f.originalName&&t(0,f.name=f.originalName,f)),n.$$.dirty[0]&1&&!f.originalName&&f.name&&t(0,f.originalName=f.name,f),n.$$.dirty[0]&1&&typeof f.toDelete>"u"&&t(0,f.toDelete=!1,f),n.$$.dirty[0]&1&&f.required&&t(0,f.nullable=!1,f),n.$$.dirty[0]&1&&t(6,i=!B.isEmpty(f.name)&&f.type),n.$$.dirty[0]&80&&(i||h&&v()),n.$$.dirty[0]&69&&t(8,s=!c&&!f.system&&!f.toDelete&&i),n.$$.dirty[0]&1&&t(5,l=$(f.name)),n.$$.dirty[0]&16418&&t(7,o=!l||!B.isEmpty(B.getNestedVal(r,`schema.${u}`)))},[f,u,c,b,h,l,i,o,s,y,C,d,v,g,r,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te]}class W3 extends Ee{constructor(e){super(),Oe(this,e,U3,B3,De,{key:1,field:0,disabled:2,excludeNames:11,expand:12,collapse:3},null,[-1,-1])}get expand(){return this.$$.ctx[12]}get collapse(){return this.$$.ctx[3]}}function nd(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function id(n,e){let t,i,s,l;function o(u){e[5](u,e[9],e[10],e[11])}function r(){return e[6](e[11])}let a={key:e[11],excludeNames:e[1].concat(e[4](e[9]))};return e[9]!==void 0&&(a.field=e[9]),i=new W3({props:a}),me.push(()=>Re(i,"field",o)),i.$on("remove",r),{key:n,first:null,c(){t=We(),q(i.$$.fragment),this.first=t},m(u,f){w(u,t,f),H(i,u,f),l=!0},p(u,f){e=u;const c={};f&1&&(c.key=e[11]),f&1&&(c.excludeNames=e[1].concat(e[4](e[9]))),!s&&f&1&&(s=!0,c.field=e[9],je(()=>s=!1)),i.$set(c)},i(u){l||(A(i.$$.fragment,u),l=!0)},o(u){L(i.$$.fragment,u),l=!1},d(u){u&&k(t),j(i,u)}}}function Y3(n){let e,t=[],i=new Map,s,l,o,r,a,u,f,c,d,h,g,v=n[0].schema;const b=y=>y[11];for(let y=0;y<v.length;y+=1){let $=nd(n,v,y),C=b($);i.set(C,t[y]=id(C,$))}return{c(){var y;e=_("div");for(let $=0;$<t.length;$+=1)t[$].c();s=D(),l=_("div"),o=D(),r=_("button"),a=_("i"),u=D(),f=_("span"),f.textContent="New field",p(e,"class","accordions"),p(l,"class","clearfix m-t-xs"),p(a,"class","ri-add-line"),p(f,"class","txt"),p(r,"type","button"),p(r,"class",c="btn btn-block "+((y=n[0].schema)!=null&&y.length?"btn-secondary":"btn-success"))},m(y,$){w(y,e,$);for(let C=0;C<t.length;C+=1)t[C].m(e,null);w(y,s,$),w(y,l,$),w(y,o,$),w(y,r,$),m(r,a),m(r,u),m(r,f),d=!0,h||(g=J(r,"click",n[3]),h=!0)},p(y,[$]){var C;$&23&&(v=y[0].schema,Ae(),t=_t(t,$,b,1,y,v,i,e,Gt,id,null,nd),Pe()),(!d||$&1&&c!==(c="btn btn-block "+((C=y[0].schema)!=null&&C.length?"btn-secondary":"btn-success")))&&p(r,"class",c)},i(y){if(!d){for(let $=0;$<v.length;$+=1)A(t[$]);d=!0}},o(y){for(let $=0;$<t.length;$+=1)L(t[$]);d=!1},d(y){y&&k(e);for(let $=0;$<t.length;$+=1)t[$].d();y&&k(s),y&&k(l),y&&k(o),y&&k(r),h=!1,g()}}}function K3(n,e,t){const i=["id","created","updated"];let{collection:s={}}=e;function l(d){s.schema[d]&&(s.schema.splice(d,1),t(0,s))}function o(){const d=new Dn({name:r()});s.schema.push(d),t(0,s)}function r(d="field"){let h="";for(;a(d+h);)++h;return d+h}function a(d){return!!s.schema.find(h=>h.name===d)}function u(d){let h=[];if(d.toDelete)return h;for(let g of s.schema)g===d||g.toDelete||h.push(g.name);return h}function f(d,h,g,v){g[v]=d,t(0,s)}const c=d=>l(d);return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof(s==null?void 0:s.schema)>"u"&&(t(0,s=s||{}),t(0,s.schema=[],s))},[s,i,l,o,u,f,c]}class J3 extends Ee{constructor(e){super(),Oe(this,e,K3,Y3,De,{collection:0})}}function sd(n,e,t){const i=n.slice();return i[13]=e[t][0],i[14]=e[t][1],i[15]=e,i[16]=t,i}function ld(n,e,t){const i=n.slice();return i[18]=e[t],i}function od(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P,I,F,z,Q,ne,G=n[0].schema,ee=[];for(let U=0;U<G.length;U+=1)ee[U]=rd(ld(n,G,U));return{c(){e=_("div"),t=_("div"),i=_("div"),s=_("p"),s.textContent="The following record fields are available:",l=D(),o=_("div"),r=_("code"),r.textContent="id",a=D(),u=_("code"),u.textContent="created",f=D(),c=_("code"),c.textContent="updated",d=D();for(let U=0;U<ee.length;U+=1)ee[U].c();h=D(),g=_("hr"),v=D(),b=_("p"),b.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",y=D(),$=_("div"),$.innerHTML=`<code>@request.method</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.user.*</code>`,C=D(),S=_("hr"),T=D(),M=_("p"),M.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=D(),E=_("div"),E.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",P=D(),I=_("hr"),F=D(),z=_("p"),z.innerHTML=`Example rule:
<br/>
<code>@request.user.id!=&quot;&quot; &amp;&amp; created&gt;&quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p($,"class","inline-flex flex-gap-5"),p(S,"class","m-t-10 m-b-5"),p(M,"class","m-b-0"),p(E,"class","inline-flex flex-gap-5"),p(I,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(U,Y){w(U,e,Y),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(o,d);for(let Z=0;Z<ee.length;Z+=1)ee[Z].m(o,null);m(i,h),m(i,g),m(i,v),m(i,b),m(i,y),m(i,$),m(i,C),m(i,S),m(i,T),m(i,M),m(i,O),m(i,E),m(i,P),m(i,I),m(i,F),m(i,z),ne=!0},p(U,Y){if(Y&1){G=U[0].schema;let Z;for(Z=0;Z<G.length;Z+=1){const de=ld(U,G,Z);ee[Z]?ee[Z].p(de,Y):(ee[Z]=rd(de),ee[Z].c(),ee[Z].m(o,null))}for(;Z<ee.length;Z+=1)ee[Z].d(1);ee.length=G.length}},i(U){ne||(U&&Tt(()=>{Q||(Q=st(e,on,{duration:150},!0)),Q.run(1)}),ne=!0)},o(U){U&&(Q||(Q=st(e,on,{duration:150},!1)),Q.run(0)),ne=!1},d(U){U&&k(e),Yt(ee,U),U&&Q&&Q.end()}}}function Z3(n){let e,t=n[18].name+"",i;return{c(){e=_("code"),i=N(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[18].name+"")&&ue(i,t)},d(s){s&&k(e)}}}function G3(n){let e,t=n[18].name+"",i,s;return{c(){e=_("code"),i=N(t),s=N(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[18].name+"")&&ue(i,t)},d(l){l&&k(e)}}}function rd(n){let e;function t(l,o){return l[18].type==="relation"||l[18].type==="user"?G3:Z3}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(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&&k(e)}}}function X3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[13];for(let r=0;r<l.length;r+=1){let a=sd(n,l,r),u=o(a);t.set(u,e[r]=ad(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=We()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&131163&&(l=Object.entries(r[6]),Ae(),e=_t(e,a,o,1,r,l,t,i.parentNode,Gt,ad,i,sd),Pe())},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)L(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function Q3(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function x3(n){let e,t,i;function s(){return n[9](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(gt.call(null,e,"Lock and set to Admins only")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Je(i)}}}function eC(n){let e,t,i;function s(){return n[8](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(gt.call(null,e,"Unlock and set custom rule")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Je(i)}}}function tC(n){let e;return{c(){e=N("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function nC(n){let e;return{c(){e=N("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function iC(n){let e,t=n[14]+"",i,s,l=Ii(n[0][n[13]])?"Admins only":"Custom rule",o,r,a,u,f=n[13],c,d,h,g,v;const b=()=>n[10](u,f),y=()=>n[10](null,f);function $(E){n[11](E,n[13])}var C=n[4];function S(E){let P={id:E[17],baseCollection:E[0],disabled:Ii(E[0][E[13]])};return E[0][E[13]]!==void 0&&(P.value=E[0][E[13]]),{props:P}}C&&(u=new C(S(n)),b(),me.push(()=>Re(u,"value",$)));function T(E,P){return P&1&&(g=null),g==null&&(g=!!Ii(E[0][E[13]])),g?nC:tC}let M=T(n,-1),O=M(n);return{c(){e=_("label"),i=N(t),s=N(" - "),o=N(l),a=D(),u&&q(u.$$.fragment),d=D(),h=_("div"),O.c(),p(e,"for",r=n[17]),p(h,"class","help-block")},m(E,P){w(E,e,P),m(e,i),m(e,s),m(e,o),w(E,a,P),u&&H(u,E,P),w(E,d,P),w(E,h,P),O.m(h,null),v=!0},p(E,P){n=E,(!v||P&1)&&l!==(l=Ii(n[0][n[13]])?"Admins only":"Custom rule")&&ue(o,l),(!v||P&131072&&r!==(r=n[17]))&&p(e,"for",r),f!==n[13]&&(y(),f=n[13],b());const I={};if(P&131072&&(I.id=n[17]),P&1&&(I.baseCollection=n[0]),P&1&&(I.disabled=Ii(n[0][n[13]])),!c&&P&65&&(c=!0,I.value=n[0][n[13]],je(()=>c=!1)),C!==(C=n[4])){if(u){Ae();const F=u;L(F.$$.fragment,1,0,()=>{j(F,1)}),Pe()}C?(u=new C(S(n)),b(),me.push(()=>Re(u,"value",$)),q(u.$$.fragment),A(u.$$.fragment,1),H(u,d.parentNode,d)):u=null}else C&&u.$set(I);M!==(M=T(n,P))&&(O.d(1),O=M(n),O&&(O.c(),O.m(h,null)))},i(E){v||(u&&A(u.$$.fragment,E),v=!0)},o(E){u&&L(u.$$.fragment,E),v=!1},d(E){E&&k(e),E&&k(a),y(),u&&j(u,E),E&&k(d),E&&k(h),O.d()}}}function ad(n,e){let t,i,s,l,o,r,a,u;function f(h,g){return g&1&&(l=null),l==null&&(l=!!Ii(h[0][h[13]])),l?eC:x3}let c=f(e,-1),d=c(e);return r=new Ne({props:{class:"form-field rule-field m-0 "+(Ii(e[0][e[13]])?"disabled":""),name:e[13],$$slots:{default:[iC,({uniqueId:h})=>({17:h}),({uniqueId:h})=>h?131072:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=_("hr"),i=D(),s=_("div"),d.c(),o=D(),q(r.$$.fragment),a=D(),p(t,"class","m-t-sm m-b-sm"),p(s,"class","rule-block svelte-fjxz7k"),this.first=t},m(h,g){w(h,t,g),w(h,i,g),w(h,s,g),d.m(s,null),m(s,o),H(r,s,null),m(s,a),u=!0},p(h,g){e=h,c===(c=f(e,g))&&d?d.p(e,g):(d.d(1),d=c(e),d&&(d.c(),d.m(s,o)));const v={};g&1&&(v.class="form-field rule-field m-0 "+(Ii(e[0][e[13]])?"disabled":"")),g&2228249&&(v.$$scope={dirty:g,ctx:e}),r.$set(v)},i(h){u||(A(r.$$.fragment,h),u=!0)},o(h){L(r.$$.fragment,h),u=!1},d(h){h&&k(t),h&&k(i),h&&k(s),d.d(),j(r)}}}function sC(n){let e,t,i,s,l,o=n[2]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,g,v,b=n[2]&&od(n);const y=[Q3,X3],$=[];function C(S,T){return S[5]?0:1}return f=C(n),c=$[f]=y[f](n),{c(){e=_("div"),t=_("div"),i=_("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
</a>.`,s=D(),l=_("span"),r=N(o),a=D(),b&&b.c(),u=D(),c.c(),d=We(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w(S,u,T),$[f].m(S,T),w(S,d,T),h=!0,g||(v=J(l,"click",n[7]),g=!0)},p(S,[T]){(!h||T&4)&&o!==(o=S[2]?"Hide available fields":"Show available fields")&&ue(r,o),S[2]?b?(b.p(S,T),T&4&&A(b,1)):(b=od(S),b.c(),A(b,1),b.m(e,null)):b&&(Ae(),L(b,1,1,()=>{b=null}),Pe());let M=f;f=C(S),f===M?$[f].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),c=$[f],c?c.p(S,T):(c=$[f]=y[f](S),c.c()),A(c,1),c.m(d.parentNode,d))},i(S){h||(A(b),A(c),h=!0)},o(S){L(b),L(c),h=!1},d(S){S&&k(e),b&&b.d(),S&&k(u),$[f].d(S),S&&k(d),g=!1,v()}}}function Ii(n){return n===null}function lC(n,e,t){let{collection:i=new dn}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Pi(()=>import("./FilterAutocompleteInput.08e9fa52.js"),["FilterAutocompleteInput.08e9fa52.js","index.2148ad18.js"],import.meta.url)).default)}catch(b){console.warn(b),t(4,r=null)}t(5,a=!1)}Fn(()=>{f()});const c=()=>t(2,l=!l),d=async b=>{var y;t(0,i[b]=s[b]||"",i),await Zn(),(y=o[b])==null||y.focus()},h=b=>{t(1,s[b]=i[b],s),t(0,i[b]=null,i)};function g(b,y){me[b?"unshift":"push"](()=>{o[y]=b,t(3,o)})}function v(b,y){n.$$.not_equal(i[y],b)&&(i[y]=b,t(0,i))}return n.$$set=b=>{"collection"in b&&t(0,i=b.collection)},[i,s,l,o,r,a,u,c,d,h,g,v]}class oC extends Ee{constructor(e){super(),Oe(this,e,lC,sC,De,{collection:0})}}function ud(n,e,t){const i=n.slice();return i[14]=e[t],i}function fd(n,e,t){const i=n.slice();return i[14]=e[t],i}function cd(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dd(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=N(`Renamed collection
`),s=_("strong"),o=N(l),r=D(),a=_("i"),u=D(),f=_("strong"),d=N(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&ue(o,l),g&2&&c!==(c=h[1].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function pd(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=N(`Renamed field
`),s=_("strong"),o=N(l),r=D(),a=_("i"),u=D(),f=_("strong"),d=N(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&ue(o,l),g&16&&c!==(c=h[14].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function hd(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=N("Removed field "),i=_("span"),l=N(s),o=D(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){w(r,e,a),m(e,t),m(e,i),m(i,l),m(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&ue(l,s)},d(r){r&&k(e)}}}function rC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&cd(),g=n[5]&&dd(n),v=n[4],b=[];for(let C=0;C<v.length;C+=1)b[C]=pd(fd(n,v,C));let y=n[3],$=[];for(let C=0;C<y.length;C+=1)$[C]=hd(ud(n,y,C));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
update it manually!`,o=D(),h&&h.c(),r=D(),a=_("h6"),a.textContent="Changes:",u=D(),f=_("ul"),g&&g.c(),c=D();for(let C=0;C<b.length;C+=1)b[C].c();d=D();for(let C=0;C<$.length;C+=1)$[C].c();p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(f,"class","changes-list svelte-1ghly2p")},m(C,S){w(C,e,S),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),h&&h.m(s,null),w(C,r,S),w(C,a,S),w(C,u,S),w(C,f,S),g&&g.m(f,null),m(f,c);for(let T=0;T<b.length;T+=1)b[T].m(f,null);m(f,d);for(let T=0;T<$.length;T+=1)$[T].m(f,null)},p(C,S){if(C[3].length?h||(h=cd(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),C[5]?g?g.p(C,S):(g=dd(C),g.c(),g.m(f,c)):g&&(g.d(1),g=null),S&16){v=C[4];let T;for(T=0;T<v.length;T+=1){const M=fd(C,v,T);b[T]?b[T].p(M,S):(b[T]=pd(M),b[T].c(),b[T].m(f,d))}for(;T<b.length;T+=1)b[T].d(1);b.length=v.length}if(S&8){y=C[3];let T;for(T=0;T<y.length;T+=1){const M=ud(C,y,T);$[T]?$[T].p(M,S):($[T]=hd(M),$[T].c(),$[T].m(f,null))}for(;T<$.length;T+=1)$[T].d(1);$.length=y.length}},d(C){C&&k(e),h&&h.d(),C&&k(r),C&&k(a),C&&k(u),C&&k(f),g&&g.d(),Yt(b,C),Yt($,C)}}}function aC(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function uC(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[J(e,"click",n[8]),J(i,"click",n[9])],s=!0)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Je(l)}}}function fC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[uC],header:[aC],default:[rC]},$$scope:{ctx:n}};return e=new ui({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function cC(n,e,t){let i,s,l;const o=xt();let r,a;async function u(y){t(1,a=y),await Zn(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function g(y){me[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){tt.call(this,n,y)}function b(y){tt.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,g,v,b]}class dC extends Ee{constructor(e){super(),Oe(this,e,cC,fC,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function md(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new oC({props:o}),me.push(()=>Re(t,"collection",l)),{c(){e=_("div"),q(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],je(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),j(t)}}}function pC(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new J3({props:a}),me.push(()=>Re(i,"collection",r));let u=n[9]===kl&&md(n);return{c(){e=_("div"),t=_("div"),q(i.$$.fragment),l=D(),u&&u.c(),p(t,"class","tab-item"),te(t,"active",n[9]===rs),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),H(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],je(()=>s=!1)),i.$set(d),(!o||c[0]&512)&&te(t,"active",f[9]===rs),f[9]===kl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=md(f),u.c(),A(u,1),u.m(e,null)):u&&(Ae(),L(u,1,1,()=>{u=null}),Pe())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){L(i.$$.fragment,f),L(u),o=!1},d(f){f&&k(e),j(i),u&&u.d()}}}function gd(n){let e,t,i,s,l,o,r;return o=new Ti({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[hC]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=D(),i=_("button"),s=_("i"),l=D(),q(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),m(i,s),m(i,l),H(o,i,null),r=!0},p(a,u){const f={};u[1]&256&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){L(o.$$.fragment,a),r=!1},d(a){a&&k(e),a&&k(t),a&&k(i),j(o)}}}function hC(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[20]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function _d(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function mC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&_d();return{c(){e=_("label"),t=N("Name"),s=D(),l=_("input"),u=D(),h&&h.c(),f=We(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),h&&h.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=J(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=_d(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),h&&h.d(g),g&&k(f),c=!1,d()}}}function bd(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Ye(t=gt.call(null,e,n[12])),l=!0)},p(r,a){t&&Nn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=st(e,Tn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=st(e,Tn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function vd(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(gt.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=st(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=st(e,Tn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function gC(n){var F,z,Q,ne,G,ee;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,g,v=!B.isEmpty((F=n[4])==null?void 0:F.schema),b,y,$,C,S=!B.isEmpty((z=n[4])==null?void 0:z.listRule)||!B.isEmpty((Q=n[4])==null?void 0:Q.viewRule)||!B.isEmpty((ne=n[4])==null?void 0:ne.createRule)||!B.isEmpty((G=n[4])==null?void 0:G.updateRule)||!B.isEmpty((ee=n[4])==null?void 0:ee.deleteRule),T,M,O,E=!n[2].isNew&&!n[2].system&&gd(n);r=new Ne({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[mC,({uniqueId:U})=>({38:U}),({uniqueId:U})=>[0,U?128:0]]},$$scope:{ctx:n}}});let P=v&&bd(n),I=S&&vd();return{c(){e=_("h4"),i=N(t),s=D(),E&&E.c(),l=D(),o=_("form"),q(r.$$.fragment),a=D(),u=_("input"),f=D(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=D(),P&&P.c(),b=D(),y=_("button"),$=_("span"),$.textContent="API Rules",C=D(),I&&I.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),te(d,"active",n[9]===rs),p($,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),te(y,"active",n[9]===kl),p(c,"class","tabs-header stretched")},m(U,Y){w(U,e,Y),m(e,i),w(U,s,Y),E&&E.m(U,Y),w(U,l,Y),w(U,o,Y),H(r,o,null),m(o,a),m(o,u),w(U,f,Y),w(U,c,Y),m(c,d),m(d,h),m(d,g),P&&P.m(d,null),m(c,b),m(c,y),m(y,$),m(y,C),I&&I.m(y,null),T=!0,M||(O=[J(o,"submit",Wt(n[22])),J(d,"click",n[23]),J(y,"click",n[24])],M=!0)},p(U,Y){var de,x,oe,Ce,Te,K;(!T||Y[0]&4)&&t!==(t=U[2].isNew?"New collection":"Edit collection")&&ue(i,t),!U[2].isNew&&!U[2].system?E?(E.p(U,Y),Y[0]&4&&A(E,1)):(E=gd(U),E.c(),A(E,1),E.m(l.parentNode,l)):E&&(Ae(),L(E,1,1,()=>{E=null}),Pe());const Z={};Y[0]&2048&&(Z.class="form-field required m-b-0 "+(U[11]?"disabled":"")),Y[0]&2052|Y[1]&384&&(Z.$$scope={dirty:Y,ctx:U}),r.$set(Z),Y[0]&16&&(v=!B.isEmpty((de=U[4])==null?void 0:de.schema)),v?P?(P.p(U,Y),Y[0]&16&&A(P,1)):(P=bd(U),P.c(),A(P,1),P.m(d,null)):P&&(Ae(),L(P,1,1,()=>{P=null}),Pe()),(!T||Y[0]&512)&&te(d,"active",U[9]===rs),Y[0]&16&&(S=!B.isEmpty((x=U[4])==null?void 0:x.listRule)||!B.isEmpty((oe=U[4])==null?void 0:oe.viewRule)||!B.isEmpty((Ce=U[4])==null?void 0:Ce.createRule)||!B.isEmpty((Te=U[4])==null?void 0:Te.updateRule)||!B.isEmpty((K=U[4])==null?void 0:K.deleteRule)),S?I?Y[0]&16&&A(I,1):(I=vd(),I.c(),A(I,1),I.m(y,null)):I&&(Ae(),L(I,1,1,()=>{I=null}),Pe()),(!T||Y[0]&512)&&te(y,"active",U[9]===kl)},i(U){T||(A(E),A(r.$$.fragment,U),A(P),A(I),T=!0)},o(U){L(E),L(r.$$.fragment,U),L(P),L(I),T=!1},d(U){U&&k(e),U&&k(s),E&&E.d(U),U&&k(l),U&&k(o),j(r),U&&k(f),U&&k(c),P&&P.d(),I&&I.d(),M=!1,Je(O)}}}function _C(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),r=N(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],te(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=[J(e,"click",n[18]),J(s,"click",n[19])],u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&1152&&a!==(a=!c[10]||c[7])&&(s.disabled=a),d[0]&128&&te(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Je(f)}}}function bC(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header compact-header collection-panel",beforeHide:n[27],$$slots:{footer:[_C],header:[gC],default:[pC]},$$scope:{ctx:n}};e=new ui({props:l}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]);let o={};return i=new dC({props:o}),n[31](i),i.$on("confirm",n[32]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),s=!0},p(r,a){const u={};a[0]&264&&(u.beforeHide=r[27]),a[0]&7828|a[1]&256&&(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){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){n[28](null),j(e,r),r&&k(t),n[31](null),j(i,r)}}}const rs="fields",kl="api_rules";function Lr(n){return JSON.stringify(n)}function vC(n,e,t){let i,s,l,o,r,a;at(n,hi,K=>t(34,r=K)),at(n,Vi,K=>t(4,a=K));const u=xt();let f,c,d=null,h=new dn,g=!1,v=!1,b=rs,y=Lr(h);function $(K){t(9,b=K)}function C(K){return T(K),t(8,v=!0),$(rs),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}async function T(K){ri({}),typeof K<"u"?(d=K,t(2,h=K==null?void 0:K.clone())):(d=null,t(2,h=new dn)),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Zn(),t(17,y=Lr(h))}function M(){if(h.isNew)return O();c==null||c.show(h)}function O(){if(g)return;t(7,g=!0);const K=E();let ke;h.isNew?ke=ye.collections.create(K):ke=ye.collections.update(h.id,K),ke.then(ae=>{t(8,v=!1),S(),sn(h.isNew?"Successfully created collection.":"Successfully updated collection."),z$(ae),h.isNew&&nn(hi,r=ae,r),u("save",ae)}).catch(ae=>{ye.errorResponseHandler(ae)}).finally(()=>{t(7,g=!1)})}function E(){const K=h.export();K.schema=K.schema.slice(0);for(let ke=K.schema.length-1;ke>=0;ke--)K.schema[ke].toDelete&&K.schema.splice(ke,1);return K}function P(){!(d!=null&&d.id)||si(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>ye.collections.delete(d==null?void 0:d.id).then(()=>{S(),sn(`Successfully deleted collection "${d==null?void 0:d.name}".`),u("delete",d),B$(d)}).catch(K=>{ye.errorResponseHandler(K)}))}const I=()=>S(),F=()=>M(),z=()=>P(),Q=K=>{t(2,h.name=B.slugify(K.target.value),h),K.target.value=h.name},ne=()=>{o&&M()},G=()=>$(rs),ee=()=>$(kl);function U(K){h=K,t(2,h)}function Y(K){h=K,t(2,h)}const Z=()=>l&&v?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,v=!1),S()}),!1):!0;function de(K){me[K?"unshift":"push"](()=>{f=K,t(5,f)})}function x(K){tt.call(this,n,K)}function oe(K){tt.call(this,n,K)}function Ce(K){me[K?"unshift":"push"](()=>{c=K,t(6,c)})}const Te=()=>O();return n.$$.update=()=>{n.$$.dirty[0]&16&&t(12,i=typeof B.getNestedVal(a,"schema.message",null)=="string"?B.getNestedVal(a,"schema.message"):"Has errors"),n.$$.dirty[0]&4&&t(11,s=!h.isNew&&h.system),n.$$.dirty[0]&131076&&t(3,l=y!=Lr(h)),n.$$.dirty[0]&12&&t(10,o=h.isNew||l)},[$,S,h,l,a,f,c,g,v,b,o,s,i,M,O,P,C,y,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te]}class tu extends Ee{constructor(e){super(),Oe(this,e,vC,bC,De,{changeTab:0,show:16,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[16]}get hide(){return this.$$.ctx[1]}}function yd(n,e,t){const i=n.slice();return i[14]=e[t],i}function kd(n){let e,t=n[1].length&&wd();return{c(){t&&t.c(),e=We()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1].length?t||(t=wd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function wd(n){let e;return{c(){e=_("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yC(n){let e;return{c(){e=_("i"),p(e,"class","ri-folder-2-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kC(n){let e;return{c(){e=_("i"),p(e,"class","ri-folder-open-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $d(n,e){let t,i,s,l=e[14].name+"",o,r,a,u;function f(g,v){var b;return((b=g[5])==null?void 0:b.id)===g[14].id?kC:yC}let c=f(e),d=c(e);function h(){return e[11](e[14])}return{key:n,first:null,c(){var g;t=_("div"),d.c(),i=D(),s=_("span"),o=N(l),r=D(),p(s,"class","txt"),p(t,"tabindex","0"),p(t,"class","sidebar-list-item"),te(t,"active",((g=e[5])==null?void 0:g.id)===e[14].id),this.first=t},m(g,v){w(g,t,v),d.m(t,null),m(t,i),m(t,s),m(s,o),m(t,r),a||(u=J(t,"click",h),a=!0)},p(g,v){var b;e=g,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i))),v&8&&l!==(l=e[14].name+"")&&ue(o,l),v&40&&te(t,"active",((b=e[5])==null?void 0:b.id)===e[14].id)},d(g){g&&k(t),d.d(),a=!1,u()}}}function Sd(n){let e,t,i,s;return{c(){e=_("footer"),t=_("button"),t.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),m(e,t),i||(s=J(t,"click",n[12]),i=!0)},p:se,d(l){l&&k(e),i=!1,s()}}}function wC(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,g,v,b,y,$,C,S=n[3];const T=P=>P[14].id;for(let P=0;P<S.length;P+=1){let I=yd(n,S,P),F=T(I);h.set(F,d[P]=$d(F,I))}let M=null;S.length||(M=kd(n));let O=!n[6]&&Sd(n),E={};return b=new tu({props:E}),n[13](b),{c(){e=_("aside"),t=_("header"),i=_("div"),s=_("div"),l=_("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=_("input"),a=D(),u=_("hr"),f=D(),c=_("div");for(let P=0;P<d.length;P+=1)d[P].c();M&&M.c(),g=D(),O&&O.c(),v=D(),q(b.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),te(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),te(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(e,"class","page-sidebar collection-sidebar")},m(P,I){w(P,e,I),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Se(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let F=0;F<d.length;F+=1)d[F].m(c,null);M&&M.m(c,null),m(e,g),O&&O.m(e,null),w(P,v,I),H(b,P,I),y=!0,$||(C=[J(l,"click",n[9]),J(r,"input",n[10])],$=!0)},p(P,[I]){(!y||I&16)&&te(l,"hidden",!P[4]),I&1&&r.value!==P[0]&&Se(r,P[0]),(!y||I&16)&&te(i,"active",P[4]),I&170&&(S=P[3],d=_t(d,I,T,1,P,S,h,c,bn,$d,null,yd),!S.length&&M?M.p(P,I):S.length?M&&(M.d(1),M=null):(M=kd(P),M.c(),M.m(c,null))),P[6]?O&&(O.d(1),O=null):O?O.p(P,I):(O=Sd(P),O.c(),O.m(e,null));const F={};b.$set(F)},i(P){y||(A(b.$$.fragment,P),y=!0)},o(P){L(b.$$.fragment,P),y=!1},d(P){P&&k(e);for(let I=0;I<d.length;I+=1)d[I].d();M&&M.d(),O&&O.d(),P&&k(v),n[13](null),j(b,P),$=!1,Je(C)}}}function $C(n,e,t){let i,s,l,o,r,a;at(n,hi,y=>t(5,o=y)),at(n,As,y=>t(8,r=y)),at(n,us,y=>t(6,a=y));let u,f="";function c(y){nn(hi,o=y,o)}const d=()=>t(0,f="");function h(){f=this.value,t(0,f)}const g=y=>c(y),v=()=>u==null?void 0:u.show();function b(y){me[y?"unshift":"push"](()=>{u=y,t(2,u)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=f.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=f!==""),n.$$.dirty&259&&t(3,l=r.filter(y=>y.name!="profiles"&&(y.id==f||y.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[f,i,u,l,s,o,a,c,r,d,h,g,v,b]}class SC extends Ee{constructor(e){super(),Oe(this,e,$C,wC,De,{})}}function CC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te,K,ke,ae,W,_e,He,Ue,X,ge,ce,we,Ge;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
<code><span class="txt-success">OPERAND</span>
<span class="txt-danger">OPERATOR</span>
<span class="txt-success">OPERAND</span></code>, where:`,t=D(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
quoted), number, null, true, false`,l=D(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=N(` - is one of:
`),u=_("br"),f=D(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=D(),v=_("span"),v.textContent="Equal",b=D(),y=_("li"),$=_("code"),$.textContent="!=",C=D(),S=_("span"),S.textContent="NOT equal",T=D(),M=_("li"),O=_("code"),O.textContent=">",E=D(),P=_("span"),P.textContent="Greater than",I=D(),F=_("li"),z=_("code"),z.textContent=">=",Q=D(),ne=_("span"),ne.textContent="Greater than or equal",G=D(),ee=_("li"),U=_("code"),U.textContent="<",Y=D(),Z=_("span"),Z.textContent="Less than or equal",de=D(),x=_("li"),oe=_("code"),oe.textContent="<=",Ce=D(),Te=_("span"),Te.textContent="Less than or equal",K=D(),ke=_("li"),ae=_("code"),ae.textContent="~",W=D(),_e=_("span"),_e.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
match)`,He=D(),Ue=_("li"),X=_("code"),X.textContent="!~",ge=D(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,we=D(),Ge=_("p"),Ge.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p($,"class","filter-op svelte-1w7s5nw"),p(S,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(P,"class","txt-hint"),p(z,"class","filter-op svelte-1w7s5nw"),p(ne,"class","txt-hint"),p(U,"class","filter-op svelte-1w7s5nw"),p(Z,"class","txt-hint"),p(oe,"class","filter-op svelte-1w7s5nw"),p(Te,"class","txt-hint"),p(ae,"class","filter-op svelte-1w7s5nw"),p(_e,"class","txt-hint"),p(X,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint")},m(et,Ke){w(et,e,Ke),w(et,t,Ke),w(et,i,Ke),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,h),m(d,g),m(d,v),m(c,b),m(c,y),m(y,$),m(y,C),m(y,S),m(c,T),m(c,M),m(M,O),m(M,E),m(M,P),m(c,I),m(c,F),m(F,z),m(F,Q),m(F,ne),m(c,G),m(c,ee),m(ee,U),m(ee,Y),m(ee,Z),m(c,de),m(c,x),m(x,oe),m(x,Ce),m(x,Te),m(c,K),m(c,ke),m(ke,ae),m(ke,W),m(ke,_e),m(c,He),m(c,Ue),m(Ue,X),m(Ue,ge),m(Ue,ce),w(et,we,Ke),w(et,Ge,Ke)},p:se,i:se,o:se,d(et){et&&k(e),et&&k(t),et&&k(i),et&&k(we),et&&k(Ge)}}}class MC extends Ee{constructor(e){super(),Oe(this,e,null,CC,De,{})}}function Cd(n,e,t){const i=n.slice();return i[5]=e[t],i}function Md(n,e,t){const i=n.slice();return i[5]=e[t],i}function Td(n,e){let t,i,s=e[5].title+"",l,o,r,a;function u(){return e[4](e[5])}return{key:n,first:null,c(){t=_("button"),i=_("div"),l=N(s),o=D(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),te(t,"active",e[0]===e[5].language),this.first=t},m(f,c){w(f,t,c),m(t,i),m(i,l),m(t,o),r||(a=J(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ue(l,s),c&3&&te(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function Dd(n,e){let t,i,s,l;return i=new _n({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item svelte-1maocj6"),te(t,"active",e[0]===e[5].language),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),(!l||r&3)&&te(t,"active",e[0]===e[5].language)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function TC(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=g=>g[5].language;for(let g=0;g<f.length;g+=1){let v=Md(n,f,g),b=c(v);s.set(b,i[g]=Td(b,v))}let d=n[1];const h=g=>g[5].language;for(let g=0;g<d.length;g+=1){let v=Cd(n,d,g),b=h(v);a.set(b,r[g]=Dd(b,v))}return{c(){e=_("div"),t=_("div");for(let g=0;g<i.length;g+=1)i[g].c();l=D(),o=_("div");for(let g=0;g<r.length;g+=1)r[g].c();p(t,"class","tabs-header compact left"),p(o,"class","tabs-content"),p(e,"class","tabs sdk-tabs m-b-lg svelte-1maocj6")},m(g,v){w(g,e,v),m(e,t);for(let b=0;b<i.length;b+=1)i[b].m(t,null);m(e,l),m(e,o);for(let b=0;b<r.length;b+=1)r[b].m(o,null);u=!0},p(g,[v]){v&3&&(f=g[1],i=_t(i,v,c,1,g,f,s,t,bn,Td,null,Md)),v&3&&(d=g[1],Ae(),r=_t(r,v,h,1,g,d,a,o,Gt,Dd,null,Cd),Pe())},i(g){if(!u){for(let v=0;v<d.length;v+=1)A(r[v]);u=!0}},o(g){for(let v=0;v<r.length;v+=1)L(r[v]);u=!1},d(g){g&&k(e);for(let v=0;v<i.length;v+=1)i[v].d();for(let v=0;v<r.length;v+=1)r[v].d()}}}const Od="pb_sdk_preference";function DC(n,e,t){let i,{js:s=""}=e,{dart:l=""}=e,o=localStorage.getItem(Od)||"javascript";const r=a=>t(0,o=a.language);return n.$$set=a=>{"js"in a&&t(2,s=a.js),"dart"in a&&t(3,l=a.dart)},n.$$.update=()=>{n.$$.dirty&1&&o&&localStorage.setItem(Od,o),n.$$.dirty&12&&t(1,i=[{title:"JavaScript",language:"javascript",content:s},{title:"Dart",language:"dart",content:l}])},[o,i,s,l,r]}class Hs extends Ee{constructor(e){super(),Oe(this,e,DC,TC,De,{js:2,dart:3})}}function Ed(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[6]=e[t],i}function Pd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ld(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("div"),s=N(i),l=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&20&&te(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Id(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,(!l||r&20)&&te(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function OC(n){var gi,Ll,ms,Il;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",$,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te,K,ke,ae,W,_e,He,Ue,X,ge,ce,we,Ge,et,Ke,nt,Me,ze,Xe,it,ct,be,Fe,dt,Dt,pt,lt,Lt,bt,Ft,Ot,Ze,$e,Be,ot,rt,Ht,Ct,ft,en,R,V,ie,re=[],Le=new Map,le,pe,ve=[],fe=new Map,he,Ie=n[1]&&Pd();O=new Hs({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
// fetch a paginated records list
const resultList = await client.records.getList('${(gi=n[0])==null?void 0:gi.name}', 1, 50, {
filter: 'created >= "2022-01-01 00:00:00"',
});
// alternatively you can also fetch all records at once via getFullList:
const records = await client.records.getFullList('${(Ll=n[0])==null?void 0:Ll.name}', 200 /* batch size */, {
sort: '-created',
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
// fetch a paginated records list
final result = await client.records.getList(
'${(ms=n[0])==null?void 0:ms.name}',
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00"',
);
// alternatively you can also fetch all records at once via getFullList:
final records = await client.records.getFullList('${(Il=n[0])==null?void 0:Il.name}', batch: 200, sort: '-created');
`}}),X=new _n({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}}),ze=new _n({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),it=new MC({}),bt=new _n({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let mt=n[4];const un=qe=>qe[6].code;for(let qe=0;qe<mt.length;qe+=1){let xe=Ad(n,mt,qe),Xt=un(xe);Le.set(Xt,re[qe]=Ld(Xt,xe))}let jt=n[4];const Di=qe=>qe[6].code;for(let qe=0;qe<jt.length;qe+=1){let xe=Ed(n,jt,qe),Xt=Di(xe);fe.set(Xt,ve[qe]=Id(Xt,xe))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=D(),Ie&&Ie.c(),d=D(),h=_("div"),g=_("p"),v=N("Fetch a paginated "),b=_("strong"),$=N(y),C=N(" records list."),S=D(),T=_("div"),T.textContent="Client SDKs example",M=D(),q(O.$$.fragment),E=D(),P=_("div"),P.textContent="Query parameters",I=D(),F=_("table"),z=_("thead"),z.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Q=D(),ne=_("tbody"),G=_("tr"),G.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,ee=D(),U=_("tr"),U.innerHTML=`<td>perPage</td>
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,Y=D(),Z=_("tr"),de=_("td"),de.textContent="sort",x=D(),oe=_("td"),oe.innerHTML='<span class="label">String</span>',Ce=D(),Te=_("td"),K=N("Specify the records order attribute(s). "),ke=_("br"),ae=N(`
Add `),W=_("code"),W.textContent="-",_e=N(" / "),He=_("code"),He.textContent="+",Ue=N(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),q(X.$$.fragment),ge=D(),ce=_("tr"),we=_("td"),we.textContent="filter",Ge=D(),et=_("td"),et.innerHTML='<span class="label">String</span>',Ke=D(),nt=_("td"),Me=N(`Filter the returned records. Ex.:
`),q(ze.$$.fragment),Xe=D(),q(it.$$.fragment),ct=D(),be=_("tr"),Fe=_("td"),Fe.textContent="expand",dt=D(),Dt=_("td"),Dt.innerHTML='<span class="label">String</span>',pt=D(),lt=_("td"),Lt=N(`Auto expand record relations. Ex.:
`),q(bt.$$.fragment),Ft=N(`
Supports up to 6-levels depth nested relations expansion. `),Ot=_("br"),Ze=N(`
The expanded relations will be appended to each individual record under the
`),$e=_("code"),$e.textContent="@expand",Be=N(" property (eg. "),ot=_("code"),ot.textContent='"@expand": {"rel1": {...}, ...}',rt=N(`). Only the
relations that the user has permissions to `),Ht=_("strong"),Ht.textContent="view",Ct=N(" will be expanded."),ft=D(),en=_("div"),en.textContent="Responses",R=D(),V=_("div"),ie=_("div");for(let qe=0;qe<re.length;qe+=1)re[qe].c();le=D(),pe=_("div");for(let qe=0;qe<ve.length;qe+=1)ve[qe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(T,"class","section-title"),p(P,"class","section-title"),p(F,"class","table-compact table-border m-b-lg"),p(en,"class","section-title"),p(ie,"class","tabs-header compact left"),p(pe,"class","tabs-content"),p(V,"class","tabs")},m(qe,xe){w(qe,e,xe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),Ie&&Ie.m(e,null),w(qe,d,xe),w(qe,h,xe),m(h,g),m(g,v),m(g,b),m(b,$),m(g,C),w(qe,S,xe),w(qe,T,xe),w(qe,M,xe),H(O,qe,xe),w(qe,E,xe),w(qe,P,xe),w(qe,I,xe),w(qe,F,xe),m(F,z),m(F,Q),m(F,ne),m(ne,G),m(ne,ee),m(ne,U),m(ne,Y),m(ne,Z),m(Z,de),m(Z,x),m(Z,oe),m(Z,Ce),m(Z,Te),m(Te,K),m(Te,ke),m(Te,ae),m(Te,W),m(Te,_e),m(Te,He),m(Te,Ue),H(X,Te,null),m(ne,ge),m(ne,ce),m(ce,we),m(ce,Ge),m(ce,et),m(ce,Ke),m(ce,nt),m(nt,Me),H(ze,nt,null),m(nt,Xe),H(it,nt,null),m(ne,ct),m(ne,be),m(be,Fe),m(be,dt),m(be,Dt),m(be,pt),m(be,lt),m(lt,Lt),H(bt,lt,null),m(lt,Ft),m(lt,Ot),m(lt,Ze),m(lt,$e),m(lt,Be),m(lt,ot),m(lt,rt),m(lt,Ht),m(lt,Ct),w(qe,ft,xe),w(qe,en,xe),w(qe,R,xe),w(qe,V,xe),m(V,ie);for(let Xt=0;Xt<re.length;Xt+=1)re[Xt].m(ie,null);m(V,le),m(V,pe);for(let Xt=0;Xt<ve.length;Xt+=1)ve[Xt].m(pe,null);he=!0},p(qe,[xe]){var Nl,Fl,Rl,Hl;(!he||xe&1)&&a!==(a=qe[0].name+"")&&ue(u,a),qe[1]?Ie||(Ie=Pd(),Ie.c(),Ie.m(e,null)):Ie&&(Ie.d(1),Ie=null),(!he||xe&1)&&y!==(y=qe[0].name+"")&&ue($,y);const Xt={};xe&9&&(Xt.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${qe[3]}');
...
// fetch a paginated records list
const resultList = await client.records.getList('${(Nl=qe[0])==null?void 0:Nl.name}', 1, 50, {
filter: 'created >= "2022-01-01 00:00:00"',
});
// alternatively you can also fetch all records at once via getFullList:
const records = await client.records.getFullList('${(Fl=qe[0])==null?void 0:Fl.name}', 200 /* batch size */, {
sort: '-created',
});
`),xe&9&&(Xt.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${qe[3]}');
...
// fetch a paginated records list
final result = await client.records.getList(
'${(Rl=qe[0])==null?void 0:Rl.name}',
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00"',
);
// alternatively you can also fetch all records at once via getFullList:
final records = await client.records.getFullList('${(Hl=qe[0])==null?void 0:Hl.name}', batch: 200, sort: '-created');
`),O.$set(Xt),xe&20&&(mt=qe[4],re=_t(re,xe,un,1,qe,mt,Le,ie,bn,Ld,null,Ad)),xe&20&&(jt=qe[4],Ae(),ve=_t(ve,xe,Di,1,qe,jt,fe,pe,Gt,Id,null,Ed),Pe())},i(qe){if(!he){A(O.$$.fragment,qe),A(X.$$.fragment,qe),A(ze.$$.fragment,qe),A(it.$$.fragment,qe),A(bt.$$.fragment,qe);for(let xe=0;xe<jt.length;xe+=1)A(ve[xe]);he=!0}},o(qe){L(O.$$.fragment,qe),L(X.$$.fragment,qe),L(ze.$$.fragment,qe),L(it.$$.fragment,qe),L(bt.$$.fragment,qe);for(let xe=0;xe<ve.length;xe+=1)L(ve[xe]);he=!1},d(qe){qe&&k(e),Ie&&Ie.d(),qe&&k(d),qe&&k(h),qe&&k(S),qe&&k(T),qe&&k(M),j(O,qe),qe&&k(E),qe&&k(P),qe&&k(I),qe&&k(F),j(X),j(ze),j(it),j(bt),qe&&k(ft),qe&&k(en),qe&&k(R),qe&&k(V);for(let xe=0;xe<re.length;xe+=1)re[xe].d();for(let xe=0;xe<ve.length;xe+=1)ve[xe].d()}}}function EC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[B.dummyCollectionRecord(l),B.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:`
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=B.getApiExampleUrl(ye.baseUrl)),[l,i,o,s,r,a]}class AC extends Ee{constructor(e){super(),Oe(this,e,EC,OC,De,{collection:0})}}function Nd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Fd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Hd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&20&&te(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function jd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,(!l||r&20)&&te(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function PC(n){var Ot,Ze;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te,K,ke,ae,W,_e,He,Ue,X,ge,ce,we,Ge,et,Ke,nt,Me,ze,Xe=[],it=new Map,ct,be,Fe=[],dt=new Map,Dt,pt=n[1]&&Rd();E=new Hs({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const record = await client.records.getOne('${(Ot=n[0])==null?void 0:Ot.name}', 'RECORD_ID', {
expand: 'some_relation'
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final record = await client.records.getOne('${(Ze=n[0])==null?void 0:Ze.name}', 'RECORD_ID', query: {
'expand': 'some_relation',
});
`}}),ae=new _n({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let lt=n[4];const Lt=$e=>$e[6].code;for(let $e=0;$e<lt.length;$e+=1){let Be=Fd(n,lt,$e),ot=Lt(Be);it.set(ot,Xe[$e]=Hd(ot,Be))}let bt=n[4];const Ft=$e=>$e[6].code;for(let $e=0;$e<bt.length;$e+=1){let Be=Nd(n,bt,$e),ot=Ft(Be);dt.set(ot,Fe[$e]=jd(ot,Be))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),pt&&pt.c(),h=D(),g=_("div"),v=_("p"),b=N("Fetch a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("div"),M.textContent="Client SDKs example",O=D(),q(E.$$.fragment),P=D(),I=_("div"),I.textContent="Path Parameters",F=D(),z=_("table"),z.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to view.</td></tr></tbody>`,Q=D(),ne=_("div"),ne.textContent="Query parameters",G=D(),ee=_("table"),U=_("thead"),U.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Y=D(),Z=_("tbody"),de=_("tr"),x=_("td"),x.textContent="expand",oe=D(),Ce=_("td"),Ce.innerHTML='<span class="label">String</span>',Te=D(),K=_("td"),ke=N(`Auto expand record relations. Ex.:
`),q(ae.$$.fragment),W=N(`
Supports up to 6-levels depth nested relations expansion. `),_e=_("br"),He=N(`
The expanded relations will be appended to the record under the
`),Ue=_("code"),Ue.textContent="@expand",X=N(" property (eg. "),ge=_("code"),ge.textContent='"@expand": {"rel1": {...}, ...}',ce=N(`). Only the
relations that the user has permissions to `),we=_("strong"),we.textContent="view",Ge=N(" will be expanded."),et=D(),Ke=_("div"),Ke.textContent="Responses",nt=D(),Me=_("div"),ze=_("div");for(let $e=0;$e<Xe.length;$e+=1)Xe[$e].c();ct=D(),be=_("div");for(let $e=0;$e<Fe.length;$e+=1)Fe[$e].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(g,"class","content m-b-base"),p(M,"class","section-title"),p(I,"class","section-title"),p(z,"class","table-compact table-border m-b-lg"),p(ne,"class","section-title"),p(ee,"class","table-compact table-border m-b-lg"),p(Ke,"class","section-title"),p(ze,"class","tabs-header compact left"),p(be,"class","tabs-content"),p(Me,"class","tabs")},m($e,Be){w($e,e,Be),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),pt&&pt.m(e,null),w($e,h,Be),w($e,g,Be),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),w($e,T,Be),w($e,M,Be),w($e,O,Be),H(E,$e,Be),w($e,P,Be),w($e,I,Be),w($e,F,Be),w($e,z,Be),w($e,Q,Be),w($e,ne,Be),w($e,G,Be),w($e,ee,Be),m(ee,U),m(ee,Y),m(ee,Z),m(Z,de),m(de,x),m(de,oe),m(de,Ce),m(de,Te),m(de,K),m(K,ke),H(ae,K,null),m(K,W),m(K,_e),m(K,He),m(K,Ue),m(K,X),m(K,ge),m(K,ce),m(K,we),m(K,Ge),w($e,et,Be),w($e,Ke,Be),w($e,nt,Be),w($e,Me,Be),m(Me,ze);for(let ot=0;ot<Xe.length;ot+=1)Xe[ot].m(ze,null);m(Me,ct),m(Me,be);for(let ot=0;ot<Fe.length;ot+=1)Fe[ot].m(be,null);Dt=!0},p($e,[Be]){var rt,Ht;(!Dt||Be&1)&&a!==(a=$e[0].name+"")&&ue(u,a),$e[1]?pt||(pt=Rd(),pt.c(),pt.m(e,null)):pt&&(pt.d(1),pt=null),(!Dt||Be&1)&&$!==($=$e[0].name+"")&&ue(C,$);const ot={};Be&9&&(ot.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${$e[3]}');
...
const record = await client.records.getOne('${(rt=$e[0])==null?void 0:rt.name}', 'RECORD_ID', {
expand: 'some_relation'
});
`),Be&9&&(ot.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${$e[3]}');
...
final record = await client.records.getOne('${(Ht=$e[0])==null?void 0:Ht.name}', 'RECORD_ID', query: {
'expand': 'some_relation',
});
`),E.$set(ot),Be&20&&(lt=$e[4],Xe=_t(Xe,Be,Lt,1,$e,lt,it,ze,bn,Hd,null,Fd)),Be&20&&(bt=$e[4],Ae(),Fe=_t(Fe,Be,Ft,1,$e,bt,dt,be,Gt,jd,null,Nd),Pe())},i($e){if(!Dt){A(E.$$.fragment,$e),A(ae.$$.fragment,$e);for(let Be=0;Be<bt.length;Be+=1)A(Fe[Be]);Dt=!0}},o($e){L(E.$$.fragment,$e),L(ae.$$.fragment,$e);for(let Be=0;Be<Fe.length;Be+=1)L(Fe[Be]);Dt=!1},d($e){$e&&k(e),pt&&pt.d(),$e&&k(h),$e&&k(g),$e&&k(T),$e&&k(M),$e&&k(O),j(E,$e),$e&&k(P),$e&&k(I),$e&&k(F),$e&&k(z),$e&&k(Q),$e&&k(ne),$e&&k(G),$e&&k(ee),j(ae),$e&&k(et),$e&&k(Ke),$e&&k(nt),$e&&k(Me);for(let Be=0;Be<Xe.length;Be+=1)Xe[Be].d();for(let Be=0;Be<Fe.length;Be+=1)Fe[Be].d()}}}function LC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=B.getApiExampleUrl(ye.baseUrl)),[l,i,o,s,r,a]}class IC extends Ee{constructor(e){super(),Oe(this,e,LC,PC,De,{collection:0})}}function qd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Vd(n,e,t){const i=n.slice();return i[6]=e[t],i}function zd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Bd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function NC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function FC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function RC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function HC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function jC(n){let e,t,i,s,l;return{c(){e=N("File object."),t=_("br"),i=N(`
Set to `),s=_("code"),s.textContent="null",l=N(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function qC(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function VC(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function zC(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function BC(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function UC(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Ud(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=B.getFieldValueType(e[11])+"",h,g,v,b;function y(O,E){return O[11].required?FC:NC}let $=y(e),C=$(e);function S(O,E){if(O[11].type==="text")return UC;if(O[11].type==="number")return BC;if(O[11].type==="json")return zC;if(O[11].type==="email")return VC;if(O[11].type==="url")return qC;if(O[11].type==="file")return jC;if(O[11].type==="relation")return HC;if(O[11].type==="user")return RC}let T=S(e),M=T&&T(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=D(),o=_("span"),a=N(r),u=D(),f=_("td"),c=_("span"),h=N(d),g=D(),v=_("td"),M&&M.c(),b=D(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),m(t,i),m(i,s),C.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),M&&M.m(v,null),m(t,b)},p(O,E){e=O,$!==($=y(e))&&(C.d(1),C=$(e),C&&(C.c(),C.m(s,l))),E&1&&r!==(r=e[11].name+"")&&ue(a,r),E&1&&d!==(d=B.getFieldValueType(e[11])+"")&&ue(h,d),T===(T=S(e))&&M?M.p(e,E):(M&&M.d(1),M=T&&T(e),M&&(M.c(),M.m(v,null)))},d(O){O&&k(t),C.d(),M&&M.d()}}}function Wd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),te(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&te(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Yd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),te(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),(!l||r&6)&&te(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function WC(n){var ie,re,Le;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",$,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x=[],oe=new Map,Ce,Te,K,ke,ae,W,_e,He,Ue,X,ge,ce,we,Ge,et,Ke,nt,Me,ze,Xe,it,ct,be,Fe,dt,Dt,pt,lt,Lt,bt=[],Ft=new Map,Ot,Ze,$e=[],Be=new Map,ot,rt=n[4]&&Bd();F=new Hs({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const data = { ... };
const record = await client.records.create('${(ie=n[0])==null?void 0:ie.name}', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.create('${(re=n[0])==null?void 0:re.name}', body: body);
`}});let Ht=(Le=n[0])==null?void 0:Le.schema;const Ct=le=>le[11].name;for(let le=0;le<Ht.length;le+=1){let pe=zd(n,Ht,le),ve=Ct(pe);oe.set(ve,x[le]=Ud(ve,pe))}et=new _n({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let ft=n[2];const en=le=>le[6].code;for(let le=0;le<ft.length;le+=1){let pe=Vd(n,ft,le),ve=en(pe);Ft.set(ve,bt[le]=Wd(ve,pe))}let R=n[2];const V=le=>le[6].code;for(let le=0;le<R.length;le+=1){let pe=qd(n,R,le),ve=V(pe);Be.set(ve,$e[le]=Yd(ve,pe))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=D(),rt&&rt.c(),d=D(),h=_("div"),g=_("p"),v=N("Create a new "),b=_("strong"),$=N(y),C=N(" record."),S=D(),T=_("p"),T.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,M=D(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",E=D(),P=_("div"),P.textContent="Client SDKs example",I=D(),q(F.$$.fragment),z=D(),Q=_("div"),Q.textContent="Body Parameters",ne=D(),G=_("table"),ee=_("thead"),ee.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,U=D(),Y=_("tbody"),Z=_("tr"),Z.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
<span>id</span></div></td>
<td><span class="label">String</span></td>
<td><strong>15 characters string</strong> to store as record ID.
<br/>
If not set, it will be auto generated.</td>`,de=D();for(let le=0;le<x.length;le+=1)x[le].c();Ce=D(),Te=_("div"),Te.textContent="Query parameters",K=D(),ke=_("table"),ae=_("thead"),ae.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,W=D(),_e=_("tbody"),He=_("tr"),Ue=_("td"),Ue.textContent="expand",X=D(),ge=_("td"),ge.innerHTML='<span class="label">String</span>',ce=D(),we=_("td"),Ge=N(`Auto expand relations when returning the created record. Ex.:
`),q(et.$$.fragment),Ke=N(`
Supports up to 6-levels depth nested relations expansion. `),nt=_("br"),Me=N(`
The expanded relations will be appended to the record under the
`),ze=_("code"),ze.textContent="@expand",Xe=N(" property (eg. "),it=_("code"),it.textContent='"@expand": {"rel1": {...}, ...}',ct=N(`). Only the
relations that the user has permissions to `),be=_("strong"),be.textContent="view",Fe=N(" will be expanded."),dt=D(),Dt=_("div"),Dt.textContent="Responses",pt=D(),lt=_("div"),Lt=_("div");for(let le=0;le<bt.length;le+=1)bt[le].c();Ot=D(),Ze=_("div");for(let le=0;le<$e.length;le+=1)$e[le].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(P,"class","section-title"),p(Q,"class","section-title"),p(G,"class","table-compact table-border m-b-lg"),p(Te,"class","section-title"),p(ke,"class","table-compact table-border m-b-lg"),p(Dt,"class","section-title"),p(Lt,"class","tabs-header compact left"),p(Ze,"class","tabs-content"),p(lt,"class","tabs")},m(le,pe){w(le,e,pe),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),rt&&rt.m(e,null),w(le,d,pe),w(le,h,pe),m(h,g),m(g,v),m(g,b),m(b,$),m(g,C),m(h,S),m(h,T),m(h,M),m(h,O),w(le,E,pe),w(le,P,pe),w(le,I,pe),H(F,le,pe),w(le,z,pe),w(le,Q,pe),w(le,ne,pe),w(le,G,pe),m(G,ee),m(G,U),m(G,Y),m(Y,Z),m(Y,de);for(let ve=0;ve<x.length;ve+=1)x[ve].m(Y,null);w(le,Ce,pe),w(le,Te,pe),w(le,K,pe),w(le,ke,pe),m(ke,ae),m(ke,W),m(ke,_e),m(_e,He),m(He,Ue),m(He,X),m(He,ge),m(He,ce),m(He,we),m(we,Ge),H(et,we,null),m(we,Ke),m(we,nt),m(we,Me),m(we,ze),m(we,Xe),m(we,it),m(we,ct),m(we,be),m(we,Fe),w(le,dt,pe),w(le,Dt,pe),w(le,pt,pe),w(le,lt,pe),m(lt,Lt);for(let ve=0;ve<bt.length;ve+=1)bt[ve].m(Lt,null);m(lt,Ot),m(lt,Ze);for(let ve=0;ve<$e.length;ve+=1)$e[ve].m(Ze,null);ot=!0},p(le,[pe]){var fe,he,Ie;(!ot||pe&1)&&a!==(a=le[0].name+"")&&ue(u,a),le[4]?rt||(rt=Bd(),rt.c(),rt.m(e,null)):rt&&(rt.d(1),rt=null),(!ot||pe&1)&&y!==(y=le[0].name+"")&&ue($,y);const ve={};pe&9&&(ve.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${le[3]}');
...
const data = { ... };
const record = await client.records.create('${(fe=le[0])==null?void 0:fe.name}', data);
`),pe&9&&(ve.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${le[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.create('${(he=le[0])==null?void 0:he.name}', body: body);
`),F.$set(ve),pe&1&&(Ht=(Ie=le[0])==null?void 0:Ie.schema,x=_t(x,pe,Ct,1,le,Ht,oe,Y,bn,Ud,null,zd)),pe&6&&(ft=le[2],bt=_t(bt,pe,en,1,le,ft,Ft,Lt,bn,Wd,null,Vd)),pe&6&&(R=le[2],Ae(),$e=_t($e,pe,V,1,le,R,Be,Ze,Gt,Yd,null,qd),Pe())},i(le){if(!ot){A(F.$$.fragment,le),A(et.$$.fragment,le);for(let pe=0;pe<R.length;pe+=1)A($e[pe]);ot=!0}},o(le){L(F.$$.fragment,le),L(et.$$.fragment,le);for(let pe=0;pe<$e.length;pe+=1)L($e[pe]);ot=!1},d(le){le&&k(e),rt&&rt.d(),le&&k(d),le&&k(h),le&&k(E),le&&k(P),le&&k(I),j(F,le),le&&k(z),le&&k(Q),le&&k(ne),le&&k(G);for(let pe=0;pe<x.length;pe+=1)x[pe].d();le&&k(Ce),le&&k(Te),le&&k(K),le&&k(ke),j(et),le&&k(dt),le&&k(Dt),le&&k(pt),le&&k(lt);for(let pe=0;pe<bt.length;pe+=1)bt[pe].d();for(let pe=0;pe<$e.length;pe+=1)$e[pe].d()}}}function YC(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`}])},t(3,s=B.getApiExampleUrl(ye.baseUrl)),[l,o,r,s,i,a]}class KC extends Ee{constructor(e){super(),Oe(this,e,YC,WC,De,{collection:0})}}function Kd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Jd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Zd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Gd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function JC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ZC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function GC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function XC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function QC(n){let e,t,i,s,l;return{c(){e=N("File object."),t=_("br"),i=N(`
Set to `),s=_("code"),s.textContent="null",l=N(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function xC(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function e4(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function t4(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function n4(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function i4(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Xd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=B.getFieldValueType(e[11])+"",h,g,v,b;function y(O,E){return O[11].required?ZC:JC}let $=y(e),C=$(e);function S(O,E){if(O[11].type==="text")return i4;if(O[11].type==="number")return n4;if(O[11].type==="json")return t4;if(O[11].type==="email")return e4;if(O[11].type==="url")return xC;if(O[11].type==="file")return QC;if(O[11].type==="relation")return XC;if(O[11].type==="user")return GC}let T=S(e),M=T&&T(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=D(),o=_("span"),a=N(r),u=D(),f=_("td"),c=_("span"),h=N(d),g=D(),v=_("td"),M&&M.c(),b=D(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),m(t,i),m(i,s),C.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),M&&M.m(v,null),m(t,b)},p(O,E){e=O,$!==($=y(e))&&(C.d(1),C=$(e),C&&(C.c(),C.m(s,l))),E&1&&r!==(r=e[11].name+"")&&ue(a,r),E&1&&d!==(d=B.getFieldValueType(e[11])+"")&&ue(h,d),T===(T=S(e))&&M?M.p(e,E):(M&&M.d(1),M=T&&T(e),M&&(M.c(),M.m(v,null)))},d(O){O&&k(t),C.d(),M&&M.d()}}}function Qd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),te(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&te(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function xd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),te(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),(!l||r&6)&&te(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function s4(n){var le,pe,ve;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te=[],K=new Map,ke,ae,W,_e,He,Ue,X,ge,ce,we,Ge,et,Ke,nt,Me,ze,Xe,it,ct,be,Fe,dt,Dt,pt,lt,Lt,bt,Ft,Ot,Ze=[],$e=new Map,Be,ot,rt=[],Ht=new Map,Ct,ft=n[4]&&Gd();z=new Hs({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const data = { ... };
const record = await client.records.update('${(le=n[0])==null?void 0:le.name}', 'RECORD_ID', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.update('${(pe=n[0])==null?void 0:pe.name}', 'RECORD_ID', body: body);
`}});let en=(ve=n[0])==null?void 0:ve.schema;const R=fe=>fe[11].name;for(let fe=0;fe<en.length;fe+=1){let he=Zd(n,en,fe),Ie=R(he);K.set(Ie,Te[fe]=Xd(Ie,he))}Me=new _n({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let V=n[2];const ie=fe=>fe[6].code;for(let fe=0;fe<V.length;fe+=1){let he=Jd(n,V,fe),Ie=ie(he);$e.set(Ie,Ze[fe]=Qd(Ie,he))}let re=n[2];const Le=fe=>fe[6].code;for(let fe=0;fe<re.length;fe+=1){let he=Kd(n,re,fe),Ie=Le(he);Ht.set(Ie,rt[fe]=xd(Ie,he))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),ft&&ft.c(),h=D(),g=_("div"),v=_("p"),b=N("Update a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,O=D(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",P=D(),I=_("div"),I.textContent="Client SDKs example",F=D(),q(z.$$.fragment),Q=D(),ne=_("div"),ne.textContent="Path parameters",G=D(),ee=_("table"),ee.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to update.</td></tr></tbody>`,U=D(),Y=_("div"),Y.textContent="Body Parameters",Z=D(),de=_("table"),x=_("thead"),x.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,oe=D(),Ce=_("tbody");for(let fe=0;fe<Te.length;fe+=1)Te[fe].c();ke=D(),ae=_("div"),ae.textContent="Query parameters",W=D(),_e=_("table"),He=_("thead"),He.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,Ue=D(),X=_("tbody"),ge=_("tr"),ce=_("td"),ce.textContent="expand",we=D(),Ge=_("td"),Ge.innerHTML='<span class="label">String</span>',et=D(),Ke=_("td"),nt=N(`Auto expand relations when returning the updated record. Ex.:
`),q(Me.$$.fragment),ze=N(`
Supports up to 6-levels depth nested relations expansion. `),Xe=_("br"),it=N(`
The expanded relations will be appended to the record under the
`),ct=_("code"),ct.textContent="@expand",be=N(" property (eg. "),Fe=_("code"),Fe.textContent='"@expand": {"rel1": {...}, ...}',dt=N(`). Only the
relations that the user has permissions to `),Dt=_("strong"),Dt.textContent="view",pt=N(" will be expanded."),lt=D(),Lt=_("div"),Lt.textContent="Responses",bt=D(),Ft=_("div"),Ot=_("div");for(let fe=0;fe<Ze.length;fe+=1)Ze[fe].c();Be=D(),ot=_("div");for(let fe=0;fe<rt.length;fe+=1)rt[fe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(I,"class","section-title"),p(ne,"class","section-title"),p(ee,"class","table-compact table-border m-b-lg"),p(Y,"class","section-title"),p(de,"class","table-compact table-border m-b-lg"),p(ae,"class","section-title"),p(_e,"class","table-compact table-border m-b-lg"),p(Lt,"class","section-title"),p(Ot,"class","tabs-header compact left"),p(ot,"class","tabs-content"),p(Ft,"class","tabs")},m(fe,he){w(fe,e,he),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),ft&&ft.m(e,null),w(fe,h,he),w(fe,g,he),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),m(g,T),m(g,M),m(g,O),m(g,E),w(fe,P,he),w(fe,I,he),w(fe,F,he),H(z,fe,he),w(fe,Q,he),w(fe,ne,he),w(fe,G,he),w(fe,ee,he),w(fe,U,he),w(fe,Y,he),w(fe,Z,he),w(fe,de,he),m(de,x),m(de,oe),m(de,Ce);for(let Ie=0;Ie<Te.length;Ie+=1)Te[Ie].m(Ce,null);w(fe,ke,he),w(fe,ae,he),w(fe,W,he),w(fe,_e,he),m(_e,He),m(_e,Ue),m(_e,X),m(X,ge),m(ge,ce),m(ge,we),m(ge,Ge),m(ge,et),m(ge,Ke),m(Ke,nt),H(Me,Ke,null),m(Ke,ze),m(Ke,Xe),m(Ke,it),m(Ke,ct),m(Ke,be),m(Ke,Fe),m(Ke,dt),m(Ke,Dt),m(Ke,pt),w(fe,lt,he),w(fe,Lt,he),w(fe,bt,he),w(fe,Ft,he),m(Ft,Ot);for(let Ie=0;Ie<Ze.length;Ie+=1)Ze[Ie].m(Ot,null);m(Ft,Be),m(Ft,ot);for(let Ie=0;Ie<rt.length;Ie+=1)rt[Ie].m(ot,null);Ct=!0},p(fe,[he]){var mt,un,jt;(!Ct||he&1)&&a!==(a=fe[0].name+"")&&ue(u,a),fe[4]?ft||(ft=Gd(),ft.c(),ft.m(e,null)):ft&&(ft.d(1),ft=null),(!Ct||he&1)&&$!==($=fe[0].name+"")&&ue(C,$);const Ie={};he&9&&(Ie.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${fe[3]}');
...
const data = { ... };
const record = await client.records.update('${(mt=fe[0])==null?void 0:mt.name}', 'RECORD_ID', data);
`),he&9&&(Ie.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${fe[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.update('${(un=fe[0])==null?void 0:un.name}', 'RECORD_ID', body: body);
`),z.$set(Ie),he&1&&(en=(jt=fe[0])==null?void 0:jt.schema,Te=_t(Te,he,R,1,fe,en,K,Ce,bn,Xd,null,Zd)),he&6&&(V=fe[2],Ze=_t(Ze,he,ie,1,fe,V,$e,Ot,bn,Qd,null,Jd)),he&6&&(re=fe[2],Ae(),rt=_t(rt,he,Le,1,fe,re,Ht,ot,Gt,xd,null,Kd),Pe())},i(fe){if(!Ct){A(z.$$.fragment,fe),A(Me.$$.fragment,fe);for(let he=0;he<re.length;he+=1)A(rt[he]);Ct=!0}},o(fe){L(z.$$.fragment,fe),L(Me.$$.fragment,fe);for(let he=0;he<rt.length;he+=1)L(rt[he]);Ct=!1},d(fe){fe&&k(e),ft&&ft.d(),fe&&k(h),fe&&k(g),fe&&k(P),fe&&k(I),fe&&k(F),j(z,fe),fe&&k(Q),fe&&k(ne),fe&&k(G),fe&&k(ee),fe&&k(U),fe&&k(Y),fe&&k(Z),fe&&k(de);for(let he=0;he<Te.length;he+=1)Te[he].d();fe&&k(ke),fe&&k(ae),fe&&k(W),fe&&k(_e),j(Me),fe&&k(lt),fe&&k(Lt),fe&&k(bt),fe&&k(Ft);for(let he=0;he<Ze.length;he+=1)Ze[he].d();for(let he=0;he<rt.length;he+=1)rt[he].d()}}}function l4(n,e,t){let i,s,{collection:l=new dn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(B.dummyCollectionRecord(l),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}])},t(3,s=B.getApiExampleUrl(ye.baseUrl)),[l,o,r,s,i,a]}class o4 extends Ee{constructor(e){super(),Oe(this,e,l4,s4,De,{collection:0})}}function ep(n,e,t){const i=n.slice();return i[6]=e[t],i}function tp(n,e,t){const i=n.slice();return i[6]=e[t],i}function np(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ip(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=N(i),l=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=J(t,"click",a),o=!0)},p(u,f){e=u,f&20&&te(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function sp(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),q(i.$$.fragment),s=D(),p(t,"class","tab-item"),te(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),H(i,t,null),m(t,s),l=!0},p(o,r){e=o,(!l||r&20)&&te(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),j(i)}}}function r4(n){var He,Ue;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,$=n[0].name+"",C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y=[],Z=new Map,de,x,oe=[],Ce=new Map,Te,K=n[1]&&np();E=new Hs({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
await client.records.delete('${(He=n[0])==null?void 0:He.name}', 'RECORD_ID');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
await client.records.delete('${(Ue=n[0])==null?void 0:Ue.name}', 'RECORD_ID');
`}});let ke=n[4];const ae=X=>X[6].code;for(let X=0;X<ke.length;X+=1){let ge=tp(n,ke,X),ce=ae(ge);Z.set(ce,Y[X]=ip(ce,ge))}let W=n[4];const _e=X=>X[6].code;for(let X=0;X<W.length;X+=1){let ge=ep(n,W,X),ce=_e(ge);Ce.set(ce,oe[X]=sp(ce,ge))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=D(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=D(),K&&K.c(),h=D(),g=_("div"),v=_("p"),b=N("Delete a single "),y=_("strong"),C=N($),S=N(" record."),T=D(),M=_("div"),M.textContent="Client SDKs example",O=D(),q(E.$$.fragment),P=D(),I=_("div"),I.textContent="Path parameters",F=D(),z=_("table"),z.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to delete.</td></tr></tbody>`,Q=D(),ne=_("div"),ne.textContent="Responses",G=D(),ee=_("div"),U=_("div");for(let X=0;X<Y.length;X+=1)Y[X].c();de=D(),x=_("div");for(let X=0;X<oe.length;X+=1)oe[X].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(g,"class","content m-b-base"),p(M,"class","section-title"),p(I,"class","section-title"),p(z,"class","table-compact table-border m-b-lg"),p(ne,"class","section-title"),p(U,"class","tabs-header compact left"),p(x,"class","tabs-content"),p(ee,"class","tabs")},m(X,ge){w(X,e,ge),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),K&&K.m(e,null),w(X,h,ge),w(X,g,ge),m(g,v),m(v,b),m(v,y),m(y,C),m(v,S),w(X,T,ge),w(X,M,ge),w(X,O,ge),H(E,X,ge),w(X,P,ge),w(X,I,ge),w(X,F,ge),w(X,z,ge),w(X,Q,ge),w(X,ne,ge),w(X,G,ge),w(X,ee,ge),m(ee,U);for(let ce=0;ce<Y.length;ce+=1)Y[ce].m(U,null);m(ee,de),m(ee,x);for(let ce=0;ce<oe.length;ce+=1)oe[ce].m(x,null);Te=!0},p(X,[ge]){var we,Ge;(!Te||ge&1)&&a!==(a=X[0].name+"")&&ue(u,a),X[1]?K||(K=np(),K.c(),K.m(e,null)):K&&(K.d(1),K=null),(!Te||ge&1)&&$!==($=X[0].name+"")&&ue(C,$);const ce={};ge&9&&(ce.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${X[3]}');
...
await client.records.delete('${(we=X[0])==null?void 0:we.name}', 'RECORD_ID');
`),ge&9&&(ce.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${X[3]}');
...
await client.records.delete('${(Ge=X[0])==null?void 0:Ge.name}', 'RECORD_ID');
`),E.$set(ce),ge&20&&(ke=X[4],Y=_t(Y,ge,ae,1,X,ke,Z,U,bn,ip,null,tp)),ge&20&&(W=X[4],Ae(),oe=_t(oe,ge,_e,1,X,W,Ce,x,Gt,sp,null,ep),Pe())},i(X){if(!Te){A(E.$$.fragment,X);for(let ge=0;ge<W.length;ge+=1)A(oe[ge]);Te=!0}},o(X){L(E.$$.fragment,X);for(let ge=0;ge<oe.length;ge+=1)L(oe[ge]);Te=!1},d(X){X&&k(e),K&&K.d(),X&&k(h),X&&k(g),X&&k(T),X&&k(M),X&&k(O),j(E,X),X&&k(P),X&&k(I),X&&k(F),X&&k(z),X&&k(Q),X&&k(ne),X&&k(G),X&&k(ee);for(let ge=0;ge<Y.length;ge+=1)Y[ge].d();for(let ge=0;ge<oe.length;ge+=1)oe[ge].d()}}}function a4(n,e,t){let i,s,{collection:l=new dn}=e,o=204,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:204,body:`
null
`}),r.push({code:400,body:`
{
"code": 400,
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=B.getApiExampleUrl(ye.baseUrl)),[l,i,o,s,r,a]}class u4 extends Ee{constructor(e){super(),Oe(this,e,a4,r4,De,{collection:0})}}function f4(n){var h,g,v,b,y,$,C,S;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new Hs({props:{js:`
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(h=n[0])==null?void 0:h.name}', function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(g=n[0])==null?void 0:g.name}/RECORD_ID', function (e) {
console.log(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(v=n[0])==null?void 0:v.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(b=n[0])==null?void 0:b.name}/RECORD_ID') // remove only the record subscription
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(y=n[0])==null?void 0:y.name}', (e) {
print(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${($=n[0])==null?void 0:$.name}/RECORD_ID', (e) {
print(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(C=n[0])==null?void 0:C.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(S=n[0])==null?void 0:S.name}/RECORD_ID') // remove only the record subscription
`}}),c=new _n({props:{content:JSON.stringify({action:"create",record:B.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
<div class="content"><p>/api/realtime</p></div>`,t=D(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
<p>Events are sent for <strong>create</strong>, <strong>update</strong>
and <strong>delete</strong> record operations (see &quot;Event data format&quot; section below).</p>
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
<p>When you subscribe to a <strong>single record</strong>, the collection&#39;s
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p>
<p>When you subscribe to an <strong>entire collection</strong>, the collection&#39;s
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p></div></div>`,s=D(),l=_("div"),l.textContent="Client SDKs example",o=D(),q(r.$$.fragment),a=D(),u=_("div"),u.textContent="Event data format",f=D(),q(c.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(u,"class","section-title")},m(T,M){w(T,e,M),w(T,t,M),w(T,i,M),w(T,s,M),w(T,l,M),w(T,o,M),H(r,T,M),w(T,a,M),w(T,u,M),w(T,f,M),H(c,T,M),d=!0},p(T,[M]){var P,I,F,z,Q,ne,G,ee;const O={};M&3&&(O.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${T[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(P=T[0])==null?void 0:P.name}', function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(I=T[0])==null?void 0:I.name}/RECORD_ID', function (e) {
console.log(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(F=T[0])==null?void 0:F.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(z=T[0])==null?void 0:z.name}/RECORD_ID') // remove only the record subscription
`),M&3&&(O.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${T[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(Q=T[0])==null?void 0:Q.name}', (e) {
print(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(ne=T[0])==null?void 0:ne.name}/RECORD_ID', (e) {
print(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(G=T[0])==null?void 0:G.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(ee=T[0])==null?void 0:ee.name}/RECORD_ID') // remove only the record subscription
`),r.$set(O);const E={};M&1&&(E.content=JSON.stringify({action:"create",record:B.dummyCollectionRecord(T[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(E)},i(T){d||(A(r.$$.fragment,T),A(c.$$.fragment,T),d=!0)},o(T){L(r.$$.fragment,T),L(c.$$.fragment,T),d=!1},d(T){T&&k(e),T&&k(t),T&&k(i),T&&k(s),T&&k(l),T&&k(o),j(r,T),T&&k(a),T&&k(u),T&&k(f),j(c,T)}}}function c4(n,e,t){let i,{collection:s=new dn}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=B.getApiExampleUrl(ye.baseUrl)),[s,i]}class d4 extends Ee{constructor(e){super(),Oe(this,e,c4,f4,De,{collection:0})}}function lp(n,e,t){const i=n.slice();return i[14]=e[t],i}function op(n,e,t){const i=n.slice();return i[14]=e[t],i}function rp(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&q(t.$$.fragment),i=D(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&H(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Ae();const f=t;L(f.$$.fragment,1,0,()=>{j(f,1)}),Pe()}l?(t=new l(o(r)),q(t.$$.fragment),A(t.$$.fragment,1),H(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&L(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&j(t)}}}function ap(n,e){let t,i,s,l=e[4]===e[14].id&&rp(e);return{key:n,first:null,c(){t=We(),l&&l.c(),i=We(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=rp(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Ae(),L(l,1,1,()=>{l=null}),Pe())},i(o){s||(A(l),s=!0)},o(o){L(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function p4(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;r<l.length;r+=1){let a=lp(n,l,r),u=o(a);i.set(u,t[r]=ap(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","tabs-content")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],Ae(),t=_t(t,a,o,1,r,l,i,e,Gt,ap,null,lp),Pe())},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)L(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function up(n,e){let t,i,s=e[14].label+"",l,o,r,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=N(s),o=D(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),te(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),m(t,i),m(i,l),m(t,o),r||(a=[J(t,"click",u),J(t,"keydown",Bm(f))],r=!0)},p(c,d){e=c,d&48&&te(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,Je(a)}}}function h4(n){let e,t,i=n[3].name+"",s,l,o,r,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let h=op(n,f,d),g=c(h);u.set(g,a[d]=up(g,h))}return{c(){e=_("h4"),t=_("strong"),s=N(i),l=N(" records API"),o=D(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();p(r,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,s),m(e,l),w(d,o,h),w(d,r,h);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&ue(s,i),h&114&&(f=d[5],a=_t(a,h,c,1,d,f,u,r,bn,up,null,op))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let h=0;h<a.length;h+=1)a[h].d()}}}function m4(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[8]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function g4(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[m4],header:[h4],default:[p4]},$$scope:{ctx:n}};return e=new ui({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function _4(n,e,t){const i=[{id:"list",label:"List",component:AC},{id:"view",label:"View",component:IC},{id:"create",label:"Create",component:KC},{id:"update",label:"Update",component:o4},{id:"delete",label:"Delete",component:u4},{id:"realtime",label:"Realtime",component:d4}];let s,l=new dn,o=i[0].id;function r(y){return t(3,l=y),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(y){t(4,o=y)}function f(y,$){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u($))}const c=()=>a(),d=y=>u(y.id),h=(y,$)=>f($,y.id);function g(y){me[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){tt.call(this,n,y)}function b(y){tt.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,h,g,v,b]}class b4 extends Ee{constructor(e){super(),Oe(this,e,_4,g4,De,{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 v4(n){let e,t,i,s=[n[3]],l={};for(let o=0;o<s.length;o+=1)l=ut(l,s[o]);return{c(){e=_("textarea"),mi(e,l),te(e,"svelte-1x1pbts",!0)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[5](e),Se(e,n[0]),t||(i=[J(e,"input",n[6]),J(e,"keydown",n[2])],t=!0)},p(o,[r]){mi(e,l=pn(s,[r&8&&o[3]])),r&1&&Se(e,o[0]),te(e,"svelte-1x1pbts",!0)},i:se,o:se,d(o){o&&k(e),n[5](null),t=!1,Je(i)}}}function y4(n,e,t){const i=["value","maxHeight"];let s=Bt(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(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)){h.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Fn(()=>(u(),()=>clearTimeout(a)));function c(h){me[h?"unshift":"push"](()=>{r=h,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=ut(ut({},e),li(h)),t(3,s=Bt(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class k4 extends Ee{constructor(e){super(),Oe(this,e,y4,v4,De,{value:0,maxHeight:4})}}function w4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(v){n[2](v)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new k4({props:g}),me.push(()=>Re(f,"value",h)),{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),q(f.$$.fragment),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),H(f,v,b),d=!0},p(v,b){(!d||b&2&&i!==(i=B.getFieldTypeIcon(v[1].type)))&&p(t,"class",i),(!d||b&2)&&o!==(o=v[1].name+"")&&ue(r,o),(!d||b&8&&a!==(a=v[3]))&&p(e,"for",a);const y={};b&8&&(y.id=v[3]),b&2&&(y.required=v[1].required),!c&&b&1&&(c=!0,y.value=v[0],je(()=>c=!1)),f.$set(y)},i(v){d||(A(f.$$.fragment,v),d=!0)},o(v){L(f.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(u),j(f,v)}}}function $4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[w4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function S4(n,e,t){let{field:i=new Dn}=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 C4 extends Ee{constructor(e){super(),Oe(this,e,S4,$4,De,{field:1,value:0})}}function M4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,v,b;return{c(){var y,$;e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),f=_("input"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",h=(y=n[1].options)==null?void 0:y.min),p(f,"max",g=($=n[1].options)==null?void 0:$.max),p(f,"step","any")},m(y,$){w(y,e,$),m(e,t),m(e,s),m(e,l),m(l,r),w(y,u,$),w(y,f,$),Se(f,n[0]),v||(b=J(f,"input",n[2]),v=!0)},p(y,$){var C,S;$&2&&i!==(i=B.getFieldTypeIcon(y[1].type))&&p(t,"class",i),$&2&&o!==(o=y[1].name+"")&&ue(r,o),$&8&&a!==(a=y[3])&&p(e,"for",a),$&8&&c!==(c=y[3])&&p(f,"id",c),$&2&&d!==(d=y[1].required)&&(f.required=d),$&2&&h!==(h=(C=y[1].options)==null?void 0:C.min)&&p(f,"min",h),$&2&&g!==(g=(S=y[1].options)==null?void 0:S.max)&&p(f,"max",g),$&1&&Pt(f.value)!==y[0]&&Se(f,y[0])},d(y){y&&k(e),y&&k(u),y&&k(f),v=!1,b()}}}function T4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[M4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function D4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(){s=Pt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class O4 extends Ee{constructor(e){super(),Oe(this,e,D4,T4,De,{field:1,value:0})}}function E4(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=_("input"),i=D(),s=_("label"),o=N(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),m(s,o),a||(u=J(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&ue(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&k(e),f&&k(i),f&&k(s),a=!1,u()}}}function A4(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[E4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function P4(n,e,t){let{field:i=new Dn}=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 L4 extends Ee{constructor(e){super(),Oe(this,e,P4,A4,De,{field:1,value:0})}}function I4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),f=_("input"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Se(f,n[0]),h||(g=J(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=B.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&f.value!==v[0]&&Se(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function N4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[I4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function F4(n,e,t){let{field:i=new Dn}=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 R4 extends Ee{constructor(e){super(),Oe(this,e,F4,N4,De,{field:1,value:0})}}function H4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),f=_("input"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Se(f,n[0]),h||(g=J(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=B.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Se(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function j4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[H4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function q4(n,e,t){let{field:i=new Dn}=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 V4 extends Ee{constructor(e){super(),Oe(this,e,q4,j4,De,{field:1,value:0})}}function z4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h;function g(b){n[2](b)}let v={id:n[3],options:B.defaultFlatpickrOptions(),value:n[0]};return n[0]!==void 0&&(v.formattedValue=n[0]),c=new eu({props:v}),me.push(()=>Re(c,"formattedValue",g)),{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),a=N(" (UTC)"),f=D(),q(c.$$.fragment),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",u=n[3])},m(b,y){w(b,e,y),m(e,t),m(e,s),m(e,l),m(l,r),m(l,a),w(b,f,y),H(c,b,y),h=!0},p(b,y){(!h||y&2&&i!==(i=B.getFieldTypeIcon(b[1].type)))&&p(t,"class",i),(!h||y&2)&&o!==(o=b[1].name+"")&&ue(r,o),(!h||y&8&&u!==(u=b[3]))&&p(e,"for",u);const $={};y&8&&($.id=b[3]),y&1&&($.value=b[0]),!d&&y&1&&(d=!0,$.formattedValue=b[0],je(()=>d=!1)),c.$set($)},i(b){h||(A(c.$$.fragment,b),h=!0)},o(b){L(c.$$.fragment,b),h=!1},d(b){b&&k(e),b&&k(f),j(c,b)}}}function B4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[z4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function U4(n,e,t){let{field:i=new Dn}=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 W4 extends Ee{constructor(e){super(),Oe(this,e,U4,B4,De,{field:1,value:0})}}function fp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=N("Select up to "),s=N(i),l=N(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function Y4(n){var $,C,S;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v(T){n[3](T)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],items:($=n[1].options)==null?void 0:$.values,searchable:((C=n[1].options)==null?void 0:C.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new rb({props:b}),me.push(()=>Re(f,"selected",v));let y=((S=n[1].options)==null?void 0:S.maxSelect)>1&&fp(n);return{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),q(f.$$.fragment),d=D(),y&&y.c(),h=We(),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(T,M){w(T,e,M),m(e,t),m(e,s),m(e,l),m(l,r),w(T,u,M),H(f,T,M),w(T,d,M),y&&y.m(T,M),w(T,h,M),g=!0},p(T,M){var E,P,I;(!g||M&2&&i!==(i=B.getFieldTypeIcon(T[1].type)))&&p(t,"class",i),(!g||M&2)&&o!==(o=T[1].name+"")&&ue(r,o),(!g||M&16&&a!==(a=T[4]))&&p(e,"for",a);const O={};M&16&&(O.id=T[4]),M&6&&(O.toggle=!T[1].required||T[2]),M&4&&(O.multiple=T[2]),M&2&&(O.items=(E=T[1].options)==null?void 0:E.values),M&2&&(O.searchable=((P=T[1].options)==null?void 0:P.values)>5),!c&&M&1&&(c=!0,O.selected=T[0],je(()=>c=!1)),f.$set(O),((I=T[1].options)==null?void 0:I.maxSelect)>1?y?y.p(T,M):(y=fp(T),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(T){g||(A(f.$$.fragment,T),g=!0)},o(T){L(f.$$.fragment,T),g=!1},d(T){T&&k(e),T&&k(u),j(f,T),T&&k(d),y&&y.d(T),T&&k(h)}}}function K4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Y4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function J4(n,e,t){let i,{field:s=new Dn}=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 Z4 extends Ee{constructor(e){super(),Oe(this,e,J4,K4,De,{field:1,value:0})}}function G4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),f=_("textarea"),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"class","txt-mono")},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Se(f,n[0]),h||(g=J(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=B.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Se(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function X4(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[G4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Q4(n,e,t){let{field:i=new Dn}=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)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&typeof s!="string"&&s!==null&&t(0,s=JSON.stringify(s,null,2))},[s,i,l]}class x4 extends Ee{constructor(e){super(),Oe(this,e,Q4,X4,De,{field:1,value:0})}}function eM(n){let e,t;return{c(){e=_("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function tM(n){let e,t,i;return{c(){e=_("img"),ti(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!ti(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function nM(n){let e;function t(l,o){return l[2]?tM:eM}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(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:se,o:se,d(l){s.d(l),l&&k(e)}}}function iM(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),B.hasImageExtension(s==null?void 0:s.name)&&B.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 sM extends Ee{constructor(e){super(),Oe(this,e,iM,nM,De,{file:0,size:1})}}function lM(n){let e,t,i;return{c(){e=_("img"),ti(e.src,t=n[2])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&4&&!ti(e.src,t=s[2])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function oM(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=J(e,"click",Wt(n[0])),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function rM(n){let e,t=n[2].substring(n[2].lastIndexOf("/")+1)+"",i,s,l,o,r,a,u;return{c(){e=_("a"),i=N(t),s=D(),l=_("div"),o=D(),r=_("button"),r.textContent="Close",p(e,"href",n[2]),p(e,"title","Download"),p(e,"class","link-hint txt-ellipsis"),p(l,"class","flex-fill"),p(r,"type","button"),p(r,"class","btn btn-secondary")},m(f,c){w(f,e,c),m(e,i),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=J(r,"click",n[0]),a=!0)},p(f,c){c&4&&t!==(t=f[2].substring(f[2].lastIndexOf("/")+1)+"")&&ue(i,t),c&4&&p(e,"href",f[2])},d(f){f&&k(e),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,u()}}}function aM(n){let e,t,i={class:"image-preview",btnClose:!1,popup:!0,$$slots:{footer:[rM],header:[oM],default:[lM]},$$scope:{ctx:n}};return e=new ui({props:i}),n[4](e),e.$on("show",n[5]),e.$on("hide",n[6]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&132&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[4](null),j(e,s)}}}function uM(n,e,t){let i,s="";function l(f){f!==""&&(t(2,s=f),i==null||i.show())}function o(){return i==null?void 0:i.hide()}function r(f){me[f?"unshift":"push"](()=>{i=f,t(1,i)})}function a(f){tt.call(this,n,f)}function u(f){tt.call(this,n,f)}return[o,i,s,l,r,a,u]}class fM extends Ee{constructor(e){super(),Oe(this,e,uM,aM,De,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function cM(n){let e;return{c(){e=_("i"),p(e,"class","ri-file-line")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function dM(n){let e,t,i,s,l;return{c(){e=_("img"),ti(e.src,t=n[4])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),te(e,"link-fade",n[2])},m(o,r){w(o,e,r),s||(l=[J(e,"click",n[7]),J(e,"error",n[5])],s=!0)},p(o,r){r&16&&!ti(e.src,t=o[4])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i),r&4&&te(e,"link-fade",o[2])},d(o){o&&k(e),s=!1,Je(l)}}}function pM(n){let e,t,i;function s(a,u){return a[2]?dM:cM}let l=s(n),o=l(n),r={};return t=new fM({props:r}),n[8](t),{c(){o.c(),e=D(),q(t.$$.fragment)},m(a,u){o.m(a,u),w(a,e,u),H(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){L(t.$$.fragment,a),i=!1},d(a){o.d(a),a&&k(e),n[8](null),j(t,a)}}}function hM(n,e,t){let i,{record:s}=e,{filename:l}=e,o,r="",a="";function u(){t(4,r="")}const f=d=>{d.stopPropagation(),o==null||o.show(a)};function c(d){me[d?"unshift":"push"](()=>{o=d,t(3,o)})}return n.$$set=d=>{"record"in d&&t(6,s=d.record),"filename"in d&&t(0,l=d.filename)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=B.hasImageExtension(l)),n.$$.dirty&69&&i&&t(1,a=ye.records.getFileUrl(s,`${l}`)),n.$$.dirty&2&&t(4,r=a?a+"?thumb=100x100":"")},[l,a,i,o,r,u,s,f,c]}class cb extends Ee{constructor(e){super(),Oe(this,e,hM,pM,De,{record:6,filename:0})}}function cp(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function dp(n,e,t){const i=n.slice();return i[25]=e[t],i[24]=t,i}function mM(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-sm btn-circle btn-remove txt-hint")},m(l,o){w(l,e,o),t||(i=[Ye(gt.call(null,e,"Remove file")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Je(i)}}}function gM(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(l,o){w(l,e,o),t||(i=J(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function pp(n,e){let t,i,s,l,o,r=e[25]+"",a,u,f,c,d,h,g;s=new cb({props:{record:e[2],filename:e[25]}});function v($,C){return C&18&&(c=null),c==null&&(c=!!$[1].includes($[24])),c?gM:mM}let b=v(e,-1),y=b(e);return{key:n,first:null,c(){t=_("div"),i=_("figure"),q(s.$$.fragment),l=D(),o=_("a"),a=N(r),f=D(),y.c(),p(i,"class","thumb"),te(i,"fade",e[1].includes(e[24])),p(o,"href",u=ye.records.getFileUrl(e[2],e[25])),p(o,"class","filename link-hint"),p(o,"target","_blank"),p(o,"rel","noopener"),te(o,"txt-strikethrough",e[1].includes(e[24])),p(t,"class","list-item"),this.first=t},m($,C){w($,t,C),m(t,i),H(s,i,null),m(t,l),m(t,o),m(o,a),m(t,f),y.m(t,null),d=!0,h||(g=Ye(gt.call(null,o,{position:"right",text:"Download"})),h=!0)},p($,C){e=$;const S={};C&4&&(S.record=e[2]),C&16&&(S.filename=e[25]),s.$set(S),(!d||C&18)&&te(i,"fade",e[1].includes(e[24])),(!d||C&16)&&r!==(r=e[25]+"")&&ue(a,r),(!d||C&20&&u!==(u=ye.records.getFileUrl(e[2],e[25])))&&p(o,"href",u),(!d||C&18)&&te(o,"txt-strikethrough",e[1].includes(e[24])),b===(b=v(e,C))&&y?y.p(e,C):(y.d(1),y=b(e),y&&(y.c(),y.m(t,null)))},i($){d||(A(s.$$.fragment,$),d=!0)},o($){L(s.$$.fragment,$),d=!1},d($){$&&k(t),j(s),y.d(),h=!1,g()}}}function hp(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,h,g,v,b;i=new sM({props:{file:n[22]}});function y(){return n[15](n[24])}return{c(){e=_("div"),t=_("figure"),q(i.$$.fragment),s=D(),l=_("div"),o=_("small"),o.textContent="New",r=D(),a=_("span"),f=N(u),d=D(),h=_("button"),h.innerHTML='<i class="ri-close-line"></i>',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename"),p(l,"title",c=n[22].name),p(h,"type","button"),p(h,"class","btn btn-secondary btn-sm btn-circle btn-remove"),p(e,"class","list-item")},m($,C){w($,e,C),m(e,t),H(i,t,null),m(e,s),m(e,l),m(l,o),m(l,r),m(l,a),m(a,f),m(e,d),m(e,h),g=!0,v||(b=[Ye(gt.call(null,h,"Remove file")),J(h,"click",y)],v=!0)},p($,C){n=$;const S={};C&1&&(S.file=n[22]),i.$set(S),(!g||C&1)&&u!==(u=n[22].name+"")&&ue(f,u),(!g||C&1&&c!==(c=n[22].name))&&p(l,"title",c)},i($){g||(A(i.$$.fragment,$),g=!0)},o($){L(i.$$.fragment,$),g=!1},d($){$&&k(e),j(i),v=!1,Je(b)}}}function mp(n){let e,t,i,s,l,o;return{c(){e=_("div"),t=_("input"),i=D(),s=_("button"),s.innerHTML=`<i class="ri-upload-cloud-line"></i>
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[J(t,"change",n[17]),J(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,Je(o)}}}function _M(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,g,v,b=n[4];const y=M=>M[25];for(let M=0;M<b.length;M+=1){let O=dp(n,b,M),E=y(O);d.set(E,c[M]=pp(E,O))}let $=n[0],C=[];for(let M=0;M<$.length;M+=1)C[M]=hp(cp(n,$,M));const S=M=>L(C[M],1,1,()=>{C[M]=null});let T=!n[8]&&mp(n);return{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),f=_("div");for(let M=0;M<c.length;M+=1)c[M].c();h=D();for(let M=0;M<C.length;M+=1)C[M].c();g=D(),T&&T.c(),p(t,"class",i=B.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","files-list")},m(M,O){w(M,e,O),m(e,t),m(e,s),m(e,l),m(l,r),w(M,u,O),w(M,f,O);for(let E=0;E<c.length;E+=1)c[E].m(f,null);m(f,h);for(let E=0;E<C.length;E+=1)C[E].m(f,null);m(f,g),T&&T.m(f,null),n[19](f),v=!0},p(M,O){if((!v||O&8&&i!==(i=B.getFieldTypeIcon(M[3].type)))&&p(t,"class",i),(!v||O&8)&&o!==(o=M[3].name+"")&&ue(r,o),(!v||O&2097152&&a!==(a=M[21]))&&p(e,"for",a),O&1558&&(b=M[4],Ae(),c=_t(c,O,y,1,M,b,d,f,Gt,pp,h,dp),Pe()),O&2049){$=M[0];let E;for(E=0;E<$.length;E+=1){const P=cp(M,$,E);C[E]?(C[E].p(P,O),A(C[E],1)):(C[E]=hp(P),C[E].c(),A(C[E],1),C[E].m(f,g))}for(Ae(),E=$.length;E<C.length;E+=1)S(E);Pe()}M[8]?T&&(T.d(1),T=null):T?T.p(M,O):(T=mp(M),T.c(),T.m(f,null))},i(M){if(!v){for(let O=0;O<b.length;O+=1)A(c[O]);for(let O=0;O<$.length;O+=1)A(C[O]);v=!0}},o(M){for(let O=0;O<c.length;O+=1)L(c[O]);C=C.filter(Boolean);for(let O=0;O<C.length;O+=1)L(C[O]);v=!1},d(M){M&&k(e),M&&k(u),M&&k(f);for(let O=0;O<c.length;O+=1)c[O].d();Yt(C,M),T&&T.d(),n[19](null)}}}function bM(n){let e,t;return e=new Ne({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[_M,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function vM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Dn}=e,c,d;function h(E){B.removeByValue(u,E),t(1,u)}function g(E){B.pushUnique(u,E),t(1,u)}function v(E){B.isEmpty(a[E])||a.splice(E,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=E=>h(E),$=E=>g(E),C=E=>v(E);function S(E){me[E?"unshift":"push"](()=>{c=E,t(6,c)})}const T=()=>{for(let E of c.files)a.push(E);t(0,a),t(6,c.value=null,c)},M=()=>c==null?void 0:c.click();function O(E){me[E?"unshift":"push"](()=>{d=E,t(7,d)})}return n.$$set=E=>{"record"in E&&t(2,o=E.record),"value"in E&&t(12,r=E.value),"uploadedFiles"in E&&t(0,a=E.uploadedFiles),"deletedFileIndexes"in E&&t(1,u=E.deletedFileIndexes),"field"in E&&t(3,f=E.field)},n.$$.update=()=>{var E,P;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=B.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=B.toArray(u))),n.$$.dirty&8&&t(5,i=((E=f.options)==null?void 0:E.maxSelect)>1),n.$$.dirty&4128&&B.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=B.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((P=f.options)==null?void 0:P.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,g,v,r,y,$,C,S,T,M,O]}class yM extends Ee{constructor(e){super(),Oe(this,e,vM,bM,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function gp(n){let e,t;return{c(){e=_("small"),t=N(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1])},d(i){i&&k(e)}}}function kM(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&gp(n);return{c(){e=_("i"),i=D(),s=_("div"),l=_("div"),r=N(o),a=D(),c&&c.c(),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(s,"class","content svelte-1gjwqyd")},m(d,h){w(d,e,h),w(d,i,h),w(d,s,h),m(s,l),m(l,r),m(s,a),c&&c.m(s,null),u||(f=Ye(t=gt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[h]){t&&Nn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&o!==(o=d[0].id+"")&&ue(r,o),d[1]!==""&&d[1]!==d[0].id?c?c.p(d,h):(c=gp(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i:se,o:se,d(d){d&&k(e),d&&k(i),d&&k(s),c&&c.d(),u=!1,f()}}}function wM(n,e,t){let i;const s=["id","created","updated","@collectionId","@collectionName"];let{item:l={}}=e;function o(r){r=r||{};const a=["name","title","label","key","email","heading","content",...Object.keys(r)];for(const u of a)if(typeof r[u]=="string"&&!B.isEmpty(r[u])&&!s.includes(u))return u+": "+r[u];return""}return n.$$set=r=>{"item"in r&&t(0,l=r.item)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=o(l))},[l,i]}class $M extends Ee{constructor(e){super(),Oe(this,e,wM,kM,De,{item:0})}}function _p(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Load more</span>',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),te(e,"btn-loading",n[6]),te(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=J(e,"click",ni(n[14])),t=!0)},p(s,l){l&64&&te(e,"btn-loading",s[6]),l&64&&te(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function SM(n){let e,t=n[7]&&_p(n);return{c(){t&&t.c(),e=We()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=_p(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function CM(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:n[4]},{optionComponent:n[4]},{multiple:n[2]},{class:"records-select block-options"},n[10]];function o(u){n[15](u)}function r(u){n[16](u)}let a={$$slots:{afterOptions:[SM]},$$scope:{ctx:n}};for(let u=0;u<l.length;u+=1)a=ut(a,l[u]);return n[1]!==void 0&&(a.keyOfSelected=n[1]),n[0]!==void 0&&(a.selected=n[0]),e=new ps({props:a}),me.push(()=>Re(e,"keyOfSelected",o)),me.push(()=>Re(e,"selected",r)),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){q(e.$$.fragment)},m(u,f){H(e,u,f),s=!0},p(u,[f]){const c=f&1340?pn(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&16&&{labelComponent:u[4]},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&oi(u[10])]):{};f&4194496&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],je(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],je(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){L(e.$$.fragment,u),s=!1},d(u){j(e,u)}}}function MM(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent","collectionId"];let o=Bt(e,l);const r="select_"+B.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=$M}=e,{collectionId:h}=e,g=[],v=1,b=0,y=!1,$=!1;C();async function C(){const I=B.toArray(f);if(!(!h||!I.length)){t(13,$=!0);try{const F=[];for(const z of I)F.push(`id="${z}"`);t(0,u=await ye.records.getFullList(h,200,{sort:"-created",filter:F.join("||"),$cancelKey:r+"loadSelected"})),t(5,g=B.filterDuplicatesByKey(g.concat(u)))}catch(F){ye.errorResponseHandler(F)}t(13,$=!1)}}async function S(I=!1){if(!!h){t(6,y=!0);try{const F=I?1:v+1,z=await ye.records.getList(h,F,200,{sort:"-created",$cancelKey:r+"loadList"});I&&t(5,g=[]),t(5,g=B.filterDuplicatesByKey(g.concat(z.items))),v=z.page,t(12,b=z.totalItems)}catch(F){ye.errorResponseHandler(F)}t(6,y=!1)}}const T=()=>S();function M(I){f=I,t(1,f)}function O(I){u=I,t(0,u)}function E(I){tt.call(this,n,I)}function P(I){tt.call(this,n,I)}return n.$$set=I=>{e=ut(ut({},e),li(I)),t(10,o=Bt(e,l)),"multiple"in I&&t(2,a=I.multiple),"selected"in I&&t(0,u=I.selected),"keyOfSelected"in I&&t(1,f=I.keyOfSelected),"selectPlaceholder"in I&&t(3,c=I.selectPlaceholder),"optionComponent"in I&&t(4,d=I.optionComponent),"collectionId"in I&&t(11,h=I.collectionId)},n.$$.update=()=>{n.$$.dirty&2048&&h&&S(!0),n.$$.dirty&8256&&t(8,i=y||$),n.$$.dirty&4128&&t(7,s=b>g.length)},[u,f,a,c,d,g,y,s,i,S,o,h,b,$,T,M,O,E,P]}class TM extends Ee{constructor(e){super(),Oe(this,e,MM,CM,De,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4,collectionId:11})}}function bp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=N("Select up to "),s=N(i),l=N(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function DM(n){var $,C;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v(S){n[3](S)}let b={toggle:!0,id:n[4],multiple:n[2],collectionId:($=n[1].options)==null?void 0:$.collectionId};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new TM({props:b}),me.push(()=>Re(f,"keyOfSelected",v));let y=((C=n[1].options)==null?void 0:C.maxSelect)>1&&bp(n);return{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),q(f.$$.fragment),d=D(),y&&y.c(),h=We(),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(S,T){w(S,e,T),m(e,t),m(e,s),m(e,l),m(l,r),w(S,u,T),H(f,S,T),w(S,d,T),y&&y.m(S,T),w(S,h,T),g=!0},p(S,T){var O,E;(!g||T&2&&i!==(i=B.getFieldTypeIcon(S[1].type)))&&p(t,"class",i),(!g||T&2)&&o!==(o=S[1].name+"")&&ue(r,o),(!g||T&16&&a!==(a=S[4]))&&p(e,"for",a);const M={};T&16&&(M.id=S[4]),T&4&&(M.multiple=S[2]),T&2&&(M.collectionId=(O=S[1].options)==null?void 0:O.collectionId),!c&&T&1&&(c=!0,M.keyOfSelected=S[0],je(()=>c=!1)),f.$set(M),((E=S[1].options)==null?void 0:E.maxSelect)>1?y?y.p(S,T):(y=bp(S),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(S){g||(A(f.$$.fragment,S),g=!0)},o(S){L(f.$$.fragment,S),g=!1},d(S){S&&k(e),S&&k(u),j(f,S),S&&k(d),y&&y.d(S),S&&k(h)}}}function OM(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[DM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function EM(n,e,t){let i,{field:s=new Dn}=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&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(s.options.maxSelect-1))},[l,s,i,o]}class AM extends Ee{constructor(e){super(),Oe(this,e,EM,OM,De,{field:1,value:0})}}function vp(n){let e,t=n[0].email+"",i;return{c(){e=_("small"),i=N(t),p(e,"class","block txt-hint txt-ellipsis")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[0].email+"")&&ue(i,t)},d(s){s&&k(e)}}}function PM(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f,c=n[0].email&&vp(n);return{c(){e=_("i"),i=D(),s=_("div"),l=_("div"),r=N(o),a=D(),c&&c.c(),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(s,"class","content")},m(d,h){w(d,e,h),w(d,i,h),w(d,s,h),m(s,l),m(l,r),m(s,a),c&&c.m(s,null),u||(f=Ye(t=gt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[h]){t&&Nn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&o!==(o=d[0].id+"")&&ue(r,o),d[0].email?c?c.p(d,h):(c=vp(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i:se,o:se,d(d){d&&k(e),d&&k(i),d&&k(s),c&&c.d(),u=!1,f()}}}function LM(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class ha extends Ee{constructor(e){super(),Oe(this,e,LM,PM,De,{item:0})}}function yp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Load more</span>',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),te(e,"btn-loading",n[6]),te(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=J(e,"click",ni(n[13])),t=!0)},p(s,l){l&64&&te(e,"btn-loading",s[6]),l&64&&te(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function IM(n){let e,t=n[7]&&yp(n);return{c(){t&&t.c(),e=We()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=yp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function NM(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:ha},{optionComponent:n[4]},{multiple:n[2]},{class:"users-select block-options"},n[10]];function o(u){n[14](u)}function r(u){n[15](u)}let a={$$slots:{afterOptions:[IM]},$$scope:{ctx:n}};for(let u=0;u<l.length;u+=1)a=ut(a,l[u]);return n[1]!==void 0&&(a.keyOfSelected=n[1]),n[0]!==void 0&&(a.selected=n[0]),e=new ps({props:a}),me.push(()=>Re(e,"keyOfSelected",o)),me.push(()=>Re(e,"selected",r)),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){q(e.$$.fragment)},m(u,f){H(e,u,f),s=!0},p(u,[f]){const c=f&1340?pn(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&0&&{labelComponent:ha},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&oi(u[10])]):{};f&2097344&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],je(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],je(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){L(e.$$.fragment,u),s=!1},d(u){j(e,u)}}}function FM(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent"];let o=Bt(e,l);const r="select_"+B.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=ha}=e,h=[],g=1,v=0,b=!1,y=!1;C(!0),$();async function $(){const P=B.toArray(f);if(!!P.length){t(12,y=!0);try{const I=[];for(const F of P)I.push(`id="${F}"`);t(0,u=await ye.users.getFullList(100,{sort:"-created",filter:I.join("||"),$cancelKey:r+"loadSelected"})),t(5,h=B.filterDuplicatesByKey(h.concat(u)))}catch(I){ye.errorResponseHandler(I)}t(12,y=!1)}}async function C(P=!1){t(6,b=!0);try{const I=P?1:g+1,F=await ye.users.getList(I,200,{sort:"-created",$cancelKey:r+"loadList"});P&&t(5,h=[]),t(5,h=B.filterDuplicatesByKey(h.concat(F.items))),g=F.page,t(11,v=F.totalItems)}catch(I){ye.errorResponseHandler(I)}t(6,b=!1)}const S=()=>C();function T(P){f=P,t(1,f)}function M(P){u=P,t(0,u)}function O(P){tt.call(this,n,P)}function E(P){tt.call(this,n,P)}return n.$$set=P=>{e=ut(ut({},e),li(P)),t(10,o=Bt(e,l)),"multiple"in P&&t(2,a=P.multiple),"selected"in P&&t(0,u=P.selected),"keyOfSelected"in P&&t(1,f=P.keyOfSelected),"selectPlaceholder"in P&&t(3,c=P.selectPlaceholder),"optionComponent"in P&&t(4,d=P.optionComponent)},n.$$.update=()=>{n.$$.dirty&4160&&t(8,i=b||y),n.$$.dirty&2080&&t(7,s=v>h.length)},[u,f,a,c,d,h,b,s,i,C,o,v,y,S,T,M,O,E]}class RM extends Ee{constructor(e){super(),Oe(this,e,FM,NM,De,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4})}}function kp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=N("Select up to "),s=N(i),l=N(" users."),p(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&ue(s,i)},d(o){o&&k(e)}}}function HM(n){var $;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v(C){n[4](C)}let b={toggle:!0,id:n[5],multiple:n[2],disabled:n[3]};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new RM({props:b}),me.push(()=>Re(f,"keyOfSelected",v));let y=(($=n[1].options)==null?void 0:$.maxSelect)>1&&kp(n);return{c(){e=_("label"),t=_("i"),s=D(),l=_("span"),r=N(o),u=D(),q(f.$$.fragment),d=D(),y&&y.c(),h=We(),p(t,"class",i=B.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[5])},m(C,S){w(C,e,S),m(e,t),m(e,s),m(e,l),m(l,r),w(C,u,S),H(f,C,S),w(C,d,S),y&&y.m(C,S),w(C,h,S),g=!0},p(C,S){var M;(!g||S&2&&i!==(i=B.getFieldTypeIcon(C[1].type)))&&p(t,"class",i),(!g||S&2)&&o!==(o=C[1].name+"")&&ue(r,o),(!g||S&32&&a!==(a=C[5]))&&p(e,"for",a);const T={};S&32&&(T.id=C[5]),S&4&&(T.multiple=C[2]),S&8&&(T.disabled=C[3]),!c&&S&1&&(c=!0,T.keyOfSelected=C[0],je(()=>c=!1)),f.$set(T),((M=C[1].options)==null?void 0:M.maxSelect)>1?y?y.p(C,S):(y=kp(C),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(C){g||(A(f.$$.fragment,C),g=!0)},o(C){L(f.$$.fragment,C),g=!1},d(C){C&&k(e),C&&k(u),j(f,C),C&&k(d),y&&y.d(C),C&&k(h)}}}function jM(n){let e,t;return e=new Ne({props:{class:"form-field "+(n[1].required?"required":"")+" "+(n[3]?"disabled":""),name:n[1].name,$$slots:{default:[HM,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&10&&(l.class="form-field "+(i[1].required?"required":"")+" "+(i[3]?"disabled":"")),s&2&&(l.name=i[1].name),s&111&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function qM(n,e,t){let i,s,{field:l=new Dn}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(2,s),t(1,l)}return n.$$set=a=>{"field"in a&&t(1,l=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{var a;n.$$.dirty&2&&t(2,s=((a=l.options)==null?void 0:a.maxSelect)>1),n.$$.dirty&7&&s&&Array.isArray(o)&&o.length>l.options.maxSelect&&t(0,o=o.slice(l.options.maxSelect-1)),n.$$.dirty&3&&t(3,i=!B.isEmpty(o)&&l.system)},[o,l,s,i,r]}class VM extends Ee{constructor(e){super(),Oe(this,e,qM,jM,De,{field:1,value:0})}}function wp(n,e,t){const i=n.slice();return i[40]=e[t],i[41]=e,i[42]=t,i}function $p(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[zM,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&4|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function zM(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="id",l=D(),o=_("span"),a=D(),u=_("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[43]),p(u,"type","text"),p(u,"id",f=n[43]),u.value=c=n[2].id,u.disabled=!0},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),w(d,a,h),w(d,u,h)},p(d,h){h[1]&4096&&r!==(r=d[43])&&p(e,"for",r),h[1]&4096&&f!==(f=d[43])&&p(u,"id",f),h[0]&4&&c!==(c=d[2].id)&&u.value!==c&&(u.value=c)},d(d){d&&k(e),d&&k(a),d&&k(u)}}}function Sp(n){let e;return{c(){e=_("div"),e.innerHTML=`<h5>No custom fields to be set</h5>
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function BM(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new VM({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function UM(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new AM({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function WM(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new yM({props:u}),me.push(()=>Re(e,"value",o)),me.push(()=>Re(e,"uploadedFiles",r)),me.push(()=>Re(e,"deletedFileIndexes",a)),{c(){q(e.$$.fragment)},m(f,c){H(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],je(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],je(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],je(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function YM(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new x4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function KM(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new Z4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function JM(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new W4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function ZM(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new V4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function GM(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new R4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function XM(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new L4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function QM(n){let e,t,i;function s(o){n[20](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new O4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function xM(n){let e,t,i;function s(o){n[19](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new C4({props:l}),me.push(()=>Re(e,"value",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Cp(n,e){let t,i,s,l,o;const r=[xM,QM,XM,GM,ZM,JM,KM,YM,WM,UM,BM],a=[];function u(f,c){return f[40].type==="text"?0:f[40].type==="number"?1:f[40].type==="bool"?2:f[40].type==="email"?3:f[40].type==="url"?4:f[40].type==="date"?5:f[40].type==="select"?6:f[40].type==="json"?7:f[40].type==="file"?8:f[40].type==="relation"?9:f[40].type==="user"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=We(),s&&s.c(),l=We(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(Ae(),L(a[d],1,1,()=>{a[d]=null}),Pe()),~i?(s=a[i],s?s.p(e,c):(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){L(s),o=!1},d(f){f&&k(t),~i&&a[i].d(f),f&&k(l)}}}function eT(n){var d;let e,t,i=[],s=new Map,l,o,r,a=!n[2].isNew&&$p(n),u=((d=n[0])==null?void 0:d.schema)||[];const f=h=>h[40].name;for(let h=0;h<u.length;h+=1){let g=wp(n,u,h),v=f(g);s.set(v,i[h]=Cp(v,g))}let c=null;return u.length||(c=Sp()),{c(){e=_("form"),a&&a.c(),t=D();for(let h=0;h<i.length;h+=1)i[h].c();c&&c.c(),p(e,"id",n[11]),p(e,"class","block")},m(h,g){w(h,e,g),a&&a.m(e,null),m(e,t);for(let v=0;v<i.length;v+=1)i[v].m(e,null);c&&c.m(e,null),l=!0,o||(r=J(e,"submit",Wt(n[12])),o=!0)},p(h,g){var v;h[2].isNew?a&&(Ae(),L(a,1,1,()=>{a=null}),Pe()):a?(a.p(h,g),g[0]&4&&A(a,1)):(a=$p(h),a.c(),A(a,1),a.m(e,t)),g[0]&29&&(u=((v=h[0])==null?void 0:v.schema)||[],Ae(),i=_t(i,g,f,1,h,u,s,e,Gt,Cp,null,wp),Pe(),!u.length&&c?c.p(h,g):u.length?c&&(c.d(1),c=null):(c=Sp(),c.c(),c.m(e,null)))},i(h){if(!l){A(a);for(let g=0;g<u.length;g+=1)A(i[g]);l=!0}},o(h){L(a);for(let g=0;g<i.length;g+=1)L(i[g]);l=!1},d(h){h&&k(e),a&&a.d();for(let g=0;g<i.length;g+=1)i[g].d();c&&c.d(),o=!1,r()}}}function Mp(n){let e,t,i,s,l,o,r,a;return r=new Ti({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[tT]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=D(),i=_("button"),s=_("div"),l=_("i"),o=D(),q(r.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(s,"class","content"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-secondary")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),m(i,s),m(s,l),m(s,o),H(r,s,null),a=!0},p(u,f){const c={};f[1]&8192&&(c.$$scope={dirty:f,ctx:u}),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){L(r.$$.fragment,u),a=!1},d(u){u&&k(e),u&&k(t),u&&k(i),j(r)}}}function tT(n){let e,t,i;return{c(){e=_("div"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function nT(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&Mp(n);return{c(){e=_("h4"),i=N(t),s=D(),o=N(l),r=N(" record"),a=D(),c&&c.c(),u=We()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ue(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ue(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&A(c,1)):(c=Mp(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){f||(A(c),f=!0)},o(d){L(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function iT(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),r=N(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],te(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=J(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&te(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function sT(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[iT],header:[nT],default:[eT]},$$scope:{ctx:n}};return e=new ui({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[33](null),j(e,s)}}}function Tp(n){return JSON.stringify(n)}function lT(n,e,t){let i,s,l,o;const r=xt(),a="record_"+B.randomString(5);let{collection:u}=e,f,c=null,d=new _o,h=!1,g=!1,v={},b={},y="";function $(ae){return S(ae),t(8,g=!0),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function S(ae){ri({}),c=ae||{},t(2,d=ae!=null&&ae.clone?ae.clone():new _o),t(3,v={}),t(4,b={}),await Zn(),t(15,y=Tp(d))}function T(){if(h||!l)return;t(7,h=!0);const ae=O();let W;d.isNew?W=ye.records.create(u==null?void 0:u.id,ae):W=ye.records.update(u==null?void 0:u.id,d.id,ae),W.then(async _e=>{sn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),C(),r("save",_e)}).catch(_e=>{ye.errorResponseHandler(_e)}).finally(()=>{t(7,h=!1)})}function M(){!(c!=null&&c.id)||si("Do you really want to delete the selected record?",()=>ye.records.delete(c["@collectionId"],c.id).then(()=>{C(),sn("Successfully deleted record."),r("delete",c)}).catch(ae=>{ye.errorResponseHandler(ae)}))}function O(){const ae=(d==null?void 0:d.export())||{},W=new FormData,_e={};for(const He of(u==null?void 0:u.schema)||[])_e[He.name]=He;for(const He in ae)!_e[He]||(typeof ae[He]>"u"&&(ae[He]=null),B.addValueToFormData(W,He,ae[He]));for(const He in v){const Ue=B.toArray(v[He]);for(const X of Ue)W.append(He,X)}for(const He in b){const Ue=B.toArray(b[He]);for(const X of Ue)W.append(He+"."+X,"")}return W}const E=()=>C(),P=()=>M();function I(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function F(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function z(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function Q(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function ne(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function G(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function ee(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function U(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function Y(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function Z(ae,W){n.$$.not_equal(v[W.name],ae)&&(v[W.name]=ae,t(3,v))}function de(ae,W){n.$$.not_equal(b[W.name],ae)&&(b[W.name]=ae,t(4,b))}function x(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}function oe(ae,W){n.$$.not_equal(d[W.name],ae)&&(d[W.name]=ae,t(2,d))}const Ce=()=>s&&g?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,g=!1),C()}),!1):!0;function Te(ae){me[ae?"unshift":"push"](()=>{f=ae,t(6,f)})}function K(ae){tt.call(this,n,ae)}function ke(ae){tt.call(this,n,ae)}return n.$$set=ae=>{"collection"in ae&&t(0,u=ae.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=B.hasNonEmptyProps(v)||B.hasNonEmptyProps(b)),n.$$.dirty[0]&98308&&t(5,s=i||y!=Tp(d)),n.$$.dirty[0]&36&&t(9,l=d.isNew||s),n.$$.dirty[0]&1&&t(10,o=(u==null?void 0:u.name)!=="profiles")},[u,C,d,v,b,s,f,h,g,l,o,a,T,M,$,y,i,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te,K,ke]}class db extends Ee{constructor(e){super(),Oe(this,e,lT,sT,De,{collection:0,show:14,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[1]}}function oT(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function rT(n){let e,t;return{c(){e=_("span"),t=N(n[1]),p(e,"class","label txt-base txt-mono"),p(e,"title",n[0])},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1]),s&1&&p(e,"title",i[0])},d(i){i&&k(e)}}}function aT(n){let e;function t(l,o){return l[0]?rT:oT}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(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:se,o:se,d(l){s.d(l),l&&k(e)}}}function uT(n,e,t){let{id:i=""}=e,s=i;return n.$$set=l=>{"id"in l&&t(0,i=l.id)},n.$$.update=()=>{n.$$.dirty&1&&typeof i=="string"&&i.length>27&&t(1,s=i.substring(0,5)+"..."+i.substring(i.length-10))},[i,s]}class sr extends Ee{constructor(e){super(),Oe(this,e,uT,aT,De,{id:0})}}function Dp(n,e,t){const i=n.slice();return i[8]=e[t],i}function Op(n,e,t){const i=n.slice();return i[3]=e[t],i}function Ep(n,e,t){const i=n.slice();return i[3]=e[t],i}function fT(n){let e,t=n[0][n[1].name]+"",i,s;return{c(){e=_("span"),i=N(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[0][n[1].name])},m(l,o){w(l,e,o),m(e,i)},p(l,o){o&3&&t!==(t=l[0][l[1].name]+"")&&ue(i,t),o&3&&s!==(s=l[0][l[1].name])&&p(e,"title",s)},i:se,o:se,d(l){l&&k(e)}}}function cT(n){let e,t,i=B.toArray(n[0][n[1].name]),s=[];for(let o=0;o<i.length;o+=1)s[o]=Ap(Dp(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;o<s.length;o+=1)s[o].c();p(e,"class","inline-flex")},m(o,r){w(o,e,r);for(let a=0;a<s.length;a+=1)s[a].m(e,null);t=!0},p(o,r){if(r&3){i=B.toArray(o[0][o[1].name]);let a;for(a=0;a<i.length;a+=1){const u=Dp(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Ap(u),s[a].c(),A(s[a],1),s[a].m(e,null))}for(Ae(),a=i.length;a<s.length;a+=1)l(a);Pe()}},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)L(s[r]);t=!1},d(o){o&&k(e),Yt(s,o)}}}function dT(n){let e,t,i=B.toArray(n[0][n[1].name]),s=[];for(let o=0;o<i.length;o+=1)s[o]=Pp(Op(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;o<s.length;o+=1)s[o].c();p(e,"class","inline-flex")},m(o,r){w(o,e,r);for(let a=0;a<s.length;a+=1)s[a].m(e,null);t=!0},p(o,r){if(r&3){i=B.toArray(o[0][o[1].name]);let a;for(a=0;a<i.length;a+=1){const u=Op(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Pp(u),s[a].c(),A(s[a],1),s[a].m(e,null))}for(Ae(),a=i.length;a<s.length;a+=1)l(a);Pe()}},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)L(s[r]);t=!1},d(o){o&&k(e),Yt(s,o)}}}function pT(n){let e,t=B.toArray(n[0][n[1].name]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Lp(Ep(n,t,s));return{c(){e=_("div");for(let s=0;s<i.length;s+=1)i[s].c();p(e,"class","inline-flex")},m(s,l){w(s,e,l);for(let o=0;o<i.length;o+=1)i[o].m(e,null)},p(s,l){if(l&3){t=B.toArray(s[0][s[1].name]);let o;for(o=0;o<t.length;o+=1){const r=Ep(s,t,o);i[o]?i[o].p(r,l):(i[o]=Lp(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:se,o:se,d(s){s&&k(e),Yt(i,s)}}}function hT(n){let e,t=JSON.stringify(n[0][n[1].name])+"",i;return{c(){e=_("span"),i=N(t),p(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&3&&t!==(t=JSON.stringify(s[0][s[1].name])+"")&&ue(i,t)},i:se,o:se,d(s){s&&k(e)}}}function mT(n){let e,t;return e=new Si({props:{date:n[0][n[1].name]}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&3&&(l.date=i[0][i[1].name]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function gT(n){let e,t=n[0][n[1].name]+"",i,s,l,o;return{c(){e=_("a"),i=N(t),p(e,"class","txt-ellipsis"),p(e,"href",s=n[0][n[1].name]),p(e,"target","_blank"),p(e,"rel","noopener")},m(r,a){w(r,e,a),m(e,i),l||(o=[Ye(gt.call(null,e,"Open in new tab")),J(e,"click",ni(n[2]))],l=!0)},p(r,a){a&3&&t!==(t=r[0][r[1].name]+"")&&ue(i,t),a&3&&s!==(s=r[0][r[1].name])&&p(e,"href",s)},i:se,o:se,d(r){r&&k(e),l=!1,Je(o)}}}function _T(n){let e,t=n[0][n[1].name]?"True":"False",i;return{c(){e=_("span"),i=N(t),p(e,"class","txt")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&3&&t!==(t=s[0][s[1].name]?"True":"False")&&ue(i,t)},i:se,o:se,d(s){s&&k(e)}}}function bT(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function Ap(n){let e,t,i,s;return t=new cb({props:{record:n[0],filename:n[8]}}),{c(){e=_("figure"),q(t.$$.fragment),i=D(),p(e,"class","thumb thumb-sm")},m(l,o){w(l,e,o),H(t,e,null),m(e,i),s=!0},p(l,o){const r={};o&1&&(r.record=l[0]),o&3&&(r.filename=l[8]),t.$set(r)},i(l){s||(A(t.$$.fragment,l),s=!0)},o(l){L(t.$$.fragment,l),s=!1},d(l){l&&k(e),j(t)}}}function Pp(n){let e,t;return e=new sr({props:{id:n[3]}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&3&&(l.id=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Lp(n){let e,t=n[3]+"",i;return{c(){e=_("span"),i=N(t),p(e,"class","label")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&3&&t!==(t=s[3]+"")&&ue(i,t)},d(s){s&&k(e)}}}function vT(n){let e,t,i,s,l,o;const r=[bT,_T,gT,mT,hT,pT,dT,cT,fT],a=[];function u(f,c){return c&3&&(t=null),t==null&&(t=!!B.isEmpty(f[0][f[1].name])),t?0:f[1].type==="bool"?1:f[1].type==="url"?2:f[1].type==="date"?3:f[1].type==="json"?4:f[1].type==="select"?5:f[1].type==="relation"||f[1].type==="user"?6:f[1].type==="file"?7:8}return i=u(n,-1),s=a[i]=r[i](n),{c(){e=_("td"),s.c(),p(e,"class",l="col-type-"+n[1].type+" col-field-"+n[1].name)},m(f,c){w(f,e,c),a[i].m(e,null),o=!0},p(f,[c]){let d=i;i=u(f,c),i===d?a[i].p(f,c):(Ae(),L(a[d],1,1,()=>{a[d]=null}),Pe(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),A(s,1),s.m(e,null)),(!o||c&2&&l!==(l="col-type-"+f[1].type+" col-field-"+f[1].name))&&p(e,"class",l)},i(f){o||(A(s),o=!0)},o(f){L(s),o=!1},d(f){f&&k(e),a[i].d()}}}function yT(n,e,t){let{record:i}=e,{field:s}=e;function l(o){tt.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record),"field"in o&&t(1,s=o.field)},[i,s,l]}class pb extends Ee{constructor(e){super(),Oe(this,e,yT,vT,De,{record:0,field:1})}}function Ip(n,e,t){const i=n.slice();return i[35]=e[t],i}function Np(n,e,t){const i=n.slice();return i[38]=e[t],i}function Fp(n,e,t){const i=n.slice();return i[38]=e[t],i}function kT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function wT(n){let e,t,i,s,l,o=n[38].name+"",r;return{c(){e=_("div"),t=_("i"),s=D(),l=_("span"),r=N(o),p(t,"class",i=B.getFieldTypeIcon(n[38].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(l,r)},p(a,u){u[0]&2048&&i!==(i=B.getFieldTypeIcon(a[38].type))&&p(t,"class",i),u[0]&2048&&o!==(o=a[38].name+"")&&ue(r,o)},d(a){a&&k(e)}}}function Rp(n,e){let t,i,s,l;function o(a){e[22](a)}let r={class:"col-type-"+e[38].type+" col-field-"+e[38].name,name:e[38].name,$$slots:{default:[wT]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new an({props:r}),me.push(()=>Re(i,"sort",o)),{key:n,first:null,c(){t=We(),q(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&2048&&(f.class="col-type-"+e[38].type+" col-field-"+e[38].name),u[0]&2048&&(f.name=e[38].name),u[0]&2048|u[1]&4096&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],je(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),j(i,a)}}}function $T(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function ST(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function Hp(n){let e;function t(l,o){return l[8]?MT:CT}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(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&&k(e)}}}function CT(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&jp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No records found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=jp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function MT(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function jp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[28]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function qp(n,e){let t,i,s;return i=new pb({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=We(),q(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),j(i,l)}}}function Vp(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,$,C,S,T,M,O,E,P,I,F,z;function Q(){return e[25](e[35])}h=new sr({props:{id:e[35].id}});let ne=e[11];const G=Y=>Y[38].name;for(let Y=0;Y<ne.length;Y+=1){let Z=Np(e,ne,Y),de=G(Z);b.set(de,v[Y]=qp(de,Z))}C=new Si({props:{date:e[35].created}}),M=new Si({props:{date:e[35].updated}});function ee(){return e[26](e[35])}function U(...Y){return e[27](e[35],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=D(),u=_("label"),c=D(),d=_("td"),q(h.$$.fragment),g=D();for(let Y=0;Y<v.length;Y+=1)v[Y].c();y=D(),$=_("td"),q(C.$$.fragment),S=D(),T=_("td"),q(M.$$.fragment),O=D(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',P=D(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],p(u,"for",f="checkbox_"+e[35].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p($,"class","col-type-date col-field-created"),p(T,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Y,Z){w(Y,t,Z),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),H(h,d,null),m(t,g);for(let de=0;de<v.length;de+=1)v[de].m(t,null);m(t,y),m(t,$),H(C,$,null),m(t,S),m(t,T),H(M,T,null),m(t,O),m(t,E),m(t,P),I=!0,F||(z=[J(l,"change",Q),J(s,"click",ni(e[19])),J(t,"click",ee),J(t,"keydown",U)],F=!0)},p(Y,Z){e=Y,(!I||Z[0]&8&&o!==(o="checkbox_"+e[35].id))&&p(l,"id",o),(!I||Z[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!I||Z[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const de={};Z[0]&8&&(de.id=e[35].id),h.$set(de),Z[0]&2056&&(ne=e[11],Ae(),v=_t(v,Z,G,1,e,ne,b,t,Gt,qp,y,Np),Pe());const x={};Z[0]&8&&(x.date=e[35].created),C.$set(x);const oe={};Z[0]&8&&(oe.date=e[35].updated),M.$set(oe)},i(Y){if(!I){A(h.$$.fragment,Y);for(let Z=0;Z<ne.length;Z+=1)A(v[Z]);A(C.$$.fragment,Y),A(M.$$.fragment,Y),I=!0}},o(Y){L(h.$$.fragment,Y);for(let Z=0;Z<v.length;Z+=1)L(v[Z]);L(C.$$.fragment,Y),L(M.$$.fragment,Y),I=!1},d(Y){Y&&k(t),j(h);for(let Z=0;Z<v.length;Z+=1)v[Z].d();j(C),j(M),F=!1,Je(z)}}}function zp(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&ue(s,i),a[0]&16&&ue(o,r[4])},d(r){r&&k(e)}}}function Bp(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),te(t,"btn-loading",n[8]),te(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=J(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c[0]&256&&te(t,"btn-loading",f[8]),c[0]&256&&te(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Up(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,v,b,y,$;return{c(){e=_("div"),t=_("div"),i=N("Selected "),s=_("strong"),l=N(n[6]),o=D(),a=N(r),u=D(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=D(),d=_("div"),h=D(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),te(f,"btn-disabled",n[9]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary btn-danger"),te(g,"btn-loading",n[9]),te(g,"btn-disabled",n[9]),p(e,"class","bulkbar")},m(C,S){w(C,e,S),m(e,t),m(t,i),m(t,s),m(s,l),m(t,o),m(t,a),m(e,u),m(e,f),m(e,c),m(e,d),m(e,h),m(e,g),b=!0,y||($=[J(f,"click",n[30]),J(g,"click",n[31])],y=!0)},p(C,S){(!b||S[0]&64)&&ue(l,C[6]),(!b||S[0]&64)&&r!==(r=C[6]===1?"record":"records")&&ue(a,r),(!b||S[0]&512)&&te(f,"btn-disabled",C[9]),(!b||S[0]&512)&&te(g,"btn-loading",C[9]),(!b||S[0]&512)&&te(g,"btn-disabled",C[9])},i(C){b||(C&&Tt(()=>{v||(v=st(e,Yn,{duration:150,y:5},!0)),v.run(1)}),b=!0)},o(C){C&&(v||(v=st(e,Yn,{duration:150,y:5},!1)),v.run(0)),b=!1},d(C){C&&k(e),C&&v&&v.end(),y=!1,Je($)}}}function TT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,$,C,S,T,M,O,E,P,I,F=[],z=new Map,Q,ne,G,ee,U,Y,Z;function de(ce){n[21](ce)}let x={class:"col-type-text col-field-id",name:"id",$$slots:{default:[kT]},$$scope:{ctx:n}};n[0]!==void 0&&(x.sort=n[0]),d=new an({props:x}),me.push(()=>Re(d,"sort",de));let oe=n[11];const Ce=ce=>ce[38].name;for(let ce=0;ce<oe.length;ce+=1){let we=Fp(n,oe,ce),Ge=Ce(we);b.set(Ge,v[ce]=Rp(Ge,we))}function Te(ce){n[23](ce)}let K={class:"col-type-date col-field-created",name:"created",$$slots:{default:[$T]},$$scope:{ctx:n}};n[0]!==void 0&&(K.sort=n[0]),$=new an({props:K}),me.push(()=>Re($,"sort",Te));function ke(ce){n[24](ce)}let ae={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[ST]},$$scope:{ctx:n}};n[0]!==void 0&&(ae.sort=n[0]),T=new an({props:ae}),me.push(()=>Re(T,"sort",ke));let W=n[3];const _e=ce=>ce[35].id;for(let ce=0;ce<W.length;ce+=1){let we=Ip(n,W,ce),Ge=_e(we);z.set(Ge,F[ce]=Vp(Ge,we))}let He=null;W.length||(He=Hp(n));let Ue=n[3].length&&zp(n),X=n[3].length&&n[12]&&Bp(n),ge=n[6]&&Up(n);return{c(){e=_("div"),t=_("table"),i=_("thead"),s=_("tr"),l=_("th"),o=_("div"),r=_("input"),u=D(),f=_("label"),c=D(),q(d.$$.fragment),g=D();for(let ce=0;ce<v.length;ce+=1)v[ce].c();y=D(),q($.$$.fragment),S=D(),q(T.$$.fragment),O=D(),E=_("th"),P=D(),I=_("tbody");for(let ce=0;ce<F.length;ce+=1)F[ce].c();He&&He.c(),Q=D(),Ue&&Ue.c(),ne=D(),X&&X.c(),G=D(),ge&&ge.c(),ee=We(),p(r,"type","checkbox"),p(r,"id","checkbox_0"),r.disabled=a=!n[3].length,r.checked=n[10],p(f,"for","checkbox_0"),p(o,"class","form-field"),p(l,"class","bulk-select-col min-width"),p(E,"class","col-type-action min-width"),p(t,"class","table"),te(t,"table-loading",n[8]),p(e,"class","table-wrapper")},m(ce,we){w(ce,e,we),m(e,t),m(t,i),m(i,s),m(s,l),m(l,o),m(o,r),m(o,u),m(o,f),m(s,c),H(d,s,null),m(s,g);for(let Ge=0;Ge<v.length;Ge+=1)v[Ge].m(s,null);m(s,y),H($,s,null),m(s,S),H(T,s,null),m(s,O),m(s,E),m(t,P),m(t,I);for(let Ge=0;Ge<F.length;Ge+=1)F[Ge].m(I,null);He&&He.m(I,null),w(ce,Q,we),Ue&&Ue.m(ce,we),w(ce,ne,we),X&&X.m(ce,we),w(ce,G,we),ge&&ge.m(ce,we),w(ce,ee,we),U=!0,Y||(Z=J(r,"change",n[20]),Y=!0)},p(ce,we){(!U||we[0]&8&&a!==(a=!ce[3].length))&&(r.disabled=a),(!U||we[0]&1024)&&(r.checked=ce[10]);const Ge={};we[1]&4096&&(Ge.$$scope={dirty:we,ctx:ce}),!h&&we[0]&1&&(h=!0,Ge.sort=ce[0],je(()=>h=!1)),d.$set(Ge),we[0]&2049&&(oe=ce[11],Ae(),v=_t(v,we,Ce,1,ce,oe,b,s,Gt,Rp,y,Fp),Pe());const et={};we[1]&4096&&(et.$$scope={dirty:we,ctx:ce}),!C&&we[0]&1&&(C=!0,et.sort=ce[0],je(()=>C=!1)),$.$set(et);const Ke={};we[1]&4096&&(Ke.$$scope={dirty:we,ctx:ce}),!M&&we[0]&1&&(M=!0,Ke.sort=ce[0],je(()=>M=!1)),T.$set(Ke),we[0]&76074&&(W=ce[3],Ae(),F=_t(F,we,_e,1,ce,W,z,I,Gt,Vp,null,Ip),Pe(),!W.length&&He?He.p(ce,we):W.length?He&&(He.d(1),He=null):(He=Hp(ce),He.c(),He.m(I,null))),(!U||we[0]&256)&&te(t,"table-loading",ce[8]),ce[3].length?Ue?Ue.p(ce,we):(Ue=zp(ce),Ue.c(),Ue.m(ne.parentNode,ne)):Ue&&(Ue.d(1),Ue=null),ce[3].length&&ce[12]?X?X.p(ce,we):(X=Bp(ce),X.c(),X.m(G.parentNode,G)):X&&(X.d(1),X=null),ce[6]?ge?(ge.p(ce,we),we[0]&64&&A(ge,1)):(ge=Up(ce),ge.c(),A(ge,1),ge.m(ee.parentNode,ee)):ge&&(Ae(),L(ge,1,1,()=>{ge=null}),Pe())},i(ce){if(!U){A(d.$$.fragment,ce);for(let we=0;we<oe.length;we+=1)A(v[we]);A($.$$.fragment,ce),A(T.$$.fragment,ce);for(let we=0;we<W.length;we+=1)A(F[we]);A(ge),U=!0}},o(ce){L(d.$$.fragment,ce);for(let we=0;we<v.length;we+=1)L(v[we]);L($.$$.fragment,ce),L(T.$$.fragment,ce);for(let we=0;we<F.length;we+=1)L(F[we]);L(ge),U=!1},d(ce){ce&&k(e),j(d);for(let we=0;we<v.length;we+=1)v[we].d();j($),j(T);for(let we=0;we<F.length;we+=1)F[we].d();He&&He.d(),ce&&k(Q),Ue&&Ue.d(ce),ce&&k(ne),X&&X.d(ce),ce&&k(G),ge&&ge.d(ce),ce&&k(ee),Y=!1,Z()}}}function DT(n,e,t){let i,s,l,o;const r=xt();let{collection:a}=e,{sort:u=""}=e,{filter:f=""}=e,c=[],d=1,h=0,g={},v=!0,b=!1;async function y(oe=1){if(!!(a!=null&&a.id))return t(8,v=!0),oe<=1&&$(),ye.records.getList(a.id,oe,50,{sort:u,filter:f}).then(Ce=>{t(8,v=!1),t(3,c=c.concat(Ce.items)),t(7,d=Ce.page),t(4,h=Ce.totalItems),r("load",c)}).catch(Ce=>{Ce!=null&&Ce.isAbort||(t(8,v=!1),console.warn(Ce),$(),ye.errorResponseHandler(Ce,!1))})}function $(){t(3,c=[]),t(7,d=1),t(4,h=0),t(5,g={})}function C(){o?S():T()}function S(){t(5,g={})}function T(){for(const oe of c)t(5,g[oe.id]=oe,g);t(5,g)}function M(oe){g[oe.id]?delete g[oe.id]:t(5,g[oe.id]=oe,g),t(5,g)}function O(){si(`Do you really want to delete the selected ${l===1?"record":"records"}?`,E)}async function E(){if(b||!l)return;let oe=[];for(const Ce of Object.keys(g))oe.push(ye.records.delete(a==null?void 0:a.id,Ce));return t(9,b=!0),Promise.all(oe).then(()=>{sn(`Successfully deleted the selected ${l===1?"record":"records"}.`),S()}).catch(Ce=>{ye.errorResponseHandler(Ce)}).finally(()=>(t(9,b=!1),y()))}function P(oe){tt.call(this,n,oe)}const I=()=>C();function F(oe){u=oe,t(0,u)}function z(oe){u=oe,t(0,u)}function Q(oe){u=oe,t(0,u)}function ne(oe){u=oe,t(0,u)}const G=oe=>M(oe),ee=oe=>r("select",oe),U=(oe,Ce)=>{Ce.code==="Enter"&&(Ce.preventDefault(),r("select",oe))},Y=()=>t(1,f=""),Z=()=>y(d+1),de=()=>S(),x=()=>O();return n.$$set=oe=>{"collection"in oe&&t(18,a=oe.collection),"sort"in oe&&t(0,u=oe.sort),"filter"in oe&&t(1,f=oe.filter)},n.$$.update=()=>{n.$$.dirty[0]&262147&&a&&a.id&&u!==-1&&f!==-1&&($(),y(1)),n.$$.dirty[0]&24&&t(12,i=h>c.length),n.$$.dirty[0]&262144&&t(11,s=(a==null?void 0:a.schema)||[]),n.$$.dirty[0]&32&&t(6,l=Object.keys(g).length),n.$$.dirty[0]&72&&t(10,o=c.length&&l===c.length)},[u,f,y,c,h,g,l,d,v,b,o,s,i,r,C,S,M,O,a,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x]}class OT extends Ee{constructor(e){super(),Oe(this,e,DT,TT,De,{collection:18,sort:0,filter:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}function ET(n){let e,t,i,s;return e=new SC({}),i=new On({props:{$$slots:{default:[LT]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&639|o[1]&1&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}function AT(n){let e,t;return e=new On({props:{center:!0,$$slots:{default:[FT]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&520|s[1]&1&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function PT(n){let e,t;return e=new On({props:{center:!0,$$slots:{default:[RT]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[1]&1&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Wp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-circle")},m(s,l){w(s,e,l),t||(i=[Ye(gt.call(null,e,{text:"Edit collection",position:"right"})),J(e,"click",n[13])],t=!0)},p:se,d(s){s&&k(e),t=!1,Je(i)}}}function LT(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P,I=!n[9]&&Wp(n);c=new Go({}),c.$on("refresh",n[14]),$=new Zo({props:{value:n[0],autocompleteCollection:n[2]}}),$.$on("submit",n[17]);function F(ne){n[19](ne)}function z(ne){n[20](ne)}let Q={collection:n[2]};return n[0]!==void 0&&(Q.filter=n[0]),n[1]!==void 0&&(Q.sort=n[1]),S=new OT({props:Q}),n[18](S),me.push(()=>Re(S,"filter",F)),me.push(()=>Re(S,"sort",z)),S.$on("select",n[21]),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Collections",s=D(),l=_("div"),r=N(o),a=D(),u=_("div"),I&&I.c(),f=D(),q(c.$$.fragment),d=D(),h=_("div"),g=_("button"),g.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,v=D(),b=_("button"),b.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,y=D(),q($.$$.fragment),C=D(),q(S.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(g,"type","button"),p(g,"class","btn btn-outline"),p(b,"type","button"),p(b,"class","btn btn-expanded"),p(h,"class","btns-group"),p(e,"class","page-header")},m(ne,G){w(ne,e,G),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),m(e,u),I&&I.m(u,null),m(u,f),H(c,u,null),m(e,d),m(e,h),m(h,g),m(h,v),m(h,b),w(ne,y,G),H($,ne,G),w(ne,C,G),H(S,ne,G),O=!0,E||(P=[J(g,"click",n[15]),J(b,"click",n[16])],E=!0)},p(ne,G){(!O||G[0]&4)&&o!==(o=ne[2].name+"")&&ue(r,o),ne[9]?I&&(I.d(1),I=null):I?I.p(ne,G):(I=Wp(ne),I.c(),I.m(u,f));const ee={};G[0]&1&&(ee.value=ne[0]),G[0]&4&&(ee.autocompleteCollection=ne[2]),$.$set(ee);const U={};G[0]&4&&(U.collection=ne[2]),!T&&G[0]&1&&(T=!0,U.filter=ne[0],je(()=>T=!1)),!M&&G[0]&2&&(M=!0,U.sort=ne[1],je(()=>M=!1)),S.$set(U)},i(ne){O||(A(c.$$.fragment,ne),A($.$$.fragment,ne),A(S.$$.fragment,ne),O=!0)},o(ne){L(c.$$.fragment,ne),L($.$$.fragment,ne),L(S.$$.fragment,ne),O=!1},d(ne){ne&&k(e),I&&I.d(),j(c),ne&&k(y),j($,ne),ne&&k(C),n[18](null),j(S,ne),E=!1,Je(P)}}}function IT(n){let e,t,i,s,l;return{c(){e=_("h1"),e.textContent="Create your first collection to add records!",t=D(),i=_("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=J(i,"click",n[12]),s=!0)},p:se,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function NT(n){let e;return{c(){e=_("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function FT(n){let e,t,i;function s(r,a){return r[9]?NT:IT}let l=s(n),o=l(n);return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),m(e,t),m(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&&k(e),o.d()}}}function RT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function HT(n){let e,t,i,s,l,o,r,a,u;const f=[PT,AT,ET],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new tu({props:h}),n[22](s);let g={};o=new b4({props:g}),n[23](o);let v={collection:n[2]};return a=new db({props:v}),n[24](a),a.$on("save",n[25]),a.$on("delete",n[26]),{c(){t.c(),i=D(),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),q(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),H(s,b,y),w(b,l,y),H(o,b,y),w(b,r,y),H(a,b,y),u=!0},p(b,y){let $=e;e=d(b),e===$?c[e].p(b,y):(Ae(),L(c[$],1,1,()=>{c[$]=null}),Pe(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const S={};o.$set(S);const T={};y[0]&4&&(T.collection=b[2]),a.$set(T)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){L(t),L(s.$$.fragment,b),L(o.$$.fragment,b),L(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[22](null),j(s,b),b&&k(l),n[23](null),j(o,b),b&&k(r),n[24](null),j(a,b)}}}function jT(n,e,t){let i,s,l,o,r,a,u;at(n,hi,Y=>t(2,s=Y)),at(n,As,Y=>t(11,l=Y)),at(n,Vo,Y=>t(27,o=Y)),at(n,Nt,Y=>t(28,r=Y)),at(n,da,Y=>t(8,a=Y)),at(n,us,Y=>t(9,u=Y)),nn(Nt,r="Collections",r);const f=new URLSearchParams(o);let c,d,h,g,v=f.get("filter")||"",b=f.get("sort")||"-created",y=f.get("collectionId")||"";function $(){t(10,y=s.id),t(1,b="-created"),t(0,v="")}U$(y);const C=()=>c==null?void 0:c.show(),S=()=>c==null?void 0:c.show(s),T=()=>g==null?void 0:g.load(),M=()=>d==null?void 0:d.show(s),O=()=>h==null?void 0:h.show(),E=Y=>t(0,v=Y.detail);function P(Y){me[Y?"unshift":"push"](()=>{g=Y,t(6,g)})}function I(Y){v=Y,t(0,v)}function F(Y){b=Y,t(1,b)}const z=Y=>h==null?void 0:h.show(Y==null?void 0:Y.detail);function Q(Y){me[Y?"unshift":"push"](()=>{c=Y,t(3,c)})}function ne(Y){me[Y?"unshift":"push"](()=>{d=Y,t(4,d)})}function G(Y){me[Y?"unshift":"push"](()=>{h=Y,t(5,h)})}const ee=()=>g==null?void 0:g.load(),U=()=>g==null?void 0:g.load();return n.$$.update=()=>{if(n.$$.dirty[0]&2048&&t(7,i=l.filter(Y=>Y.name!="profiles")),n.$$.dirty[0]&1028&&(s==null?void 0:s.id)&&y!=s.id&&$(),n.$$.dirty[0]&7&&(b||v||(s==null?void 0:s.id))){const Y=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:b}).toString();Ci("/collections?"+Y)}},[v,b,s,c,d,h,g,i,a,u,y,l,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U]}class qT extends Ee{constructor(e){super(),Oe(this,e,jT,HT,De,{},null,[-1,-1])}}const wl={googleAuth:{title:"Google",icon:"ri-google-fill"},facebookAuth:{title:"Facebook",icon:"ri-facebook-fill"},twitterAuth:{title:"Twitter",icon:"ri-twitter-fill"},githubAuth:{title:"GitHub",icon:"ri-github-fill"},gitlabAuth:{title:"GitLab",icon:"ri-gitlab-fill",selfHosted:!0},discordAuth:{title:"Discord",icon:"ri-discord-fill"}};function Yp(n,e,t){const i=n.slice();return i[9]=e[t],i}function VT(n){let e;return{c(){e=_("p"),e.textContent="No authorized OAuth2 providers.",p(e,"class","txt-hint txt-center")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function zT(n){let e,t=n[1],i=[];for(let s=0;s<t.length;s+=1)i[s]=Kp(Yp(n,t,s));return{c(){e=_("div");for(let s=0;s<i.length;s+=1)i[s].c();p(e,"class","list")},m(s,l){w(s,e,l);for(let o=0;o<i.length;o+=1)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=Yp(s,t,o);i[o]?i[o].p(r,l):(i[o]=Kp(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&&k(e),Yt(i,s)}}}function BT(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Kp(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,c=n[9].providerId+"",d,h,g,v,b,y;function $(){return n[6](n[9])}return{c(){e=_("div"),t=_("i"),s=D(),l=_("span"),r=N(o),a=D(),u=_("div"),f=N("ID: "),d=N(c),h=D(),g=_("button"),g.innerHTML='<i class="ri-close-line"></i>',v=D(),p(t,"class",i=n[4](n[9].provider)),p(l,"class","txt"),p(u,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-secondary link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(C,S){w(C,e,S),m(e,t),m(e,s),m(e,l),m(l,r),m(e,a),m(e,u),m(u,f),m(u,d),m(e,h),m(e,g),m(e,v),b||(y=J(g,"click",$),b=!0)},p(C,S){n=C,S&2&&i!==(i=n[4](n[9].provider))&&p(t,"class",i),S&2&&o!==(o=n[3](n[9].provider)+"")&&ue(r,o),S&2&&c!==(c=n[9].providerId+"")&&ue(d,c)},d(C){C&&k(e),b=!1,y()}}}function UT(n){let e;function t(l,o){var r;return l[2]?BT:((r=l[0])==null?void 0:r.id)&&l[1].length?zT:VT}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(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:se,o:se,d(l){s.d(l),l&&k(e)}}}function WT(n,e,t){const i=xt();let{user:s}=e,l=[],o=!1;function r(d){var h;return((h=wl[d+"Auth"])==null?void 0:h.title)||B.sentenize(auth.provider,!1)}function a(d){var h;return((h=wl[d+"Auth"])==null?void 0:h.icon)||`ri-${d}-line`}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await ye.users.listExternalAuths(s.id))}catch(d){ye.errorResponseHandler(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||si(`Do you really want to unlink the ${r(d)} provider?`,()=>ye.users.unlinkExternalAuth(s.id,d).then(()=>{sn(`Successfully unlinked the ${r(d)} provider.`),i("unlink",d),u()}).catch(h=>{ye.errorResponseHandler(h)}))}Fn(()=>{u()});const c=d=>f(d.provider);return n.$$set=d=>{"user"in d&&t(0,s=d.user)},[s,l,o,r,a,f,c]}class YT extends Ee{constructor(e){super(),Oe(this,e,WT,UT,De,{user:0})}}function Jp(n){let e,t,i,s,l,o;return{c(){e=_("div"),t=_("button"),t.textContent="Account",i=D(),s=_("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),te(t,"active",n[10]===wi),p(s,"type","button"),p(s,"class","tab-item"),te(s,"active",n[10]===Ps),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),m(e,t),m(e,i),m(e,s),l||(o=[J(t,"click",n[20]),J(s,"click",n[21])],l=!0)},p(r,a){a[0]&1024&&te(t,"active",r[10]===wi),a[0]&1024&&te(s,"active",r[10]===Ps)},d(r){r&&k(e),l=!1,Je(o)}}}function Zp(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[KT,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&24&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function KT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="ID",o=D(),r=_("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[1]&8&&l!==(l=f[34])&&p(e,"for",l),c[1]&8&&a!==(a=f[34])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Gp(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=Ye(gt.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function JT(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&n[1].email&&Gp();return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="Email",o=D(),d&&d.c(),r=D(),a=_("input"),p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[34]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",u=n[34]),a.required=!0},m(h,g){w(h,e,g),m(e,t),m(e,i),m(e,s),w(h,o,g),d&&d.m(h,g),w(h,r,g),w(h,a,g),Se(a,n[2]),f||(c=J(a,"input",n[22]),f=!0)},p(h,g){g[1]&8&&l!==(l=h[34])&&p(e,"for",l),h[1].verified&&h[1].email?d||(d=Gp(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&8&&u!==(u=h[34])&&p(a,"id",u),g[0]&4&&a.value!==h[2]&&Se(a,h[2])},d(h){h&&k(e),h&&k(o),d&&d.d(h),h&&k(r),h&&k(a),f=!1,c()}}}function Xp(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[ZT,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&8|s[1]&24&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ZT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"for",o=n[34])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[23]),r=!0)},p(u,f){f[1]&8&&t!==(t=u[34])&&p(e,"id",t),f[0]&8&&(e.checked=u[3]),f[1]&8&&o!==(o=u[34])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Qp(n){let e,t,i,s,l,o,r,a,u;return s=new Ne({props:{class:"form-field required",name:"password",$$slots:{default:[GT,({uniqueId:f})=>({34:f}),({uniqueId:f})=>[0,f?8:0]]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[XT,({uniqueId:f})=>({34:f}),({uniqueId:f})=>[0,f?8:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),q(s.$$.fragment),l=D(),o=_("div"),q(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),H(s,i,null),m(t,l),m(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&128|c[1]&24&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&256|c[1]&24&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Tt(()=>{a||(a=st(t,on,{duration:150},!0)),a.run(1)}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=st(t,on,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),j(s),j(r),f&&a&&a.end()}}}function GT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="Password",o=D(),r=_("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[34]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[34]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Se(r,n[7]),u||(f=J(r,"input",n[24]),u=!0)},p(c,d){d[1]&8&&l!==(l=c[34])&&p(e,"for",l),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&128&&r.value!==c[7]&&Se(r,c[7])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function XT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="Password confirm",o=D(),r=_("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[34]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[34]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Se(r,n[8]),u||(f=J(r,"input",n[25]),u=!0)},p(c,d){d[1]&8&&l!==(l=c[34])&&p(e,"for",l),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&Se(r,c[8])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function xp(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[QT,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&512|s[1]&24&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function QT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Send verification email"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(s,"for",o=n[34])},m(u,f){w(u,e,f),e.checked=n[9],w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[26]),r=!0)},p(u,f){f[1]&8&&t!==(t=u[34])&&p(e,"id",t),f[0]&512&&(e.checked=u[9]),f[1]&8&&o!==(o=u[34])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function eh(n){let e,t,i;return t=new YT({props:{user:n[1]}}),{c(){e=_("div"),q(t.$$.fragment),p(e,"class","tab-item"),te(e,"active",n[10]===Ps)},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&2&&(o.user=s[1]),t.$set(o),(!i||l[0]&1024)&&te(e,"active",s[10]===Ps)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),j(t)}}}function xT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v=!n[1].isNew&&Jp(n),b=!n[1].isNew&&Zp(n);r=new Ne({props:{class:"form-field required",name:"email",$$slots:{default:[JT,({uniqueId:T})=>({34:T}),({uniqueId:T})=>[0,T?8:0]]},$$scope:{ctx:n}}});let y=!n[1].isNew&&n[1].email&&Xp(n),$=(n[1].isNew||!n[1].email||n[3])&&Qp(n),C=(n[1].isNew||!n[1].email)&&xp(n),S=!n[1].isNew&&eh(n);return{c(){e=_("div"),v&&v.c(),t=D(),i=_("div"),s=_("div"),l=_("form"),b&&b.c(),o=D(),q(r.$$.fragment),a=D(),y&&y.c(),u=D(),$&&$.c(),f=D(),C&&C.c(),c=D(),S&&S.c(),p(l,"id",n[12]),p(l,"class","grid"),p(l,"autocomplete","off"),p(s,"class","tab-item"),te(s,"active",n[10]===wi),p(i,"class","tabs-content"),p(e,"class","tabs user-tabs")},m(T,M){w(T,e,M),v&&v.m(e,null),m(e,t),m(e,i),m(i,s),m(s,l),b&&b.m(l,null),m(l,o),H(r,l,null),m(l,a),y&&y.m(l,null),m(l,u),$&&$.m(l,null),m(l,f),C&&C.m(l,null),m(i,c),S&&S.m(i,null),d=!0,h||(g=J(l,"submit",Wt(n[13])),h=!0)},p(T,M){T[1].isNew?v&&(v.d(1),v=null):v?v.p(T,M):(v=Jp(T),v.c(),v.m(e,t)),T[1].isNew?b&&(Ae(),L(b,1,1,()=>{b=null}),Pe()):b?(b.p(T,M),M[0]&2&&A(b,1)):(b=Zp(T),b.c(),A(b,1),b.m(l,o));const O={};M[0]&6|M[1]&24&&(O.$$scope={dirty:M,ctx:T}),r.$set(O),!T[1].isNew&&T[1].email?y?(y.p(T,M),M[0]&2&&A(y,1)):(y=Xp(T),y.c(),A(y,1),y.m(l,u)):y&&(Ae(),L(y,1,1,()=>{y=null}),Pe()),T[1].isNew||!T[1].email||T[3]?$?($.p(T,M),M[0]&10&&A($,1)):($=Qp(T),$.c(),A($,1),$.m(l,f)):$&&(Ae(),L($,1,1,()=>{$=null}),Pe()),T[1].isNew||!T[1].email?C?(C.p(T,M),M[0]&2&&A(C,1)):(C=xp(T),C.c(),A(C,1),C.m(l,null)):C&&(Ae(),L(C,1,1,()=>{C=null}),Pe()),(!d||M[0]&1024)&&te(s,"active",T[10]===wi),T[1].isNew?S&&(Ae(),L(S,1,1,()=>{S=null}),Pe()):S?(S.p(T,M),M[0]&2&&A(S,1)):(S=eh(T),S.c(),A(S,1),S.m(i,null))},i(T){d||(A(b),A(r.$$.fragment,T),A(y),A($),A(C),A(S),d=!0)},o(T){L(b),L(r.$$.fragment,T),L(y),L($),L(C),L(S),d=!1},d(T){T&&k(e),v&&v.d(),b&&b.d(),j(r),y&&y.d(),$&&$.d(),C&&C.d(),S&&S.d(),h=!1,g()}}}function th(n){let e,t,i,s,l,o,r;return o=new Ti({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[eD]},$$scope:{ctx:n}}}),{c(){e=_("button"),t=_("span"),i=D(),s=_("i"),l=D(),q(o.$$.fragment),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary m-l-auto")},m(a,u){w(a,e,u),m(e,t),m(e,i),m(e,s),m(e,l),H(o,e,null),r=!0},p(a,u){const f={};u[0]&2|u[1]&16&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){L(o.$$.fragment,a),r=!1},d(a){a&&k(e),j(o)}}}function nh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function eD(n){let e,t,i,s,l=!n[1].verified&&n[1].email&&nh(n);return{c(){l&&l.c(),e=D(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(t,"type","button"),p(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=J(t,"click",n[19]),i=!0)},p(o,r){!o[1].verified&&o[1].email?l?l.p(o,r):(l=nh(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function tD(n){let e,t=n[1].isNew?"New user":"Edit user",i,s,l,o,r=!n[1].isNew&&th(n);return{c(){e=_("h4"),i=N(t),s=D(),r&&r.c(),l=We()},m(a,u){w(a,e,u),m(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u[0]&2)&&t!==(t=a[1].isNew?"New user":"Edit user")&&ue(i,t),a[1].isNew?r&&(Ae(),L(r,1,1,()=>{r=null}),Pe()):r?(r.p(a,u),u[0]&2&&A(r,1)):(r=th(a),r.c(),A(r,1),r.m(l.parentNode,l))},i(a){o||(A(r),o=!0)},o(a){L(r),o=!1},d(a){a&&k(e),a&&k(s),r&&r.d(a),a&&k(l)}}}function ih(n){let e,t,i=n[1].isNew?"Create":"Save changes",s,l;return{c(){e=_("button"),t=_("span"),s=N(i),p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[12]),p(e,"class","btn btn-expanded"),e.disabled=l=!n[11]||n[5],te(e,"btn-loading",n[5])},m(o,r){w(o,e,r),m(e,t),m(t,s)},p(o,r){r[0]&2&&i!==(i=o[1].isNew?"Create":"Save changes")&&ue(s,i),r[0]&2080&&l!==(l=!o[11]||o[5])&&(e.disabled=l),r[0]&32&&te(e,"btn-loading",o[5])},d(o){o&&k(e)}}}function nD(n){let e,t,i,s,l,o,r=n[10]===wi&&ih(n);return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),r&&r.c(),s=We(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[5]},m(a,u){w(a,e,u),m(e,t),w(a,i,u),r&&r.m(a,u),w(a,s,u),l||(o=J(e,"click",n[17]),l=!0)},p(a,u){u[0]&32&&(e.disabled=a[5]),a[10]===wi?r?r.p(a,u):(r=ih(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},d(a){a&&k(e),a&&k(i),r&&r.d(a),a&&k(s),l=!1,o()}}}function iD(n){let e,t,i={class:"user-panel",popup:n[1].isNew,beforeHide:n[27],$$slots:{footer:[nD],header:[tD],default:[xT]},$$scope:{ctx:n}};return e=new ui({props:i}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&2&&(o.popup=s[1].isNew),l[0]&2112&&(o.beforeHide=s[27]),l[0]&4014|l[1]&16&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[28](null),j(e,s)}}}const wi="account",Ps="providers";function sD(n,e,t){let i;const s=xt(),l="user_"+B.randomString(5);let o,r=new Ms,a=!1,u=!1,f="",c="",d="",h=!1,g=!0,v=wi;function b(x){return $(x),t(6,u=!0),t(10,v=r.isNew||r.email?wi:Ps),o==null?void 0:o.show()}function y(){return o==null?void 0:o.hide()}function $(x){ri({}),t(1,r=x!=null&&x.clone?x.clone():new Ms),C()}function C(){t(3,h=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const x={email:f};(r.isNew||h)&&(x.password=c,x.passwordConfirm=d);let oe;r.isNew?oe=ye.users.create(x):oe=ye.users.update(r.id,x),oe.then(async Ce=>{t(1,r=Ce),g&&M(!1),t(6,u=!1),y(),sn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",Ce)}).catch(Ce=>{ye.errorResponseHandler(Ce)}).finally(()=>{t(5,a=!1)})}function T(){!(r!=null&&r.id)||si("Do you really want to delete the selected user?",()=>ye.users.delete(r.id).then(()=>{t(6,u=!1),y(),sn("Successfully deleted user."),s("delete",r)}).catch(x=>{ye.errorResponseHandler(x)}))}function M(x=!0){return ye.users.requestVerification(r.email||f).then(()=>{t(6,u=!1),y(),x&&sn(`Successfully sent verification email to ${r.email}.`)}).catch(oe=>{ye.errorResponseHandler(oe)})}const O=()=>y(),E=()=>M(),P=()=>T(),I=()=>t(10,v=wi),F=()=>t(10,v=Ps);function z(){f=this.value,t(2,f)}function Q(){h=this.checked,t(3,h)}function ne(){c=this.value,t(7,c)}function G(){d=this.value,t(8,d)}function ee(){g=this.checked,t(9,g)}const U=()=>i&&u?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),y()}),!1):!0;function Y(x){me[x?"unshift":"push"](()=>{o=x,t(4,o)})}function Z(x){tt.call(this,n,x)}function de(x){tt.call(this,n,x)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(11,i=r.isNew&&f!=""||h||f!==r.email)},[y,r,f,h,o,a,u,c,d,g,v,i,l,S,T,M,b,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de]}class lD extends Ee{constructor(e){super(),Oe(this,e,sD,iD,De,{show:16,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[16]}get hide(){return this.$$.ctx[0]}}function sh(n,e,t){const i=n.slice();return i[41]=e[t],i}function lh(n,e,t){const i=n.slice();return i[44]=e[t],i}function oh(n,e,t){const i=n.slice();return i[44]=e[t],i}function oD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P=[],I=new Map,F,z,Q,ne,G,ee,U,Y,Z,de,x=[],oe=new Map,Ce,Te,K,ke,ae,W,_e=!n[15]&&rh(n);r=new Go({}),r.$on("refresh",n[18]),h=new Zo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),h.$on("submit",n[20]);function He(be){n[21](be)}let Ue={class:"col-type-text col-field-id",name:"id",$$slots:{default:[aD]},$$scope:{ctx:n}};n[4]!==void 0&&(Ue.sort=n[4]),C=new an({props:Ue}),me.push(()=>Re(C,"sort",He));function X(be){n[22](be)}let ge={class:"col-type-email col-field-email",name:"email",$$slots:{default:[uD]},$$scope:{ctx:n}};n[4]!==void 0&&(ge.sort=n[4]),M=new an({props:ge}),me.push(()=>Re(M,"sort",X));let ce=n[12];const we=be=>be[44].name;for(let be=0;be<ce.length;be+=1){let Fe=oh(n,ce,be),dt=we(Fe);I.set(dt,P[be]=ah(dt,Fe))}function Ge(be){n[23](be)}let et={class:"col-type-date col-field-created",name:"created",$$slots:{default:[fD]},$$scope:{ctx:n}};n[4]!==void 0&&(et.sort=n[4]),z=new an({props:et}),me.push(()=>Re(z,"sort",Ge));function Ke(be){n[24](be)}let nt={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[cD]},$$scope:{ctx:n}};n[4]!==void 0&&(nt.sort=n[4]),G=new an({props:nt}),me.push(()=>Re(G,"sort",Ke));let Me=n[1];const ze=be=>be[41].id;for(let be=0;be<Me.length;be+=1){let Fe=sh(n,Me,be),dt=ze(Fe);oe.set(dt,x[be]=ph(dt,Fe))}let Xe=null;Me.length||(Xe=uh(n));let it=n[1].length&&hh(n),ct=n[1].length&&n[13]&&mh(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),s=N(n[14]),l=D(),_e&&_e.c(),o=D(),q(r.$$.fragment),a=D(),u=_("div"),f=D(),c=_("button"),c.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New user</span>`,d=D(),q(h.$$.fragment),g=D(),v=_("div"),b=_("table"),y=_("thead"),$=_("tr"),q(C.$$.fragment),T=D(),q(M.$$.fragment),E=D();for(let be=0;be<P.length;be+=1)P[be].c();F=D(),q(z.$$.fragment),ne=D(),q(G.$$.fragment),U=D(),Y=_("th"),Z=D(),de=_("tbody");for(let be=0;be<x.length;be+=1)x[be].c();Xe&&Xe.c(),Ce=D(),it&&it.c(),Te=D(),ct&&ct.c(),K=We(),p(i,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(e,"class","page-header"),p(Y,"class","col-type-action min-width"),p(b,"class","table"),te(b,"table-loading",n[10]),p(v,"class","table-wrapper")},m(be,Fe){w(be,e,Fe),m(e,t),m(t,i),m(i,s),m(e,l),_e&&_e.m(e,null),m(e,o),H(r,e,null),m(e,a),m(e,u),m(e,f),m(e,c),w(be,d,Fe),H(h,be,Fe),w(be,g,Fe),w(be,v,Fe),m(v,b),m(b,y),m(y,$),H(C,$,null),m($,T),H(M,$,null),m($,E);for(let dt=0;dt<P.length;dt+=1)P[dt].m($,null);m($,F),H(z,$,null),m($,ne),H(G,$,null),m($,U),m($,Y),m(b,Z),m(b,de);for(let dt=0;dt<x.length;dt+=1)x[dt].m(de,null);Xe&&Xe.m(de,null),w(be,Ce,Fe),it&&it.m(be,Fe),w(be,Te,Fe),ct&&ct.m(be,Fe),w(be,K,Fe),ke=!0,ae||(W=J(c,"click",n[19]),ae=!0)},p(be,Fe){(!ke||Fe[0]&16384)&&ue(s,be[14]),be[15]?_e&&(_e.d(1),_e=null):_e?_e.p(be,Fe):(_e=rh(be),_e.c(),_e.m(e,o));const dt={};Fe[0]&8&&(dt.value=be[3]),h.$set(dt);const Dt={};Fe[1]&262144&&(Dt.$$scope={dirty:Fe,ctx:be}),!S&&Fe[0]&16&&(S=!0,Dt.sort=be[4],je(()=>S=!1)),C.$set(Dt);const pt={};Fe[1]&262144&&(pt.$$scope={dirty:Fe,ctx:be}),!O&&Fe[0]&16&&(O=!0,pt.sort=be[4],je(()=>O=!1)),M.$set(pt),Fe[0]&4096&&(ce=be[12],P=_t(P,Fe,we,1,be,ce,I,$,bn,ah,F,oh));const lt={};Fe[1]&262144&&(lt.$$scope={dirty:Fe,ctx:be}),!Q&&Fe[0]&16&&(Q=!0,lt.sort=be[4],je(()=>Q=!1)),z.$set(lt);const Lt={};Fe[1]&262144&&(Lt.$$scope={dirty:Fe,ctx:be}),!ee&&Fe[0]&16&&(ee=!0,Lt.sort=be[4],je(()=>ee=!1)),G.$set(Lt),Fe[0]&5450&&(Me=be[1],Ae(),x=_t(x,Fe,ze,1,be,Me,oe,de,Gt,ph,null,sh),Pe(),!Me.length&&Xe?Xe.p(be,Fe):Me.length?Xe&&(Xe.d(1),Xe=null):(Xe=uh(be),Xe.c(),Xe.m(de,null))),(!ke||Fe[0]&1024)&&te(b,"table-loading",be[10]),be[1].length?it?it.p(be,Fe):(it=hh(be),it.c(),it.m(Te.parentNode,Te)):it&&(it.d(1),it=null),be[1].length&&be[13]?ct?ct.p(be,Fe):(ct=mh(be),ct.c(),ct.m(K.parentNode,K)):ct&&(ct.d(1),ct=null)},i(be){if(!ke){A(r.$$.fragment,be),A(h.$$.fragment,be),A(C.$$.fragment,be),A(M.$$.fragment,be),A(z.$$.fragment,be),A(G.$$.fragment,be);for(let Fe=0;Fe<Me.length;Fe+=1)A(x[Fe]);ke=!0}},o(be){L(r.$$.fragment,be),L(h.$$.fragment,be),L(C.$$.fragment,be),L(M.$$.fragment,be),L(z.$$.fragment,be),L(G.$$.fragment,be);for(let Fe=0;Fe<x.length;Fe+=1)L(x[Fe]);ke=!1},d(be){be&&k(e),_e&&_e.d(),j(r),be&&k(d),j(h,be),be&&k(g),be&&k(v),j(C),j(M);for(let Fe=0;Fe<P.length;Fe+=1)P[Fe].d();j(z),j(G);for(let Fe=0;Fe<x.length;Fe+=1)x[Fe].d();Xe&&Xe.d(),be&&k(Ce),it&&it.d(be),be&&k(Te),ct&&ct.d(be),be&&k(K),ae=!1,W()}}}function rD(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading users...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function rh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-circle")},m(s,l){w(s,e,l),t||(i=[Ye(gt.call(null,e,{text:"Edit profile collection",position:"right"})),J(e,"click",n[17])],t=!0)},p:se,d(s){s&&k(e),t=!1,Je(i)}}}function aD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function uD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function ah(n,e){let t,i,s,l,o,r,a,u=e[44].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=D(),r=_("span"),a=N("profile."),f=N(u),p(s,"class",l=B.getFieldTypeIcon(e[44].type)),p(r,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[44].type+" col-field-"+e[44].name),p(t,"name",d=e[44].name),this.first=t},m(h,g){w(h,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(h,g){e=h,g[0]&4096&&l!==(l=B.getFieldTypeIcon(e[44].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[44].name+"")&&ue(f,u),g[0]&4096&&c!==(c="col-type-"+e[44].type+" col-field-"+e[44].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[44].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function fD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function cD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function uh(n){let e;function t(l,o){return l[10]?pD:dD}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(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&&k(e)}}}function dD(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&fh(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=fh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function pD(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function fh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[27]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function hD(n){let e,t,i,s=n[41].verified&&ch();return{c(){e=_("div"),e.textContent="N/A",t=D(),s&&s.c(),i=We(),p(e,"class","txt-hint")},m(l,o){w(l,e,o),w(l,t,o),s&&s.m(l,o),w(l,i,o)},p(l,o){l[41].verified?s||(s=ch(),s.c(),s.m(i.parentNode,i)):s&&(s.d(1),s=null)},d(l){l&&k(e),l&&k(t),s&&s.d(l),l&&k(i)}}}function mD(n){let e,t=n[41].email+"",i,s,l,o,r=n[41].verified?"Verified":"Unverified",a;return{c(){e=_("span"),i=N(t),l=D(),o=_("span"),a=N(r),p(e,"class","txt"),p(e,"title",s=n[41].email),p(o,"class","label"),te(o,"label-success",n[41].verified),te(o,"label-warning",!n[41].verified)},m(u,f){w(u,e,f),m(e,i),w(u,l,f),w(u,o,f),m(o,a)},p(u,f){f[0]&2&&t!==(t=u[41].email+"")&&ue(i,t),f[0]&2&&s!==(s=u[41].email)&&p(e,"title",s),f[0]&2&&r!==(r=u[41].verified?"Verified":"Unverified")&&ue(a,r),f[0]&2&&te(o,"label-success",u[41].verified),f[0]&2&&te(o,"label-warning",!u[41].verified)},d(u){u&&k(e),u&&k(l),u&&k(o)}}}function ch(n){let e;return{c(){e=_("span"),e.textContent="OAuth2 verified",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dh(n,e){let t,i,s;return i=new pb({props:{field:e[44],record:e[41].profile||{}}}),{key:n,first:null,c(){t=We(),q(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[44]),o[0]&2&&(r.record=e[41].profile||{}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),j(i,l)}}}function ph(n,e){let t,i,s,l,o,r,a,u=[],f=new Map,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P;s=new sr({props:{id:e[41].id}});function I(U,Y){return U[41].email?mD:hD}let F=I(e),z=F(e),Q=e[12];const ne=U=>U[44].name;for(let U=0;U<Q.length;U+=1){let Y=lh(e,Q,U),Z=ne(Y);f.set(Z,u[U]=dh(Z,Y))}h=new Si({props:{date:e[41].created}}),b=new Si({props:{date:e[41].updated}});function G(){return e[25](e[41])}function ee(){return e[26](e[41])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),q(s.$$.fragment),l=D(),o=_("td"),r=_("div"),z.c(),a=D();for(let U=0;U<u.length;U+=1)u[U].c();c=D(),d=_("td"),q(h.$$.fragment),g=D(),v=_("td"),q(b.$$.fragment),y=D(),$=_("td"),C=_("button"),C.innerHTML=`<i class="ri-user-settings-line"></i>
<span class="txt">Edit user</span>`,S=D(),T=_("button"),T.innerHTML=`<i class="ri-profile-line"></i>
<span class="txt">Edit profile</span>`,M=D(),p(i,"class","col-type-text col-field-id"),p(r,"class","inline-flex"),p(o,"class","col-type-email col-field-email"),p(d,"class","col-type-date col-field-created"),p(v,"class","col-type-date col-field-updated"),p(C,"type","button"),p(C,"class","btn btn-sm btn-outline"),p(T,"type","button"),p(T,"class","btn btn-sm m-l-10"),p($,"class","col-type-action min-width"),this.first=t},m(U,Y){w(U,t,Y),m(t,i),H(s,i,null),m(t,l),m(t,o),m(o,r),z.m(r,null),m(t,a);for(let Z=0;Z<u.length;Z+=1)u[Z].m(t,null);m(t,c),m(t,d),H(h,d,null),m(t,g),m(t,v),H(b,v,null),m(t,y),m(t,$),m($,C),m($,S),m($,T),m(t,M),O=!0,E||(P=[J(C,"click",ni(G)),J(T,"click",ni(ee))],E=!0)},p(U,Y){e=U;const Z={};Y[0]&2&&(Z.id=e[41].id),s.$set(Z),F===(F=I(e))&&z?z.p(e,Y):(z.d(1),z=F(e),z&&(z.c(),z.m(r,null))),Y[0]&4098&&(Q=e[12],Ae(),u=_t(u,Y,ne,1,e,Q,f,t,Gt,dh,c,lh),Pe());const de={};Y[0]&2&&(de.date=e[41].created),h.$set(de);const x={};Y[0]&2&&(x.date=e[41].updated),b.$set(x)},i(U){if(!O){A(s.$$.fragment,U);for(let Y=0;Y<Q.length;Y+=1)A(u[Y]);A(h.$$.fragment,U),A(b.$$.fragment,U),O=!0}},o(U){L(s.$$.fragment,U);for(let Y=0;Y<u.length;Y+=1)L(u[Y]);L(h.$$.fragment,U),L(b.$$.fragment,U),O=!1},d(U){U&&k(t),j(s),z.d();for(let Y=0;Y<u.length;Y+=1)u[Y].d();j(h),j(b),E=!1,Je(P)}}}function hh(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&ue(s,i),a[0]&4&&ue(o,r[2])},d(r){r&&k(e)}}}function mh(n){let e,t,i,s,l=n[2]-n[1].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=N("Load more ("),o=N(l),r=N(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),te(t,"btn-loading",n[10]),te(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=J(t,"click",n[28]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&ue(o,l),c[0]&1024&&te(t,"btn-loading",f[10]),c[0]&1024&&te(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function gD(n){let e,t,i,s;const l=[rD,oD],o=[];function r(a,u){return a[11]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=We()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(Ae(),L(o[f],1,1,()=>{o[f]=null}),Pe(),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){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function _D(n){let e,t,i,s,l,o,r,a;e=new On({props:{$$slots:{default:[gD]},$$scope:{ctx:n}}});let u={};i=new lD({props:u}),n[29](i),i.$on("save",n[30]),i.$on("delete",n[31]);let f={};l=new tu({props:f}),n[32](l),l.$on("save",n[33]);let c={collection:n[5]};return r=new db({props:c}),n[34](r),r.$on("save",n[35]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment),o=D(),q(r.$$.fragment)},m(d,h){H(e,d,h),w(d,t,h),H(i,d,h),w(d,s,h),H(l,d,h),w(d,o,h),H(r,d,h),a=!0},p(d,h){const g={};h[0]&65534|h[1]&262144&&(g.$$scope={dirty:h,ctx:d}),e.$set(g);const v={};i.$set(v);const b={};l.$set(b);const y={};h[0]&32&&(y.collection=d[5]),r.$set(y)},i(d){a||(A(e.$$.fragment,d),A(i.$$.fragment,d),A(l.$$.fragment,d),A(r.$$.fragment,d),a=!0)},o(d){L(e.$$.fragment,d),L(i.$$.fragment,d),L(l.$$.fragment,d),L(r.$$.fragment,d),a=!1},d(d){j(e,d),d&&k(t),n[29](null),j(i,d),d&&k(s),n[32](null),j(l,d),d&&k(o),n[34](null),j(r,d)}}}function bD(n,e,t){let i,s,l,o,r;at(n,Vo,W=>t(36,l=W)),at(n,Nt,W=>t(14,o=W)),at(n,us,W=>t(15,r=W)),nn(Nt,o="Users",o);const a=new URLSearchParams(l),u=["id","userId","created","updated"];let f,c,d,h=[],g=1,v=0,b=!1,y=a.get("filter")||"",$=a.get("sort")||"-created",C=new dn,S=!1;E();async function T(W=1){return t(10,b=!0),W<=1&&M(),ye.users.getList(W,50,{sort:$||"-created",filter:y}).then(_e=>{t(10,b=!1),t(1,h=h.concat(_e.items)),t(9,g=_e.page),t(2,v=_e.totalItems)}).catch(_e=>{_e!=null&&_e.isAbort||(t(10,b=!1),console.warn(_e),M(),ye.errorResponseHandler(_e,!1))})}function M(){t(1,h=[]),t(9,g=1),t(2,v=0)}function O(W){const _e=h.find(He=>He.id===(W==null?void 0:W.userId));_e&&(_e.profile=W),t(1,h)}async function E(){t(11,S=!0);try{t(5,C=await ye.collections.getOne("profiles"))}catch(W){ye.errorResponseHandler(W)}t(11,S=!1)}const P=()=>c==null?void 0:c.show(C),I=()=>T(),F=()=>f==null?void 0:f.show(),z=W=>t(3,y=W.detail);function Q(W){$=W,t(4,$)}function ne(W){$=W,t(4,$)}function G(W){$=W,t(4,$)}function ee(W){$=W,t(4,$)}const U=W=>f==null?void 0:f.show(W),Y=W=>d==null?void 0:d.show(W.profile),Z=()=>t(3,y=""),de=()=>T(g+1);function x(W){me[W?"unshift":"push"](()=>{f=W,t(6,f)})}const oe=()=>T(),Ce=()=>T();function Te(W){me[W?"unshift":"push"](()=>{c=W,t(7,c)})}const K=W=>t(5,C=W.detail);function ke(W){me[W?"unshift":"push"](()=>{d=W,t(8,d)})}const ae=W=>O(W.detail);return n.$$.update=()=>{var W;if(n.$$.dirty[0]&24&&$!==-1&&y!==-1){const _e=new URLSearchParams({filter:y,sort:$}).toString();Ci("/users?"+_e),T()}n.$$.dirty[0]&6&&t(13,i=v>h.length),n.$$.dirty[0]&32&&t(12,s=(W=C==null?void 0:C.schema)==null?void 0:W.filter(_e=>!u.includes(_e.name)))},[T,h,v,y,$,C,f,c,d,g,b,S,s,i,o,r,O,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x,oe,Ce,Te,K,ke,ae]}class vD extends Ee{constructor(e){super(),Oe(this,e,bD,_D,De,{loadUsers:0},null,[-1,-1])}get loadUsers(){return this.$$.ctx[0]}}function yD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P;return{c(){e=_("aside"),t=_("div"),i=_("div"),i.textContent="System",s=D(),l=_("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=D(),r=_("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),c=_("div"),c.innerHTML=`<span class="txt">Sync</span>
<small class="label label-danger label-sm">Experimental</small>`,d=D(),h=_("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,g=D(),v=_("a"),v.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,b=D(),y=_("div"),y.textContent="Authentication",$=D(),C=_("a"),C.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,S=D(),T=_("a"),T.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,M=D(),O=_("a"),O.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(v,"href","/settings/import-collections"),p(v,"class","sidebar-list-item"),p(y,"class","sidebar-title"),p(C,"href","/settings/auth-providers"),p(C,"class","sidebar-list-item"),p(T,"href","/settings/tokens"),p(T,"class","sidebar-list-item"),p(O,"href","/settings/admins"),p(O,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(I,F){w(I,e,F),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,h),m(t,g),m(t,v),m(t,b),m(t,y),m(t,$),m(t,C),m(t,S),m(t,T),m(t,M),m(t,O),E||(P=[Ye(Vn.call(null,l,{path:"/settings"})),Ye(mn.call(null,l)),Ye(Vn.call(null,r,{path:"/settings/mail/?.*"})),Ye(mn.call(null,r)),Ye(Vn.call(null,u,{path:"/settings/storage/?.*"})),Ye(mn.call(null,u)),Ye(Vn.call(null,h,{path:"/settings/export-collections/?.*"})),Ye(mn.call(null,h)),Ye(Vn.call(null,v,{path:"/settings/import-collections/?.*"})),Ye(mn.call(null,v)),Ye(Vn.call(null,C,{path:"/settings/auth-providers/?.*"})),Ye(mn.call(null,C)),Ye(Vn.call(null,T,{path:"/settings/tokens/?.*"})),Ye(mn.call(null,T)),Ye(Vn.call(null,O,{path:"/settings/admins/?.*"})),Ye(mn.call(null,O))],E=!0)},p:se,i:se,o:se,d(I){I&&k(e),E=!1,Je(P)}}}class Ui extends Ee{constructor(e){super(),Oe(this,e,null,yD,De,{})}}function gh(n,e,t){const i=n.slice();return i[31]=e[t],i}function _h(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[kD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function kD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="ID",o=D(),r=_("input"),p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","text"),p(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function bh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[31])}function u(...f){return n[18](n[31],...f)}return{c(){e=_("figure"),t=_("img"),s=D(),ti(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,c){w(f,e,c),m(e,t),m(e,s),o||(r=[J(e,"click",a),J(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(f){f&&k(e),o=!1,Je(r)}}}function wD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="Email",o=D(),r=_("input"),p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Se(r,n[3]),u||(f=J(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&Se(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function vh(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[$D,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function $D(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function yh(n){let e,t,i,s,l,o,r,a,u;return s=new Ne({props:{class:"form-field required",name:"password",$$slots:{default:[SD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new Ne({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[CD,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),q(s.$$.fragment),l=D(),o=_("div"),q(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),H(s,i,null),m(t,l),m(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742080|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&1073742336|c[1]&8&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Tt(()=>{a||(a=st(t,on,{duration:150},!0)),a.run(1)}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=st(t,on,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),j(s),j(r),f&&a&&a.end()}}}function SD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="Password",o=D(),r=_("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Se(r,n[8]),u||(f=J(r,"input",n[21]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&Se(r,c[8])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function CD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=D(),s=_("span"),s.textContent="Password confirm",o=D(),r=_("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Se(r,n[9]),u||(f=J(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&512&&r.value!==c[9]&&Se(r,c[9])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function MD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=!n[1].isNew&&_h(n),v=[0,1,2,3,4,5,6,7,8,9],b=[];for(let C=0;C<10;C+=1)b[C]=bh(gh(n,v,C));a=new Ne({props:{class:"form-field required",name:"email",$$slots:{default:[wD,({uniqueId:C})=>({30:C}),({uniqueId:C})=>[C?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[1].isNew&&vh(n),$=(n[1].isNew||n[4])&&yh(n);return{c(){e=_("form"),g&&g.c(),t=D(),i=_("div"),s=_("p"),s.textContent="Avatar",l=D(),o=_("div");for(let C=0;C<10;C+=1)b[C].c();r=D(),q(a.$$.fragment),u=D(),y&&y.c(),f=D(),$&&$.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m(C,S){w(C,e,S),g&&g.m(e,null),m(e,t),m(e,i),m(i,s),m(i,l),m(i,o);for(let T=0;T<10;T+=1)b[T].m(o,null);m(e,r),H(a,e,null),m(e,u),y&&y.m(e,null),m(e,f),$&&$.m(e,null),c=!0,d||(h=J(e,"submit",Wt(n[12])),d=!0)},p(C,S){if(C[1].isNew?g&&(Ae(),L(g,1,1,()=>{g=null}),Pe()):g?(g.p(C,S),S[0]&2&&A(g,1)):(g=_h(C),g.c(),A(g,1),g.m(e,t)),S[0]&4){v=[0,1,2,3,4,5,6,7,8,9];let M;for(M=0;M<10;M+=1){const O=gh(C,v,M);b[M]?b[M].p(O,S):(b[M]=bh(O),b[M].c(),b[M].m(o,null))}for(;M<10;M+=1)b[M].d(1)}const T={};S[0]&1073741832|S[1]&8&&(T.$$scope={dirty:S,ctx:C}),a.$set(T),C[1].isNew?y&&(Ae(),L(y,1,1,()=>{y=null}),Pe()):y?(y.p(C,S),S[0]&2&&A(y,1)):(y=vh(C),y.c(),A(y,1),y.m(e,f)),C[1].isNew||C[4]?$?($.p(C,S),S[0]&18&&A($,1)):($=yh(C),$.c(),A($,1),$.m(e,null)):$&&(Ae(),L($,1,1,()=>{$=null}),Pe())},i(C){c||(A(g),A(a.$$.fragment,C),A(y),A($),c=!0)},o(C){L(g),L(a.$$.fragment,C),L(y),L($),c=!1},d(C){C&&k(e),g&&g.d(),Yt(b,C),j(a),y&&y.d(),$&&$.d(),d=!1,h()}}}function TD(n){let e,t=n[1].isNew?"New admin":"Edit admin",i;return{c(){e=_("h4"),i=N(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].isNew?"New admin":"Edit admin")&&ue(i,t)},d(s){s&&k(e)}}}function kh(n){let e,t,i,s,l,o,r,a,u;return o=new Ti({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[DD]},$$scope:{ctx:n}}}),{c(){e=_("button"),t=_("span"),i=D(),s=_("i"),l=D(),q(o.$$.fragment),r=D(),a=_("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),m(e,l),H(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){L(o.$$.fragment,f),u=!1},d(f){f&&k(e),j(o),f&&k(r),f&&k(a)}}}function DD(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function OD(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&kh(n);return{c(){h&&h.c(),e=D(),t=_("button"),i=_("span"),i.textContent="Cancel",s=D(),l=_("button"),o=_("span"),a=N(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],te(l,"btn-loading",n[6])},m(g,v){h&&h.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=J(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?h&&(Ae(),L(h,1,1,()=>{h=null}),Pe()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=kh(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),(!f||v[0]&64)&&te(l,"btn-loading",g[6])},i(g){f||(A(h),f=!0)},o(g){L(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function ED(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[OD],header:[TD],default:[MD]},$$scope:{ctx:n}};return e=new ui({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[24](null),j(e,s)}}}function AD(n,e,t){let i;const s=xt(),l="admin_"+B.randomString(5);let o,r=new as,a=!1,u=!1,f=0,c="",d="",h="",g=!1;function v(U){return y(U),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(U){ri({}),t(1,r=U!=null&&U.clone?U.clone():new as),$()}function $(){t(4,g=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,h="")}function C(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||g)&&(U.password=d,U.passwordConfirm=h);let Y;r.isNew?Y=ye.admins.create(U):Y=ye.admins.update(r.id,U),Y.then(async Z=>{var de;t(7,u=!1),b(),sn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",Z),((de=ye.authStore.model)==null?void 0:de.id)===Z.id&&ye.authStore.save(ye.authStore.token,Z)}).catch(Z=>{ye.errorResponseHandler(Z)}).finally(()=>{t(6,a=!1)})}function S(){!(r!=null&&r.id)||si("Do you really want to delete the selected admin?",()=>ye.admins.delete(r.id).then(()=>{t(7,u=!1),b(),sn("Successfully deleted admin."),s("delete",r)}).catch(U=>{ye.errorResponseHandler(U)}))}const T=()=>S(),M=()=>b(),O=U=>t(2,f=U),E=(U,Y)=>{(Y.code==="Enter"||Y.code==="Space")&&(Y.preventDefault(),t(2,f=U))};function P(){c=this.value,t(3,c)}function I(){g=this.checked,t(4,g)}function F(){d=this.value,t(8,d)}function z(){h=this.value,t(9,h)}const Q=()=>i&&u?(si("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function ne(U){me[U?"unshift":"push"](()=>{o=U,t(5,o)})}function G(U){tt.call(this,n,U)}function ee(U){tt.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||g||c!==r.email||f!==r.avatar)},[b,r,f,c,g,o,a,u,d,h,i,l,C,S,v,T,M,O,E,P,I,F,z,Q,ne,G,ee]}class PD extends Ee{constructor(e){super(),Oe(this,e,AD,ED,De,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function wh(n,e,t){const i=n.slice();return i[24]=e[t],i}function LD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="id",p(t,"class",B.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function ID(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="email",p(t,"class",B.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function ND(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="created",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function FD(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),s.textContent="updated",p(t,"class",B.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:se,d(l){l&&k(e)}}}function $h(n){let e;function t(l,o){return l[5]?HD:RD}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(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&&k(e)}}}function RD(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Sh(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No admins found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Sh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function HD(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Sh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[17]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function Ch(n){let e;return{c(){e=_("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mh(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g=e[24].email+"",v,b,y,$,C,S,T,M,O,E,P,I,F,z;u=new sr({props:{id:e[24].id}});let Q=e[24].id===e[7].id&&Ch();C=new Si({props:{date:e[24].created}}),M=new Si({props:{date:e[24].updated}});function ne(){return e[15](e[24])}function G(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=D(),a=_("td"),q(u.$$.fragment),f=D(),Q&&Q.c(),c=D(),d=_("td"),h=_("span"),v=N(g),y=D(),$=_("td"),q(C.$$.fragment),S=D(),T=_("td"),q(M.$$.fragment),O=D(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',P=D(),ti(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",b=e[24].email),p(d,"class","col-type-email col-field-email"),p($,"class","col-type-date col-field-created"),p(T,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,U){w(ee,t,U),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),H(u,a,null),m(a,f),Q&&Q.m(a,null),m(t,c),m(t,d),m(d,h),m(h,v),m(t,y),m(t,$),H(C,$,null),m(t,S),m(t,T),H(M,T,null),m(t,O),m(t,E),m(t,P),I=!0,F||(z=[J(t,"click",ne),J(t,"keydown",G)],F=!0)},p(ee,U){e=ee,(!I||U&16&&!ti(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Y={};U&16&&(Y.id=e[24].id),u.$set(Y),e[24].id===e[7].id?Q||(Q=Ch(),Q.c(),Q.m(a,null)):Q&&(Q.d(1),Q=null),(!I||U&16)&&g!==(g=e[24].email+"")&&ue(v,g),(!I||U&16&&b!==(b=e[24].email))&&p(h,"title",b);const Z={};U&16&&(Z.date=e[24].created),C.$set(Z);const de={};U&16&&(de.date=e[24].updated),M.$set(de)},i(ee){I||(A(u.$$.fragment,ee),A(C.$$.fragment,ee),A(M.$$.fragment,ee),I=!0)},o(ee){L(u.$$.fragment,ee),L(C.$$.fragment,ee),L(M.$$.fragment,ee),I=!1},d(ee){ee&&k(t),j(u),Q&&Q.d(),j(C),j(M),F=!1,Je(z)}}}function Th(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),r=N(o),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&ue(s,i),u&16&&o!==(o=a[4].length+"")&&ue(r,o)},d(a){a&&k(e)}}}function jD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y,Z,de,x=[],oe=new Map,Ce,Te,K,ke,ae;a=new Go({}),a.$on("refresh",n[8]),g=new Zo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),g.$on("submit",n[10]);function W(Me){n[11](Me)}let _e={class:"col-type-text",name:"id",$$slots:{default:[LD]},$$scope:{ctx:n}};n[2]!==void 0&&(_e.sort=n[2]),M=new an({props:_e}),me.push(()=>Re(M,"sort",W));function He(Me){n[12](Me)}let Ue={class:"col-type-email col-field-email",name:"email",$$slots:{default:[ID]},$$scope:{ctx:n}};n[2]!==void 0&&(Ue.sort=n[2]),P=new an({props:Ue}),me.push(()=>Re(P,"sort",He));function X(Me){n[13](Me)}let ge={class:"col-type-date col-field-created",name:"created",$$slots:{default:[ND]},$$scope:{ctx:n}};n[2]!==void 0&&(ge.sort=n[2]),z=new an({props:ge}),me.push(()=>Re(z,"sort",X));function ce(Me){n[14](Me)}let we={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[FD]},$$scope:{ctx:n}};n[2]!==void 0&&(we.sort=n[2]),G=new an({props:we}),me.push(()=>Re(G,"sort",ce));let Ge=n[4];const et=Me=>Me[24].id;for(let Me=0;Me<Ge.length;Me+=1){let ze=wh(n,Ge,Me),Xe=et(ze);oe.set(Xe,x[Me]=Mh(Xe,ze))}let Ke=null;Ge.length||(Ke=$h(n));let nt=n[4].length&&Th(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[6]),r=D(),q(a.$$.fragment),u=D(),f=_("div"),c=D(),d=_("button"),d.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New admin</span>`,h=D(),q(g.$$.fragment),v=D(),b=_("div"),y=_("table"),$=_("thead"),C=_("tr"),S=_("th"),T=D(),q(M.$$.fragment),E=D(),q(P.$$.fragment),F=D(),q(z.$$.fragment),ne=D(),q(G.$$.fragment),U=D(),Y=_("th"),Z=D(),de=_("tbody");for(let Me=0;Me<x.length;Me+=1)x[Me].c();Ke&&Ke.c(),Ce=D(),nt&&nt.c(),Te=We(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(S,"class","min-width"),p(Y,"class","col-type-action min-width"),p(y,"class","table"),te(y,"table-loading",n[5]),p(b,"class","table-wrapper")},m(Me,ze){w(Me,e,ze),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,r),H(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),w(Me,h,ze),H(g,Me,ze),w(Me,v,ze),w(Me,b,ze),m(b,y),m(y,$),m($,C),m(C,S),m(C,T),H(M,C,null),m(C,E),H(P,C,null),m(C,F),H(z,C,null),m(C,ne),H(G,C,null),m(C,U),m(C,Y),m(y,Z),m(y,de);for(let Xe=0;Xe<x.length;Xe+=1)x[Xe].m(de,null);Ke&&Ke.m(de,null),w(Me,Ce,ze),nt&&nt.m(Me,ze),w(Me,Te,ze),K=!0,ke||(ae=J(d,"click",n[9]),ke=!0)},p(Me,ze){(!K||ze&64)&&ue(o,Me[6]);const Xe={};ze&2&&(Xe.value=Me[1]),g.$set(Xe);const it={};ze&134217728&&(it.$$scope={dirty:ze,ctx:Me}),!O&&ze&4&&(O=!0,it.sort=Me[2],je(()=>O=!1)),M.$set(it);const ct={};ze&134217728&&(ct.$$scope={dirty:ze,ctx:Me}),!I&&ze&4&&(I=!0,ct.sort=Me[2],je(()=>I=!1)),P.$set(ct);const be={};ze&134217728&&(be.$$scope={dirty:ze,ctx:Me}),!Q&&ze&4&&(Q=!0,be.sort=Me[2],je(()=>Q=!1)),z.$set(be);const Fe={};ze&134217728&&(Fe.$$scope={dirty:ze,ctx:Me}),!ee&&ze&4&&(ee=!0,Fe.sort=Me[2],je(()=>ee=!1)),G.$set(Fe),ze&186&&(Ge=Me[4],Ae(),x=_t(x,ze,et,1,Me,Ge,oe,de,Gt,Mh,null,wh),Pe(),!Ge.length&&Ke?Ke.p(Me,ze):Ge.length?Ke&&(Ke.d(1),Ke=null):(Ke=$h(Me),Ke.c(),Ke.m(de,null))),(!K||ze&32)&&te(y,"table-loading",Me[5]),Me[4].length?nt?nt.p(Me,ze):(nt=Th(Me),nt.c(),nt.m(Te.parentNode,Te)):nt&&(nt.d(1),nt=null)},i(Me){if(!K){A(a.$$.fragment,Me),A(g.$$.fragment,Me),A(M.$$.fragment,Me),A(P.$$.fragment,Me),A(z.$$.fragment,Me),A(G.$$.fragment,Me);for(let ze=0;ze<Ge.length;ze+=1)A(x[ze]);K=!0}},o(Me){L(a.$$.fragment,Me),L(g.$$.fragment,Me),L(M.$$.fragment,Me),L(P.$$.fragment,Me),L(z.$$.fragment,Me),L(G.$$.fragment,Me);for(let ze=0;ze<x.length;ze+=1)L(x[ze]);K=!1},d(Me){Me&&k(e),j(a),Me&&k(h),j(g,Me),Me&&k(v),Me&&k(b),j(M),j(P),j(z),j(G);for(let ze=0;ze<x.length;ze+=1)x[ze].d();Ke&&Ke.d(),Me&&k(Ce),nt&&nt.d(Me),Me&&k(Te),ke=!1,ae()}}}function qD(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[jD]},$$scope:{ctx:n}}});let r={};return l=new PD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[18](null),j(l,a)}}}function VD(n,e,t){let i,s,l;at(n,Vo,F=>t(21,i=F)),at(n,Nt,F=>t(6,s=F)),at(n,Ea,F=>t(7,l=F)),nn(Nt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),ye.admins.getFullList(100,{sort:c||"-created",filter:f}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),h(),ye.errorResponseHandler(F,!1))})}function h(){t(4,a=[])}const g=()=>d(),v=()=>r==null?void 0:r.show(),b=F=>t(1,f=F.detail);function y(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}function C(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}const T=F=>r==null?void 0:r.show(F),M=(F,z)=>{(z.code==="Enter"||z.code==="Space")&&(z.preventDefault(),r==null||r.show(F))},O=()=>t(1,f="");function E(F){me[F?"unshift":"push"](()=>{r=F,t(3,r)})}const P=()=>d(),I=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();Ci("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,g,v,b,y,$,C,S,T,M,O,E,P,I]}class zD extends Ee{constructor(e){super(),Oe(this,e,VD,qD,De,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function BD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Email"),s=D(),l=_("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0]),l.focus(),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&Se(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function UD(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=N("Password"),s=D(),l=_("input"),r=D(),a=_("div"),u=_("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),Se(l,n[1]),w(d,r,h),w(d,a,h),m(a,u),f||(c=[J(l,"input",n[5]),Ye(mn.call(null,u))],f=!0)},p(d,h){h&256&&i!==(i=d[8])&&p(e,"for",i),h&256&&o!==(o=d[8])&&p(l,"id",o),h&2&&l.value!==d[1]&&Se(l,d[1])},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),d&&k(a),f=!1,Je(c)}}}function WD(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new Ne({props:{class:"form-field required",name:"email",$$slots:{default:[BD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"password",$$slots:{default:[UD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="<h4>Admin sign in</h4>",i=D(),q(s.$$.fragment),l=D(),q(o.$$.fragment),r=D(),a=_("button"),a.innerHTML=`<span class="txt">Login</span>
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),te(a,"btn-disabled",n[2]),te(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),H(s,e,null),m(e,l),H(o,e,null),m(e,r),m(e,a),u=!0,f||(c=J(e,"submit",Wt(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const v={};h&770&&(v.$$scope={dirty:h,ctx:d}),o.$set(v),(!u||h&4)&&te(a,"btn-disabled",d[2]),(!u||h&4)&&te(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){L(s.$$.fragment,d),L(o.$$.fragment,d),u=!1},d(d){d&&k(e),j(s),j(o),f=!1,c()}}}function YD(n){let e,t;return e=new l_({props:{$$slots:{default:[WD]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function KD(n,e,t){let i;at(n,Vo,c=>t(6,i=c));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),ye.admins.authViaEmail(l,o).then(()=>{Ci("/")}).catch(()=>{hl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class JD extends Ee{constructor(e){super(),Oe(this,e,KD,YD,De,{})}}function ZD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T;i=new Ne({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[XD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[QD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[xD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new Ne({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[eO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Dh(n);return{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),c=D(),d=_("div"),h=_("div"),g=D(),M&&M.c(),v=D(),b=_("button"),y=_("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(h,"class","flex-fill"),p(y,"class","txt"),p(b,"type","submit"),p(b,"class","btn btn-expanded"),b.disabled=$=!n[3]||n[2],te(b,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,E){w(O,e,E),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),H(a,e,null),m(e,u),H(f,e,null),m(e,c),m(e,d),m(d,h),m(d,g),M&&M.m(d,null),m(d,v),m(d,b),m(b,y),C=!0,S||(T=J(b,"click",n[13]),S=!0)},p(O,E){const P={};E&1572865&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const I={};E&1572865&&(I.$$scope={dirty:E,ctx:O}),o.$set(I);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:O}),a.$set(F);const z={};E&1572865&&(z.$$scope={dirty:E,ctx:O}),f.$set(z),O[3]?M?M.p(O,E):(M=Dh(O),M.c(),M.m(d,v)):M&&(M.d(1),M=null),(!C||E&12&&$!==($=!O[3]||O[2]))&&(b.disabled=$),(!C||E&4)&&te(b,"btn-loading",O[2])},i(O){C||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),C=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(a.$$.fragment,O),L(f.$$.fragment,O),C=!1},d(O){O&&k(e),j(i),j(o),j(a),j(f),M&&M.d(),S=!1,T()}}}function GD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function XD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Application name"),s=D(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].meta.appName),r||(a=J(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&Se(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function QD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Application url"),s=D(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].meta.appUrl),r||(a=J(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&Se(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function xD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Logs max days retention"),s=D(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].logs.maxDays),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].logs.maxDays&&Se(l,u[0].logs.maxDays)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function eO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("input"),i=D(),s=_("label"),l=_("span"),l.textContent="Hide collection create and edit controls",o=D(),r=_("i"),p(e,"type","checkbox"),p(e,"id",t=n[19]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[19])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,s,d),m(s,l),m(s,o),m(s,r),u||(f=[J(e,"change",n[11]),Ye(gt.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&524288&&t!==(t=c[19])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Je(f)}}}function Dh(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),m(e,t),i||(s=J(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function tO(n){let e,t,i,s,l,o,r,a,u;const f=[GD,ZD],c=[];function d(h,g){return h[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=_("header"),e.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=_("div"),s=_("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),m(i,s),c[l].m(s,null),r=!0,a||(u=J(s,"submit",Wt(n[4])),a=!0)},p(h,g){let v=l;l=d(h),l===v?c[l].p(h,g):(Ae(),L(c[v],1,1,()=>{c[v]=null}),Pe(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){L(o),r=!1},d(h){h&&k(e),h&&k(t),h&&k(i),c[l].d(),a=!1,u()}}}function nO(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[tO]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(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){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}function iO(n,e,t){let i,s,l,o;at(n,us,M=>t(14,s=M)),at(n,wo,M=>t(15,l=M)),at(n,Nt,M=>t(16,o=M)),nn(Nt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const M=await ye.settings.getAll()||{};g(M)}catch(M){ye.errorResponseHandler(M)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const M=await ye.settings.update(B.filterRedactedProps(a));g(M),sn("Successfully saved application settings.")}catch(M){ye.errorResponseHandler(M)}t(2,f=!1)}}function g(M={}){var O,E;nn(wo,l=(O=M==null?void 0:M.meta)==null?void 0:O.appName,l),nn(us,s=!!((E=M==null?void 0:M.meta)!=null&&E.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 v(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function $(){a.logs.maxDays=Pt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const S=()=>v(),T=()=>h();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,h,v,r,c,b,y,$,C,S,T]}class sO extends Ee{constructor(e){super(),Oe(this,e,iO,nO,De,{})}}function lO(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=ut(l,s[o]);return{c(){e=_("input"),mi(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Se(e,n[0]),t||(i=J(e,"input",n[8]),t=!0)},p(o,r){mi(e,l=pn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Se(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function oO(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=ut(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=_("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),mi(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Ye(gt.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){mi(s,a=pn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,Je(o)}}}function rO(n){let e;function t(l,o){return l[3]?oO:lO}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(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:se,o:se,d(l){s.d(l),l&&k(e)}}}function aO(n,e,t){const i=["value","mask"];let s=Bt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await Zn(),r==null||r.focus()}const f=()=>u();function c(h){me[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=ut(ut({},e),li(h)),t(5,s=Bt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class nu extends Ee{constructor(e){super(),Oe(this,e,aO,rO,De,{value:0,mask:1})}}function uO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;return{c(){e=_("label"),t=N("Subject"),s=D(),l=_("input"),r=D(),a=_("div"),u=N(`Available placeholder parameters:
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=N(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=N("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(b,y){w(b,e,y),m(e,t),w(b,s,y),w(b,l,y),Se(l,n[0].subject),w(b,r,y),w(b,a,y),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),g||(v=[J(l,"input",n[13]),J(f,"click",n[14]),J(d,"click",n[15])],g=!0)},p(b,y){y[1]&1&&i!==(i=b[31])&&p(e,"for",i),y[1]&1&&o!==(o=b[31])&&p(l,"id",o),y[0]&1&&l.value!==b[0].subject&&Se(l,b[0].subject)},d(b){b&&k(e),b&&k(s),b&&k(l),b&&k(r),b&&k(a),g=!1,Je(v)}}}function fO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y;return{c(){e=_("label"),t=N("Action URL"),s=D(),l=_("input"),r=D(),a=_("div"),u=N(`Available placeholder parameters:
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=N(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=N(`,
`),g=_("span"),g.textContent="{TOKEN}",v=N("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m($,C){w($,e,C),m(e,t),w($,s,C),w($,l,C),Se(l,n[0].actionUrl),w($,r,C),w($,a,C),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),b||(y=[J(l,"input",n[16]),J(f,"click",n[17]),J(d,"click",n[18]),J(g,"click",n[19])],b=!0)},p($,C){C[1]&1&&i!==(i=$[31])&&p(e,"for",i),C[1]&1&&o!==(o=$[31])&&p(l,"id",o),C[0]&1&&l.value!==$[0].actionUrl&&Se(l,$[0].actionUrl)},d($){$&&k(e),$&&k(s),$&&k(l),$&&k(r),$&&k(a),b=!1,Je(y)}}}function cO(n){let e,t,i,s;return{c(){e=_("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),Se(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&Se(e,l[0].body)},i:se,o:se,d(l){l&&k(e),i=!1,s()}}}function dO(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=new o(r(n)),me.push(()=>Re(e,"value",l))),{c(){e&&q(e.$$.fragment),i=We()},m(a,u){e&&H(e,a,u),w(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,je(()=>t=!1)),o!==(o=a[4])){if(e){Ae();const c=e;L(c.$$.fragment,1,0,()=>{j(c,1)}),Pe()}o?(e=new o(r(a)),me.push(()=>Re(e,"value",l)),q(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&j(e,a)}}}function pO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S;const T=[dO,cO],M=[];function O(E,P){return E[4]&&!E[5]?0:1}return l=O(n),o=M[l]=T[l](n),{c(){e=_("label"),t=N("Body (HTML)"),s=D(),o.c(),r=D(),a=_("div"),u=N(`Available placeholder parameters:
`),f=_("span"),f.textContent=`{APP_NAME}
`,c=N(`,
`),d=_("span"),d.textContent=`{APP_URL}
`,h=N(`,
`),g=_("span"),g.textContent=`{TOKEN}
`,v=N(`,
`),b=_("span"),b.textContent=`{ACTION_URL}
`,y=N("."),p(e,"for",i=n[31]),p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(E,P){w(E,e,P),m(e,t),w(E,s,P),M[l].m(E,P),w(E,r,P),w(E,a,P),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),m(a,b),m(a,y),$=!0,C||(S=[J(f,"click",n[22]),J(d,"click",n[23]),J(g,"click",n[24]),J(b,"click",n[25])],C=!0)},p(E,P){(!$||P[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let I=l;l=O(E),l===I?M[l].p(E,P):(Ae(),L(M[I],1,1,()=>{M[I]=null}),Pe(),o=M[l],o?o.p(E,P):(o=M[l]=T[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){$||(A(o),$=!0)},o(E){L(o),$=!1},d(E){E&&k(e),E&&k(s),M[l].d(E),E&&k(r),E&&k(a),C=!1,Je(S)}}}function hO(n){let e,t,i,s,l,o;return e=new Ne({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[uO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new Ne({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[fO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new Ne({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[pO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&k(t),j(i,r),r&&k(s),j(l,r)}}}function Oh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(gt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=st(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=st(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function mO(n){let e,t,i,s,l,o,r,a,u,f,c=n[6]&&Oh();return{c(){e=_("div"),t=_("i"),i=D(),s=_("span"),l=N(n[2]),o=D(),r=_("div"),a=D(),c&&c.c(),u=We(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),w(d,o,h),w(d,r,h),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&ue(l,d[2]),d[6]?c?h[0]&64&&A(c,1):(c=Oh(),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){f||(A(c),f=!0)},o(d){L(c),f=!1},d(d){d&&k(e),d&&k(o),d&&k(r),d&&k(a),c&&c.d(d),d&&k(u)}}}function gO(n){let e,t;const i=[n[8]];let s={$$slots:{header:[mO],default:[hO]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ut(s,i[l]);return e=new ir({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,o){const r=o[0]&256?pn(i,[oi(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){L(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}function _O(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;at(n,Vi,Z=>t(12,o=Z));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function v(){f==null||f.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await Pi(()=>import("./CodeEditor.ab054dd3.js"),["CodeEditor.ab054dd3.js","index.2148ad18.js"],import.meta.url)).default),t(5,d=!1))}function y(Z){B.copyToClipboard(Z),i_(`Copied ${Z} to clipboard`,2e3)}b();function $(){u.subject=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),S=()=>y("{APP_URL}");function T(){u.actionUrl=this.value,t(0,u)}const M=()=>y("{APP_NAME}"),O=()=>y("{APP_URL}"),E=()=>y("{TOKEN}");function P(Z){n.$$.not_equal(u.body,Z)&&(u.body=Z,t(0,u))}function I(){u.body=this.value,t(0,u)}const F=()=>y("{APP_NAME}"),z=()=>y("{APP_URL}"),Q=()=>y("{TOKEN}"),ne=()=>y("{ACTION_URL}");function G(Z){me[Z?"unshift":"push"](()=>{f=Z,t(3,f)})}function ee(Z){tt.call(this,n,Z)}function U(Z){tt.call(this,n,Z)}function Y(Z){tt.call(this,n,Z)}return n.$$set=Z=>{e=ut(ut({},e),li(Z)),t(8,l=Bt(e,s)),"key"in Z&&t(1,r=Z.key),"title"in Z&&t(2,a=Z.title),"config"in Z&&t(0,u=Z.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!B.isEmpty(B.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Oa(r))},[u,r,a,f,c,d,i,y,l,h,g,v,o,$,C,S,T,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y]}class Ir extends Ee{constructor(e){super(),Oe(this,e,_O,gO,De,{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 Eh(n,e,t){const i=n.slice();return i[22]=e[t],i}function Ah(n,e){let t,i,s,l,o,r=e[22].label+"",a,u,f,c,d;return{key:n,first:null,c(){t=_("div"),i=_("input"),l=D(),o=_("label"),a=N(r),f=D(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[21]+e[22].value),i.__value=e[22].value,i.value=i.__value,e[12][0].push(i),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),this.first=t},m(h,g){w(h,t,g),m(t,i),i.checked=i.__value===e[2],m(t,l),m(t,o),m(o,a),m(t,f),c||(d=J(i,"change",e[11]),c=!0)},p(h,g){e=h,g&2097152&&s!==(s=e[21]+e[22].value)&&p(i,"id",s),g&4&&(i.checked=i.__value===e[2]),g&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(h){h&&k(t),e[12][0].splice(e[12][0].indexOf(i),1),c=!1,d()}}}function bO(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[22].value;for(let o=0;o<s.length;o+=1){let r=Eh(n,s,o),a=l(r);t.set(a,e[o]=Ah(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=We()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r&2097284&&(s=o[7],e=_t(e,r,l,1,o,s,t,i.parentNode,bn,Ah,i,Eh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function vO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("To email address"),s=D(),l=_("input"),p(e,"for",i=n[21]),p(l,"type","email"),p(l,"id",o=n[21]),l.autofocus=!0,l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[1]),l.focus(),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"id",o),f&2&&l.value!==u[1]&&Se(l,u[1])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function yO(n){let e,t,i,s,l,o,r;return t=new Ne({props:{class:"form-field required",name:"template",$$slots:{default:[bO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),s=new Ne({props:{class:"form-field required m-0",name:"email",$$slots:{default:[vO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),q(t.$$.fragment),i=D(),q(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){w(a,e,u),H(t,e,null),m(e,i),H(s,e,null),l=!0,o||(r=J(e,"submit",Wt(n[14])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){L(t.$$.fragment,a),L(s.$$.fragment,a),l=!1},d(a){a&&k(e),j(t),j(s),o=!1,r()}}}function kO(n){let e;return{c(){e=_("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function wO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("button"),t=N("Close"),i=D(),s=_("button"),l=_("i"),o=D(),r=_("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],te(s,"btn-loading",n[4])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(s,o),m(s,r),u||(f=[J(e,"click",n[0]),J(s,"click",n[10])],u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&te(s,"btn-loading",c[4])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Je(f)}}}function $O(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[15],popup:!0,$$slots:{footer:[wO],header:[kO],default:[yO]},$$scope:{ctx:n}};return e=new ui({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[15]),l&33554486&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}const Nr="last_email_test",Ph="email_test_request";function SO(n,e,t){let i;const s=xt(),l="email_test_"+B.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(Nr),u=o[0].value,f=!1,c=null;function d(E="",P=""){t(1,a=E||localStorage.getItem(Nr)),t(2,u=P||o[0].value),ri({}),r==null||r.show()}function h(){return clearTimeout(c),r==null?void 0:r.hide()}async function g(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Nr,a),clearTimeout(c),c=setTimeout(()=>{ye.cancelRequest(Ph),hl("Test email send timeout.")},3e4);try{await ye.settings.testEmail(a,u,{$cancelKey:Ph}),sn("Successfully sent test email."),s("submit"),t(4,f=!1),await Zn(),h()}catch(E){t(4,f=!1),ye.errorResponseHandler(E)}clearTimeout(c)}}const v=[[]],b=()=>g();function y(){u=this.__value,t(2,u)}function $(){a=this.value,t(1,a)}const C=()=>g(),S=()=>!f;function T(E){me[E?"unshift":"push"](()=>{r=E,t(3,r)})}function M(E){tt.call(this,n,E)}function O(E){tt.call(this,n,E)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[h,a,u,r,f,i,l,o,g,d,b,y,v,$,C,S,T,M,O]}class CO extends Ee{constructor(e){super(),Oe(this,e,SO,$O,De,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function MO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O,E,P,I;i=new Ne({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[DO,({uniqueId:x})=>({29:x}),({uniqueId:x})=>x?536870912:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[OO,({uniqueId:x})=>({29:x}),({uniqueId:x})=>x?536870912:0]},$$scope:{ctx:n}}});function F(x){n[13](x)}let z={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(z.config=n[0].meta.verificationTemplate),u=new Ir({props:z}),me.push(()=>Re(u,"config",F));function Q(x){n[14](x)}let ne={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(ne.config=n[0].meta.resetPasswordTemplate),d=new Ir({props:ne}),me.push(()=>Re(d,"config",Q));function G(x){n[15](x)}let ee={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(ee.config=n[0].meta.confirmEmailChangeTemplate),v=new Ir({props:ee}),me.push(()=>Re(v,"config",G)),S=new Ne({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[EO,({uniqueId:x})=>({29:x}),({uniqueId:x})=>x?536870912:0]},$$scope:{ctx:n}}});let U=n[0].smtp.enabled&&Lh(n);function Y(x,oe){return x[4]?RO:FO}let Z=Y(n),de=Z(n);return{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),c=D(),q(d.$$.fragment),g=D(),q(v.$$.fragment),y=D(),$=_("hr"),C=D(),q(S.$$.fragment),T=D(),U&&U.c(),M=D(),O=_("div"),E=_("div"),P=D(),de.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(E,"class","flex-fill"),p(O,"class","flex")},m(x,oe){w(x,e,oe),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),w(x,r,oe),w(x,a,oe),H(u,a,null),m(a,c),H(d,a,null),m(a,g),H(v,a,null),w(x,y,oe),w(x,$,oe),w(x,C,oe),H(S,x,oe),w(x,T,oe),U&&U.m(x,oe),w(x,M,oe),w(x,O,oe),m(O,E),m(O,P),de.m(O,null),I=!0},p(x,oe){const Ce={};oe&1610612737&&(Ce.$$scope={dirty:oe,ctx:x}),i.$set(Ce);const Te={};oe&1610612737&&(Te.$$scope={dirty:oe,ctx:x}),o.$set(Te);const K={};!f&&oe&1&&(f=!0,K.config=x[0].meta.verificationTemplate,je(()=>f=!1)),u.$set(K);const ke={};!h&&oe&1&&(h=!0,ke.config=x[0].meta.resetPasswordTemplate,je(()=>h=!1)),d.$set(ke);const ae={};!b&&oe&1&&(b=!0,ae.config=x[0].meta.confirmEmailChangeTemplate,je(()=>b=!1)),v.$set(ae);const W={};oe&1610612737&&(W.$$scope={dirty:oe,ctx:x}),S.$set(W),x[0].smtp.enabled?U?(U.p(x,oe),oe&1&&A(U,1)):(U=Lh(x),U.c(),A(U,1),U.m(M.parentNode,M)):U&&(Ae(),L(U,1,1,()=>{U=null}),Pe()),Z===(Z=Y(x))&&de?de.p(x,oe):(de.d(1),de=Z(x),de&&(de.c(),de.m(O,null)))},i(x){I||(A(i.$$.fragment,x),A(o.$$.fragment,x),A(u.$$.fragment,x),A(d.$$.fragment,x),A(v.$$.fragment,x),A(S.$$.fragment,x),A(U),I=!0)},o(x){L(i.$$.fragment,x),L(o.$$.fragment,x),L(u.$$.fragment,x),L(d.$$.fragment,x),L(v.$$.fragment,x),L(S.$$.fragment,x),L(U),I=!1},d(x){x&&k(e),j(i),j(o),x&&k(r),x&&k(a),j(u),j(d),j(v),x&&k(y),x&&k($),x&&k(C),j(S,x),x&&k(T),U&&U.d(x),x&&k(M),x&&k(O),de.d()}}}function TO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function DO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Sender name"),s=D(),l=_("input"),p(e,"for",i=n[29]),p(l,"type","text"),p(l,"id",o=n[29]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].meta.senderName),r||(a=J(l,"input",n[11]),r=!0)},p(u,f){f&536870912&&i!==(i=u[29])&&p(e,"for",i),f&536870912&&o!==(o=u[29])&&p(l,"id",o),f&1&&l.value!==u[0].meta.senderName&&Se(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function OO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Sender address"),s=D(),l=_("input"),p(e,"for",i=n[29]),p(l,"type","email"),p(l,"id",o=n[29]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].meta.senderAddress),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&536870912&&i!==(i=u[29])&&p(e,"for",i),f&536870912&&o!==(o=u[29])&&p(l,"id",o),f&1&&l.value!==u[0].meta.senderAddress&&Se(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function EO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("input"),i=D(),s=_("label"),l=_("span"),l.innerHTML="Use SMTP mail server <strong>(recommended)</strong>",o=D(),r=_("i"),p(e,"type","checkbox"),p(e,"id",t=n[29]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[29])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,s,d),m(s,l),m(s,o),m(s,r),u||(f=[J(e,"change",n[16]),Ye(gt.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d&536870912&&t!==(t=c[29])&&p(e,"id",t),d&1&&(e.checked=c[0].smtp.enabled),d&536870912&&a!==(a=c[29])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Je(f)}}}function Lh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C;return i=new Ne({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[AO,({uniqueId:S})=>({29:S}),({uniqueId:S})=>S?536870912:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[PO,({uniqueId:S})=>({29:S}),({uniqueId:S})=>S?536870912:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[LO,({uniqueId:S})=>({29:S}),({uniqueId:S})=>S?536870912:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"smtp.username",$$slots:{default:[IO,({uniqueId:S})=>({29:S}),({uniqueId:S})=>S?536870912:0]},$$scope:{ctx:n}}}),v=new Ne({props:{class:"form-field",name:"smtp.password",$$slots:{default:[NO,({uniqueId:S})=>({29:S}),({uniqueId:S})=>S?536870912:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),f=D(),c=_("div"),q(d.$$.fragment),h=D(),g=_("div"),q(v.$$.fragment),b=D(),y=_("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p(e,"class","grid")},m(S,T){w(S,e,T),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),m(e,f),m(e,c),H(d,c,null),m(e,h),m(e,g),H(v,g,null),m(e,b),m(e,y),C=!0},p(S,T){const M={};T&1610612737&&(M.$$scope={dirty:T,ctx:S}),i.$set(M);const O={};T&1610612737&&(O.$$scope={dirty:T,ctx:S}),o.$set(O);const E={};T&1610612737&&(E.$$scope={dirty:T,ctx:S}),u.$set(E);const P={};T&1610612737&&(P.$$scope={dirty:T,ctx:S}),d.$set(P);const I={};T&1610612737&&(I.$$scope={dirty:T,ctx:S}),v.$set(I)},i(S){C||(A(i.$$.fragment,S),A(o.$$.fragment,S),A(u.$$.fragment,S),A(d.$$.fragment,S),A(v.$$.fragment,S),S&&Tt(()=>{$||($=st(e,on,{duration:150},!0)),$.run(1)}),C=!0)},o(S){L(i.$$.fragment,S),L(o.$$.fragment,S),L(u.$$.fragment,S),L(d.$$.fragment,S),L(v.$$.fragment,S),S&&($||($=st(e,on,{duration:150},!1)),$.run(0)),C=!1},d(S){S&&k(e),j(i),j(o),j(u),j(d),j(v),S&&$&&$.end()}}}function AO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("SMTP server host"),s=D(),l=_("input"),p(e,"for",i=n[29]),p(l,"type","text"),p(l,"id",o=n[29]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].smtp.host),r||(a=J(l,"input",n[17]),r=!0)},p(u,f){f&536870912&&i!==(i=u[29])&&p(e,"for",i),f&536870912&&o!==(o=u[29])&&p(l,"id",o),f&1&&l.value!==u[0].smtp.host&&Se(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function PO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Port"),s=D(),l=_("input"),p(e,"for",i=n[29]),p(l,"type","number"),p(l,"id",o=n[29]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].smtp.port),r||(a=J(l,"input",n[18]),r=!0)},p(u,f){f&536870912&&i!==(i=u[29])&&p(e,"for",i),f&536870912&&o!==(o=u[29])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].smtp.port&&Se(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function LO(n){let e,t,i,s,l,o,r;function a(f){n[19](f)}let u={id:n[29],items:n[6]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new ps({props:u}),me.push(()=>Re(l,"keyOfSelected",a)),{c(){e=_("label"),t=N("TLS Encryption"),s=D(),q(l.$$.fragment),p(e,"for",i=n[29])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&536870912&&i!==(i=f[29]))&&p(e,"for",i);const d={};c&536870912&&(d.id=f[29]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,je(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),j(l,f)}}}function IO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Username"),s=D(),l=_("input"),p(e,"for",i=n[29]),p(l,"type","text"),p(l,"id",o=n[29])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].smtp.username),r||(a=J(l,"input",n[20]),r=!0)},p(u,f){f&536870912&&i!==(i=u[29])&&p(e,"for",i),f&536870912&&o!==(o=u[29])&&p(l,"id",o),f&1&&l.value!==u[0].smtp.username&&Se(l,u[0].smtp.username)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function NO(n){let e,t,i,s,l,o,r;function a(f){n[21](f)}let u={id:n[29]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new nu({props:u}),me.push(()=>Re(l,"value",a)),{c(){e=_("label"),t=N("Password"),s=D(),q(l.$$.fragment),p(e,"for",i=n[29])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&536870912&&i!==(i=f[29]))&&p(e,"for",i);const d={};c&536870912&&(d.id=f[29]),!o&&c&1&&(o=!0,d.value=f[0].smtp.password,je(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),j(l,f)}}}function FO(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[24]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function RO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=D(),s=_("button"),l=_("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],te(s,"btn-loading",n[3])},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),m(s,l),r||(a=[J(e,"click",n[22]),J(s,"click",n[23])],r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f&8&&te(s,"btn-loading",u[3])},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,Je(a)}}}function HO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[TO,MO],$=[];function C(S,T){return S[2]?0:1}return d=C(n),h=$[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[5]),r=D(),a=_("div"),u=_("form"),f=_("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(S,r,T),w(S,a,T),m(a,u),m(u,f),m(u,c),$[d].m(u,null),g=!0,v||(b=J(u,"submit",Wt(n[25])),v=!0)},p(S,T){(!g||T&32)&&ue(o,S[5]);let M=d;d=C(S),d===M?$[d].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),h=$[d],h?h.p(S,T):(h=$[d]=y[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&k(e),S&&k(r),S&&k(a),$[d].d(),v=!1,b()}}}function jO(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[HO]},$$scope:{ctx:n}}});let r={};return l=new CO({props:r}),n[26](l),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&1073741887&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[26](null),j(l,a)}}}function qO(n,e,t){let i,s,l;at(n,Nt,ee=>t(5,l=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}];nn(Nt,l="Mail settings",l);let r,a={},u={},f=!1,c=!1;d();async function d(){t(2,f=!0);try{const ee=await ye.settings.getAll()||{};g(ee)}catch(ee){ye.errorResponseHandler(ee)}t(2,f=!1)}async function h(){if(!(c||!s)){t(3,c=!0);try{const ee=await ye.settings.update(B.filterRedactedProps(u));g(ee),ri({}),sn("Successfully saved mail settings.")}catch(ee){ye.errorResponseHandler(ee)}t(3,c=!1)}}function g(ee={}){t(0,u={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),t(9,a=JSON.parse(JSON.stringify(u)))}function v(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function b(){u.meta.senderName=this.value,t(0,u)}function y(){u.meta.senderAddress=this.value,t(0,u)}function $(ee){n.$$.not_equal(u.meta.verificationTemplate,ee)&&(u.meta.verificationTemplate=ee,t(0,u))}function C(ee){n.$$.not_equal(u.meta.resetPasswordTemplate,ee)&&(u.meta.resetPasswordTemplate=ee,t(0,u))}function S(ee){n.$$.not_equal(u.meta.confirmEmailChangeTemplate,ee)&&(u.meta.confirmEmailChangeTemplate=ee,t(0,u))}function T(){u.smtp.enabled=this.checked,t(0,u)}function M(){u.smtp.host=this.value,t(0,u)}function O(){u.smtp.port=Pt(this.value),t(0,u)}function E(ee){n.$$.not_equal(u.smtp.tls,ee)&&(u.smtp.tls=ee,t(0,u))}function P(){u.smtp.username=this.value,t(0,u)}function I(ee){n.$$.not_equal(u.smtp.password,ee)&&(u.smtp.password=ee,t(0,u))}const F=()=>v(),z=()=>h(),Q=()=>r==null?void 0:r.show(),ne=()=>h();function G(ee){me[ee?"unshift":"push"](()=>{r=ee,t(1,r)})}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(4,s=i!=JSON.stringify(u))},[u,r,f,c,s,l,o,h,v,a,i,b,y,$,C,S,T,M,O,E,P,I,F,z,Q,ne,G]}class VO extends Ee{constructor(e){super(),Oe(this,e,qO,jO,De,{})}}function zO(n){var S,T;let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[UO,({uniqueId:M})=>({25:M}),({uniqueId:M})=>M?33554432:0]},$$scope:{ctx:n}}});let b=((S=n[0].s3)==null?void 0:S.enabled)!=n[1].s3.enabled&&Ih(n),y=n[1].s3.enabled&&Nh(n),$=((T=n[1].s3)==null?void 0:T.enabled)&&!n[6]&&!n[3]&&Fh(n),C=n[6]&&Rh(n);return{c(){q(e.$$.fragment),t=D(),b&&b.c(),i=D(),y&&y.c(),s=D(),l=_("div"),o=_("div"),r=D(),$&&$.c(),a=D(),C&&C.c(),u=D(),f=_("button"),c=_("span"),c.textContent="Save changes",p(o,"class","flex-fill"),p(c,"class","txt"),p(f,"type","submit"),p(f,"class","btn btn-expanded"),f.disabled=d=!n[6]||n[3],te(f,"btn-loading",n[3]),p(l,"class","flex")},m(M,O){H(e,M,O),w(M,t,O),b&&b.m(M,O),w(M,i,O),y&&y.m(M,O),w(M,s,O),w(M,l,O),m(l,o),m(l,r),$&&$.m(l,null),m(l,a),C&&C.m(l,null),m(l,u),m(l,f),m(f,c),h=!0,g||(v=J(f,"click",n[19]),g=!0)},p(M,O){var P,I;const E={};O&100663298&&(E.$$scope={dirty:O,ctx:M}),e.$set(E),((P=M[0].s3)==null?void 0:P.enabled)!=M[1].s3.enabled?b?(b.p(M,O),O&3&&A(b,1)):(b=Ih(M),b.c(),A(b,1),b.m(i.parentNode,i)):b&&(Ae(),L(b,1,1,()=>{b=null}),Pe()),M[1].s3.enabled?y?(y.p(M,O),O&2&&A(y,1)):(y=Nh(M),y.c(),A(y,1),y.m(s.parentNode,s)):y&&(Ae(),L(y,1,1,()=>{y=null}),Pe()),((I=M[1].s3)==null?void 0:I.enabled)&&!M[6]&&!M[3]?$?$.p(M,O):($=Fh(M),$.c(),$.m(l,a)):$&&($.d(1),$=null),M[6]?C?C.p(M,O):(C=Rh(M),C.c(),C.m(l,u)):C&&(C.d(1),C=null),(!h||O&72&&d!==(d=!M[6]||M[3]))&&(f.disabled=d),(!h||O&8)&&te(f,"btn-loading",M[3])},i(M){h||(A(e.$$.fragment,M),A(b),A(y),h=!0)},o(M){L(e.$$.fragment,M),L(b),L(y),h=!1},d(M){j(e,M),M&&k(t),b&&b.d(M),M&&k(i),y&&y.d(M),M&&k(s),M&&k(l),$&&$.d(),C&&C.d(),g=!1,v()}}}function BO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function UO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[25]),e.required=!0,p(s,"for",o=n[25])},m(u,f){w(u,e,f),e.checked=n[1].s3.enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[11]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&2&&(e.checked=u[1].s3.enabled),f&33554432&&o!==(o=u[25])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Ih(n){var P;let e,t,i,s,l,o,r,a=(P=n[0].s3)!=null&&P.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",h,g,v,b,y,$,C,S,T,M,O,E;return{c(){e=_("div"),t=_("div"),i=_("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',s=D(),l=_("div"),o=N(`If you have existing uploaded files, you'll have to migrate them manually from
the
`),r=_("strong"),u=N(a),f=N(`
to the
`),c=_("strong"),h=N(d),g=N(`.
`),v=_("br"),b=N(`
There are numerous command line tools that can help you, such as:
`),y=_("a"),y.textContent=`rclone
`,$=N(`,
`),C=_("a"),C.textContent=`s5cmd
`,S=N(", etc."),T=D(),M=_("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener"),p(y,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener"),p(C,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(I,F){w(I,e,F),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(c,h),m(l,g),m(l,v),m(l,b),m(l,y),m(l,$),m(l,C),m(l,S),m(e,T),m(e,M),E=!0},p(I,F){var z;(!E||F&1)&&a!==(a=(z=I[0].s3)!=null&&z.enabled?"S3 storage":"local file system")&&ue(u,a),(!E||F&2)&&d!==(d=I[1].s3.enabled?"S3 storage":"local file system")&&ue(h,d)},i(I){E||(I&&Tt(()=>{O||(O=st(e,on,{duration:150},!0)),O.run(1)}),E=!0)},o(I){I&&(O||(O=st(e,on,{duration:150},!1)),O.run(0)),E=!1},d(I){I&&k(e),I&&O&&O.end()}}}function Nh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M;return i=new Ne({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[WO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[YO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field required",name:"s3.region",$$slots:{default:[KO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[JO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),v=new Ne({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[ZO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),$=new Ne({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[GO,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),f=D(),c=_("div"),q(d.$$.fragment),h=D(),g=_("div"),q(v.$$.fragment),b=D(),y=_("div"),q($.$$.fragment),C=D(),S=_("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p(S,"class","col-lg-12"),p(e,"class","grid")},m(O,E){w(O,e,E),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),m(e,f),m(e,c),H(d,c,null),m(e,h),m(e,g),H(v,g,null),m(e,b),m(e,y),H($,y,null),m(e,C),m(e,S),M=!0},p(O,E){const P={};E&100663298&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const I={};E&100663298&&(I.$$scope={dirty:E,ctx:O}),o.$set(I);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:O}),u.$set(F);const z={};E&100663298&&(z.$$scope={dirty:E,ctx:O}),d.$set(z);const Q={};E&100663298&&(Q.$$scope={dirty:E,ctx:O}),v.$set(Q);const ne={};E&100663298&&(ne.$$scope={dirty:E,ctx:O}),$.$set(ne)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(v.$$.fragment,O),A($.$$.fragment,O),O&&Tt(()=>{T||(T=st(e,on,{duration:150},!0)),T.run(1)}),M=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(u.$$.fragment,O),L(d.$$.fragment,O),L(v.$$.fragment,O),L($.$$.fragment,O),O&&(T||(T=st(e,on,{duration:150},!1)),T.run(0)),M=!1},d(O){O&&k(e),j(i),j(o),j(u),j(d),j(v),j($),O&&T&&T.end()}}}function WO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Endpoint"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[1].s3.endpoint),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&Se(l,u[1].s3.endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function YO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Bucket"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[1].s3.bucket),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&Se(l,u[1].s3.bucket)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function KO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Region"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[1].s3.region),r||(a=J(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.region&&Se(l,u[1].s3.region)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function JO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Access key"),s=D(),l=_("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[1].s3.accessKey),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.accessKey&&Se(l,u[1].s3.accessKey)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function ZO(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 nu({props:u}),me.push(()=>Re(l,"value",a)),{c(){e=_("label"),t=N("Secret"),s=D(),q(l.$$.fragment),p(e,"for",i=n[25])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&33554432&&i!==(i=f[25]))&&p(e,"for",i);const d={};c&33554432&&(d.id=f[25]),!o&&c&2&&(o=!0,d.value=f[1].s3.secret,je(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),j(l,f)}}}function GO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("input"),i=D(),s=_("label"),l=_("span"),l.textContent="Force path-style addressing",o=D(),r=_("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[1].s3.forcePathStyle,w(c,i,d),w(c,s,d),m(s,l),m(s,o),m(s,r),u||(f=[J(e,"change",n[17]),Ye(gt.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(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&2&&(e.checked=c[1].s3.forcePathStyle),d&33554432&&a!==(a=c[25])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Je(f)}}}function Fh(n){let e;function t(l,o){return l[4]?xO:l[5]?QO:XO}let i=t(n),s=i(n);return{c(){s.c(),e=We()},m(l,o){s.m(l,o),w(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&&k(e)}}}function XO(n){let e;return{c(){e=_("div"),e.innerHTML=`<i class="ri-checkbox-circle-line txt-success"></i>
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function QO(n){let e,t,i,s;return{c(){e=_("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Ye(t=gt.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Nn(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function xO(n){let e;return{c(){e=_("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function Rh(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),m(e,t),i||(s=J(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function e5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[BO,zO],$=[];function C(S,T){return S[2]?0:1}return d=C(n),h=$[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[7]),r=D(),a=_("div"),u=_("form"),f=_("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>`,c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(S,r,T),w(S,a,T),m(a,u),m(u,f),m(u,c),$[d].m(u,null),g=!0,v||(b=J(u,"submit",Wt(n[20])),v=!0)},p(S,T){(!g||T&128)&&ue(o,S[7]);let M=d;d=C(S),d===M?$[d].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),h=$[d],h?h.p(S,T):(h=$[d]=y[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&k(e),S&&k(r),S&&k(a),$[d].d(),v=!1,b()}}}function t5(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[e5]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(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){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}const Fr="s3_test_request";function n5(n,e,t){let i,s,l;at(n,Nt,z=>t(7,l=z)),nn(Nt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;h();async function h(){t(2,a=!0);try{const z=await ye.settings.getAll()||{};b(z)}catch(z){ye.errorResponseHandler(z)}t(2,a=!1)}async function g(){if(t(5,c=null),!!r.s3.enabled){t(4,f=!0);try{await ye.settings.testS3({$cancelKey:Fr})}catch(z){t(5,c=z)}t(4,f=!1)}}async function v(){if(!(u||!s)){t(3,u=!0),clearTimeout(d),d=setTimeout(()=>{ye.cancelRequest(Fr),addErrorToast("S3 test connection timeout.")},3e4);try{ye.cancelRequest(Fr);const z=await ye.settings.update(B.filterRedactedProps(r));ri({}),await b(z),J0(),c?K0("Successfully saved but failed to establish S3 connection."):sn("Successfully saved files storage settings.")}catch(z){ye.errorResponseHandler(z)}clearTimeout(d),t(3,u=!1)}}async function b(z={}){t(1,r={s3:(z==null?void 0:z.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await g()}async function y(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await g()}function $(){r.s3.enabled=this.checked,t(1,r)}function C(){r.s3.endpoint=this.value,t(1,r)}function S(){r.s3.bucket=this.value,t(1,r)}function T(){r.s3.region=this.value,t(1,r)}function M(){r.s3.accessKey=this.value,t(1,r)}function O(z){n.$$.not_equal(r.s3.secret,z)&&(r.s3.secret=z,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const P=()=>y(),I=()=>v(),F=()=>v();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,v,y,i,$,C,S,T,M,O,E,P,I,F]}class i5 extends Ee{constructor(e){super(),Oe(this,e,n5,t5,De,{})}}function s5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(s,"for",o=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Hh(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Ne({props:{class:"form-field required",name:"emailAuth.minPasswordLength",$$slots:{default:[l5,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field "+(B.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailAuth.exceptDomains",$$slots:{default:[o5,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field "+(B.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailAuth.onlyDomains",$$slots:{default:[r5,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),q(i.$$.fragment),s=D(),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),H(i,t,null),m(e,s),m(e,l),H(o,l,null),m(e,r),m(e,a),H(u,a,null),c=!0},p(d,h){const g={};h&196609&&(g.$$scope={dirty:h,ctx:d}),i.$set(g);const v={};h&1&&(v.class="form-field "+(B.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),o.$set(v);const b={};h&1&&(b.class="form-field "+(B.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Tt(()=>{f||(f=st(e,on,{duration:150},!0)),f.run(1)}),c=!0)},o(d){L(i.$$.fragment,d),L(o.$$.fragment,d),L(u.$$.fragment,d),d&&(f||(f=st(e,on,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),j(i),j(o),j(u),d&&f&&f.end()}}}function l5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Minimum password length"),s=D(),l=_("input"),p(e,"for",i=n[16]),p(l,"type","number"),p(l,"id",o=n[16]),l.required=!0,p(l,"min","5"),p(l,"max","200")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].minPasswordLength),r||(a=J(l,"input",n[9]),r=!0)},p(u,f){f&65536&&i!==(i=u[16])&&p(e,"for",i),f&65536&&o!==(o=u[16])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].minPasswordLength&&Se(l,u[0].minPasswordLength)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function o5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[10](b)}let v={id:n[16],disabled:!B.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),r=new hs({props:v}),me.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(gt.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]))&&p(e,"for",l);const $={};y&65536&&($.id=b[16]),y&1&&($.disabled=!B.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,je(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function r5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!B.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new hs({props:v}),me.push(()=>Re(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=D(),s=_("i"),o=D(),q(r.$$.fragment),u=D(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]+".config.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),H(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(gt.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]+".config.onlyDomains"))&&p(e,"for",l);const $={};y&65536&&($.id=b[16]+".config.onlyDomains"),y&1&&($.disabled=!B.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,je(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),j(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function a5(n){let e,t,i,s;e=new Ne({props:{class:"form-field form-field-toggle m-b-0",name:"emailAuth.enabled",$$slots:{default:[s5,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Hh(n);return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=We()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=Hh(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Ae(),L(l,1,1,()=>{l=null}),Pe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){j(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function u5(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function f5(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function jh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(gt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=st(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=st(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function c5(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].enabled?f5:u5}let u=a(n),f=u(n),c=n[2]&&jh();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Email/Password</span>`,t=D(),f.c(),i=D(),s=_("div"),l=D(),c&&c.c(),o=We(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),f.m(d,h),w(d,i,h),w(d,s,h),w(d,l,h),c&&c.m(d,h),w(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&A(c,1):(c=jh(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(Ae(),L(c,1,1,()=>{c=null}),Pe())},i(d){r||(A(c),r=!0)},o(d){L(c),r=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(o)}}}function d5(n){let e,t;const i=[n[3]];let s={$$slots:{header:[c5],default:[a5]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ut(s,i[l]);return e=new ir({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,[o]){const r=o&8?pn(i,[oi(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[12](null),j(e,l)}}}function p5(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;at(n,Vi,S=>t(7,o=S));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function h(){r.minPasswordLength=Pt(this.value),t(0,r)}function g(S){n.$$.not_equal(r.exceptDomains,S)&&(r.exceptDomains=S,t(0,r))}function v(S){n.$$.not_equal(r.onlyDomains,S)&&(r.onlyDomains=S,t(0,r))}function b(S){me[S?"unshift":"push"](()=>{a=S,t(1,a)})}function y(S){tt.call(this,n,S)}function $(S){tt.call(this,n,S)}function C(S){tt.call(this,n,S)}return n.$$set=S=>{e=ut(ut({},e),li(S)),t(3,l=Bt(e,s)),"config"in S&&t(0,r=S.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!B.isEmpty(o==null?void 0:o.emailAuth))},[r,a,i,l,u,f,c,o,d,h,g,v,b,y,$,C]}class h5 extends Ee{constructor(e){super(),Oe(this,e,p5,d5,De,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function m5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[12]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function qh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;l=new Ne({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[g5,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[_5,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),c=new Ne({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[b5,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}});let v=n[4]&&Vh(n);return{c(){e=_("div"),t=_("div"),i=D(),s=_("div"),q(l.$$.fragment),o=D(),r=_("div"),q(a.$$.fragment),u=D(),f=_("div"),q(c.$$.fragment),d=D(),v&&v.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(r,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),H(l,s,null),m(e,o),m(e,r),H(a,r,null),m(e,u),m(e,f),H(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const $={};y&2&&($.name=b[1]+".clientId"),y&25165825&&($.$$scope={dirty:y,ctx:b}),l.$set($);const C={};y&2&&(C.name=b[1]+".clientSecret"),y&25165825&&(C.$$scope={dirty:y,ctx:b}),a.$set(C);const S={};y&2&&(S.name=b[1]+".allowRegistrations"),y&25165825&&(S.$$scope={dirty:y,ctx:b}),c.$set(S),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=Vh(b),v.c(),A(v,1),v.m(e,null)):v&&(Ae(),L(v,1,1,()=>{v=null}),Pe())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Tt(()=>{h||(h=st(e,on,{duration:200},!0)),h.run(1)}),g=!0)},o(b){L(l.$$.fragment,b),L(a.$$.fragment,b),L(c.$$.fragment,b),L(v),b&&(h||(h=st(e,on,{duration:200},!1)),h.run(0)),g=!1},d(b){b&&k(e),j(l),j(a),j(c),v&&v.d(),b&&h&&h.end()}}}function g5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Client ID"),s=D(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].clientId),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].clientId&&Se(l,u[0].clientId)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function _5(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[23],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new nu({props:u}),me.push(()=>Re(l,"value",a)),{c(){e=_("label"),t=N("Client Secret"),s=D(),q(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,je(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),j(l,f)}}}function b5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=D(),s=_("label"),l=N("Allow registration for new users"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].allowRegistrations,w(u,i,f),w(u,s,f),m(s,l),r||(a=J(e,"change",n[15]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].allowRegistrations),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Vh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return o=new Ne({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[v5,({uniqueId:g})=>({23:g}),({uniqueId:g})=>g?8388608:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[y5,({uniqueId:g})=>({23:g}),({uniqueId:g})=>g?8388608:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[k5,({uniqueId:g})=>({23:g}),({uniqueId:g})=>g?8388608:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),t.textContent="Optional endpoints (if you self host the OAUTH2 service)",i=D(),s=_("div"),l=_("div"),q(o.$$.fragment),r=D(),a=_("div"),q(u.$$.fragment),f=D(),c=_("div"),q(d.$$.fragment),p(t,"class","section-title"),p(l,"class","col-lg-4"),p(a,"class","col-lg-4"),p(c,"class","col-lg-4"),p(s,"class","grid"),p(e,"class","col-lg-12")},m(g,v){w(g,e,v),m(e,t),m(e,i),m(e,s),m(s,l),H(o,l,null),m(s,r),m(s,a),H(u,a,null),m(s,f),m(s,c),H(d,c,null),h=!0},p(g,v){const b={};v&2&&(b.name=g[1]+".authUrl"),v&25165825&&(b.$$scope={dirty:v,ctx:g}),o.$set(b);const y={};v&2&&(y.name=g[1]+".tokenUrl"),v&25165825&&(y.$$scope={dirty:v,ctx:g}),u.$set(y);const $={};v&2&&($.name=g[1]+".userApiUrl"),v&25165825&&($.$$scope={dirty:v,ctx:g}),d.$set($)},i(g){h||(A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){L(o.$$.fragment,g),L(u.$$.fragment,g),L(d.$$.fragment,g),h=!1},d(g){g&&k(e),j(o),j(u),j(d)}}}function v5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Custom Auth URL"),s=D(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","url"),p(l,"id",o=n[23])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].authUrl),r||(a=J(l,"input",n[16]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&Se(l,u[0].authUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function y5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Custom Token URL"),s=D(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].tokenUrl),r||(a=J(l,"input",n[17]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&Se(l,u[0].tokenUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function k5(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Custom User API URL"),s=D(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Se(l,n[0].userApiUrl),r||(a=J(l,"input",n[18]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&Se(l,u[0].userApiUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function w5(n){let e,t,i,s;e=new Ne({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[m5,({uniqueId:o})=>({23:o}),({uniqueId:o})=>o?8388608:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&qh(n);return{c(){q(e.$$.fragment),t=D(),l&&l.c(),i=We()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&2&&(a.name=o[1]+".enabled"),r&25165825&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=qh(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Ae(),L(l,1,1,()=>{l=null}),Pe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){j(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function zh(n){let e;return{c(){e=_("i"),p(e,"class",n[3])},m(t,i){w(t,e,i)},p(t,i){i&8&&p(e,"class",t[3])},d(t){t&&k(e)}}}function $5(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label label-hint")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function S5(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(gt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=st(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=st(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function C5(n){let e,t,i,s,l,o,r,a,u,f,c=n[3]&&zh(n);function d(b,y){return b[0].enabled?S5:$5}let h=d(n),g=h(n),v=n[6]&&Bh();return{c(){e=_("div"),c&&c.c(),t=D(),i=_("span"),s=N(n[2]),l=D(),g.c(),o=D(),r=_("div"),a=D(),v&&v.c(),u=We(),p(i,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(b,y){w(b,e,y),c&&c.m(e,null),m(e,t),m(e,i),m(i,s),w(b,l,y),g.m(b,y),w(b,o,y),w(b,r,y),w(b,a,y),v&&v.m(b,y),w(b,u,y),f=!0},p(b,y){b[3]?c?c.p(b,y):(c=zh(b),c.c(),c.m(e,t)):c&&(c.d(1),c=null),(!f||y&4)&&ue(s,b[2]),h!==(h=d(b))&&(g.d(1),g=h(b),g&&(g.c(),g.m(o.parentNode,o))),b[6]?v?y&64&&A(v,1):(v=Bh(),v.c(),A(v,1),v.m(u.parentNode,u)):v&&(Ae(),L(v,1,1,()=>{v=null}),Pe())},i(b){f||(A(v),f=!0)},o(b){L(v),f=!1},d(b){b&&k(e),c&&c.d(),b&&k(l),g.d(b),b&&k(o),b&&k(r),b&&k(a),v&&v.d(b),b&&k(u)}}}function M5(n){let e,t;const i=[n[7]];let s={$$slots:{header:[C5],default:[w5]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ut(s,i[l]);return e=new ir({props:s}),n[19](e),e.$on("expand",n[20]),e.$on("collapse",n[21]),e.$on("toggle",n[22]),{c(){q(e.$$.fragment)},m(l,o){H(e,l,o),t=!0},p(l,[o]){const r=o&128?pn(i,[oi(l[7])]):{};o&16777311&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[19](null),j(e,l)}}}function T5(n,e,t){let i;const s=["key","title","icon","config","showSelfHostedFields","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;at(n,Vi,F=>t(11,o=F));let{key:r}=e,{title:a}=e,{icon:u=""}=e,{config:f={}}=e,{showSelfHostedFields:c=!1}=e,d;function h(){d==null||d.expand()}function g(){d==null||d.collapse()}function v(){d==null||d.collapseSiblings()}function b(){f.enabled=this.checked,t(0,f)}function y(){f.clientId=this.value,t(0,f)}function $(F){n.$$.not_equal(f.clientSecret,F)&&(f.clientSecret=F,t(0,f))}function C(){f.allowRegistrations=this.checked,t(0,f)}function S(){f.authUrl=this.value,t(0,f)}function T(){f.tokenUrl=this.value,t(0,f)}function M(){f.userApiUrl=this.value,t(0,f)}function O(F){me[F?"unshift":"push"](()=>{d=F,t(5,d)})}function E(F){tt.call(this,n,F)}function P(F){tt.call(this,n,F)}function I(F){tt.call(this,n,F)}return n.$$set=F=>{e=ut(ut({},e),li(F)),t(7,l=Bt(e,s)),"key"in F&&t(1,r=F.key),"title"in F&&t(2,a=F.title),"icon"in F&&t(3,u=F.icon),"config"in F&&t(0,f=F.config),"showSelfHostedFields"in F&&t(4,c=F.showSelfHostedFields)},n.$$.update=()=>{n.$$.dirty&2050&&t(6,i=!B.isEmpty(B.getNestedVal(o,r))),n.$$.dirty&3&&(f.enabled||Oa(r))},[f,r,a,u,c,d,i,l,h,g,v,o,b,y,$,C,S,T,M,O,E,P,I]}class D5 extends Ee{constructor(e){super(),Oe(this,e,T5,M5,De,{key:1,title:2,icon:3,config:0,showSelfHostedFields:4,expand:8,collapse:9,collapseSiblings:10})}get expand(){return this.$$.ctx[8]}get collapse(){return this.$$.ctx[9]}get collapseSiblings(){return this.$$.ctx[10]}}function Uh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i[19]=e,i[20]=t,i}function O5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;function b(M){n[11](M)}let y={single:!0};n[0].emailAuth!==void 0&&(y.config=n[0].emailAuth),t=new h5({props:y}),n[10](t),me.push(()=>Re(t,"config",b));let $=Object.entries(wl),C=[];for(let M=0;M<$.length;M+=1)C[M]=Wh(Uh(n,$,M));const S=M=>L(C[M],1,1,()=>{C[M]=null});let T=n[4]&&Yh(n);return{c(){e=_("div"),q(t.$$.fragment),s=D();for(let M=0;M<C.length;M+=1)C[M].c();l=D(),o=_("div"),r=_("div"),a=D(),T&&T.c(),u=D(),f=_("button"),c=_("span"),c.textContent="Save changes",p(e,"class","accordions"),p(r,"class","flex-fill"),p(c,"class","txt"),p(f,"type","submit"),p(f,"class","btn btn-expanded"),f.disabled=d=!n[4]||n[3],te(f,"btn-loading",n[3]),p(o,"class","flex m-t-base")},m(M,O){w(M,e,O),H(t,e,null),m(e,s);for(let E=0;E<C.length;E+=1)C[E].m(e,null);w(M,l,O),w(M,o,O),m(o,r),m(o,a),T&&T.m(o,null),m(o,u),m(o,f),m(f,c),h=!0,g||(v=J(f,"click",n[14]),g=!0)},p(M,O){const E={};if(!i&&O&1&&(i=!0,E.config=M[0].emailAuth,je(()=>i=!1)),t.$set(E),O&1){$=Object.entries(wl);let P;for(P=0;P<$.length;P+=1){const I=Uh(M,$,P);C[P]?(C[P].p(I,O),A(C[P],1)):(C[P]=Wh(I),C[P].c(),A(C[P],1),C[P].m(e,null))}for(Ae(),P=$.length;P<C.length;P+=1)S(P);Pe()}M[4]?T?T.p(M,O):(T=Yh(M),T.c(),T.m(o,u)):T&&(T.d(1),T=null),(!h||O&24&&d!==(d=!M[4]||M[3]))&&(f.disabled=d),(!h||O&8)&&te(f,"btn-loading",M[3])},i(M){if(!h){A(t.$$.fragment,M);for(let O=0;O<$.length;O+=1)A(C[O]);h=!0}},o(M){L(t.$$.fragment,M),C=C.filter(Boolean);for(let O=0;O<C.length;O+=1)L(C[O]);h=!1},d(M){M&&k(e),n[10](null),j(t),Yt(C,M),M&&k(l),M&&k(o),T&&T.d(),g=!1,v()}}}function E5(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function Wh(n){let e,t,i;function s(o){n[12](o,n[17])}let l={single:!0,key:n[17],title:n[18].title,icon:n[18].icon||"ri-fingerprint-line",showSelfHostedFields:n[18].selfHosted};return n[0][n[17]]!==void 0&&(l.config=n[0][n[17]]),e=new D5({props:l}),me.push(()=>Re(e,"config",s)),{c(){q(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};!t&&r&1&&(t=!0,a.config=n[0][n[17]],je(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Yh(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),m(e,t),i||(s=J(e,"click",n[13]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function A5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[E5,O5],$=[];function C(S,T){return S[2]?0:1}return d=C(n),h=$[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[5]),r=D(),a=_("div"),u=_("form"),f=_("h6"),f.textContent="Manage the allowed users sign-in/sign-up methods.",c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(S,r,T),w(S,a,T),m(a,u),m(u,f),m(u,c),$[d].m(u,null),g=!0,v||(b=J(u,"submit",Wt(n[6])),v=!0)},p(S,T){(!g||T&32)&&ue(o,S[5]);let M=d;d=C(S),d===M?$[d].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),h=$[d],h?h.p(S,T):(h=$[d]=y[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&k(e),S&&k(r),S&&k(a),$[d].d(),v=!1,b()}}}function P5(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[A5]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&2097215&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}function L5(n,e,t){let i,s,l;at(n,Nt,S=>t(5,l=S)),nn(Nt,l="Auth providers",l);let o,r={},a={},u=!1,f=!1;c();async function c(){t(2,u=!0);try{const S=await ye.settings.getAll()||{};h(S)}catch(S){ye.errorResponseHandler(S)}t(2,u=!1)}async function d(){if(!(f||!s)){t(3,f=!0);try{const S=await ye.settings.update(B.filterRedactedProps(a));h(S),ri({}),o==null||o.collapseSiblings(),sn("Successfully updated auth providers.")}catch(S){ye.errorResponseHandler(S)}t(3,f=!1)}}function h(S){S=S||{},t(0,a={emailAuth:Object.assign({enabled:!0},S.emailAuth)});for(const T in wl)t(0,a[T]=Object.assign({enabled:!1,allowRegistrations:!0},S[T]),a);t(8,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(S){me[S?"unshift":"push"](()=>{o=S,t(1,o)})}function b(S){n.$$.not_equal(a.emailAuth,S)&&(a.emailAuth=S,t(0,a))}function y(S,T){n.$$.not_equal(a[T],S)&&(a[T]=S,t(0,a))}const $=()=>g(),C=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(4,s=i!=JSON.stringify(a))},[a,o,u,f,s,l,d,g,r,i,v,b,y,$,C]}class I5 extends Ee{constructor(e){super(),Oe(this,e,L5,P5,De,{})}}function Kh(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function N5(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,h,g=n[5];const v=y=>y[16].key;for(let y=0;y<g.length;y+=1){let $=Kh(n,g,y),C=v($);t.set(C,e[y]=Jh(C,$))}let b=n[3]&&Zh(n);return{c(){for(let y=0;y<e.length;y+=1)e[y].c();i=D(),s=_("div"),l=_("div"),o=D(),b&&b.c(),r=D(),a=_("button"),u=_("span"),u.textContent="Save changes",p(l,"class","flex-fill"),p(u,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-expanded"),a.disabled=f=!n[3]||n[2],te(a,"btn-loading",n[2]),p(s,"class","flex")},m(y,$){for(let C=0;C<e.length;C+=1)e[C].m(y,$);w(y,i,$),w(y,s,$),m(s,l),m(s,o),b&&b.m(s,null),m(s,r),m(s,a),m(a,u),c=!0,d||(h=J(a,"click",n[13]),d=!0)},p(y,$){$&524321&&(g=y[5],Ae(),e=_t(e,$,v,1,y,g,t,i.parentNode,Gt,Jh,i,Kh),Pe()),y[3]?b?b.p(y,$):(b=Zh(y),b.c(),b.m(s,r)):b&&(b.d(1),b=null),(!c||$&12&&f!==(f=!y[3]||y[2]))&&(a.disabled=f),(!c||$&4)&&te(a,"btn-loading",y[2])},i(y){if(!c){for(let $=0;$<g.length;$+=1)A(e[$]);c=!0}},o(y){for(let $=0;$<e.length;$+=1)L(e[$]);c=!1},d(y){for(let $=0;$<e.length;$+=1)e[$].d(y);y&&k(i),y&&k(s),b&&b.d(),d=!1,h()}}}function F5(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function R5(n){let e,t=n[16].label+"",i,s,l,o,r,a,u,f,c,d,h;function g(){n[10].call(r,n[16])}function v(){return n[11](n[16])}return{c(){e=_("label"),i=N(t),s=N(" duration (in seconds)"),o=D(),r=_("input"),u=D(),f=_("div"),c=_("span"),c.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[19]),p(r,"type","number"),p(r,"id",a=n[19]),r.required=!0,p(c,"class","link-primary"),te(c,"txt-success",n[0][n[16].key].secret),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,i),m(e,s),w(b,o,y),w(b,r,y),Se(r,n[0][n[16].key].duration),w(b,u,y),w(b,f,y),m(f,c),d||(h=[J(r,"input",g),J(c,"click",v)],d=!0)},p(b,y){n=b,y&524288&&l!==(l=n[19])&&p(e,"for",l),y&524288&&a!==(a=n[19])&&p(r,"id",a),y&33&&Pt(r.value)!==n[0][n[16].key].duration&&Se(r,n[0][n[16].key].duration),y&33&&te(c,"txt-success",n[0][n[16].key].secret)},d(b){b&&k(e),b&&k(o),b&&k(r),b&&k(u),b&&k(f),d=!1,Je(h)}}}function Jh(n,e){let t,i,s;return i=new Ne({props:{class:"form-field required",name:e[16].key+".duration",$$slots:{default:[R5,({uniqueId:l})=>({19:l}),({uniqueId:l})=>l?524288:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=We(),q(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o&1572865&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),j(i,l)}}}function Zh(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),m(e,t),i||(s=J(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function H5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[F5,N5],$=[];function C(S,T){return S[1]?0:1}return d=C(n),h=$[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[4]),r=D(),a=_("div"),u=_("form"),f=_("div"),f.innerHTML="<p>Adjust common token options.</p>",c=D(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(S,r,T),w(S,a,T),m(a,u),m(u,f),m(u,c),$[d].m(u,null),g=!0,v||(b=J(u,"submit",Wt(n[6])),v=!0)},p(S,T){(!g||T&16)&&ue(o,S[4]);let M=d;d=C(S),d===M?$[d].p(S,T):(Ae(),L($[M],1,1,()=>{$[M]=null}),Pe(),h=$[d],h?h.p(S,T):(h=$[d]=y[d](S),h.c()),A(h,1),h.m(u,null))},i(S){g||(A(h),g=!0)},o(S){L(h),g=!1},d(S){S&&k(e),S&&k(r),S&&k(a),$[d].d(),v=!1,b()}}}function j5(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[H5]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&1048607&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}function q5(n,e,t){let i,s,l;at(n,Nt,C=>t(4,l=C));const o=[{key:"userAuthToken",label:"Users auth token"},{key:"userVerificationToken",label:"Users email verification token"},{key:"userPasswordResetToken",label:"Users password reset token"},{key:"userEmailChangeToken",label:"Users email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];nn(Nt,l="Token options",l);let r={},a={},u=!1,f=!1;c();async function c(){t(1,u=!0);try{const C=await ye.settings.getAll()||{};h(C)}catch(C){ye.errorResponseHandler(C)}t(1,u=!1)}async function d(){if(!(f||!s)){t(2,f=!0);try{const C=await ye.settings.update(B.filterRedactedProps(a));h(C),sn("Successfully saved tokens options.")}catch(C){ye.errorResponseHandler(C)}t(2,f=!1)}}function h(C){var S;C=C||{},t(0,a={});for(const T of o)t(0,a[T.key]={duration:((S=C[T.key])==null?void 0:S.duration)||0},a);t(8,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(C){a[C.key].duration=Pt(this.value),t(0,a)}const b=C=>{a[C.key].secret?(delete a[C.key].secret,t(0,a)):t(0,a[C.key].secret=B.randomString(50),a)},y=()=>g(),$=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(3,s=i!=JSON.stringify(a))},[a,u,f,s,l,o,d,g,r,i,v,b,y,$]}class V5 extends Ee{constructor(e){super(),Oe(this,e,q5,j5,De,{})}}function z5(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return o=new _n({props:{content:n[2]}}),{c(){e=_("div"),e.innerHTML=`<p>Below you&#39;ll find your current collections configuration that you could import in
another PocketBase environment.</p>`,t=D(),i=_("div"),s=_("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),q(o.$$.fragment),r=D(),a=_("div"),u=_("div"),f=D(),c=_("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-secondary fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(v,b){w(v,e,b),w(v,t,b),w(v,i,b),m(i,s),m(i,l),H(o,i,null),n[8](i),w(v,r,b),w(v,a,b),m(a,u),m(a,f),m(a,c),d=!0,h||(g=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(c,"click",n[10])],h=!0)},p(v,b){const y={};b&4&&(y.content=v[2]),o.$set(y)},i(v){d||(A(o.$$.fragment,v),d=!0)},o(v){L(o.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(t),v&&k(i),j(o),n[8](null),v&&k(r),v&&k(a),h=!1,Je(g)}}}function B5(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function U5(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[B5,z5],g=[];function v(b,y){return b[1]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[3]),r=D(),a=_("div"),u=_("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y&8)&&ue(o,b[3]);let $=f;f=v(b),f===$?g[f].p(b,y):(Ae(),L(g[$],1,1,()=>{g[$]=null}),Pe(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function W5(n){let e,t,i,s;return e=new Ui({}),i=new On({props:{$$slots:{default:[U5]},$$scope:{ctx:n}}}),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(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){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&k(t),j(i,l)}}}function Y5(n,e,t){let i,s;at(n,Nt,b=>t(3,s=b)),nn(Nt,s="Export collections",s);const l="export_"+B.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await ye.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){ye.errorResponseHandler(b)}t(1,a=!1)}function f(){B.downloadJson(r,"pb_schema")}function c(){B.copyToClipboard(i),i_("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(b){me[b?"unshift":"push"](()=>{o=b,t(0,o)})}const g=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),$=document.createRange();$.selectNodeContents(o),y.removeAllRanges(),y.addRange($)}},v=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,v]}class K5 extends Ee{constructor(e){super(),Oe(this,e,Y5,W5,De,{})}}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[14]=e[t],i}function xh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function em(n,e,t){const i=n.slice();return i[14]=e[t],i}function tm(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function nm(n,e,t){const i=n.slice();return i[30]=e[t],i}function J5(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&im(),a=n[0].name!==n[1].name&&sm(n);return{c(){e=_("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=_("strong"),o=N(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),m(e,t),a&&a.m(e,null),m(e,i),m(e,s),m(s,o)},p(u,f){u[9]?r||(r=im(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=sm(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&ue(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function Z5(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Deleted",t=D(),i=_("strong"),l=N(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&ue(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function G5(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Added",t=D(),i=_("strong"),l=N(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&ue(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function im(n){let e;return{c(){e=_("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function sm(n){let e,t=n[0].name+"",i,s,l;return{c(){e=_("strong"),i=N(t),s=D(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),m(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&ue(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function lm(n){var b,y;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((b=n[0])==null?void 0:b[n[30]])+"",f,c,d,h,g=n[12]((y=n[1])==null?void 0:y[n[30]])+"",v;return{c(){var $,C,S,T,M,O;e=_("tr"),t=_("td"),i=_("span"),l=N(s),o=D(),r=_("td"),a=_("pre"),f=N(u),c=D(),d=_("td"),h=_("pre"),v=N(g),p(t,"class","min-width svelte-lmkr38"),p(a,"class","txt"),p(r,"class","svelte-lmkr38"),te(r,"changed-old-col",!n[10]&&yn(($=n[0])==null?void 0:$[n[30]],(C=n[1])==null?void 0:C[n[30]])),te(r,"changed-none-col",n[10]),p(h,"class","txt"),p(d,"class","svelte-lmkr38"),te(d,"changed-new-col",!n[5]&&yn((S=n[0])==null?void 0:S[n[30]],(T=n[1])==null?void 0:T[n[30]])),te(d,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),te(e,"txt-primary",yn((M=n[0])==null?void 0:M[n[30]],(O=n[1])==null?void 0:O[n[30]]))},m($,C){w($,e,C),m(e,t),m(t,i),m(i,l),m(e,o),m(e,r),m(r,a),m(a,f),m(e,c),m(e,d),m(d,h),m(h,v)},p($,C){var S,T,M,O,E,P,I,F;C[0]&1&&u!==(u=$[12]((S=$[0])==null?void 0:S[$[30]])+"")&&ue(f,u),C[0]&3075&&te(r,"changed-old-col",!$[10]&&yn((T=$[0])==null?void 0:T[$[30]],(M=$[1])==null?void 0:M[$[30]])),C[0]&1024&&te(r,"changed-none-col",$[10]),C[0]&2&&g!==(g=$[12]((O=$[1])==null?void 0:O[$[30]])+"")&&ue(v,g),C[0]&2083&&te(d,"changed-new-col",!$[5]&&yn((E=$[0])==null?void 0:E[$[30]],(P=$[1])==null?void 0:P[$[30]])),C[0]&32&&te(d,"changed-none-col",$[5]),C[0]&2051&&te(e,"txt-primary",yn((I=$[0])==null?void 0:I[$[30]],(F=$[1])==null?void 0:F[$[30]]))},d($){$&&k(e)}}}function om(n){let e,t=n[6],i=[];for(let s=0;s<t.length;s+=1)i[s]=am(em(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=We()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);w(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=em(s,t,o);i[o]?i[o].p(r,l):(i[o]=am(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){Yt(i,s),s&&k(e)}}}function rm(n){let e,t,i=n[17]+"",s,l,o,r,a=n[12](n[18])+"",u,f,c,d;return{c(){e=_("tr"),t=_("td"),s=N(i),l=D(),o=_("td"),r=_("pre"),u=N(a),f=D(),c=_("td"),d=D(),p(t,"class","min-width field-key-col svelte-lmkr38"),p(r,"class","txt"),p(o,"class","changed-old-col svelte-lmkr38"),p(c,"class","changed-none-col svelte-lmkr38"),p(e,"class","txt-primary svelte-lmkr38")},m(h,g){w(h,e,g),m(e,t),m(t,s),m(e,l),m(e,o),m(o,r),m(r,u),m(e,f),m(e,c),m(e,d)},p(h,g){g[0]&64&&i!==(i=h[17]+"")&&ue(s,i),g[0]&64&&a!==(a=h[12](h[18])+"")&&ue(u,a)},d(h){h&&k(e)}}}function am(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,c,d,h=n[14].name+"",g,v,b,y,$=Object.entries(n[14]),C=[];for(let S=0;S<$.length;S+=1)C[S]=rm(tm(n,$,S));return{c(){e=_("tr"),t=_("th"),i=_("span"),s=N("field: "),o=N(l),r=D(),a=_("span"),u=N("Deleted - "),f=_("small"),c=N("All stored data related to "),d=_("strong"),g=N(h),v=N(" will be deleted!"),b=D();for(let S=0;S<C.length;S+=1)C[S].c();y=We(),p(i,"class","txt"),p(a,"class","label label-danger m-l-5 svelte-lmkr38"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(S,T){w(S,e,T),m(e,t),m(t,i),m(i,s),m(i,o),m(t,r),m(t,a),m(a,u),m(a,f),m(f,c),m(f,d),m(d,g),m(f,v),w(S,b,T);for(let M=0;M<C.length;M+=1)C[M].m(S,T);w(S,y,T)},p(S,T){if(T[0]&64&&l!==(l=S[14].name+"")&&ue(o,l),T[0]&64&&h!==(h=S[14].name+"")&&ue(g,h),T[0]&4160){$=Object.entries(S[14]);let M;for(M=0;M<$.length;M+=1){const O=tm(S,$,M);C[M]?C[M].p(O,T):(C[M]=rm(O),C[M].c(),C[M].m(y.parentNode,y))}for(;M<C.length;M+=1)C[M].d(1);C.length=$.length}},d(S){S&&k(e),S&&k(b),Yt(C,S),S&&k(y)}}}function um(n){let e;return{c(){e=_("span"),e.textContent="Changed",p(e,"class","label label-warning m-l-5 svelte-lmkr38")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fm(n){var v;let e,t,i=n[17]+"",s,l,o,r,a=n[12]((v=zn(n[3],n[14].id))==null?void 0:v[n[17]])+"",u,f,c,d,h=n[12](n[23])+"",g;return{c(){var b,y,$;e=_("tr"),t=_("td"),s=N(i),l=D(),o=_("td"),r=_("pre"),u=N(a),f=D(),c=_("td"),d=_("pre"),g=N(h),p(t,"class","min-width field-key-col svelte-lmkr38"),p(r,"class","txt"),p(o,"class","svelte-lmkr38"),te(o,"changed-old-col",yn((b=zn(n[3],n[14].id))==null?void 0:b[n[17]],n[23])),p(d,"class","txt"),p(c,"class","svelte-lmkr38"),te(c,"changed-new-col",yn((y=zn(n[3],n[14].id))==null?void 0:y[n[17]],n[23])),p(e,"class","svelte-lmkr38"),te(e,"txt-primary",yn(($=zn(n[3],n[14].id))==null?void 0:$[n[17]],n[23]))},m(b,y){w(b,e,y),m(e,t),m(t,s),m(e,l),m(e,o),m(o,r),m(r,u),m(e,f),m(e,c),m(c,d),m(d,g)},p(b,y){var $,C,S,T;y[0]&128&&i!==(i=b[17]+"")&&ue(s,i),y[0]&136&&a!==(a=b[12](($=zn(b[3],b[14].id))==null?void 0:$[b[17]])+"")&&ue(u,a),y[0]&136&&te(o,"changed-old-col",yn((C=zn(b[3],b[14].id))==null?void 0:C[b[17]],b[23])),y[0]&128&&h!==(h=b[12](b[23])+"")&&ue(g,h),y[0]&136&&te(c,"changed-new-col",yn((S=zn(b[3],b[14].id))==null?void 0:S[b[17]],b[23])),y[0]&136&&te(e,"txt-primary",yn((T=zn(b[3],b[14].id))==null?void 0:T[b[17]],b[23]))},d(b){b&&k(e)}}}function cm(n){let e,t,i,s,l=n[14].name+"",o,r,a=yn(zn(n[3],n[14].id),zn(n[4],n[14].id)),u,f,c=a&&um(),d=Object.entries(n[14]),h=[];for(let g=0;g<d.length;g+=1)h[g]=fm(xh(n,d,g));return{c(){e=_("tr"),t=_("th"),i=_("span"),s=N("field: "),o=N(l),r=D(),c&&c.c(),u=D();for(let g=0;g<h.length;g+=1)h[g].c();f=We(),p(i,"class","txt"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(g,v){w(g,e,v),m(e,t),m(t,i),m(i,s),m(i,o),m(t,r),c&&c.m(t,null),w(g,u,v);for(let b=0;b<h.length;b+=1)h[b].m(g,v);w(g,f,v)},p(g,v){if(v[0]&128&&l!==(l=g[14].name+"")&&ue(o,l),v[0]&152&&(a=yn(zn(g[3],g[14].id),zn(g[4],g[14].id))),a?c||(c=um(),c.c(),c.m(t,null)):c&&(c.d(1),c=null),v[0]&4232){d=Object.entries(g[14]);let b;for(b=0;b<d.length;b+=1){const y=xh(g,d,b);h[b]?h[b].p(y,v):(h[b]=fm(y),h[b].c(),h[b].m(f.parentNode,f))}for(;b<h.length;b+=1)h[b].d(1);h.length=d.length}},d(g){g&&k(e),c&&c.d(),g&&k(u),Yt(h,g),g&&k(f)}}}function dm(n){let e,t,i=n[17]+"",s,l,o,r,a,u,f=n[12](n[18])+"",c,d;return{c(){e=_("tr"),t=_("td"),s=N(i),l=D(),o=_("td"),r=D(),a=_("td"),u=_("pre"),c=N(f),d=D(),p(t,"class","min-width field-key-col svelte-lmkr38"),p(o,"class","changed-none-col svelte-lmkr38"),p(u,"class","txt"),p(a,"class","changed-new-col svelte-lmkr38"),p(e,"class","txt-primary svelte-lmkr38")},m(h,g){w(h,e,g),m(e,t),m(t,s),m(e,l),m(e,o),m(e,r),m(e,a),m(a,u),m(u,c),m(e,d)},p(h,g){g[0]&256&&i!==(i=h[17]+"")&&ue(s,i),g[0]&256&&f!==(f=h[12](h[18])+"")&&ue(c,f)},d(h){h&&k(e)}}}function pm(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,c=Object.entries(n[14]),d=[];for(let h=0;h<c.length;h+=1)d[h]=dm(Xh(n,c,h));return{c(){e=_("tr"),t=_("th"),i=_("span"),s=N("field: "),o=N(l),r=D(),a=_("span"),a.textContent="Added",u=D();for(let h=0;h<d.length;h+=1)d[h].c();f=We(),p(i,"class","txt"),p(a,"class","label label-success m-l-5 svelte-lmkr38"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(i,s),m(i,o),m(t,r),m(t,a),w(h,u,g);for(let v=0;v<d.length;v+=1)d[v].m(h,g);w(h,f,g)},p(h,g){if(g[0]&256&&l!==(l=h[14].name+"")&&ue(o,l),g[0]&4352){c=Object.entries(h[14]);let v;for(v=0;v<c.length;v+=1){const b=Xh(h,c,v);d[v]?d[v].p(b,g):(d[v]=dm(b),d[v].c(),d[v].m(f.parentNode,f))}for(;v<d.length;v+=1)d[v].d(1);d.length=c.length}},d(h){h&&k(e),h&&k(u),Yt(d,h),h&&k(f)}}}function X5(n){let e,t,i,s,l,o,r,a,u;function f(S,T){var M,O;return(M=S[0])!=null&&M.id?(O=S[1])!=null&&O.id?J5:Z5:G5}let c=f(n),d=c(n),h=n[11],g=[];for(let S=0;S<h.length;S+=1)g[S]=lm(nm(n,h,S));let v=(n[2]||n[5])&&om(n),b=n[7],y=[];for(let S=0;S<b.length;S+=1)y[S]=cm(Qh(n,b,S));let $=n[8],C=[];for(let S=0;S<$.length;S+=1)C[S]=pm(Gh(n,$,S));return{c(){e=_("div"),d.c(),t=D(),i=_("table"),s=_("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=D(),o=_("tbody");for(let S=0;S<g.length;S+=1)g[S].c();r=D(),v&&v.c(),a=D();for(let S=0;S<y.length;S+=1)y[S].c();u=D();for(let S=0;S<C.length;S+=1)C[S].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(S,T){w(S,e,T),d.m(e,null),w(S,t,T),w(S,i,T),m(i,s),m(i,l),m(i,o);for(let M=0;M<g.length;M+=1)g[M].m(o,null);m(o,r),v&&v.m(o,null),m(o,a);for(let M=0;M<y.length;M+=1)y[M].m(o,null);m(o,u);for(let M=0;M<C.length;M+=1)C[M].m(o,null)},p(S,T){if(c===(c=f(S))&&d?d.p(S,T):(d.d(1),d=c(S),d&&(d.c(),d.m(e,null))),T[0]&7203){h=S[11];let M;for(M=0;M<h.length;M+=1){const O=nm(S,h,M);g[M]?g[M].p(O,T):(g[M]=lm(O),g[M].c(),g[M].m(o,r))}for(;M<g.length;M+=1)g[M].d(1);g.length=h.length}if(S[2]||S[5]?v?v.p(S,T):(v=om(S),v.c(),v.m(o,a)):v&&(v.d(1),v=null),T[0]&4248){b=S[7];let M;for(M=0;M<b.length;M+=1){const O=Qh(S,b,M);y[M]?y[M].p(O,T):(y[M]=cm(O),y[M].c(),y[M].m(o,u))}for(;M<y.length;M+=1)y[M].d(1);y.length=b.length}if(T[0]&4352){$=S[8];let M;for(M=0;M<$.length;M+=1){const O=Gh(S,$,M);C[M]?C[M].p(O,T):(C[M]=pm(O),C[M].c(),C[M].m(o,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=$.length}},i:se,o:se,d(S){S&&k(e),d.d(),S&&k(t),S&&k(i),Yt(g,S),v&&v.d(),Yt(y,S),Yt(C,S)}}}function zn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function yn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function Q5(n,e,t){let i,s,l,{collectionA:o=new dn}=e,{collectionB:r=new dn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],h=[];const g=Object.keys(new dn().export()).filter(y=>!["schema","created","updated"].includes(y));function v(){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(y=>!f.find($=>y.id==$.id))))}function b(y){return typeof y>"u"?"":B.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.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")&&v(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find($=>y.id==$.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find($=>$.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find($=>$.id==y.id))),n.$$.dirty[0]&7&&t(9,l=B.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,g,b]}class x5 extends Ee{constructor(e){super(),Oe(this,e,Q5,X5,De,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function hm(n,e,t){const i=n.slice();return i[17]=e[t],i}function mm(n){let e,t;return e=new x5({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){q(e.$$.fragment)},m(i,s){H(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){L(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function eE(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=mm(hm(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=We()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);w(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=hm(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=mm(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(Ae(),a=i.length;a<s.length;a+=1)l(a);Pe()}},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)L(s[r]);t=!1},d(o){Yt(s,o),o&&k(e)}}}function tE(n){let e;return{c(){e=_("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:se,d(t){t&&k(e)}}}function nE(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=N("Close"),i=D(),s=_("button"),l=_("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=n[4],te(s,"btn-loading",n[4])},m(a,u){w(a,e,u),m(e,t),w(a,i,u),w(a,s,u),m(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&&te(s,"btn-loading",a[4])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,Je(r)}}}function iE(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[nE],header:[tE],default:[eE]},$$scope:{ctx:n}};return e=new ui({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){q(e.$$.fragment)},m(s,l){H(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){L(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function sE(n,e,t){const i=xt();let s,l=[],o=[],r=[],a=!1,u=!1;function f(S,T,M=!1){t(7,l=S),t(8,o=T),t(3,a=M),s==null||s.show()}function c(){return s==null?void 0:s.hide()}function d(){t(2,r=[]);for(const S of l){const T=B.findByKey(o,"id",S.id)||null;(a&&!(T!=null&&T.id)||(T==null?void 0:T.id)&&B.hasCollectionChanges(S,T,a))&&r.push({old:S,new:T})}for(const S of o){const T=B.findByKey(l,"id",S.id)||null;T!=null&&T.id||r.push({old:T,new:S})}}function h(){const S=[];if(a)for(const T of l){const M=B.findByKey(o,"id",T.id);if(!M)S.push(T.name+".*");else{const O=Array.isArray(T.schema)?T.schema:[];for(const E of O)B.findByKey(M.schema,"id",E.id)||S.push(`${T.name}.${E.name} (${E.id})`)}}S.length?si(`Do you really want to delete the following collection fields and their related records data:
- ${S.join(`
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await ye.collections.import(o,a),sn("Successfully imported collections configuration."),i("submit")}catch(S){ye.errorResponseHandler(S)}t(4,u=!1),c()}}const v=()=>h(),b=()=>!u;function y(S){me[S?"unshift":"push"](()=>{s=S,t(1,s)})}function $(S){tt.call(this,n,S)}function C(S){tt.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,v,b,y,$,C]}class lE extends Ee{constructor(e){super(),Oe(this,e,sE,iE,De,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function gm(n,e,t){const i=n.slice();return i[32]=e[t],i}function _m(n,e,t){const i=n.slice();return i[35]=e[t],i}function bm(n,e,t){const i=n.slice();return i[32]=e[t],i}function oE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S,T,M,O;a=new Ne({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[aE,({uniqueId:Q})=>({40:Q}),({uniqueId:Q})=>[0,Q?512:0]]},$$scope:{ctx:n}}});let E=!1,P=n[6]&&n[1].length&&!n[7]&&ym(),I=n[6]&&n[1].length&&n[7]&&km(n),F=n[13].length&&Pm(n),z=!!n[0]&&Lm(n);return{c(){e=_("input"),t=D(),i=_("div"),s=_("p"),l=N(`Paste below the collections configuration you want to import or
`),o=_("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),q(a.$$.fragment),u=D(),f=D(),P&&P.c(),c=D(),I&&I.c(),d=D(),F&&F.c(),h=D(),g=_("div"),z&&z.c(),v=D(),b=_("div"),y=D(),$=_("button"),C=_("span"),C.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),te(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p(C,"class","txt"),p($,"type","button"),p($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=S=!n[14],p(g,"class","flex m-t-base")},m(Q,ne){w(Q,e,ne),n[19](e),w(Q,t,ne),w(Q,i,ne),m(i,s),m(s,l),m(s,o),w(Q,r,ne),H(a,Q,ne),w(Q,u,ne),w(Q,f,ne),P&&P.m(Q,ne),w(Q,c,ne),I&&I.m(Q,ne),w(Q,d,ne),F&&F.m(Q,ne),w(Q,h,ne),w(Q,g,ne),z&&z.m(g,null),m(g,v),m(g,b),m(g,y),m(g,$),m($,C),T=!0,M||(O=[J(e,"change",n[20]),J(o,"click",n[21]),J($,"click",n[26])],M=!0)},p(Q,ne){(!T||ne[0]&4096)&&te(o,"btn-loading",Q[12]);const G={};ne[0]&64&&(G.class="form-field "+(Q[6]?"":"field-error")),ne[0]&65|ne[1]&1536&&(G.$$scope={dirty:ne,ctx:Q}),a.$set(G),Q[6]&&Q[1].length&&!Q[7]?P||(P=ym(),P.c(),P.m(c.parentNode,c)):P&&(P.d(1),P=null),Q[6]&&Q[1].length&&Q[7]?I?I.p(Q,ne):(I=km(Q),I.c(),I.m(d.parentNode,d)):I&&(I.d(1),I=null),Q[13].length?F?F.p(Q,ne):(F=Pm(Q),F.c(),F.m(h.parentNode,h)):F&&(F.d(1),F=null),Q[0]?z?z.p(Q,ne):(z=Lm(Q),z.c(),z.m(g,v)):z&&(z.d(1),z=null),(!T||ne[0]&16384&&S!==(S=!Q[14]))&&($.disabled=S)},i(Q){T||(A(a.$$.fragment,Q),A(E),T=!0)},o(Q){L(a.$$.fragment,Q),L(E),T=!1},d(Q){Q&&k(e),n[19](null),Q&&k(t),Q&&k(i),Q&&k(r),j(a,Q),Q&&k(u),Q&&k(f),P&&P.d(Q),Q&&k(c),I&&I.d(Q),Q&&k(d),F&&F.d(Q),Q&&k(h),Q&&k(g),z&&z.d(),M=!1,Je(O)}}}function rE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:se,i:se,o:se,d(t){t&&k(e)}}}function vm(n){let e;return{c(){e=_("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function aE(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&vm();return{c(){e=_("label"),t=N("Collections"),s=D(),l=_("textarea"),r=D(),c&&c.c(),a=We(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),Se(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=J(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&Se(l,d[0]),!!d[0]&&!d[6]?c||(c=vm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),u=!1,f()}}}function ym(n){let e;return{c(){e=_("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>`,p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function km(n){let e,t,i,s,l,o=n[9].length&&wm(n),r=n[4].length&&Cm(n),a=n[8].length&&Om(n);return{c(){e=_("h5"),e.textContent="Detected changes",t=D(),i=_("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),m(i,s),r&&r.m(i,null),m(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=wm(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Cm(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Om(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),u&&k(t),u&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function wm(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=bm(n,s,o),a=l(r);t.set(a,e[o]=Sm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=We()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=_t(e,r,l,1,o,s,t,i.parentNode,bn,Sm,i,bm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function $m(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Sm(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&$m(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Deleted",s=D(),l=_("strong"),r=N(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&ue(r,o),e[32].id?f?f.p(e,d):(f=$m(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function Cm(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=_m(n,s,o),a=l(r);t.set(a,e[o]=Dm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=We()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=_t(e,r,l,1,o,s,t,i.parentNode,bn,Dm,i,_m))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Mm(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=_("strong"),i=N(t),s=D(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),m(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&ue(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function Tm(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Dm(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&Mm(e),h=e[35].new.id&&Tm(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Changed",s=D(),l=_("div"),d&&d.c(),o=D(),r=_("strong"),u=N(a),f=D(),h&&h.c(),c=D(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(g,v){w(g,t,v),m(t,i),m(t,s),m(t,l),d&&d.m(l,null),m(l,o),m(l,r),m(r,u),m(l,f),h&&h.m(l,null),m(t,c)},p(g,v){e=g,e[35].old.name!==e[35].new.name?d?d.p(e,v):(d=Mm(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),v[0]&16&&a!==(a=e[35].new.name+"")&&ue(u,a),e[35].new.id?h?h.p(e,v):(h=Tm(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(g){g&&k(t),d&&d.d(),h&&h.d()}}}function Om(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=gm(n,s,o),a=l(r);t.set(a,e[o]=Am(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=We()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=_t(e,r,l,1,o,s,t,i.parentNode,bn,Am,i,gm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Em(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Am(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Em(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Added",s=D(),l=_("strong"),r=N(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-success list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[32].name+"")&&ue(r,o),e[32].id?f?f.p(e,d):(f=Em(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function Pm(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=_("div"),s.innerHTML=`<string>Some of the imported collections shares the same name and/or fields but are
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=D(),o=_("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=J(o,"click",n[24]),r=!0)},p:se,d(u){u&&k(e),r=!1,a()}}}function Lm(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-secondary link-hint")},m(s,l){w(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:se,d(s){s&&k(e),t=!1,i()}}}function uE(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[rE,oE],g=[];function v(b,y){return b[5]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=D(),l=_("div"),o=N(n[15]),r=D(),a=_("div"),u=_("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y[0]&32768)&&ue(o,b[15]);let $=f;f=v(b),f===$?g[f].p(b,y):(Ae(),L(g[$],1,1,()=>{g[$]=null}),Pe(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){L(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function fE(n){let e,t,i,s,l,o;e=new Ui({}),i=new On({props:{$$slots:{default:[uE]},$$scope:{ctx:n}}});let r={};return l=new lE({props:r}),n[27](l),l.$on("submit",n[28]),{c(){q(e.$$.fragment),t=D(),q(i.$$.fragment),s=D(),q(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&k(t),j(i,a),a&&k(s),n[27](null),j(l,a)}}}function cE(n,e,t){let i,s,l,o,r,a,u;at(n,Nt,Z=>t(15,u=Z)),nn(Nt,u="Import collections",u);let f,c,d="",h=!1,g=[],v=[],b=!0,y=[],$=!1;C();async function C(){t(5,$=!0);try{t(2,v=await ye.collections.getFullList(200));for(let Z of v)delete Z.created,delete Z.updated}catch(Z){ye.errorResponseHandler(Z)}t(5,$=!1)}function S(){if(t(4,y=[]),!!i)for(let Z of g){const de=B.findByKey(v,"id",Z.id);!(de!=null&&de.id)||!B.hasCollectionChanges(de,Z,b)||y.push({new:Z,old:de})}}function T(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=B.filterDuplicatesByKey(g)):t(1,g=[]);for(let Z of g)delete Z.created,delete Z.updated,Z.schema=B.filterDuplicatesByKey(Z.schema)}function M(){var Z,de;for(let x of g){const oe=B.findByKey(v,"name",x.name)||B.findByKey(v,"id",x.id);if(!oe)continue;const Ce=x.id,Te=oe.id;x.id=Te;const K=Array.isArray(oe.schema)?oe.schema:[],ke=Array.isArray(x.schema)?x.schema:[];for(const ae of ke){const W=B.findByKey(K,"name",ae.name);W&&W.id&&(ae.id=W.id)}for(let ae of g)if(!!Array.isArray(ae.schema))for(let W of ae.schema)((Z=W.options)==null?void 0:Z.collectionId)&&((de=W.options)==null?void 0:de.collectionId)===Ce&&(W.options.collectionId=Te)}t(0,d=JSON.stringify(g,null,4))}function O(Z){t(12,h=!0);const de=new FileReader;de.onload=async x=>{t(12,h=!1),t(10,f.value="",f),t(0,d=x.target.result),await Zn(),g.length||(hl("Invalid collections configuration."),E())},de.onerror=x=>{console.warn(x),hl("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},de.readAsText(Z)}function E(){t(0,d=""),t(10,f.value="",f),ri({})}function P(Z){me[Z?"unshift":"push"](()=>{f=Z,t(10,f)})}const I=()=>{f.files.length&&O(f.files[0])},F=()=>{f.click()};function z(){d=this.value,t(0,d)}function Q(){b=this.checked,t(3,b)}const ne=()=>M(),G=()=>E(),ee=()=>c==null?void 0:c.show(v,g,b);function U(Z){me[Z?"unshift":"push"](()=>{c=Z,t(11,c)})}const Y=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&T(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(Z=>!!Z.id&&!!Z.name).length),n.$$.dirty[0]&78&&t(9,s=v.filter(Z=>i&&b&&!B.findByKey(g,"id",Z.id))),n.$$.dirty[0]&70&&t(8,l=g.filter(Z=>i&&!B.findByKey(v,"id",Z.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof b<"u")&&S(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!$&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(Z=>{let de=B.findByKey(v,"name",Z.name)||B.findByKey(v,"id",Z.id);if(!de)return!1;if(de.id!=Z.id)return!0;const x=Array.isArray(de.schema)?de.schema:[],oe=Array.isArray(Z.schema)?Z.schema:[];for(const Ce of oe){if(B.findByKey(x,"id",Ce.id))continue;const K=B.findByKey(x,"name",Ce.name);if(K&&Ce.id!=K.id)return!0}return!1}))},[d,g,v,b,y,$,i,o,l,s,f,c,h,a,r,u,M,O,E,P,I,F,z,Q,ne,G,ee,U,Y]}class dE extends Ee{constructor(e){super(),Oe(this,e,cE,fE,De,{},null,[-1,-1])}}const rn=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Ci("/"):!0}],pE={"/login":tn({component:JD,conditions:rn.concat([n=>!ye.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":tn({asyncComponent:()=>Pi(()=>import("./PageAdminRequestPasswordReset.ebc5ff6b.js"),[],import.meta.url),conditions:rn.concat([n=>!ye.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":tn({asyncComponent:()=>Pi(()=>import("./PageAdminConfirmPasswordReset.586559df.js"),[],import.meta.url),conditions:rn.concat([n=>!ye.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":tn({component:qT,conditions:rn.concat([n=>ye.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":tn({component:V$,conditions:rn.concat([n=>ye.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users":tn({component:vD,conditions:rn.concat([n=>ye.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":tn({asyncComponent:()=>Pi(()=>import("./PageUserConfirmPasswordReset.67271359.js"),[],import.meta.url),conditions:rn,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":tn({asyncComponent:()=>Pi(()=>import("./PageUserConfirmVerification.22842cc3.js"),[],import.meta.url),conditions:rn,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":tn({asyncComponent:()=>Pi(()=>import("./PageUserConfirmEmailChange.858a932e.js"),[],import.meta.url),conditions:rn,userData:{showAppSidebar:!1}}),"/settings":tn({component:sO,conditions:rn.concat([n=>ye.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":tn({component:zD,conditions:rn.concat([n=>ye.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":tn({component:VO,conditions:rn.concat([n=>ye.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":tn({component:i5,conditions:rn.concat([n=>ye.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":tn({component:I5,conditions:rn.concat([n=>ye.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":tn({component:V5,conditions:rn.concat([n=>ye.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":tn({component:K5,conditions:rn.concat([n=>ye.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":tn({component:dE,conditions:rn.concat([n=>ye.authStore.isValid]),userData:{showAppSidebar:!0}}),"*":tn({component:mv,userData:{showAppSidebar:!1}})};function hE(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=h=>Math.sqrt(h)*120,easing:d=Jo}=i;return{delay:f,duration:Nn(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(h,g)=>{const v=g*a,b=g*u,y=h+g*e.width/t.width,$=h+g*e.height/t.height;return`transform: ${l} translate(${v}px, ${b}px) scale(${y}, ${$});`}}}function Im(n,e,t){const i=n.slice();return i[2]=e[t],i}function mE(n){let e;return{c(){e=_("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function gE(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function _E(n){let e;return{c(){e=_("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function bE(n){let e;return{c(){e=_("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Nm(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,h=se,g,v,b;function y(T,M){return T[2].type==="info"?bE:T[2].type==="success"?_E:T[2].type==="warning"?gE:mE}let $=y(e),C=$(e);function S(){return e[1](e[2])}return{key:n,first:null,c(){t=_("div"),i=_("div"),C.c(),s=D(),l=_("div"),r=N(o),a=D(),u=_("div"),u.innerHTML='<i class="ri-close-line"></i>',f=D(),p(i,"class","icon"),p(l,"class","content"),p(u,"class","close"),p(t,"class","alert txt-break"),te(t,"alert-info",e[2].type=="info"),te(t,"alert-success",e[2].type=="success"),te(t,"alert-danger",e[2].type=="error"),te(t,"alert-warning",e[2].type=="warning"),this.first=t},m(T,M){w(T,t,M),m(t,i),C.m(i,null),m(t,s),m(t,l),m(l,r),m(t,a),m(t,u),m(t,f),g=!0,v||(b=J(u,"click",Wt(S)),v=!0)},p(T,M){e=T,$!==($=y(e))&&(C.d(1),C=$(e),C&&(C.c(),C.m(i,null))),(!g||M&1)&&o!==(o=e[2].message+"")&&ue(r,o),(!g||M&1)&&te(t,"alert-info",e[2].type=="info"),(!g||M&1)&&te(t,"alert-success",e[2].type=="success"),(!g||M&1)&&te(t,"alert-danger",e[2].type=="error"),(!g||M&1)&&te(t,"alert-warning",e[2].type=="warning")},r(){d=t.getBoundingClientRect()},f(){wb(t),h(),Wm(t,d)},a(){h(),h=kb(t,d,hE,{duration:150})},i(T){g||(Tt(()=>{c||(c=st(t,$o,{duration:150},!0)),c.run(1)}),g=!0)},o(T){c||(c=st(t,$o,{duration:150},!1)),c.run(0),g=!1},d(T){T&&k(t),C.d(),T&&c&&c.end(),v=!1,b()}}}function vE(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=Im(n,l,r),u=o(a);i.set(u,t[r]=Nm(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","toasts-wrapper")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,[a]){if(a&1){l=r[0],Ae();for(let u=0;u<t.length;u+=1)t[u].r();t=_t(t,a,o,1,r,l,i,e,Mb,Nm,null,Im);for(let u=0;u<t.length;u+=1)t[u].a();Pe()}},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)L(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function yE(n,e,t){let i;return at(n,Yo,l=>t(0,i=l)),[i,l=>s_(l)]}class kE extends Ee{constructor(e){super(),Oe(this,e,yE,vE,De,{})}}function wE(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=_("h4"),i=N(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){w(l,e,o),m(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&ue(i,t)},d(l){l&&k(e)}}}function $E(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=_("span"),t.textContent="No",i=D(),s=_("button"),l=_("span"),l.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],te(s,"btn-loading",n[2])},m(a,u){w(a,e,u),m(e,t),w(a,i,u),w(a,s,u),m(s,l),e.focus(),o||(r=[J(e,"click",n[3]),J(s,"click",n[4])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&te(s,"btn-loading",a[2])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,Je(r)}}}function SE(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:[$E],header:[wE]},$$scope:{ctx:n}};return e=new ui({props:i}),n[5](e),e.$on("hide",n[6]),{c(){q(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&135&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[5](null),j(e,s)}}}function CE(n,e,t){let i;at(n,xa,f=>t(1,i=f));let s,l=!1;const o=()=>{i!=null&&i.noCallback&&i.noCallback(),s==null||s.hide()},r=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),s==null||s.hide()};function a(f){me[f?"unshift":"push"](()=>{s=f,t(0,s)})}const u=async()=>{i!=null&&i.noCallback&&i.noCallback(),await Zn(),ob()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(s==null||s.show())},[s,i,l,o,r,a,u]}class ME extends Ee{constructor(e){super(),Oe(this,e,CE,SE,De,{})}}function Fm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,$,C,S;return y=new Ti({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[TE]},$$scope:{ctx:n}}}),{c(){var T;e=_("aside"),t=_("a"),t.innerHTML='<img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=D(),s=_("nav"),l=_("a"),l.innerHTML='<i class="ri-database-2-line"></i>',o=D(),r=_("a"),r.innerHTML='<i class="ri-group-line"></i>',a=D(),u=_("a"),u.innerHTML='<i class="ri-line-chart-line"></i>',f=D(),c=_("a"),c.innerHTML='<i class="ri-tools-line"></i>',d=D(),h=_("figure"),g=_("img"),b=D(),q(y.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/users"),p(r,"class","menu-item"),p(r,"aria-label","Users"),p(u,"href","/logs"),p(u,"class","menu-item"),p(u,"aria-label","Logs"),p(c,"href","/settings"),p(c,"class","menu-item"),p(c,"aria-label","Settings"),p(s,"class","main-menu"),ti(g.src,v="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(g,"src",v),p(g,"alt","Avatar"),p(h,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,M){w(T,e,M),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),m(s,r),m(s,a),m(s,u),m(s,f),m(s,c),m(e,d),m(e,h),m(h,g),m(h,b),H(y,h,null),$=!0,C||(S=[Ye(mn.call(null,t)),Ye(mn.call(null,l)),Ye(Vn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ye(gt.call(null,l,{text:"Collections",position:"right"})),Ye(mn.call(null,r)),Ye(Vn.call(null,r,{path:"/users/?.*",className:"current-route"})),Ye(gt.call(null,r,{text:"Users",position:"right"})),Ye(mn.call(null,u)),Ye(Vn.call(null,u,{path:"/logs/?.*",className:"current-route"})),Ye(gt.call(null,u,{text:"Logs",position:"right"})),Ye(mn.call(null,c)),Ye(Vn.call(null,c,{path:"/settings/?.*",className:"current-route"})),Ye(gt.call(null,c,{text:"Settings",position:"right"}))],C=!0)},p(T,M){var E;(!$||M&1&&!ti(g.src,v="./images/avatars/avatar"+(((E=T[0])==null?void 0:E.avatar)||0)+".svg"))&&p(g,"src",v);const O={};M&1024&&(O.$$scope={dirty:M,ctx:T}),y.$set(O)},i(T){$||(A(y.$$.fragment,T),$=!0)},o(T){L(y.$$.fragment,T),$=!1},d(T){T&&k(e),j(y),C=!1,Je(S)}}}function TE(n){let e,t,i,s,l,o,r;return{c(){e=_("a"),e.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Manage admins</span>`,t=D(),i=_("hr"),s=D(),l=_("div"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"tabindex","0"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Ye(mn.call(null,e)),J(l,"click",n[6])],o=!0)},p:se,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Je(r)}}}function DE(n){var h;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=B.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((h=n[0])==null?void 0:h.id)&&n[1]&&Fm(n);return o=new Ib({props:{routes:pE}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new kE({}),f=new ME({}),{c(){t=D(),i=_("div"),d&&d.c(),s=D(),l=_("div"),q(o.$$.fragment),r=D(),q(a.$$.fragment),u=D(),q(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(g,v){w(g,t,v),w(g,i,v),d&&d.m(i,null),m(i,s),m(i,l),H(o,l,null),m(l,r),H(a,l,null),w(g,u,v),H(f,g,v),c=!0},p(g,[v]){var b;(!c||v&12)&&e!==(e=B.joinNonEmpty([g[3],g[2],"PocketBase"]," - "))&&(document.title=e),((b=g[0])==null?void 0:b.id)&&g[1]?d?(d.p(g,v),v&3&&A(d,1)):(d=Fm(g),d.c(),A(d,1),d.m(i,s)):d&&(Ae(),L(d,1,1,()=>{d=null}),Pe())},i(g){c||(A(d),A(o.$$.fragment,g),A(a.$$.fragment,g),A(f.$$.fragment,g),c=!0)},o(g){L(d),L(o.$$.fragment,g),L(a.$$.fragment,g),L(f.$$.fragment,g),c=!1},d(g){g&&k(t),g&&k(i),d&&d.d(),j(o),j(a),g&&k(u),j(f,g)}}}function OE(n,e,t){let i,s,l,o;at(n,us,h=>t(8,i=h)),at(n,wo,h=>t(2,s=h)),at(n,Ea,h=>t(0,l=h)),at(n,Nt,h=>t(3,o=h));let r,a=!1;function u(h){var g,v,b,y;((g=h==null?void 0:h.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((b=(v=h==null?void 0:h.detail)==null?void 0:v.userData)!=null&&b.showAppSidebar)),r=(y=h==null?void 0:h.detail)==null?void 0:y.location,nn(Nt,o="",o),ri({}),ob())}function f(){Ci("/")}async function c(){var h,g;if(!!(l!=null&&l.id))try{const v=await ye.settings.getAll({$cancelKey:"initialAppSettings"});nn(wo,s=((h=v==null?void 0:v.meta)==null?void 0:h.appName)||"",s),nn(us,i=!!((g=v==null?void 0:v.meta)!=null&&g.hideControls),i)}catch(v){console.warn("Failed to load app settings.",v)}}function d(){ye.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class EE extends Ee{constructor(e){super(),Oe(this,e,OE,DE,De,{})}}new EE({target:document.getElementById("app")});export{Je as A,sn as B,B as C,Ci as D,We as E,l_ as F,va as G,at as H,As as I,xt as J,dn as K,Fn as L,me as M,lu as N,Ee as S,L as a,D as b,q as c,j as d,_ as e,p as f,w as g,m as h,Oe as i,Ye as j,Ae as k,mn as l,H as m,Pe as n,k as o,ye as p,Ne as q,te as r,De as s,A as t,J as u,Wt as v,N as w,ue as x,se as y,Se as z};